Skip to content

Commit

Permalink
update.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsalo committed Nov 21, 2023
1 parent 8a951b8 commit 7950ec4
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
8 changes: 7 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ On the relationship between ASLPrep and fMRIPrep
************************************************

ASLPrep is largely based on fMRIPrep, as ASL processing is very similar to fMRI processing.
There are several crucial differences though:
fMRIPrep is developed by a larger group and receives more regular feedback on its workflow,
so we (the ASLPrep developers) try to update ASLPrep in line with fMRIPrep.

ASLPrep and fMRIPrep are both part of the NiPreps community.

There are several crucial differences between ASL and fMRI processing,
which must be accounted for in ASLPrep:

1. ASL processing does not include slice timing correction.
Instead, post-labeling delays are shifted based on the slice timing when CBF is calculated.
Expand Down
6 changes: 6 additions & 0 deletions aslprep/workflows/asl/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,9 @@ def init_asl_preproc_wf(
]) # fmt:skip

def _last(inlist):
if not isinstance(inlist, list):
raise ValueError(f"_last: input is not list ({inlist})")

return inlist[-1]

workflow.connect([
Expand Down Expand Up @@ -797,4 +800,7 @@ def _read_json(in_file):
from json import loads
from pathlib import Path

if not isinstance(in_file, str):
raise ValueError(f"_read_json: input is not str ({in_file})")

return loads(Path(in_file).read_text())
9 changes: 9 additions & 0 deletions aslprep/workflows/asl/cbf.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,18 @@ def init_cbf_wf(

# Warp tissue probability maps to ASL space
def _pick_gm(files):
if not isinstance(files, list):
raise ValueError(f"_pick_gm: input is not list ({files})")
return files[0]

def _pick_wm(files):
if not isinstance(files, list):
raise ValueError(f"_pick_wm: input is not list ({files})")
return files[1]

def _pick_csf(files):
if not isinstance(files, list):
raise ValueError(f"_pick_csf: input is not list ({files})")
return files[2]

def _getfiledir(file):
Expand Down Expand Up @@ -612,6 +618,9 @@ def _pick_csf(files):
def _getfiledir(file):
import os

if not isinstance(file, str):
raise ValueError(f"_getfiledir: input is not str ({file})")

return os.path.dirname(file)

# convert tmps to asl_space
Expand Down
2 changes: 1 addition & 1 deletion aslprep/workflows/asl/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ def init_ds_asl_native_wf(

raw_sources = pe.Node(niu.Function(function=_bids_relative), name="raw_sources")
raw_sources.inputs.bids_root = bids_root
workflow.connect(inputnode, "source_files", raw_sources, "in_files")
workflow.connect([(inputnode, raw_sources, [("source_files", "in_files")])])

# Masks should be output if any other derivatives are output
ds_asl_mask = pe.Node(
Expand Down

0 comments on commit 7950ec4

Please sign in to comment.