MRIwrite() writes out the image as a float, whereas FS insists that it be UCHAR or INT. To get this, run
mri_convert aseg.mgz -odt int --no_scale 1 aseg.mgz View aseg.mgz to make sure it looks right, then rerun recon-all -autorecon2-cp -autorecon3 On 08/24/2016 05:51 PM, Silas wrote: > > Dear FreeSurfer team, > > > I'm doing a structural analysis with 50 MS patients and 50 healthy > controls (T1, T2 and FLAIR). The MS patients have multiple lesions > mainly in white matter. My co-worker did manual editing (bullet > points) in the FLAIR images, and i would like to use these edits when > running recon-all in order to avoid further manual editing. > > > _Steps in analysis:_ > > > 1) First steps of recon-all: > > recon-all -autorecon1 -autorecon2 > > > 2) Reslicing the FLAIR images: > > The aseg.auto.mgz (256x256x256) didn't have the same size as the > FLAIR (resliced to 1mm, co-registered in MNI-space and with manually > drawn binary lesion masks (218x182x182)). I overcome this problem by > reslicing the FLAIR images using aseg.auto.nii as the image defining > space. This was done in SPM8, and prior to this the aseg.auto.mgz was > converted to a .nii using mri_convert. > > > 3) Insert lesions from the resliced FLAIR images to aseg.mgz: > > aseg = MRIread('aseg.auto.mgz'); % FreeSurfer aseg > > manlesion = MRIread('manlesion.nii.gz'); % Manual lesion, whatever > format, but should be binary > > ind = find( (aseg.vol == 2 | aseg.vol == 41) & manlesion.vol ~= 0); > > newaseg = aseg; > > newaseg.vol(ind) = 77; > > MRIwrite(newaseg,'aseg.mgz'); % This will overwrite the aseg.mgz, so > make a backup > > > 4) The last steps of recon-all: > > recon- all -autorecon2-cp -autorecon3 > > When running the following command i get this error: > > /depot64/freesurfer/freesurfer.5.3.0/bin/recon-all -s 01MS > -autorecon2-cp -autorecon3 subjid 01MS > > ............ > > > '#@# Intensity Normalization2 Mon Aug DATE > /.../subjects_FLAIR/01MS/mri > > mri_normalize -aseg aseg.mgz -mask brainmask.mgz norm.mgz brain.mgz > > using segmentation for initial intensity normalization > using MR volume brainmask.mgz to mask input volume... > reading from norm.mgz... > Reading aseg aseg.mgz > normalizing image... > processing with aseg > removing outliers in the aseg WM... > 5361 control points removed > Building bias image > mriMarkUnmarkedNeighbors: all inputs must be MRI_UCHAR or MRI_INT > building Voronoi diagram... > Numerical argument out of domain > Linux big28 3.13.0-66-generic #108-Ubuntu SMP Wed Oct 7 15:20:27 UTC > 2015 x86_64 x86_64 x86_64 GNU/Linux > > recon-all -s 01MS exited with ERRORS at Mon Aug 8 15:31:32 CEST 2016 > > *The lesions looks alright (as if they are in the right place). Do you > have any suggestions what to do if they are not? And what could be the > problem if they are placed correctly?* > > *What is the advantage of starting by running autorecon-1 and 2 and > then inserting the lesions from the FLAIR?* > > > Thanks a lot for all your help! > > > Best, Silas > > > > > _______________________________________________ > Freesurfer mailing list > Freesurfer@nmr.mgh.harvard.edu > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer -- Douglas N. Greve, Ph.D. MGH-NMR Center gr...@nmr.mgh.harvard.edu Phone Number: 617-724-2358 Fax: 617-726-7422 Bugs: surfer.nmr.mgh.harvard.edu/fswiki/BugReporting FileDrop: https://gate.nmr.mgh.harvard.edu/filedrop2 www.nmr.mgh.harvard.edu/facility/filedrop/index.html Outgoing: ftp://surfer.nmr.mgh.harvard.edu/transfer/outgoing/flat/greve/ _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Partners Compliance HelpLine at http://www.partners.org/complianceline . If the e-mail was sent to you in error but does not contain patient information, please contact the sender and properly dispose of the e-mail.