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

[6VV2] AFNI through NIpype (AFNI - raw) #126

Open
JLefortBesnard opened this issue Nov 7, 2023 · 1 comment
Open

[6VV2] AFNI through NIpype (AFNI - raw) #126

JLefortBesnard opened this issue Nov 7, 2023 · 1 comment
Assignees

Comments

@JLefortBesnard
Copy link

JLefortBesnard commented Nov 7, 2023

Softwares

AFNI

Input data

raw data

Additional context

I attempted to replicate the pipeline 6VV2 using three different methods for the first level (preprocessing + subject-wise regression) and the same three methods for the second level (group-wise regression)
1.Recreate the AFNI code using Nipype AFNI interface
2.Execute the afni_proc.py file through Nipype (not using the AFNI interface)
3.Execute the afni_proc.py file independently.

Issues with method 1

Some Afni features are not implemented in the Afni interface of Nipype
  • Nipype deconvolve function doesn't have the "stim_times_AM2" options of the afni deconvolve function

  • When a temporary file should be transposed, nipype workflow does not allow for this. ex: AFNI: 3dTstat -sos -prefix - mean.errts.unit.1D\' > out.gcor.1D or set blurs = (`3dTstat -mean -prefix - blur.epits.1D'{0..$(2)}'\'` )

  • Missing gen_epi_review.py

  • Missing auto_warp.py

  • 3dbucket in nipype requires list of tuple with 2 elements (for 6VV2 only one is needed: 3dbucket -DAFNI_NIFTI_VIEW=tlrc -prefix sub-001_T1w_ns awpy/sub-001_T1w_ns.nii*

Some Afni features are not implemented with the same options in the Afni interface of Nipype
  • 3dmean as afni.Means() takes only 2 inputs (in_file_a and in_file_b) instead of more than 2

  • 3dDot instead of 3ddot in nipype (written 3dDot when actually calling the 3ddot afni function thus returns an error)

  • The nipype version of align_epi_anat.py does not have the -skullstrip attribute working (error returned: AttributeError: 'dict' object has no attribute 'skullstrip')

Issues with method 2

Using a computer with 16G Ram, the code systematically crashed (Ram saturation)

Suggested solutions

As I proceeded, within the script, include sections utilizing Nipype workflows, and other sections directly invoking Afni functions (e.g., "!3d mean").
Another option is to modify the nipype afni interface locally
A greater option is to contribute to the nipype repro directly

@JLefortBesnard JLefortBesnard changed the title [6VV] AFNI through NIpype [6VV2] AFNI through NIpype Nov 7, 2023
@cmaumet cmaumet changed the title [6VV2] AFNI through NIpype [6VV2] AFNI through NIpype (AFNI - raw) Feb 13, 2024
@bclenet
Copy link
Collaborator

bclenet commented Feb 14, 2024

Here are a few notes, for further work on these issues.

  • 3dDeconvolve : args input of the nipype.interfaces.afni.model.Deconvolveinterface could allow to add the missing parameter stim_times_AM2
  • 3dtstat : I need to better understand the issue
  • gen_epi_review.py : this would require to develop a new nipype interface. Is this feature really needed in our usecase ?
  • auto_warp.py : this would require to develop a new nipype interface.
  • 3dBucket : not sure to understand this, but it looks like the required tuple is on the form (file: str, subbrick_selection: str), perhaps using '{0..$}' as subbrick_selection to select all ?
  • 3dMean : args input of the nipype.interfaces.afni.preprocess.Meansinterface could allow to add the other files (to be tested though)
  • 3dDot : workaround (no extra code needed) - modify the _cmd attribute of the interface, e.g.: dot._cmd = '3ddot'
  • align_epi_anat.py : this would require to develop a new nipype interface.

@bclenet bclenet moved this from In progress to Backlog in NARPS Open Pipelines | Reproductions Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants