Slicer version:
slicer/4.4.0 and slicer/4.8.1 (I got an error using both versions)
Generally, when running the WMA pipeline, I run DTIPrep > DWIToDTIEstimation > DiffusionWeightedVolumeMasking > TractographyLabelMapSeeding. I wanted to create the mask before the tensor estimation step and use the mask to limit the area where the tensor is being calculated. I switched the two steps around and added the mask as an argument in the DWIToDTIEstimation code and got the following error: DWIToDTIEstimation: Error reading Mask file, wrong coordinate space
As suggested in this link, I ran the estimation once without a mask and then used the baseline volume to regenerate the mask and tried re-running DWIToDTIEstimation with this mask but got the same error.
Please let me know if you need any more information to debug this issue.
The output DWI from DTIPrep is probably in ITK’s native LPS.
Slicer’s NRRD reader (used by DWVolumeMasking) “reorients” the volume while loading, such that the transformation matrix is relative to Slicer’s native RAS. This is technically an identity operation, but when the mask volume is saved, the resulting transform is different than the input DWI.
Then DWToDTIEstimation checks that the mask and DWI transforms are equal, but only looks at the transformation matrices, and does not account for the fact that the image is (technically) the same (relative to the embedding NRRD space-directions).
So, in light of that, in the short term I think the quickest solution is to use the OrientScalarVolume module to change the mask image back to the same “space directions” as found in the DTIPrep output.
Assuming the DTIPrep output is indeed LPS (check the NRRD header “space directions” field), then you could try adding a step to your script – something like this: