From dgold@bic.mni.mcgill.ca Fri Jun 1 17:10:25 2001 Modified by Kate Hanratty, Friday, September 20, 2002. Recipes for processing T1 weighted MRI volumes. -- # 1. For a linear transformation from Native --> MNI_Tal space: batch -Q medium -H bullcalf -S -k -o '1Linear_reg.log mritotal -model icbm_avg_152_t1_tal_lin_symmetric subject_native_mri.mnc subject_t1tal_lin.xfm' # 2. Evaluate the contribution of nonuniformity of the magnetic field in the MRI volume batch -Q medium -H bullcalf -S -k -o 2Evaluate.log 'nu_estimate subject_native_mri.mnc subject_native_field_map.imp' # 3. Correct the field inhomogeneities in the MRI volume batch -Q medium -H bullcalf -S -k -o 3Apply.log 'nu_evaluate subject_native_mri.mnc -mapping subject_native_field_map.imp subject_native_mri_nuc.mnc' # 4. For a non-linear transformation from Native --> MNI_Tal space: batch -Q medium -H bullcalf -S -k -o 4Nonlin_reg.log 'mritotal -model icbm_avg_152_t1_tal_lin_symmetric -nonlin native_mri_nuc.mnc -transformation subject_t1tal_lin.xfm subject_t1tal_nl.xfm' # 5. To generate a minc volume in MNI_Tal space batch -Q medium -H bullcalf -S -k -o 5Resample.log 'mincresample -like /avgbrain/brain/images/icbm_template_1.00mm.mnc subject_native_mri_nuc.mnc -transformation subject_t1tal_lin.xfm subject_stx_mri_nuc.mnc' # 6. To classify tissue in T1 weighted volume as grey matter, white # matter or csf batch -Q medium -H bullcalf -S -k -o 6Classify.log 'classify_clean stx_mri_nuc.mnc stx_classes.mnc' # 7. To identify structures in the T1 weighted volume: batch -Q medium -H bullcalf -S -k -o 7Segment.log 'stx_segment -symmetric_atlas subject_t1tal_nl.xfm subject_t1tal_lin.xfm subject_classified.mnc subject_stx_labels.mnc' -- Extras: # To generate a label file with only a few structures specified minclookup -discrete -lut_string '1 5; 3 7; 9 2' subject_classified.mnc new_label_file.mnc {If you want to use the same colors, you'll say for instance '1 1; 7 7; etc', but if you want to use other colors, you can say eg. '1 15; 46 7; etc'.} The label numbers can be found by looking at Jakob's brain. MRI Volume lives in: /data/avgbrain/avgbrain1/brain/images/himaster_stereo_jacob.mnc Labels: All labelled structures in one file: /data/icbm/cryo2/noor/Jakob-2002/jakob-temp.mnc (put the arrow cursor over a colour label and look in the lower left hand corner of the Display main window to see what numerical value this label has. Look for "Lb ###") Individual labels: /data/icbm/cryo2/noor/Jakob-2002/Extracted-labels/label_###.mnc Where ### represents the number you looked up in the jakob-tmp.mnc label file... # 36 = Right hippocampus; 101 = Left hippocampus # the command for the cortical surface removal is a two-step # process. First, you have to render the surface of the brain you are # interested in: # Compute the threshold: /nil/david/public_bin/compute_cortex_threshold.pl brain.mnc {It would seem that the number spit out by this process is too high for the automatic registration process. Taking 80% of that number seems just right. Taking 70% might be better. Yupf, much better. Oh yeah.} # To make the cortical surface object: batch -Q medium -H bullcalf -S -k -o adelson.log/ /home/bic/david/public_bin/cortical_surface.pl scan_mri_tal.mnc adelson_75.obj 75 #With that, you call the program surface_mask2 classified_image.mnc object_file.obj classified_image_surface_corrected.mnc # After that, you can use that for multiplication with your label file. That is a three step process. # First, match the two files mincresample label_file.mnc label_file_rszd.mnc -clobber -like classified_image_surface_corrected.mnc -nearest # Then, multiply them mincmath label_file_rszd.mnc classified_image_surface_corrected.mnc label_file_surface_rmvd.mnc -clobber -mult # Last, correct the image range mincreshape label_file_surface_rmvd.mnc label_file_surface_rmvd_corr.mnc -clobber -image_range 0 255 -valid_range 0 255 # All set! #Finally, change the labels back to the nice colors (like running # extraction again): '30 15;89 30;51 17;18 9;54 27;140 70;100 50;30 # 15;180 90;169 85;14 7;234 117;20 10;4 2; 150 75;12 6;2 1;160 80;10 # 5' minclookup -discrete -lut_string '1 5;3 7;9 2' Adelson_stx_labels.mnc.gz Adelson_stx_labels_extract.mnc.gz /data/nil/david/public_bin/print_all_labels Adelson_stx_labels_extract.mnc # will calculate the volumes of all labels in that label file. # To change cortex.obj files into PC friendly format: (Binary to # Ascii) /home/bic/david/public_bin/ascii_binary input.obj output.obj ascii