I’m trying to use mrthreshold to create a fixelmask (by thresholding a fixel -non binarized-image), as suggested here (Remove fixels with value 0 from fixelmask). However, mrthreshold seems to be misbehaving.
but this seems to have no effect. My fixelmask has the same number of fixels than before thresholding and it doesn’t threshold appropriately (see below)
Could this be related to the mrtrix version I’m using? I updated recently (Feb 5 2019) (see below) and I’m afraid this version might not be as stable, since with previous MRtrix versions the same mrthreshold command was working fine in the same PC.
$ mrconvert -version
== mrconvert 3.0_RC3-135-g2b8e7d0c-dirty ==
64 bit release version, built Feb 5 2019
mrthreshold does not remove fixels but thresholds the fixel image which results in a binary mask (see mrstats fixelmask.mif). You can apply this fixel mask to zero out fixels below the threshold, keep others unaltered, by multiplying the mask with the fixel image: mrthreshold -abs 0.5 fixelmask_non_bin.mif - | mrcalc fixelmask_non_bin.mif - -mult fixel_thresholded.mif
In case it was not clear, I want something like the following. I want to extract FD values only in those fixels but I’m only able to get such a file for visualization (thresholding it in mrview).
Just to clarify, mrthreshold creates a mask that you can use to on the fixel value image or in fixel-specfic commands such as fixelcrop. The mrcalc command I provided multiplies the values associated with each fixel with the mask values, no fixels are removed (mrinfo -size stays constant). As Rob hinted at, this might be desirable if you do not want to change the associated direction and index files. If you actually want to remove fixels them, have a look at fixelcrop which will generate a new fixel directory with cropped fixel value, direction and index files.
As to why the mask is not applied: I suspect your fixel_thresholded.mif was not produced with the command you posted.
You can check the command used with mrinfo fixel_thresholded.mif -property command_history
This should work to set the fixel values below the threshold value to zero:
Note that the “count” field of mrstats output will additionally tell you the number of fixels with a value of 1 in the mask, as opposed to mrinfo which purely tells you the total number of fixels in the image regardless of their value.