Skip to content
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

Processing functions on RawAcquisitionData #231

Open
aTrotier opened this issue Feb 17, 2025 · 2 comments
Open

Processing functions on RawAcquisitionData #231

aTrotier opened this issue Feb 17, 2025 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@aTrotier
Copy link
Contributor

I will create a PR that add the following function acting on RawAcquisitionData object :

Subset of profiles

A function that return subset of profile according to flag. For example if I want to create a raw object only with the [ACQ_IS_PARALLEL_CALIBRATION,ACQ_IS_PARALLEL_CALIBRATION_AND_IMAGING] : raw_subset(raw,ACQ_IS_PARALLEL_CALIBRATION+ACQ_IS_PARALLEL_CALIBRATION_AND_IMAGING) or raw_subset(raw,["ACQ_IS_PARALLEL_CALIBRATION","ACQ_IS_PARALLEL_CALIBRATION_AND_IMAGING"])

Remove readout oversampling

function remove_oversampling!(raw)
ratioFOV = raw.params["encodedFOV"][1] / raw.params["reconFOV"][1]

# Assuming all profiles have the same size
sdim = size(raw.profiles[1].data)
sdim_out = Int(sdim[1] / ratioFOV)
start = Int((sdim[1] - sdim_out) ÷ 2)

Threads.@threads for profile in raw.profiles
    tmp = profile.data
    tmp = ifftshift(ifft(ifftshift(tmp, 1), 1), 1)
    @views tmp = tmp[start:start+sdim_out, :]
    tmp = fftshift(fft(fftshift(tmp, 1), 1), 1)
    
    profile.data = tmp
    profile.head.number_of_samples = sdim_out
    profile.head.center_sample = UInt16(profile.head.center_sample / ratioFOV)
    profile.head.discard_pre = UInt16(profile.head.discard_pre / ratioFOV)
    profile.head.discard_post = UInt16(profile.head.discard_post / ratioFOV)
end
raw.params["encodedSize"][1] = raw.params["encodedSize"][1] ÷ ratioFOV
return raw

end

Coil compression on RawAcquisitionData

SVD calculation will be done on calibration profiles ?

Any other idea about function that acts on RawAcquisitionData ?

@aTrotier aTrotier added the enhancement New feature or request label Feb 17, 2025
@aTrotier aTrotier self-assigned this Feb 17, 2025
@aTrotier
Copy link
Contributor Author

aTrotier commented Feb 18, 2025

Ongoing implementation : #232

@aTrotier
Copy link
Contributor Author

aTrotier commented Feb 18, 2025

Hmm,
I am now able to filter the acquisition by FLAGS but I think we also need a function to create an "IMAGING" datasets. Any idea how to do that ?

Something like :

function remove_raw_by_flags(rawData::RawAcquisitionData, flags= [ACQ_IS_NOISE_MEASUREMENT,
       ACQ_IS_PARALLEL_CALIBRATION,
       ACQ_IS_NAVIGATION_DATA,
       ACQ_IS_PHASECORR_DATA],
       ACQ_IS_DUMMYSCAN_DATA,     
      ACQ_IS_PHASE_STABILIZATION_REFERENCE,
       ACQ_IS_PHASE_STABILIZATION) 

# return profiles that are not flags
end

I am not sure about the default flags we should remove

       ACQ_IS_NOISE_MEASUREMENT,
       ACQ_IS_PARALLEL_CALIBRATION,
       ACQ_IS_PARALLEL_CALIBRATION_AND_IMAGING, #we should keep it
       ACQ_IS_REVERSE, # we should keep it
       ACQ_IS_NAVIGATION_DATA,
       ACQ_IS_PHASECORR_DATA,
       ACQ_IS_HPFEEDBACK_DATA,
       ACQ_IS_DUMMYSCAN_DATA,
       ACQ_IS_RTFEEDBACK_DATA,
       ACQ_IS_SURFACECOILCORRECTIONSCAN_DATA, #we should keep it
       ACQ_IS_PHASE_STABILIZATION_REFERENCE,
       ACQ_IS_PHASE_STABILIZATION,

@mrikasper Do you have an opinion about it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant