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

plot_reports not removed from _KurtosisReconstructionInputSpec #216

Open
smeisler opened this issue Mar 18, 2025 · 0 comments
Open

plot_reports not removed from _KurtosisReconstructionInputSpec #216

smeisler opened this issue Mar 18, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@smeisler
Copy link
Contributor

Summary

plot_reports is not getting removed from DKI workflow when skipping ODF plots

Additional details

  • QSIRecon version: 1.0.0

What were you trying to do?

Run a big recon workflow (including DKI) while skipping ODF plots.

What did you expect to happen?

What actually happened?

Traceback (most recent call last):
  File "/opt/conda/envs/qsiprep/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/opt/conda/envs/qsiprep/lib/python3.10/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/qsirecon/cli/workflow.py", line 133, in build_workflow
    retval["workflow"] = init_qsirecon_wf()
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/qsirecon/workflows/base.py", line 44, in init_qsirecon_wf
    single_subject_wf = init_single_subject_recon_wf(subject_id=subject_id)
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/qsirecon/workflows/base.py", line 268, in init_single_subject_recon_wf
    dwi_recon_wfs[dwi_file] = init_dwi_recon_workflow(
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/qsirecon/workflows/recon/build_workflow.py", line 76, in init_dwi_recon_workflow
    new_node = workflow_from_spec(
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/qsirecon/workflows/recon/build_workflow.py", line 298, in workflow_from_spec
    return init_dipy_dki_recon_wf(**kwargs)
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/qsirecon/workflows/recon/dipy.py", line 616, in init_dipy_dki_recon_wf
    recon_dki = pe.Node(KurtosisReconstruction(**params), name="recon_dki")
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 567, in __init__
    super().__init__(
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 204, in __init__
    self.inputs.trait_set(**inputs)
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/traits/has_traits.py", line 1520, in trait_set
    setattr(self, name, value)
traits.trait_errors.TraitError: Cannot set the undefined 'plot_reports' attribute of a '_KurtosisReconstructionInputSpec' object.

Reproducing the bug

singularity run --containall \
	--writable-tmpfs \
	-B ${PWD} \
	-B code/license.txt:/SGLR/FREESURFER_HOME/license.txt \
	containers/.datalad/environments/qsirecon-1-0-0/image \
	${PWD}/inputs/data/qsiprep/qsiprep \
	${PWD}/outputs/qsirecon \
	participant \
	-w ${PWD}/.git/tmp/wkdir \
	--fs-license-file /SGLR/FREESURFER_HOME/license.txt \
	-vv \
	--input-type qsiprep \
	--recon-spec ${PWD}/code/recon_spec.yaml \
	--output-resolution 1.5 \
	--nthreads $SLURM_CPUS_PER_TASK \
	--mem-mb $SLURM_MEM_PER_NODE \
	--participant-label "${subid}"

recon spec:

description: DKI, NODDI, MAPMRI, MSMT CSD, GQI Scalars, AutoTrack (with MSMT CSD)
name: workshop_recon_spec
space: T1w
nodes:

    # Run DKI from DIPY
-   action: DKI_reconstruction
    input: qsirecon
    name: dipy_dki
    parameters:
        write_fibgz: false
        write_mif: false
    qsirecon_suffix: DIPYDKI
    software: Dipy

    # Fit NODDI for WM and GM
-   action: fit_noddi
    input: qsirecon
    name: fit_noddi_wm
    parameters:
        dIso: 0.003
        dPar: 0.0017
        isExvivo: false
    qsirecon_suffix: wmNODDI
    software: AMICO
-   action: fit_noddi
    input: qsirecon
    name: fit_noddi_gm
    parameters:
        dIso: 0.003
        dPar: 0.0011
        isExvivo: false
    qsirecon_suffix: gmNODDI
    software: AMICO

    # Run MAPMRI
-   action: MAPMRI_reconstruction
    input: qsirecon
    name: mapmri_recon
    parameters:
        anisotropic_scaling: false
        bval_threshold: 2000
        dti_scale_estimation: false
        laplacian_regularization: true
        laplacian_weighting: 0.2
        radial_order: 6
        write_fibgz: false
        write_mif: false
    qsirecon_suffix: MAPMRI
    software: Dipy

    # Fit the actual GQI model to the data
-   action: reconstruction
    input: qsirecon
    name: dsistudio_gqi
    parameters:
        method: gqi
    qsirecon_suffix: DSIStudioGQI
    software: DSI Studio

    # Get 3D images of DSI Studio's scalar maps
-   action: export
    input: dsistudio_gqi
    name: gqi_scalars
    qsirecon_suffix: DSIStudioGQI
    software: DSI Studio

    # Perform the registration using the GQI-based QA+ISO
-   action: autotrack_registration
    input: dsistudio_gqi
    name: autotrack_gqi_registration
    # qsirecon_suffix: Don't include here - the map.gz is saved in autotrack
    software: DSI Studio

    # Run MSMT CSD
-   action: csd
    input: qsirecon
    name: msmt_csd
    parameters:
        fod:
            algorithm: msmt_csd
            max_sh:
            - 8
            - 8
            - 8
        mtnormalize: true
        response:
            algorithm: dhollander
    qsirecon_suffix: MSMTAutoTrack
    software: MRTrix3

    # Run Tractography
-   action: fod_fib_merge
    name: create_fod_fib
    # to include the fib file AND the map file
    input: autotrack_gqi_registration
    csd_input: msmt_csd
    # outputs include the FOD fib file and the map file is passed through
    qsirecon_suffix: MSMTAutoTrack
    parameters:
        model: msmt
-   action: autotrack
    input: create_fod_fib
    name: autotrack_fod
    parameters:
        tolerance: 22,26,30
        track_id: Association,Projection,Commissure,Cerebellum
        track_voxel_ratio: 2.0
        yield_rate: 1.0e-06
        model: msmt
    qsirecon_suffix: MSMTAutoTrack
    software: DSI Studio

    # Average scalars in bundles
-   action: bundle_map
    input: autotrack_fod
    name: bundle_means
    scalars_from:
    - gqi_scalars
    - dipy_dki
    - mapmri_recon
    - fit_noddi_wm
    software: qsirecon

    # Map scalars to MNI
-   action: template_map
    input: qsirecon
    name: template_map
    parameters:
        interpolation: NearestNeighbor
    scalars_from:
    - gqi_scalars
    - dipy_dki
    - mapmri_recon
    - fit_noddi_wm
    - fit_noddi_gm
    software: qsirecon
@smeisler smeisler added the bug Something isn't working label Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant