Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Simplify STC logic for too short BOLD series #2489

Merged

Conversation

oesteban
Copy link
Member

@oesteban oesteban commented Aug 3, 2021

After #2461 and #2468, the TooShort value for running STC could not be assigned.
This PR ignores manually set dummy timepoints, although the case when this could be problematic is largely a very edge case (say you have only 7 timepoints and manually set 3 as dummy).

On the flip side, this PR drops the use of a function discontinued in the latest niworkflows release, fixing a bug ahead of time (currently popping out in #2392).

return 1

if skip_vols is None:
skip_vols = _get_vols_to_discard(img)
Copy link
Member

Choose a reason for hiding this comment

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

We lose the case where the series has >5 volumes but <5 taking into account dummy scans.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, this is what I meant (and definitely failed to convey) above.

@oesteban
Copy link
Member Author

oesteban commented Aug 3, 2021

After some thinking, I believe the problem we were trying to avert with the check removed by this PR should actually end up in an error. However, the specific error that 3dTShift issues (which fMRIPrep bubbles up) is really hard to understand.

My last commit 18f5e72 patches the interface so that the error is anticipated by the interface itself and a more understandable message is delivered to the user. CircleCI's build of ds210 should now crash with the new error (I'll fix that in an upcoming commit once this is confirmed to work properly).

I'm aware of the cost of not calculating steady states at workflow building time is delaying the crash - but it is preferable that the user suffers an error down the line rather than just skipping STC and cross fingers that they will read the reports and the boilerplate, IMHO.

@oesteban
Copy link
Member Author

oesteban commented Aug 4, 2021

Okay, the new edit seems to work well. Now ds210 is crashing at the STC node with:

RuntimeError: Insufficient length of BOLD data (5 time points) after discarding 1 nonsteady-state (or 'dummy') time points.

I'm going to switch this test to have --ignore slicetiming and add one entry to the FAQ.

After nipreps#2461 and nipreps#2468, the ``TooShort`` value for running STC could not
be assigned.
This PR ignores manually set dummy timepoints, although the case when
this could be problematic is largely a very edge case (say you have only
7 timepoints and manually set 3 as dummy).

On the flip side, this PR drops the use of a function discontinued in
the latest niworkflows release, fixing a bug ahead of time.
Minimal stylistic changes and a better structure with a ToC in the
beginning are sneaked into this commit - sorry about that.
@oesteban oesteban force-pushed the fix/deprecated-niworkflows-function branch from faa845c to 3e2d0d8 Compare August 4, 2021 08:46
@oesteban oesteban requested a review from effigies August 4, 2021 11:46
@oesteban oesteban merged commit 40ca4ec into nipreps:master Aug 4, 2021
@oesteban oesteban deleted the fix/deprecated-niworkflows-function branch August 4, 2021 18:11
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.

None yet

2 participants