Q: Hello!

Is it possible to mask any voxel readings that are below a minimum desired reading? I have used:

mincmath name.mnc -segment -const2 40 90000 nameseg.mnc

But it turns all readings into either 0 or 1. Is there a command to use so that voxel readings within the range will keep their values instead of changing to 1?
http://www.bic.mni.mcgill.ca/pipermail/minc-users/2009-July/002516.html

A: You can use minccalc and specify your rule with the switch “-expression”….

minccalc -expression “if (A[0]<N){out=0;}else{out=A[0];}” name.mnc
name_thresholded.mnc

where N = your desired threshold value

Just to assure though, you were on the right track with mincmath, you just needed to add an extra step whereby you multiplied your 1/0 volume by the original using:

  mincmath -mult nameseg.mnc name.mnc out.mnc