-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix mrdata dimensions #1161
Fix mrdata dimensions #1161
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -962,8 +962,8 @@ def dimensions(self): | |
if self.number() < 1: | ||
return numpy.zeros((MAX_ACQ_DIMENSIONS,), dtype=cpp_int_dtype()) | ||
dim = numpy.ones((MAX_ACQ_DIMENSIONS,), dtype=cpp_int_dtype()) | ||
hv = pygadgetron.cGT_getAcquisitionDataDimensions\ | ||
(self.handle, dim.ctypes.data) | ||
hv = try_calling(pygadgetron.cGT_getAcquisitionDataDimensions\ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. to be sure, by the next line I mean line 967 ( |
||
(self.handle, dim.ctypes.data)) | ||
pyiutil.deleteDataHandle(hv) | ||
dim[2] = numpy.prod(dim[2:]) | ||
return tuple(dim[2::-1]) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same edits for
get_trajectory_dimensions
andget_kspace_dimensions
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the situation is more complicated, I am afraid. If some acquisitions are to be ignored,
dim[2]
needs to be reduced accordingly in order forfill
andas-array
to work with correct dimensions, and all computations with acquisition data must doTO_BE_IGNORED
checks, which makes it rather pointless to keep ignored acquisitions at all. And if we do not keep them, thenTO_BE_IGNORED
would only be needed when reading from file, and I believe we should issue warning message for every ignored acquisition to make the users aware that the data SIRF reads is not identical to the data in the file.This all should be well thought through and discussed, so I suggest we postpone this PR and PR #1158 until after Release 3.4.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree, but as mentioned in #1156 then gadgetron reconstructions seem not to work any more without the noise sample readouts, which was the reason for trying to drop the macro.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turns out that
gadgetron_ismrmrd_client
usingGeneric_Cartesian_Grappa.xml
without conversion to unsigned shorts produces expected images.Apparently, the pixel values of the reconstructed images are too small to be represented by non-zero unsigned shorts, which suggests Gadgetron scaling problems in the absence of noise calibration data. I will create a Gadgetron issue for this bug when we switch to using up-to-date Gadgetron.
Meanwhile I suggest adding second
int
/bool
argumentall
toMRAcquisitionData::read
, defaulting tofalse
, that would allow the user to disable ignoring acquisitions, and the same argument toAcquisitionsVector
constructor-from-file etc. I volunteer to do that and also fix dimensions bugs (in fact, it looks like ignoring acquisitions inMRAcquisitionData::read
was merely my quick fix for those bugs, so a proper fix is on me).@johannesmayer are you joining our tomorrow zoom?