SyneRBI / SIRF

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

SIRF Reading & Writing and gadgetron_ismrmrd_client collide #1156

Closed johannesmayer closed 1 year ago

johannesmayer commented 1 year ago

I encountered a problem executing the following steps:

all reconstructions yield zeros.

I have found the solution: https://github.com/SyneRBI/SIRF/blob/93f280fbfc95f914642d1a532a65882d83938eb5/src/xGadgetron/cGadgetron/include/sirf/Gadgetron/gadgetron_data_containers.h#L62

to false for all acquisitions will solve this problem.

evgueni-ovtchinnikov commented 1 year ago

false for all acquisitions will solve this problem

@johannesmayer ... and will create problems elsewhere (as_array, fill, norm, dot, ...)

Better try your steps with these lines in MRAcquisitionData::read commented out:

            if( TO_BE_IGNORED(acq) )
                continue;
            else
johannesmayer commented 1 year ago

Thanks, good point @evgueni-ovtchinnikov. For my tests I did as you suggested.

I checked again and I ran the following reconstruction (using the "old" Gadgetron commit that's used in the current Superbuild)

preprocessed_data = preprocess_acquisition_data(acq_data)

    # Perform reconstruction of the preprocessed data.
    # 1. set the reconstruction to be for Cartesian GRAPPA data.
    recon_gadgets = ['AcquisitionAccumulateTriggerGadget',
            'BucketToBufferGadget', 
            'GenericReconCartesianReferencePrepGadget', 
            'GRAPPA:GenericReconCartesianGrappaGadget', 
            'GenericReconFieldOfViewAdjustmentGadget', 
            'GenericReconImageArrayScalingGadget', 
            'ImageArraySplitGadget',
            'PhysioInterpolationGadget(phases=30, mode=0, first_beat_on_trigger=true, interp_method=BSpline)']

    recon = Reconstructor(recon_gadgets)
    recon.set_gadget_property('GRAPPA', 'send_out_gfactor', True)

    # 2. set the reconstruction input to be the data we just preprocessed.
    recon.set_input(preprocessed_data)

    # 3. run (i.e. 'process') the reconstruction.
    print('---\n reconstructing...\n')
    recon.process()

    # retrieve reconstruced image and G-factor data
    image_data = recon.get_output('Image PhysioInterp')

    image_data = image_data.abs()
    image_data.write("output.dcm")

Left: reconstruction including the TO_BE_IGNORED in the read function, right without it. So it seems not to be just about the client.

tmprecon_sirf_with_ignore tmprecon_sirf_without_ignore

evgueni-ovtchinnikov commented 1 year ago

@johannesmayer so I understand removing those 3 lines fixed the issue? If so, could you please create a PR, and if GHA builds succeed merge it - or I could do it if you are busy.

evgueni-ovtchinnikov commented 1 year ago

see PR #1161

evgueni-ovtchinnikov commented 1 year ago

taken care of by #1174, closing...