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

✨ Potential idea: repopulate certain Nifti header fields #2139

Open
2 tasks
sgiavasis opened this issue Jul 26, 2024 · 2 comments
Open
2 tasks

✨ Potential idea: repopulate certain Nifti header fields #2139

sgiavasis opened this issue Jul 26, 2024 · 2 comments
Assignees
Labels
enhancement potential idea For feature/change ideas that are still up for discussion or approval.
Milestone

Comments

@sgiavasis
Copy link
Collaborator

sgiavasis commented Jul 26, 2024

Related problem

Certain unused Nifti header fields can sometimes be overwritten by a tool somewhere in the pipeline.
For example, the TR value can be stored in pixdim4 and then overwritten with something like the number of TRs/timepoints later on, depending on the tool.

C-PAC relies on the BIDS sidecars for the TR and other usual Nifti header information, not the Nifti headers, so processing is not impacted by this.
However, users who may rely on older tools that do not use BIDS may need the Nifti headers intact when running those tools for post-processing analysis.

Proposed feature

We could possibly implement a feature where we simply make sure or copy over the original Nifti header to the final pipeline outputs, as appropriate - as long as this information remains accurate by the end of the pipeline.
At the very least, the TR can be held stable.

Acceptance criteria

  • TR in pixdim4 or other Nifti header fields still present and accurate.
  • Other fields that may be relevant are still present in the Nifti headers, as we assess them.

Alternatives

No response

Additional context

No response

@sgiavasis sgiavasis added potential idea For feature/change ideas that are still up for discussion or approval. enhancement labels Jul 26, 2024
@sgiavasis sgiavasis added this to the 1.8.8 release milestone Jul 26, 2024
@birajstha
Copy link
Contributor

birajstha commented Sep 6, 2024

Following AFNI tools found to reset pixdim[4] to the Time Step value in 3dinfo.

  1. 3dTproject
  2. 3dcalc
  3. TCat

raw file (pixdim4=0.8) -> split -> TCat = preserved (pixdim4 = 0.8)
desc_preproc (pixdim=1) -> update_pixdim=0.8 -> split -> TCat = reset (pixdim4 = 1)

@birajstha
Copy link
Contributor

birajstha commented Sep 6, 2024

Looking into output of CPAC for a particular sub, ses, scan, whose native TR and pixdim[4] = 0.8. It was obvious that this happened at different places in the pipeline.

File Name Status
sub-PA001_ses-V1W1_task-facesmatching_run-1_space-MNI152NLin2009cAsym_desc-head_bold.nii.gz "0.0, needs updating"
sub-PA001_ses-V1W1_task-facesmatching_run-1_space-MNI152NLin2009cAsym_reg-noGSR_desc-preproc1_bold.nii.gz "1.0, needs updating"
sub-PA001_ses-V1W1_task-facesmatching_run-1_desc-preproc_bold.nii.gz Already 0.8
sub-PA001_ses-V1W1_task-facesmatching_run-1_space-MNI152NLin2009cAsym_reg-GSR_desc-preproc2_bold.nii.gz "1.0, needs updating"
sub-PA001_ses-V1W1_task-facesmatching_run-1_desc-mean_bold.nii.gz "None, needs updating"

So, @sgiavasis suggested to build in functionality to check the pixdim4 field of input raw bold files, then at the end, check the pixdim4 and update it if it has changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement potential idea For feature/change ideas that are still up for discussion or approval.
Projects
Status: No status
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants