Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Reinvent dmriprep? #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Reinvent dmriprep? #103

wants to merge 1 commit into from

Conversation

dPys
Copy link

@dPys dPys commented Sep 8, 2019

Okay everybody ( @akeshavan, @richford, @arokem, @josephmje, @nrajamani3 )

I've overhauled nearly everything. Feel free to accept whatever elements of this PR that you deem useful and agreeable. I'm very flexible about how we go about this from here.

*Stripped of everything freesurfer (at least for now since it was weighing down the package and is not necessary for dmri preprocessing).
*BIDS bindings still need to be updated (I'm working off of a homemade API-- get_bids_layout)
*metadata from raw .json's are used to automatically generate any arbitrary configuration of acqparameters and index.txt files
*Eddy options have been extended, and no need for a second workflow for non-reverse phase encoded acquisitions. The present workflow works for single phase-encodings as well.
*Regarding qc, dwi (and corresponding bvecs) are forced to RAS+ and isotropic voxels (either 1mm or 2mm) using a slightly more robust set of routine that I've also been implementing in PyNets and NDMG.
*Order of operations has changed-- use ART to remove gross motion artifact first, then run topup/eddy, then remove outliers detected from the susceptibility correction
*I'm working on an API for handling multishell data. Shouldn't take too much longer.
*added gibbs noise ringing and denoising routines (various strategies available) to the end of the workflow.
*Still need to connect to the viewer @akeshavan , and to the eddy qc report. save_json/load_json from nipype were giving me issues -- most likely a version issue -- so I commented out for now.

Please let me know if you have any thoughts, questions, critiques, etc. and I'll respond when I can.

@dPys

@pep8speaks
Copy link

pep8speaks commented Sep 8, 2019

Hello @dPys! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 30:80: E501 line too long (99 > 79 characters)
Line 33:80: E501 line too long (83 > 79 characters)
Line 59:80: E501 line too long (98 > 79 characters)
Line 60:80: E501 line too long (111 > 79 characters)
Line 86:80: E501 line too long (111 > 79 characters)
Line 87:80: E501 line too long (119 > 79 characters)
Line 142:80: E501 line too long (99 > 79 characters)

Line 15:80: E501 line too long (88 > 79 characters)
Line 48:80: E501 line too long (86 > 79 characters)
Line 53:80: E501 line too long (86 > 79 characters)
Line 81:53: E712 comparison to True should be 'if cond is True:' or 'if cond:'
Line 88:80: E501 line too long (85 > 79 characters)
Line 96:80: E501 line too long (100 > 79 characters)
Line 103:80: E501 line too long (80 > 79 characters)
Line 107:80: E501 line too long (104 > 79 characters)
Line 138:80: E501 line too long (83 > 79 characters)
Line 170:80: E501 line too long (88 > 79 characters)
Line 171:80: E501 line too long (85 > 79 characters)
Line 252:80: E501 line too long (86 > 79 characters)
Line 293:80: E501 line too long (87 > 79 characters)
Line 310:80: E501 line too long (83 > 79 characters)
Line 315:80: E501 line too long (83 > 79 characters)
Line 320:80: E501 line too long (83 > 79 characters)
Line 452:80: E501 line too long (84 > 79 characters)
Line 503:80: E501 line too long (82 > 79 characters)
Line 505:80: E501 line too long (81 > 79 characters)

Line 13:80: E501 line too long (83 > 79 characters)
Line 33:80: E501 line too long (81 > 79 characters)
Line 55:80: E501 line too long (86 > 79 characters)
Line 71:80: E501 line too long (81 > 79 characters)
Line 74:80: E501 line too long (86 > 79 characters)
Line 105:80: E501 line too long (80 > 79 characters)
Line 107:80: E501 line too long (86 > 79 characters)
Line 112:80: E501 line too long (88 > 79 characters)

Line 12:80: E501 line too long (116 > 79 characters)
Line 13:80: E501 line too long (85 > 79 characters)
Line 56:80: E501 line too long (84 > 79 characters)
Line 100:80: E501 line too long (81 > 79 characters)
Line 127:80: E501 line too long (84 > 79 characters)

Line 230:80: E501 line too long (92 > 79 characters)
Line 243:80: E501 line too long (82 > 79 characters)
Line 386:80: E501 line too long (81 > 79 characters)

Line 97:80: E501 line too long (84 > 79 characters)
Line 108:80: E501 line too long (82 > 79 characters)
Line 185:80: E501 line too long (86 > 79 characters)
Line 297:80: E501 line too long (88 > 79 characters)
Line 302:80: E501 line too long (80 > 79 characters)
Line 304:80: E501 line too long (86 > 79 characters)
Line 305:80: E501 line too long (84 > 79 characters)
Line 306:80: E501 line too long (80 > 79 characters)
Line 307:80: E501 line too long (84 > 79 characters)
Line 308:80: E501 line too long (101 > 79 characters)
Line 309:80: E501 line too long (108 > 79 characters)
Line 310:80: E501 line too long (98 > 79 characters)
Line 311:80: E501 line too long (90 > 79 characters)
Line 312:80: E501 line too long (100 > 79 characters)
Line 313:80: E501 line too long (85 > 79 characters)
Line 314:80: E501 line too long (83 > 79 characters)
Line 318:80: E501 line too long (85 > 79 characters)
Line 320:80: E501 line too long (98 > 79 characters)
Line 321:80: E501 line too long (81 > 79 characters)
Line 322:80: E501 line too long (94 > 79 characters)
Line 323:80: E501 line too long (98 > 79 characters)
Line 325:80: E501 line too long (85 > 79 characters)
Line 327:80: E501 line too long (99 > 79 characters)
Line 328:80: E501 line too long (86 > 79 characters)
Line 330:80: E501 line too long (95 > 79 characters)
Line 331:80: E501 line too long (98 > 79 characters)
Line 332:80: E501 line too long (93 > 79 characters)
Line 335:80: E501 line too long (81 > 79 characters)
Line 337:80: E501 line too long (85 > 79 characters)
Line 338:80: E501 line too long (92 > 79 characters)
Line 339:80: E501 line too long (86 > 79 characters)
Line 340:80: E501 line too long (81 > 79 characters)
Line 341:80: E501 line too long (82 > 79 characters)
Line 342:80: E501 line too long (80 > 79 characters)
Line 344:80: E501 line too long (83 > 79 characters)
Line 346:80: E501 line too long (80 > 79 characters)
Line 347:80: E501 line too long (81 > 79 characters)
Line 349:80: E501 line too long (83 > 79 characters)
Line 353:80: E501 line too long (91 > 79 characters)
Line 354:80: E501 line too long (82 > 79 characters)
Line 355:80: E501 line too long (84 > 79 characters)
Line 356:80: E501 line too long (99 > 79 characters)
Line 357:80: E501 line too long (90 > 79 characters)
Line 358:80: E501 line too long (96 > 79 characters)
Line 359:80: E501 line too long (102 > 79 characters)
Line 360:80: E501 line too long (93 > 79 characters)
Line 362:80: E501 line too long (82 > 79 characters)
Line 365:80: E501 line too long (94 > 79 characters)
Line 366:80: E501 line too long (96 > 79 characters)
Line 368:80: E501 line too long (83 > 79 characters)
Line 369:80: E501 line too long (86 > 79 characters)
Line 372:80: E501 line too long (85 > 79 characters)
Line 373:80: E501 line too long (89 > 79 characters)
Line 374:80: E501 line too long (90 > 79 characters)
Line 379:80: E501 line too long (108 > 79 characters)
Line 380:80: E501 line too long (86 > 79 characters)
Line 381:80: E501 line too long (100 > 79 characters)
Line 419:5: E722 do not use bare 'except'

Comment last updated at 2019-09-08 07:57:18 UTC

@dPys
Copy link
Author

dPys commented Sep 8, 2019

And if anyone wishes to experiment, a quick and dirty run can be accomplished as follows:

from dmriprep.run import init_single_subject_wf
from dmriprep.io import get_bids_layout

bdir = '/Users/derekpisner/Downloads/HNU1'
sub='0025427'
ses=1
out_dir = '/Users/derekpisner/Downloads/HNU1_output'
sub_dict = get_bids_layout(bdir, sub, ses)
dwi = sub_dict[ses]['dwi']
fbvec = sub_dict[ses]['bvec']
fbval = sub_dict[ses]['bval']
metadata = sub_dict[ses]['metadata']

wf = init_single_subject_wf(sub, ses, dwi, fbval, fbvec, metadata, out_dir)

out = wf.run()

correct hemi check

correct drop outliers

update cli
@josephmje
Copy link
Contributor

Hi @dPys . Thanks for this! dmriprep is actually being moved to nipreps. I've made a PR for some of my dwi workflow changes. Do you want to connect your changes to my fork? Or wait till I'm done?

@dPys
Copy link
Author

dPys commented Sep 8, 2019

Hi @josephmje , I might just make a direct PR there then, but will sync to your changes as applicable. Thanks for the heads up!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants