Closed mathieuboudreau closed 6 years ago
Hi,
I downloaded the data (thanks for making that available!), and the problem is that VFAData.nii.gz
is a 3D nifti containing a single slice, whereas B1map.nii.gz
and Mask.nii.gz
are true 2D files. You can check this using qihdr
, which will print out the header as ITK sees it:
The FSL tools sadly obscure the problem. If you run fslhd
on B1map.nii.gz
you get:
Which indicates that it is a 2D file but somehow fills out the 3D dimension information. If you run fsledithd
then you get:
Note that here, nz
and dz
do not exist. I used fsledithd
to change ndim
to 3, and then ran it again to set dz
to 2 to match VFAdata.nii.gz
, and then qidespot1
ran successfully.
I think a similar issue has come up in the qMRLab issues, because ideally you would be able to indicate that a file is 2D but has multiple "timepoints", but this isn't possible with nifti (a 4D file must have a 3rd dimension).
Sadly I don't think there are any checks I can put in the QUIT code to deal with true 2D files.
Note that you should be able to re-compile QUIT to have MINC support. It involves editing CMakeLists.txt
in the QUIT directory - see here: http://spinicist.github.io/QUIT/Developer/#file-formats. The MINC module is called ITKIOMINC
, add it next to ITKIONIFTI
and then re-compile QUIT (only QUIT, not ITK). If you then set the environment variable QUIT_EXT
to .mnc
, it should even output MINC (completely untested, let me know what happens!).
we can fit this data with no issue in qMRLab (likely because these parameters aren't checked)
This was one of the major benefits of swapping to ITK where these things are checked rigorously. Multiple times I have tried fitting models to images with different voxel spacings and been confused by the results, now I get an error up front that the images are incompatible
@spinicist Thanks for investigating and the quick response ā your fix worked for me!
You can check this using qihdr
I didn't know about that command yet! š
The FSL tools sadly obscure the problem.
This was really unfortunate, and what mislead me I think. I might mention it to them, though it's unlikely that they'll care too much, as single-slice imaging isn't a primary focus of theirs I'd imagine.
I think a similar issue has come up in the qMRLab issues, because ideally you would be able to indicate that a file is 2D but has multiple "timepoints", but this isn't possible with nifti (a 4D file must have a 3rd dimension).
I think the issue it relates to is the "singleton dimension" issue we have in MATLAB, if that's what you mean. In some cases, single-slice data is loaded to be a m x n
matrix, instead of a m x n x 1
array. It's an issue I've had with MINC tools too.
I think for this case here, the issue likely (not 100% sure) happened on the MINC side ā the VFA data was acquired as a full 3D volume and resampled down to a single slice, whereas the B1 map was acquired using a single-pulse sequence. It's likely that extracting a slice from a volume in MINC doesn't mimic the same dimension configuration that acquiring a single-slice does, leading to their missing nz dimension. I might raise this up with them ā it's an issue that I've dealt with dating back at least 5 years.
Sadly I don't think there are any checks I can put in the QUIT code to deal with true 2D files.
Since you are able to check the # of dimensions with qihdr, you could use that as a check for dimension matching between inputs?
Note that you should be able to re-compile QUIT to have MINC support. It involves editing CMakeLists.txt in the QUIT directory - see here: http://spinicist.github.io/QUIT/Developer/#file-formats. The MINC module is called ITKIOMINC, add it next to ITKIONIFTI and then re-compile QUIT (only QUIT, not ITK). If you then set the environment variable QUIT_EXT to .mnc, it should even output MINC (completely untested, let me know what happens!).
Cool! I might try it!
This was one of the major benefits of swapping to ITK where these things are checked rigorously. Multiple times I have tried fitting models to images with different voxel spacings and been confused by the results, now I get an error up front that the images are incompatible
Agreed ā this isn't an issue we've encountered yet, but risk doing so in the future. I just checked, and unfortunately the only MATLAB ITK package doesn't seem to have been updated since 2007 =(
Hi!
I successfully compiled from source last week, and today wanted to try fitting some simple VFA/DESPOT1 data (using the ones we provide with qMRLab: https://osf.io/7wcvh/).
The json file I used was:
Unfortunately, I encountered the following error:
I tried debugging this several ways (up to even manually editing the header so that the files match), but haven't been successful. It doesn't occur if I try fitting only the VFA data (without the mask or B1 map), only when any 2 or 3 combinations of each are used. I can't find the actual values that the error throws in the header using FSL, which is what's making debugging hard for me.
While I realise that it may not be a QUIT issue but a data or ITK issue (similar errors have been reported here in ANTs, and it's not clear what their solution was/is), I thought I'd bring it to your attention.
That being said, I've tried fitting other VFA datasets that I acquired during my PhD, and this resulted in the same error for each that I tried. The common denominator between all three may be 1- the scanner that was used (3T Siemens Tim TRIO at the Montreal Neurological Institute), and 2 - that a conversion was used (our scanner outputs MINC format, so these data files were converted from MINC to NIFTI).
If anyone out there knows a way to fix this issue, I would be greatly appreciate it. Since this is simply single-slice images, I feel like it shouldn't throw an origin/spacing issue since there's not much that can be done with the data to fix either š¤, and we can fit this data with no issue in qMRLab (likely because these parameters aren't checked).