Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/rbc/core/anatomical/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,6 @@ def ants_registration(
print_out_composite_warp_file=True,
),
)
return SimpleNamespace(forward=fwd.output, inverse=rev.output)
return SimpleNamespace(
forward=fwd.output.output_image_outfile, inverse=rev.output.output_image_outfile
)
4 changes: 2 additions & 2 deletions src/rbc/core/anatomical/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def fsl_tissue_segmentation(in_file: Path, output_prefix: str) -> SimpleNamespac
tissue_type: fsl.fslmaths(
input_files=[tissues.root / f"{output_prefix}_pve_{idx}.nii.gz"],
operations=[
fsl.fslmaths_operation(thr=0.95),
fsl.fslmaths_operation(bin_=True),
fsl.fslmaths_operation_thr(thr=0.95),
fsl.fslmaths_operation_bin(bin_=True),
],
output=f"{tissue_type}_mask.nii.gz",
).output_file
Expand Down
15 changes: 7 additions & 8 deletions src/rbc/workflows/anatomical.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,15 @@ def single_session(in_t1w: Path, output_dir: Path) -> None:
)

# Prep files to save
t1w_outputs = [
(extracted_t1w.brain_extracted_image, "brain", "T1w"),
(extracted_t1w.brain_mask, "T1w", "mask"),
(tissue_masks.csf, "csf", "mask"),
(tissue_masks.gm, "gm", "mask"),
(tissue_masks.wm, "wm", "mask"),
]
renamed_files = [
rename(out_file, bids(desc=desc, suffix=suffix, ext=".nii.gz"))
for out_file, desc, suffix in t1w_outputs
for out_file, desc, suffix in [
(extracted_t1w.brain_extracted_image, "brain", "T1w"),
(extracted_t1w.brain_mask, "T1w", "mask"),
(tissue_masks.csf, "csf", "mask"),
(tissue_masks.gm, "gm", "mask"),
(tissue_masks.wm, "wm", "mask"),
]
]
niwrap_helper.save(
[*renamed_files, transforms.forward, transforms.inverse],
Expand Down