FCP-INDI / C-PAC

Configurable Pipeline for the Analysis of Connectomes
https://fcp-indi.github.io/
GNU Lesser General Public License v3.0
63 stars 41 forks source link

🐛 `[smoothed, unsmoothed]` not forking #1988

Open shnizzedy opened 1 year ago

shnizzedy commented 1 year ago

Discovered by @ppombosegura

Describe the bug

No desc-sm files are appearing in the output directory, and the -NN_smooth 74 option for 3dSkullStrip is the only smoothing shown in pypeline.log with post_processing, spatial_smoothing, output: [smoothed, nonsmoothed]

Custom pipeline configuration

post_processing: 

  spatial_smoothing: 

    # Smooth the derivative outputs.
    # Set as ['nonsmoothed'] to disable smoothing. Set as ['smoothed', 'nonsmoothed'] to get both.
    #
    # Options:
    #     ['smoothed', 'nonsmoothed']
    output: [smoothed, nonsmoothed]

    # Tool to use for smoothing.
    # 'FSL' for FSL MultiImageMaths for FWHM provided
    # 'AFNI' for AFNI 3dBlurToFWHM for FWHM provided
    smoothing_method: [FSL]

Expected behavior

Both smoothed and nonsmoothed outputs are generated, and clearly differentiated in their filenames

Acceptance criteria

C-PAC version

v1.8.4 & v1.8.5

Container platform

Docker

Additional context

I created a https://github.com/FCP-INDI/C-PAC/labels/forking label in case any of these issues share a cause.

shnizzedy commented 1 year ago

This may actually be a design decision:

Looking at the code where [this command is generated]https://github.com/FCP-INDI/C-PAC/blob/v1.8.4/CPAC/image_utils/spatial_smoothing.py) and called https://github.com/FCP-INDI/C-PAC/blob/12c4f74a3cfeb544239e34301853b90b34d7edc1/CPAC/pipeline/engine.py#L700-L737, only derivatives (the ones with “Yes” under “To Smooth” in this table, like ALFF, ReHo) are smoothed in C-PAC, and space-template_desc-preproc_bold isn’t one of those.

― @shnizzedy

the mask on which the smoothing is supposed to occur is the same mask across subjects…..

― A.D.M.

Ah! That might be the answer as to why this step doesn't happen in the participant-level pipeline! So we’d just need to swap in the correct mask.

― @shnizzedy

shnizzedy commented 1 year ago

in older versions of C-PAC (at least for v1.7.0, which is the one we have used for other pipelines) the functional to standard images were also smoothed and saved when the pipeline config file had the section for spatial smoothing enabled.

― @ppombosegura