PennLINC / qsirecon

Reconstruction of preprocessed q-space images (dMRI)
https://qsirecon.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

HSVS Anatomical Outputs not Written to Datasink #112

Closed smeisler closed 4 days ago

smeisler commented 2 months ago

Summary

During anatomical HSVS postprocessing, the anatomical output folder and files are not created. The datasink node for these outputs throws an error.

Additional details

What were you trying to do?

HSVS MSMT Tractography --> PyAFQ

Output Log

     [Node] Executing "ds_qsiprep_5tt_hsvs" <qsirecon.interfaces.bids.DerivativesDataSink>
INFO:nipype.workflow:[Node] Executing "ds_qsiprep_5tt_hsvs" <qsirecon.interfaces.bids.DerivativesDataSink>
240919-16:49:49,689 nipype.workflow INFO:
     [Node] Finished "ds_qsiprep_5tt_hsvs", elapsed time 0.005615s.
INFO:nipype.workflow:[Node] Finished "ds_qsiprep_5tt_hsvs", elapsed time 0.005615s.
240919-16:49:49,689 nipype.workflow WARNING:
     Storing result file without outputs
WARNING:nipype.workflow:Storing result file without outputs
240919-16:49:49,696 nipype.workflow WARNING:
     [Node] Error on "qsirecon_0_1_wf.sub-100307_mrtrix_multishell_msmt_hsvs_pyafq.recon_anatomical_wf.ds_qsiprep_5tt_hsvs" (/om2/vast/gablab/smeisler/qsirecon_dev/qsirecon_work2/qsirecon_0_1_wf/sub-100307_mrtrix_multishell_msmt_hsvs_pyafq/recon_anatomical_wf/ds_qsiprep_5tt_hsvs)
WARNING:nipype.workflow:[Node] Error on "qsirecon_0_1_wf.sub-100307_mrtrix_multishell_msmt_hsvs_pyafq.recon_anatomical_wf.ds_qsiprep_5tt_hsvs" (/om2/vast/gablab/smeisler/qsirecon_dev/qsirecon_work2/qsirecon_0_1_wf/sub-100307_mrtrix_multishell_msmt_hsvs_pyafq/recon_anatomical_wf/ds_qsiprep_5tt_hsvs)
240919-16:49:49,700 nipype.workflow ERROR:
     Node ds_qsiprep_5tt_hsvs failed to run on host node066.
ERROR:nipype.workflow:Node ds_qsiprep_5tt_hsvs failed to run on host node066.
240919-16:49:49,706 nipype.workflow ERROR:
     Saving crash info to /om2/user/smeisler/qsirecon_dev/qsirecon_out2/sub-100307/log/20240919-161736_0bfd3cfc-46b3-4a6e-bd2d-3711295d2081/crash-20240919-164949-smeisler-ds_qsiprep_5tt_hsvs-19c4b695-9f9c-40f4-b7b7-0a8f91e7f039.txt
Traceback (most recent call last):
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/pipeline/plugins/multiproc.py", line 344, in _send_procs_to_workers
    self.procs[jobid].run(updatehash=updatehash)
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node ds_qsiprep_5tt_hsvs.

Traceback:
    Traceback (most recent call last):
      File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 397, in run
        runtime = self._run_interface(runtime)
      File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/niworkflows/interfaces/bids.py", line 632, in _run_interface
        raise ValueError(f"Could not build path with entities {out_entities}.")
    ValueError: Could not build path with entities {'subject': '100307', 'suffix': 'dseg', 'datatype': 'anat', 'extension': 'nii', 'space': 'T1w', 'atlas': 'hsvs'}.

ERROR:nipype.workflow:Saving crash info to /om2/user/smeisler/qsirecon_dev/qsirecon_out2/sub-100307/log/20240919-161736_0bfd3cfc-46b3-4a6e-bd2d-3711295d2081/crash-20240919-164949-smeisler-ds_qsiprep_5tt_hsvs-19c4b695-9f9c-40f4-b7b7-0a8f91e7f039.txt
Traceback (most recent call last):
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/pipeline/plugins/multiproc.py", line 344, in _send_procs_to_workers
    self.procs[jobid].run(updatehash=updatehash)
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node ds_qsiprep_5tt_hsvs.

Traceback:
    Traceback (most recent call last):
      File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/nipype/interfaces/base/core.py", line 397, in run
        runtime = self._run_interface(runtime)
      File "/opt/conda/envs/qsiprep/lib/python3.10/site-packages/niworkflows/interfaces/bids.py", line 632, in _run_interface
        raise ValueError(f"Could not build path with entities {out_entities}.")
    ValueError: Could not build path with entities {'subject': '100307', 'suffix': 'dseg', 'datatype': 'anat', 'extension': 'nii', 'space': 'T1w', 'atlas': 'hsvs'}.

Reproducing the bug

Recon Spec

{
    "name": "mrtrix_multishell_msmt_hsvs_pyafq",
    "space": "T1w",
    "atlases": [
        "schaefer400",
        "aal116"
    ],
    "anatomical": [
        "mrtrix_5tt_hsvs"
    ],
    "nodes": [
        {
            "name": "msmt_csd",
            "software": "MRTrix3",
            "action": "csd",
            "qsirecon_suffix": "MRtrix3_act-HSVS",
            "input": "qsirecon",
            "parameters": {
                "mtnormalize": true,
                "response": {
                    "algorithm": "dhollander"
                },
                "fod": {
                    "algorithm": "msmt_csd",
                    "max_sh": [
                        8,
                        8,
                        8
                    ]
                }
            }
        },
        {
            "name": "track_ifod2",
            "software": "MRTrix3",
            "action": "tractography",
            "qsirecon_suffix": "MRtrix3_act-HSVS",
            "input": "msmt_csd",
            "parameters": {
                "use_5tt": true,
                "method_5tt": "hsvs",
                "use_sift2": true,
                "tckgen": {
                    "algorithm": "iFOD2",
                    "select": 2000000,
                    "max_length": 250,
                    "min_length": 30,
                    "power": 0.33,
                    "crop_at_gmwmi": true,
                    "backtrack": true,
                    "quiet": true
                },
                "sift2": {}
            }
        },
        {
            "name": "mrtrix_conn",
            "software": "MRTrix3",
            "action": "connectivity",
            "qsirecon_suffix": "MRtrix3_act-HSVS",
            "input": "track_ifod2",
            "parameters": {
                "tck2connectome": [
                    {
                        "zero_diagonal": false,
                        "search_radius": 2,
                        "scale_invnodevol": true,
                        "symmetric": true,
                        "use_sift_weights": true,
                        "stat_edge": "sum",
                        "measure": "sift_invnodevol_radius2_count"
                    },
                    {
                        "zero_diagonal": false,
                        "search_radius": 2,
                        "scale_invnodevol": false,
                        "symmetric": true,
                        "length_scale": "length",
                        "use_sift_weights": false,
                        "stat_edge": "mean",
                        "measure": "radius2_meanlength"
                    },
                    {
                        "zero_diagonal": false,
                        "search_radius": 2,
                        "scale_invnodevol": false,
                        "symmetric": true,
                        "use_sift_weights": false,
                        "stat_edge": "sum",
                        "measure": "radius2_count"
                    },
                    {
                        "zero_diagonal": false,
                        "search_radius": 2,
                        "scale_invnodevol": false,
                        "symmetric": true,
                        "use_sift_weights": true,
                        "stat_edge": "sum",
                        "measure": "sift_radius2_count"
                    }
                ]
            }
        },
        {
            "name": "pyafq_tractometry",
            "software": "pyAFQ",
            "action": "pyafq_tractometry",
            "input": "track_ifod2",
            "qsirecon_suffix": "PYAFQ",
            "parameters": {
                "use_external_tracking": true,
                "export": "all",
                "directions": "prob",
                "max_angle": 30,
                "sphere": "",
                "seed_mask": "",
                "seed_threshold": 0,
                "n_seeds": 1,
                "random_seeds": false,
                "rng_seed": "",
                "stop_mask": "",
                "stop_threshold": 0,
                "step_size": 0.5,
                "min_length": 50,
                "max_length": 250,
                "odf_model": "CSD",
                "tracker": "local",
                "nb_points": false,
                "nb_streamlines": false,
                "seg_algo": "AFQ",
                "reg_algo": "",
                "clip_edges": false,
                "parallel_segmentation": "{'n_jobs': -1, 'engine': 'joblib', 'backend': 'loky'}",
                "progressive": true,
                "greater_than": 50,
                "rm_small_clusters": 50,
                "model_clust_thr": 1.25,
                "reduction_thr": 25,
                "refine": false,
                "pruning_thr": 12,
                "b0_threshold": 50,
                "prob_threshold": 0,
                "roi_dist_tie_break": false,
                "dist_to_waypoint": "",
                "rng": "",
                "return_idx": false,
                "presegment_bundle_dict": null,
                "presegment_kwargs": "{}",
                "filter_by_endpoints": true,
                "dist_to_atlas": 4,
                "save_intermediates": "",
                "n_points": 100,
                "clean_rounds": 5,
                "distance_threshold": 3,
                "length_threshold": 4,
                "min_sl": 20,
                "stat": "mean",
                "min_bval": "",
                "max_bval": "",
                "filter_b": true,
                "robust_tensor_fitting": false,
                "csd_response": "",
                "csd_sh_order": "",
                "csd_lambda_": 1,
                "csd_tau": 0.1,
                "gtol": 0.01,
                "brain_mask_definition": "",
                "bundle_info": null,
                "reg_template_spec": "mni_T1",
                "mapping_definition": "",
                "reg_subject_spec": "power_map",
                "profile_weights": "gauss",
                "scalars": "['dti_fa', 'dti_md']",
                "import_tract": "",
                "sbv_lims_bundles": "[None, None]",
                "volume_opacity_bundles": 0.3,
                "n_points_bundles": 40,
                "sbv_lims_indiv": "[None, None]",
                "volume_opacity_indiv": 0.3,
                "n_points_indiv": 40,
                "viz_backend_spec": "plotly_no_gif",
                "virtual_frame_buffer": false
            }
        }
    ]
}

Command

singularity run \
-e -H $FAKE_HOME \
-B /om2,/nese \
--writable-tmpfs --containall \
$QSIRECON_IMG \
$HCP1200 $OUT participant \
-w $WORK \
--freesurfer-input $PWD/freesurfer \
--fs-license-file ${license} \
--input-type hcpya \
--participant-label 100307 \
 --recon-spec $PWD/recon_spec2.json \
-v -v
tsalo commented 4 days ago

I think this is fixed by #131. @smeisler do you know if it's still a problem?

smeisler commented 4 days ago

I'm not sure, but it would guess it is safe to close this.