qsiprep
qsiprep copied to clipboard
QSIRecon: `NameError: name 'has_qsiprep_t1w' is not defined`
Summary
When starting a recon workflow (HSVS tractography --> pyafq and scaler production) I get an error when logging what anatomical inputs are available.
Additional details
- QSIPrep 0.20.0
- Apptainer 1.1.7
What actually happened?
Running qsirecon version 0.20.1.dev0+geda84d5.d20240112:
* BIDS dataset path: /om2/scratch/tmp/smeisler/fsub_proc/sub-01/data.
* Participant list: ['01'].
* Run identifier: 20240228-215923_25b787db-62e3-47fc-bb80-ffa9d166b8ac.
240228-21:59:29,67 nipype.workflow INFO:
found ['/om2/scratch/tmp/smeisler/fsub_proc/sub-01/data/derivatives/qsiprep/sub-01/dwi/sub-01_space-T1w_desc-preproc_dwi.nii.gz'] in /om2/scratch/tmp/smeisler/fsub_proc/sub-01/data/derivatives/qsiprep
240228-21:59:29,74 nipype.workflow WARNING:
A Non-gzipped input nifti file was found. Consider gzipping /om2/scratch/tmp/smeisler/fsub_proc/sub-01/data/derivatives/qsiprep/sub-01/anat/sub-01_desc-preproc_T1w.nii
240228-21:59:29,74 nipype.workflow INFO:
Found usable QSIPrep-preprocessed T1w image and mask.
240228-21:59:29,77 nipype.workflow INFO:
Found high-res anatomical data in preprocessed inputs for 01.
240228-21:59:29,78 nipype.workflow INFO:
Freesurfer directory /om2/scratch/tmp/smeisler/fsub_proc/sub-01/data/derivatives/freesurfer/sub-01 exists for 01
240228-21:59:29,82 nipype.workflow INFO:
FreeSurfer data will be used to create a HSVS 5tt image.
Process Process-36:
Traceback (most recent call last):
File "/usr/local/miniconda/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/usr/local/miniconda/lib/python3.10/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/miniconda/lib/python3.10/site-packages/qsiprep/cli/run.py", line 1198, in build_recon_workflow
retval['workflow'] = init_qsirecon_wf(
File "/usr/local/miniconda/lib/python3.10/site-packages/qsiprep/workflows/recon/base.py", line 99, in init_qsirecon_wf
single_subject_wf = init_single_subject_wf(
File "/usr/local/miniconda/lib/python3.10/site-packages/qsiprep/workflows/recon/base.py", line 208, in init_single_subject_wf
anat_ingress_node, available_anatomical_data = init_highres_recon_anatomical_wf(
File "/usr/local/miniconda/lib/python3.10/site-packages/qsiprep/workflows/recon/anatomical.py", line 162, in init_highres_recon_anatomical_wf
if has_qsiprep_t1w:
NameError: name 'has_qsiprep_t1w' is not defined
Reproducing the bug
QSIPrep CMD
singularity run -e --containall -B $scratch,$templateflow $IMG \
$scratch/data/ $scratch/data/derivatives participant \
--participant_label $SUB \
-w $scratch \
--output_resolution 1.25 \
--unringing-method mrdegibbs \
--recon-spec $scratch/recon_spec.json \
--freesurfer-input $scratch/data/derivatives/freesurfer/ \
--fs-license-file $scratch/license.txt \
--skip-odf-reports \
--notrack \
--mem_mb 239000 \
--nthreads 32 \
--omp-nthreads 8 \
Recon spec
{
"name": "mrtrix_multishell_msmt_hsvs_pyafq_tractometry",
"space": "T1w",
"atlases": [],
"anatomical": [
"mrtrix_5tt_hsvs"
],
"nodes": [{
"name": "msmt_csd",
"software": "MRTrix3",
"action": "csd",
"output_suffix": "msmtcsd",
"input": "qsiprep",
"parameters": {
"mtnormalize": true,
"response": {
"algorithm": "dhollander"
},
"fod": {
"algorithm": "msmt_csd",
"max_sh": [8, 8, 8]
}
}
},
{
"name": "track_ifod2",
"software": "MRTrix3",
"action": "tractography",
"output_suffix": "ifod2",
"input": "msmt_csd",
"parameters": {
"use_5tt": true,
"method_5tt": "hsvs",
"use_sift2": true,
"tckgen": {
"algorithm": "iFOD2",
"select": 1e7,
"max_length": 250,
"min_length": 30,
"power": 0.33,
"crop_at_gmwmi": true,
"backtrack": true,
"quiet": true
},
"sift2": {}
}
},
{
"name": "pyafq_tractometry",
"software": "pyAFQ",
"action": "pyafq_tractometry",
"input": "track_ifod2",
"output_suffix": "PYAFQ_TRACTOMETRY_ET",
"parameters": {
"use_external_tracking": true,
"export": "all",
"directions": "prob",
"max_angle": 30.0,
"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": "",
"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": "",
"reg_template_spec": "mni_T1",
"mapping_definition": "",
"reg_subject_spec": "power_map",
"profile_weights": "gauss",
"scalars": "['dki_fa', 'dki_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
}
},
{
"name": "fit_noddi",
"action": "fit_noddi",
"software": "AMICO",
"input": "qsiprep",
"output_suffix": "NODDI",
"parameters": {
"isExvivo": false,
"dPar": 1.7E-3,
"dIso": 3.0E-3
}
},
{
"name": "dki_recon",
"software": "Dipy",
"action": "DKI_reconstruction",
"input": "qsiprep",
"output_suffix": "DKI",
"parameters": {
"write_mif": false,
"write_fibgz": false
}
},
{
"name": "dsistudio_gqi",
"software": "DSI Studio",
"action": "reconstruction",
"input": "qsiprep",
"output_suffix": "gqi",
"parameters": {
"method": "gqi"
}
},
{
"name": "scalar_export",
"software": "DSI Studio",
"action": "export",
"input": "dsistudio_gqi",
"output_suffix": "gqiscalar"
},
{
"name": "autotrackgqi",
"software": "DSI Studio",
"action": "autotrack",
"input": "dsistudio_gqi",
"output_suffix": "AutoTrackGQI",
"parameters": {
"track_id": "Fasciculus,Cingulum,Aslant,Corticos,Thalamic_R,Reticular,Optic,Fornix,Corpus",
"tolerance": "22,26,30",
"track_voxel_ratio": 2.0,
"yield_rate": 0.000001
}
}
]
}
My diagnosis
I know that file has changed in recent commits but it looks like, at least at the release of 0.20.0, has_qsiprep_t1w
was not defined in def init_highres_recon_anatomical_wf
, and was only defined in the def gather_qsiprep_anatomical_data
function. In earlier commits (e.g., 8ee6440798d2ea3010cb86c6b7e83b045813770a), the input gathering was done in init_highres_recon_anatomical_wf
, which might be why the error is popping up now.
Thanks, Steven
I just ran into this one too, thanks for opening the issue
Seems related to #675 as well.
Does anyone on this thread know of a good open dataset that has dwi and freesurfer results? The reason this exists as a bug now is that I don't have any good testing data for the hsvs workflow
I have bids-ified one subject of the Natural Scenes Dataset, found here: (edit to remove link) I also have qsiprep outputs for it already, so you can go right to qsirecon testing.
this is perfect! Do you mind if I use this in the CI tests?
Don't mind at all!
You should sign the data access agreement, though: https://docs.google.com/forms/d/e/1FAIpQLSduTPeZo54uEMKD-ihXmRhx0hBDdLHNsVyeo_kCb8qbyAkXuQ/viewform
You're allowed to host the data on openneuro even with point 3 I will not distribute this dataset or its components to any other individual or entity
?
I think HBN has these. Freesurfer v6 though
On Mon, Mar 4, 2024 at 12:07 PM Matt Cieslak @.***> wrote:
You're allowed to host the data on openneuro even with point 3 I will not distribute this dataset or its components to any other individual or entity ?
— Reply to this email directly, view it on GitHub https://github.com/PennLINC/qsiprep/issues/705#issuecomment-1977367362, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA46NTUXDIDBIJXFT67VOTYWTH63AVCNFSM6AAAAABEAJBVP2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZXGM3DOMZWGI . You are receiving this because you are subscribed to this thread.Message ID: @.***>
@mattcieslak,
I haven't seen this in 0.21.4
. It got fixed somewhere along the way when the preprocessed T1w images weren't getting gzipped when being written and now are.... looking for the commit but haven't been able to find it. It's probably #745 so that it's now correctly assessing whether the input was compressed and therefore the derivatives should be compressed.
This should definitely be fixed in 0.22.0, will reopen if it reappears