shimming-toolbox / shimming-toolbox-matlab

Code for performing real-time shimming using external MRI shim coils
GNU General Public License v3.0
16 stars 5 forks source link

BUG: resliceimg (MaRdI interpolation) issue #161 #162

Open rtopfer opened 4 years ago

rtopfer commented 4 years ago

PR fixes #161 — bug in MaRdI.m (constructor) when the number of image volumes acquired for a given series (a.k.a. number of repetitions, or measurements) as stated in the dicom header differs from the number of image files discovered (i.e. provided by the user).

Also fixed are several erroneous variable assignments/reassignments in MaRdI.resliceimg() re: array dimensions.

evaalonsoortiz commented 4 years ago

@rtopfer I just tested this out, and was able to use the testing dataset that has a number of volume repetitions that differs from the original number. To confirm, the original error when usingMaRdI.resliceimg() still occurs. This is expected, right?

rtopfer commented 4 years ago

@evaalonsoortiz should work now? tbh the whole function seems way more complicated than it ought to be... i feel there must be a simpler built-in matlab function somewhere 🧐

evaalonsoortiz commented 4 years ago

Hmmm, still getting an error. I am using the EPI image in the sample dataset "34_ep2d_bold_realtime_zshim_UNSHIMMED_2" instead of a GRE for the resampling. The error I am getting now is slightly different:

Error using MaRdI/resliceimg (line 1283)
Dimensions of the arrays of extrapolation coordinate and the assigned extrapolation ROI mask must be identical

Error in realtime_zshim (line 310)
GzField.resliceimg( X,Y,Z, mask ) ; % reslice static b0 image
evaalonsoortiz commented 4 years ago

@evaalonsoortiz should work now? tbh the whole function seems way more complicated than it ought to be... i feel there must be a simpler built-in matlab function somewhere 🧐

I think ANTs ResampleImage could replace this once the code is fully nifti-functional.