FreeSurfer offers 'mris_calc' which is similar to 'fslmaths'. I'm a bit confused with your fslmaths line, but you should be able to do a similar operation using 'mris_calc':
(assuming you have 'right_vect_mask_inv.nii.gz' and right_vect_mask.nii.gz')
$>mris_calc -o aparc+aseg_masked.mgz aparc+aseg.mgz maskedby right_vect_inv.nii.gz
$>mris_calc -o aparc+aseg2.mgz aparc+aseg_masked.mgz add right_vect_mask.nii.gz
will result in 'aparc+aseg2.mgz' which is the original aparc+aseg.mgz masked by the right_vect_inv.nii.gz added to right_vect_mask.nii.gz
Perhaps worth trying with 'mris_calc'?
On 10/5/10 16:24 , Wayne Su wrote:
Well, I tried to avoid FSL, and used only Freesurfer tool to do the same thing. I found there was the same issue when an image with 32-bit float point data type converts to 32-bit integer. No problem for the convertion from 32-bit float point to 8-bit unsigned integer.
Wayne
On 05/10/10 10:44 AM, "Wayne Su" wsu@interchange.ubc.ca wrote:
Hello Freesurfer Users, I am feeling very bad when I am using mri_convert. There are two problems: 1. When I converted a file in mgz format to nii.gz format, and did some volume calculation (mask and addition) by using fslmaths from FSL, then converted back to mgz. If the image type is uchar, it works fine. If the image type is int, the intensities changed. The ‘0’ value is changed to ‘–2.1e+09’, others also in very large number (look like read the data from wrong place). Here is the code I used: ${FREESURFER_HOME}/bin/mri_convert aparc+aseg.mgz aparc+aseg.nii.gz -odt int ${FSLDIR}/bin/fslmaths aparc+aseg -mas right_vect_mask_inv -add right_vect_mask aparc+aseg ${FREESURFER_HOME}/bin/mri_convert aparc+aseg.nii.gz aparc+aseg.mgz -odt int If no fslmaths calculation, convert back to mgz right way, no problem found. 2. when the –conform is used, some head were rotated a little bit, but not for others. I am wondering how to avoid the rotation? Regards, Wayne ------------------------------------------------------------------------ _______________________________________________ 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.
Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer