Skip to content

Conversation

@mgxd
Copy link
Contributor

@mgxd mgxd commented Jun 2, 2020

Since outputs would change, this PR targets 1.3.0

@mgxd mgxd added the api change label Jun 2, 2020
@pull-assistant
Copy link

pull-assistant bot commented Jun 2, 2020

Score: 0.17

Best reviewed: with all changes


Optimal code review plan (2 commits squashed)

FIX: Avoid diverting... ... ENH: apply changes f...

Squashed 2 commits:

Powered by Pull Assistant. Last update c5a257f ... 915cb01. Read the comment docs.

@codecov
Copy link

codecov bot commented Jun 2, 2020

Codecov Report

Merging #532 into master will decrease coverage by 0.01%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #532      +/-   ##
==========================================
- Coverage   64.17%   64.16%   -0.02%     
==========================================
  Files          43       43              
  Lines        5290     5291       +1     
  Branches      770      770              
==========================================
  Hits         3395     3395              
- Misses       1750     1751       +1     
  Partials      145      145              
Flag Coverage Δ
#documentation 33.84% <0.00%> (-0.01%) ⬇️
#reportlettests 100.00% <ø> (ø)
#travis 59.29% <0.00%> (-0.02%) ⬇️
#unittests 47.58% <0.00%> (-0.01%) ⬇️
Impacted Files Coverage Δ
niworkflows/interfaces/cifti.py 53.84% <0.00%> (-0.35%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a6a328f...c5a257f. Read the comment docs.

Copy link
Contributor Author

@mgxd mgxd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few comments to explain some changes

@mgxd mgxd marked this pull request as ready for review June 2, 2020 17:08
label_img = _reorient_image(label_img, orientation="LAS")

bold_data = bold_img.get_fdata(dtype="float32")
bold_data = bold_img.get_fdata()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a good reason to upcast to float64?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, can revert that

medial = np.nonzero(annot.darrays[0].data)[0]
# extract values across volumes
ts = np.array([tsarr.data[medial] for tsarr in surf.darrays])
ts = np.array([tsarr.data[medial] for tsarr in surf_ts.darrays])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, here would be a good place to use agg_data().

Suggested change
ts = np.array([tsarr.data[medial] for tsarr in surf_ts.darrays])
ts = surf_ts.agg_data()[medial, :]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't agg_data() return a tuple?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the image has multiple types of data array, or you request multiple intents, then no.

If you want to be safe (e.g., if we start putting surfaces inside functional files...):

Suggested change
ts = np.array([tsarr.data[medial] for tsarr in surf_ts.darrays])
ts = surf_ts.agg_data("time series")[medial, :]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

running fmriprep with this change leads to:

   ts = surf_ts.agg_data("time series")[medial, :]
TypeError: tuple indices must be integers or slices, not tuple

I think keeping it as it was is simplest ATM

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. That seems really weird, though. If you can pdb it at some point, I would be interested in the details.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, if there are no darrays, you do get an empty tuple.

@mgxd mgxd force-pushed the fix/cifti-save branch from a551f2d to 915cb01 Compare June 2, 2020 18:13
@oesteban oesteban added this to the 1.3.0 milestone Jun 4, 2020
@oesteban oesteban merged commit 42748dc into nipreps:master Jun 9, 2020
oesteban added a commit that referenced this pull request Aug 14, 2020
First release in the 1.3.x series. This release includes enhancements and bug-fixes
towards the release of the first LTS version of fMRIPrep.
PyBIDS has been revised to use more recent versions, a series of ANTs' interfaces
have been deemed ready to upstream into Nipype, and several improvements regarding
multi-echo EPI are included.
With thanks to Basile Pinsard for contributions.

  * FIX: Patch ``ApplyTransforms`` spec to permit identity in a chain (#554)
  * FIX: Add dots to extensions in PyBIDS' config file (#548)
  * FIX: Segmentation plots aligned with cardinal axes (#544)
  * FIX: Skip T1w file existence check if ``anat_derivatives`` are provided (#545)
  * FIX: Avoid diverting CIFTI dtype from original BOLD (#532)
  * ENH: Add ``smooth`` input to ``RegridToZooms`` (#549)
  * ENH: Enable ``DerivativesDataSink`` to take multiple source files to derive entities (#547)
  * ENH: Allow ``bold_reference_wf`` to accept multiple EPIs/SBRefs (#408)
  * ENH: Numerical stability of EPI brain-masks using probabilistic prior (#485)
  * ENH: Add a pure-Python interface to resample to specific resolutions (#511)
  * MAINT: Finalize upstreaming of ANTs' interfaces to Nipype (#550)
  * MAINT: Update to Python +3.6 (#541)
HippocampusGirl added a commit to HippocampusGirl/niworkflows that referenced this pull request Sep 29, 2020
1.3.0rc3

First release in the 1.3.x series. This release includes enhancements and bug-fixes
towards the release of the first LTS version of fMRIPrep.
PyBIDS has been revised to use more recent versions, a series of ANTs' interfaces
have been deemed ready to upstream into Nipype, and several improvements regarding
multi-echo EPI are included.
With thanks to Basile Pinsard for contributions.

* FIX: Patch ``ApplyTransforms`` spec to permit identity in a chain (nipreps#554)
* FIX: Add dots to extensions in PyBIDS' config file (nipreps#548)
* FIX: Segmentation plots aligned with cardinal axes (nipreps#544)
* FIX: Skip T1w file existence check if ``anat_derivatives`` are provided (nipreps#545)
* FIX: Avoid diverting CIFTI dtype from original BOLD (nipreps#532)
* ENH: Add ``smooth`` input to ``RegridToZooms`` (nipreps#549)
* ENH: Enable ``DerivativesDataSink`` to take multiple source files to derive entities (nipreps#547)
* ENH: Allow ``bold_reference_wf`` to accept multiple EPIs/SBRefs (nipreps#408)
* ENH: Numerical stability of EPI brain-masks using probabilistic prior (nipreps#485)
* ENH: Add a pure-Python interface to resample to specific resolutions (nipreps#511)
* MAINT: Finalize upstreaming of ANTs' interfaces to Nipype (nipreps#550)
* MAINT: Update to Python +3.6 (nipreps#541)
HippocampusGirl added a commit to HippocampusGirl/niworkflows that referenced this pull request Sep 29, 2020
1.3.0

First release in the 1.3.x series.
This release includes enhancements and bug-fixes towards the release of the first
LTS (*long-term support*) version of *fMRIPrep*.
*PyBIDS* has been revised to use more recent versions, a series of ANTs' interfaces
have been deemed ready to upstream into *Nipype*, and several improvements regarding
multi-echo EPI are included.
With thanks to Basile Pinsard for contributions.

* FIX: Patch ``ApplyTransforms`` spec to permit identity in a chain (nipreps#554)
* FIX: Add dots to extensions in PyBIDS' config file (nipreps#548)
* FIX: Segmentation plots aligned with cardinal axes (nipreps#544)
* FIX: Skip T1w file existence check if ``anat_derivatives`` are provided (nipreps#545)
* FIX: Avoid diverting CIFTI dtype from original BOLD (nipreps#532)
* ENH: Add ``smooth`` input to ``RegridToZooms`` (nipreps#549)
* ENH: Enable ``DerivativesDataSink`` to take multiple source files to derive entities (nipreps#547)
* ENH: Allow ``bold_reference_wf`` to accept multiple EPIs/SBRefs (nipreps#408)
* ENH: Numerical stability of EPI brain-masks using probabilistic prior (nipreps#485)
* ENH: Add a pure-Python interface to resample to specific resolutions (nipreps#511)
* MAINT: Upstream all bug-fixes in the 1.2.9 release
* MAINT: Finalize upstreaming of ANTs' interfaces to Nipype (nipreps#550)
* MAINT: Update to Python +3.6 (nipreps#541)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants