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
12 changes: 3 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,6 @@ jobs:
- run:
name: Get intermediate transforms
command: |
mkdir -p /tmp/pooch
cd /tmp/pooch
# Caching intermediate templates so no need to constantly fetch
XFM="from-MNI152NLin6Asym_to-MNIInfant+1_xfm.h5"
echo "Downloading $XFM"
Expand All @@ -229,7 +227,6 @@ jobs:
paths:
- fslicense
- bcp/nipype.cfg
- pooch/*

test_pytest:
!!merge <<: *machine_defaults
Expand Down Expand Up @@ -348,8 +345,7 @@ jobs:
--nthreads 4 -vv --age-months 2 --sloppy \
--surface-recon-method infantfs \
--derivatives precomputed=/tmp/data/${DATASET}/derivatives/bibsnet \
--output-layout bids --anat-only \
--pooch-cache-dir /tmp/pooch
--output-layout bids --anat-only
- run:
name: Checking outputs of anatomical nibabies run
command: |
Expand Down Expand Up @@ -378,8 +374,7 @@ jobs:
--nthreads 4 -vv --age-months 2 \
--surface-recon-method infantfs \
--derivatives precomputed=/tmp/data/${DATASET}/derivatives/bibsnet \
--output-layout bids \
--pooch-cache-dir /tmp/pooch
--output-layout bids
- run:
name: Checking outputs of full nibabies run
command: |
Expand Down Expand Up @@ -425,8 +420,7 @@ jobs:
--nthreads 4 -vv --age-months 2 \
--surface-recon-method infantfs \
--derivatives precomputed=/tmp/data/${DATASET}-t2only/derivatives/bibsnet \
--output-layout bids --anat-only --cifti-output \
--pooch-cache-dir /tmp/pooch
--output-layout bids --anat-only --cifti-output
- run:
name: Checking outputs of T2-only nibabies anat
command: |
Expand Down
73 changes: 0 additions & 73 deletions nibabies/interfaces/download.py

This file was deleted.

19 changes: 0 additions & 19 deletions nibabies/interfaces/tests/test_download.py

This file was deleted.

38 changes: 31 additions & 7 deletions nibabies/workflows/anatomical/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ def init_concat_registrations_wf(
further use in downstream nodes.

"""
from nibabies.interfaces.download import RetrievePoochFiles
from nibabies.interfaces.patches import CompositeTransformUtil

ntpls = len(templates)
Expand Down Expand Up @@ -405,9 +404,9 @@ def init_concat_registrations_wf(
]
outputnode = pe.Node(niu.IdentityInterface(fields=out_fields), name='outputnode')

intermed_xfms = pe.MapNode(
RetrievePoochFiles(),
name='retrieve_xfms',
fetch_tf_xfms = pe.MapNode(
niu.Function(function=_get_intermediate_xfms, output_names=['int2tgt_xfm', 'tgt2int_xfm']),
name='fetch_tf_xfms',
iterfield=['target'],
run_without_submitting=True,
)
Expand Down Expand Up @@ -460,10 +459,10 @@ def init_concat_registrations_wf(
# Transform concatenation
(inputnode, dis_anat2int, [('anat2int_xfm', 'in_file')]),
(inputnode, dis_int2anat, [('int2anat_xfm', 'in_file')]),
(inputnode, intermed_xfms, [('intermediate', 'intermediate'),
(inputnode, fetch_tf_xfms, [('intermediate', 'intermediate'),
('template', 'target')]),
(intermed_xfms, dis_int2std, [('int2tgt_xfm', 'in_file')]),
(intermed_xfms, dis_std2int, [('tgt2int_xfm', 'in_file')]),
(fetch_tf_xfms, dis_int2std, [('int2tgt_xfm', 'in_file')]),
(fetch_tf_xfms, dis_std2int, [('tgt2int_xfm', 'in_file')]),
(dis_anat2int, order_anat2std, [
('affine_transform', 'in1'),
('displacement_field', 'in2'),
Expand Down Expand Up @@ -499,3 +498,28 @@ def init_concat_registrations_wf(
]) # fmt:skip

return workflow


def _get_intermediate_xfms(intermediate, target):
import templateflow.api as tf

# Native -> MNIInfant:cohort-X (int) -> Target (std)
ispace, _, icohort = intermediate.partition(':cohort-')
ispaceid = f'{ispace}+{icohort}' if icohort else ispace

int2std = tf.get(
target,
suffix='xfm',
**{'from': ispaceid},
raise_empty=True,
)

std2int = tf.get(
ispace,
cohort=icohort or None,
suffix='xfm',
**{'from': target},
raise_empty=True,
)

return int2std, std2int
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ dependencies = [
"numpy >= 1.21.0",
"packaging",
"pandas < 3",
"pooch",
"psutil >= 5.4",
"pybids >= 0.15.0",
"requests",
Expand Down
9 changes: 0 additions & 9 deletions wrapper/src/nibabies_wrapper/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,12 +476,6 @@ def _is_file(path, parser):
type=os.path.abspath,
help='Filter file',
)
g_wrap.add_argument(
'--pooch-cache-dir',
metavar='DIR',
type=os.path.abspath,
help='Directory to serve as cache for pooch files'
)

# Developer patch/shell options
g_dev = parser.add_argument_group(
Expand Down Expand Up @@ -649,9 +643,6 @@ def main():
if opts.deriv_filter_file:
container.add_mount(opts.deriv_filter_file, '/opt/derivative_filters.json')
unknown_args.extend(['--deriv-filter-file', '/opt/derivative_filters.json'])
if opts.pooch_cache_dir:
container.add_mount(opts.pooch_cache_dir, '/tmp/pooch_cache', read_only=False)
container.add_envvar(('NIBABIES_POOCH_DIR', '/tmp/pooch_cache'))
# Patch derivatives for searching
if opts.derivatives:
deriv_args = ['--derivatives']
Expand Down