Skip to content

Commit f8ca1ae

Browse files
authored
REL: 23.0.0 (#273)
* RM: Unused bold grouping * MNT: Prepare changes for next release * CI: Update pip first, avoid any prepended messages when checking version * CI: Remove erroneous substitution * DEP: Set nipreps to releases
1 parent b7c4e3c commit f8ca1ae

File tree

5 files changed

+25
-115
lines changed

5 files changed

+25
-115
lines changed

.circleci/config.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,9 @@ jobs:
518518
- checkout
519519
- run:
520520
name: Update build tools
521-
command: python -m pip install pip build twine hatch
521+
command: |
522+
python -m pip install -U pip
523+
python -m pip install -U build twine hatch
522524
- run:
523525
name: Build nibabies
524526
command: python -m build
@@ -527,8 +529,7 @@ jobs:
527529
- run:
528530
name: Check sdist distribution
529531
command: |
530-
THISVERSION=$( python -m hatch version )
531-
THISVERSION=${THISVERSION%.d*}
532+
THISVERSION=$( python -m hatch version | tail -n1 )
532533
THISVERSION=${CIRCLE_TAG:-$THISVERSION}
533534
python -m twine check dist/nibabies*.tar.gz
534535
virtualenv --python=python sdist
@@ -546,7 +547,6 @@ jobs:
546547
name: Check wheel distribution
547548
command: |
548549
THISVERSION=$( python -m hatch version )
549-
THISVERSION=${THISVERSION%.d*}
550550
THISVERSION=${CIRCLE_TAG:-$THISVERSION}
551551
python -m twine check dist/nibabies*.whl
552552
virtualenv --python=python wheel
@@ -563,7 +563,6 @@ jobs:
563563
name: Build nibabies-wrapper
564564
command: |
565565
THISVERSION=$( python -m hatch version )
566-
THISVERSION=${THISVERSION%.d*}
567566
python -m build wrapper/
568567
- store_artifacts:
569568
path: /tmp/src/nibabies/wrapper/dist
@@ -583,7 +582,6 @@ jobs:
583582
name: Build nibabies-wrapper
584583
command: |
585584
THISVERSION=$( python -m hatch version )
586-
THISVERSION=${THISVERSION%.d*}
587585
python -m build wrapper/
588586
- run:
589587
name: Upload packages to PyPI

CHANGES.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
23.0.0 (January 23, 2023)
2+
=========================
3+
New year, new *NiBabies* minor series!
4+
Some of the highlights of this release include:
5+
- New run-wise BOLD reference generation, prioritizing single-band references if available, unless avoided with the `--ignore sbrefs` flag.
6+
- New output: Preprocessed T2w in T1w space.
7+
8+
A full list of changes can be found below.
9+
10+
## Full Changelog
11+
* ENH: Runwise bold reference generation (#268)
12+
* ENH: Add preprocessed T2w volume to outputs (#271)
13+
* MAINT: Drop versioneer for hatch backend, fully embrace pyproject.toml (#265)
14+
* MAINT: Rotate CircleCI secrets and setup up org-level context (#266)
15+
* CI: Bump convenience images, limit datalad (#267)
16+
* FIX: Remove legacy CIFTI variant support (#264)
17+
18+
119
22.2.0 (December 13, 2022)
220
==========================
321
The final *NiBabies* minor series of 2022!

nibabies/utils/bids.py

Lines changed: 0 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -127,111 +127,6 @@ def _unique(inlist):
127127
return {k: _unique(v) for k, v in entities.items()}
128128

129129

130-
def group_bolds_ref(*, layout, subject, sessions=None):
131-
"""
132-
Extracts BOLD files from a BIDS dataset and combines them into buckets.
133-
Files in a bucket share:
134-
1) Session
135-
2) Phase-encoding direction (PEdir)
136-
3) Total readout time (TRT)
137-
138-
Any files with missing data for (2) or (3) are put in their own bucket.
139-
140-
Parameters
141-
----------
142-
layout : pybids.layout.BIDSLayout
143-
Initialized BIDSLayout
144-
subject : str
145-
The subject ID
146-
sessions : None
147-
148-
Outputs
149-
-------
150-
combinations : list of tuples
151-
Each tuple is composed of (session, PEdir, TRT)
152-
files : list of lists
153-
Files matching each combination.
154-
155-
Limitations
156-
-----------
157-
Single-band reference (sbref) are excluded.
158-
"""
159-
import re
160-
from contextlib import suppress
161-
from itertools import product
162-
163-
from sdcflows.utils.epimanip import get_trt
164-
165-
base_entities = {
166-
"subject": subject,
167-
"extension": (".nii", ".nii.gz"),
168-
"scope": "raw", # Ensure derivatives are not captured
169-
}
170-
# dictionary containing unique Groupings and files
171-
groupings = {}
172-
# list of all BOLDS encountered
173-
all_bolds = []
174-
175-
sessions = sessions if sessions else layout.get_sessions(subject=subject, scope="raw")
176-
177-
for ses, suffix in sorted(product(sessions or (None,), {"bold"})):
178-
# bold files same session
179-
bolds = layout.get(suffix=suffix, session=ses, **base_entities)
180-
# some sessions may not have BOLD scans
181-
if bolds is None:
182-
continue
183-
184-
for i, bold in enumerate(bolds):
185-
multiecho_id = None
186-
# multi-echo should be grouped together
187-
if 'echo' in bold.entities:
188-
# create unique id by dropping "_echo-{i}"
189-
multiecho_id = re.sub(r"_echo-\d+", "", bold.filename)
190-
191-
# session, pe, ro
192-
meta = bold.get_metadata()
193-
pe_dir = meta.get("PhaseEncodingDirection")
194-
195-
ro = None
196-
with suppress(ValueError):
197-
ro = get_trt(meta, bold.path)
198-
if ro is not None:
199-
meta.update({"TotalReadoutTime": ro})
200-
201-
grouping = BOLDGrouping(
202-
session=ses,
203-
pe_dir=pe_dir,
204-
readout=ro,
205-
multiecho_id=multiecho_id,
206-
)
207-
208-
if any(v is None for v in (pe_dir, ro)):
209-
# cannot be certain so treat as unique
210-
grouping.add_file(bold.path)
211-
groupings[f'unknown{i}'] = grouping
212-
else:
213-
try:
214-
grouping = groupings[grouping.name]
215-
except KeyError:
216-
groupings[grouping.name] = grouping
217-
218-
grouping.add_file(bold.path)
219-
220-
all_bolds += bolds
221-
222-
if len(all_bolds) != sum([len(g.files) for _, g in groupings.items()]):
223-
msg = f"""Error encountered when grouping BOLD runs.
224-
Combinations: {groupings}
225-
BOLD files: {bolds}
226-
227-
Please file a bug-report with the nibabies developers at:
228-
https://github.com/nipreps/nibabies/issues/new/choose
229-
"""
230-
raise RuntimeError(msg)
231-
232-
return groupings
233-
234-
235130
def validate_input_dir(exec_env, bids_dir, participant_label):
236131
# Ignore issues and warnings that should not influence NiBabies
237132
import subprocess

nibabies/workflows/base.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
from .. import config
5252
from ..interfaces import DerivativesDataSink
5353
from ..interfaces.reports import AboutSummary, SubjectSummary
54-
from ..utils.bids import group_bolds_ref
5554
from .bold import init_func_preproc_wf
5655

5756

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ dependencies = [
2424
"nipype >= 1.8.1",
2525
"nitime",
2626
"nitransforms >= 21.0.0",
27-
"niworkflows @ git+https://github.com/nipreps/niworkflows.git@master",
27+
"niworkflows ~= 1.7.1",
2828
"numpy >= 1.21.0",
2929
"packaging",
3030
"pandas",
3131
"psutil >= 5.4",
3232
"pybids >= 0.15.0",
3333
"requests",
34-
"sdcflows @ git+https://github.com/nipreps/sdcflows.git@master",
35-
"smriprep @ git+https://github.com/nipreps/smriprep.git@master",
34+
"sdcflows ~= 2.2.2",
35+
"smriprep ~= 0.10.0",
3636
"tedana ~= 0.0.12",
3737
"templateflow >= 0.6",
3838
"toml",

0 commit comments

Comments
 (0)