-
Notifications
You must be signed in to change notification settings - Fork 27
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
MAINT: Housekeeping and more verbose debugging outputs #302
Conversation
632f6e0
to
dacfb63
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comments. Nothing that would have been blocking.
debug_ref = (~xfm).apply(fmap_ref, reference=nii_target) | ||
debug_ref.header.set_qform(nii_target.affine, code=1) | ||
debug_ref.header.set_sform(nii_target.affine, code=1) | ||
debug_ref.to_filename(Path() / "debug_fmapref.nii.gz") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Odd idiom.
>>> Path() / "debug_fmapref.nii.gz"
PosixPath('debug_fmapref.nii.gz')
So this is the same as:
debug_ref.to_filename("debug_fmapref.nii.gz")
debug_ref.to_filename(Path() / "debug_fmapref.nii.gz") | ||
|
||
# Generate a new transform | ||
newaff = np.linalg.inv(np.linalg.inv(coeff.affine) @ (~xfm).matrix) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why you're replacing A @ B
with ~(~B @ ~A)
.
@@ -103,7 +103,9 @@ def init_unwarp_wf(omp_nthreads=1, debug=False, name="unwarp_wf"): | |||
|
|||
rotime = pe.Node(GetReadoutTime(), name="rotime") | |||
rotime.interface._always_run = debug | |||
resample = pe.Node(ApplyCoeffsField(num_threads=omp_nthreads), name="resample") | |||
resample = pe.Node(ApplyCoeffsField( | |||
num_threads=omp_nthreads if not debug else 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just as a thought, I wonder if this would be more or less clear:
resample = pe.Node(ApplyCoeffsField(num_threads=debug or omp_nthreads), name="resample")
Since bools are a subclass of int, it will be 1 if debug is True or omp_nthreads if debug is False.
>>> ApplyCoeffsField(num_threads=True).inputs
in_coeff = <undefined>
in_data = <undefined>
in_xfms = <undefined>
num_threads = 1
pe_dir = <undefined>
ro_time = <undefined>
Can be backported to 2.1.0 if needed. |
No description provided.