Skip to content

Commit

Permalink
Switch hbcd pipeline back to Chen (#202)
Browse files Browse the repository at this point in the history
* check the right file for bundle names

* change hbcd_scalar_maps to Chen
  • Loading branch information
mattcieslak authored Jan 14, 2025
1 parent 0e40c3b commit f78c888
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
14 changes: 12 additions & 2 deletions qsirecon/data/pipelines/hbcd_scalar_maps.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
anatomical: []
name: hbcd_postproc_beta
space: T1w
nodes:

- action: DKI_reconstruction
input: qsirecon
name: dipy_dki
Expand All @@ -9,6 +11,7 @@ nodes:
write_mif: false
qsirecon_suffix: DIPYDKI
software: Dipy

- action: estimate
input: qsirecon
name: tortoise_dtmapmri
Expand All @@ -23,6 +26,7 @@ nodes:
small_delta: null
qsirecon_suffix: TORTOISE_model-MAPMRI
software: TORTOISE

- action: estimate
input: qsirecon
name: tortoise_fullshell_tensor
Expand All @@ -35,28 +39,33 @@ nodes:
small_delta: null
qsirecon_suffix: TORTOISE_model-tensor
software: TORTOISE

- action: reconstruction
input: qsirecon
name: dsistudio_gqi
parameters:
method: gqi
qsirecon_suffix: DSIStudio
software: DSI Studio

- action: autotrack
input: dsistudio_gqi
name: autotrackgqi
parameters:
dsi_studio_version: chen
tolerance: 22,26,30
track_id: Association,Projection,Commissure,Cerebellum,CranialNerve
track_id: Association,Projection,Commissure,Cerebellum
track_voxel_ratio: 2.0
yield_rate: 1.0e-06
qsirecon_suffix: DSIStudio
software: DSI Studio

- action: export
input: dsistudio_gqi
name: gqi_scalars
qsirecon_suffix: DSIStudio
software: DSI Studio

- action: bundle_map
input: autotrackgqi
name: bundle_means
Expand All @@ -66,6 +75,7 @@ nodes:
- tortoise_fullshell_tensor
- tortoise_dtmapmri
software: qsirecon

- action: template_map
input: qsirecon
name: template_map
Expand All @@ -77,4 +87,4 @@ nodes:
- tortoise_fullshell_tensor
- tortoise_dtmapmri
software: qsirecon
space: T1w

12 changes: 9 additions & 3 deletions qsirecon/interfaces/dsi_studio.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,9 +880,15 @@ def btable_from_bvals_bvecs(bval_file, bvec_file, output_file):
btablef.write("\n".join(rows) + "\n")


def _get_dsi_studio_bundles(desired_bundles=""):
def _get_dsi_studio_bundles(desired_bundles="", version="hou"):

if version == "hou":
dsi_studio_exe = which("dsi_studio")
elif version == "chen":
dsi_studio_exe = which("dsi_studio_chen")
else:
raise Exception(f"Unrecognized version of DSI Studio. Must be hou or chen, got {version}")

dsi_studio_exe = which("dsi_studio")
if not dsi_studio_exe:
raise Exception("No dsi_studio executable found in $PATH")
bundle_dir = op.split(dsi_studio_exe)[0]
Expand Down Expand Up @@ -935,6 +941,6 @@ def get_bundles(search_string):
else:
matching_bundles = get_bundles(bundle)
if not matching_bundles:
LOGGER.warn("No matching bundles found for " + bundle)
LOGGER.warning("No matching bundles found for " + bundle)
bundles_to_track.extend(matching_bundles)
return bundles_to_track
6 changes: 3 additions & 3 deletions qsirecon/workflows/recon/dsi_studio.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,9 @@ def init_dsi_studio_autotrack_wf(
)
model_name = params.pop("model", "gqi")
omp_nthreads = config.nipype.omp_nthreads
bundle_names = _get_dsi_studio_bundles(params.get("track_id", ""))
dsi_studio_version = params.pop("dsi_studio_version", "hou")

bundle_names = _get_dsi_studio_bundles(params.get("track_id", ""), version=dsi_studio_version)
bundle_desc = (
"AutoTrack attempted to reconstruct the following bundles:\n * "
+ "\n * ".join(bundle_names)
Expand All @@ -407,8 +409,6 @@ def init_dsi_studio_autotrack_wf(
workflow = Workflow(name=name)
workflow.__desc__ = desc + bundle_desc

dsi_studio_version = params.pop("dsi_studio_version", "hou")

_AutoTrack = AutoTrack if dsi_studio_version == "hou" else ChenAutoTrack

# Run autotrack!
Expand Down

0 comments on commit f78c888

Please sign in to comment.