First a couple of other points.

 

The ‘import’ command does work in Matlab functions, it is the ‘clear import’ that is the problem. On a very minor point, should the loading of the iUtilities library be separate from loading mgadgetron, as the latter is specific to the chosen MR engine?

 

I see that a fill method has been added for Matlab – that’s great, however when I tried it, nothing happened – even tried filling with zeros and my original data was still there!

 

On the retrieval of data, there is some confusion in my mind as to whether get_output returns an Image object, which then needs an ‘as_array’ method applying, or the array directly.

From a user perspective, ultimately we would like to be able to read/manipulate in Matlab/Python any part of the data i.e. sorted k-space, noise measurements, reconstructed images, g-factors, coil maps or whatever as matrices in Matlab/Python. (Note these are physical properties and not something unique to Gadgetron.) In general these might be different sizes so cannot all be placed into one multi-dimensional output matrix.  

The Gyrotools software has a method ‘.Data’ that returns a cell array with each element being an array, for example one cell array element with k-space, another element noise etc.

 

For now, how about as_array(‘data’) (dumps the whole lot), as_array(‘image’) or as_array(‘Gfactor’) etc?

 

David

 

 

From: CCP-PETMR Developers list [mailto:[log in to unmask]] On Behalf Of Thielemans, Kris
Sent: Tuesday, January 10, 2017 08:31
To: [log in to unmask]
Subject: Re: Data meaning from Gadgetron

 

Wonderful. Thanks guys.

 

So now we need to decide on naming. Consistency and uniformity is important, but of course not easy to achieve…

 

Current status is I think as follows

 

SimpleReconstruction

get_output()  (returns image)

 

GenericCartesianGRAPPAReconstruction

get_output('image')

get_output('gfactor')

get_output() (returns all output without select, so presumably having either only image, or both image/gfactor merged somehow)

 

ImagesReconstructor (for gadget-chains)

get_output() (returns all output without select, so depends on gadget-chain)

 

My opinion is as follows.

 

I think the “merged” format is a Gadgetron specific thing, which most people don’t want to know about. If we use it at all, it has to be only in gadget-specific code.

 

I think most users would be surprised if GenericCartesianGRAPPAReconstruction.get_output() returns a different sized image depending on parameter settings. Also, I don’t think that the “merged” output is really truly an object of the Image class (or is it Images?).

 

I think it would therefore make most sense to say that all Reconstructor-type objects have

·       get_output(): returns reconstructed image(s)

·       get_gfactors(): returns gfactors if they were computed (I’d raise an error as opposed to returning an empty object otherwise)

 

Have an additional member for ImagesReconstructor that returns all output somehow. As this class is Gadgetron specific, we could call this for instance

·       get_gadgetron_output(…): return everything the gadgets produce somehow

 

What the return format of this function has to be, I don’t really know as I don’t know Gadgetron well enough. I don’t know if it would return stuff with different sizes etc for instance. Possibly this could be handled by exposing the “select” functionality somehow. I’d be happy enough to have

get_gadgetron_output(gadgetron_selection_mask)

or something like that.

 

What do our MR experts say?

 

Kris

From: CCP-PETMR Developers list [mailto:[log in to unmask]] On Behalf Of Evgueni Ovtchinnikov
Sent: 09 January 2017 17:08
To: [log in to unmask]
Subject: Re: Data meaning from Gadgetron

 

Thanks a lot!

 

I thought everything was described in image header, but what I needed was actually in image attributes!

 

Now we can do selection of images by image role (“Image”/“Gfactor”/etc), and e.g. get_output(‘Gfactor’) will work with any reconstruction chain (simply returning empty Image object if there are no Gfactors).

 

Thanks very much for your help again!

 

From: Atkinson, David [mailto:[log in to unmask]]
Sent: 09 January 2017 16:03
To: Ovtchinnikov, Evgueni (STFC,RAL,SC)
Cc: Atkinson, David
Subject: Data meaning from Gadgetron

 

Evgueni,

 

On the tcon you asked about how the output data from Gadgetron was labelled, so that you could distinguish gfactor maps from the normal reconstructed images.

You said there seemed to be some label number but you could not find a table or documentation where these codes were set.

 

I had a look at the Gadgetron code and in GenericReconGadget.cpp there is the following:

else if (data_role == GADGETRON_IMAGE_GFACTOR)

            {

                res.headers_(n, s, slc).image_type = ISMRMRD::ISMRMRD_IMTYPE_MAGNITUDE;

 

                res.meta_[offset].append(GADGETRON_IMAGECOMMENT, GADGETRON_IMAGE_GFACTOR);

                res.meta_[offset].append(GADGETRON_SEQUENCEDESCRIPTION, GADGETRON_IMAGE_GFACTOR);

                res.meta_[offset].set(GADGETRON_DATA_ROLE, GADGETRON_IMAGE_GFACTOR);

 

where GADGETRON_IMAGE_GFACTOR has been defined in mri_core_def.h as the string "Gfactor". So it looks like internally the data has a description string attached. Do you know if this string is available to you when you access the data, rather than a numeric code?

 

David