open-discussion > How to change labels values
Showing 1-2 of 2 posts
Display:
Results per page:
Mar 14, 2019  07:03 AM | eng
How to change labels values
I have MRI images with labels 20 ,30 ,40 . I need to change the labels from 20 ,30 ,40 to 1,2,3 


Is there any tools to do that...
Mar 15, 2019  08:03 AM | Mehran Azimbagirad
RE: How to change labels values
Depends on the software that you use. For instance, 
in freesurfer
https://surfer.nmr.mgh.harvard.edu/fswik...

in 3DSlicer using Editor
https://www.slicer.org/wiki/Documentatio...

in FSL 
https://mandymejia.com/fsl-maths-command...

fslmaths [-dt datatype ] first_input [operations and inputs] output [-odt datatype ]

in your case can be
fslmaths -dt label.nii -div 10 -odt output.nii
fslmath -dt -output.nii -sub 1 -odt output2.nii

At first divided by 10, then subtracted by 1.