SyneRBI / SIRF

Main repository for the CCP SynerBI software
http://www.ccpsynerbi.ac.uk
Other
59 stars 29 forks source link

Cine Interpolation Gadget producing NaN #1123

Closed johannesmayer closed 2 years ago

johannesmayer commented 2 years ago

If in a SIRF recon the script is run to reconstruct MR cine images as indicated in the CPC publication:

recon_gadgets = ['AcquisitionAccumulateTriggerGadget',
         'BucketToBufferGadget', 
         'GenericReconCartesianReferencePrepGadget', 
         'GRAPPA:GenericReconCartesianGrappaGadget', 
         'GenericReconFieldOfViewAdjustmentGadget', 
         'GenericReconImageArrayScalingGadget', 
         'ImageArraySplitGadget',
         'PhysioInterpolationGadget(phases=30, mode=0, first_beat_on_trigger=true, interp_method=BSpline)'
         ]
recon = pMR.Reconstructor(recon_gadgets)
recon.set_gadget_property('GRAPPA', 'send_out_gfactor', True)

recon.set_input(rawdata)
recon.process()
img = recon.get_output('Image PhysioInterp')

then you do get back 30 phases but they all contain only NaN.

evgueni-ovtchinnikov commented 2 years ago

@johannesmayer which raw data do you use?

evgueni-ovtchinnikov commented 2 years ago

@johannesmayer does it give you NaNs without Physio gadget?

johannesmayer commented 2 years ago

1st: I am using undersampled cardiac 2D cartesian cine MR data with 24 phases.

2nd: If I don't put the PhysioInterpolationGadget into the chain and retrieve the result with img_data = recon.get_output('Image') then it works fine. No NaN.

evgueni-ovtchinnikov commented 2 years ago

I found this script that I got from Christoph long time ago:

import os, sys, numpy

import pGadgetron as pMR
import pSTIR as pPET
from pUtilities import show_2D_array, show_3D_array

raw_data_path = './' 
mr_file = 'meas_MID80_2d_cart_cine_30ph_headcoil_FID17006.h5'

acq_data = pMR.AcquisitionData(raw_data_path + mr_file)
preprocessed_data = pMR.preprocess_acquisition_data(acq_data)
recon_gadgets = ['AcquisitionAccumulateTriggerGadget(trigger_dimension=repetition)', 
        'BucketToBufferGadget(split_slices=true, verbose=false)', 
        'GenericReconCartesianReferencePrepGadget', 
        'GenericReconCartesianGrappaGadget(send_out_gfactor=false)',
        'GenericReconFieldOfViewAdjustmentGadget',
        'GenericReconImageArrayScalingGadget',
        'ImageArraySplitGadget',
        'PhysioInterpolationGadget(phases=30, mode=0, first_beat_on_trigger=true, interp_method=BSpline)']
#        'PhysioInterpolationGadget(phases=40, mode=0, first_beat_on_trigger=true, interp_method=BSpline)']
#        'PhysioInterpolationGadget(phases=24, mode=0, first_beat_on_trigger=true, interp_method=BSpline)']

recon = pMR.Reconstructor(recon_gadgets)
recon.set_input(preprocessed_data);
recon.process()

image_data = recon.get_output('image PhysioInterp')
print('Size of image data with PhysioInterpolationGadget: ', image_data.dimensions())
image_data.show()
print(image_data.norm())

and it works fine.

johannesmayer commented 2 years ago

Okay, it actually does. Thanks a lot :) Beats me why the other one above gives you NaNs but I take it!