Skip to content

[RTM] Accept T2w images in recon-all #376

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

Merged
merged 9 commits into from
Mar 6, 2017
Merged

Conversation

effigies
Copy link
Member

Starting to track progress on T2w incorporation.

Follow-up to #347.

@effigies effigies force-pushed the reconall_t2 branch 2 times, most recently from 2c3eaf0 to 2e5d51e Compare March 1, 2017 02:41
@effigies
Copy link
Member Author

effigies commented Mar 1, 2017

I've run a test on sub-s483.

Nipype log excerpts:

170301-02:39:34,493 workflow INFO:
	 Executing node Reconstruction in dir: /scratch/workflow_enumerator/s483/t1w_preprocessing/Reconstruction
170301-02:39:34,498 workflow INFO:
	 Running: recon-all -autorecon1 -i /data/sub-s483/ses-1/anat/sub-s483_T1w.nii.gz -i /data/sub-s483/ses-2/anat/sub-s483_T1w.nii.gz -T2 /data/sub-s483/ses-1/anat/sub-s483_T2w.nii.gz -noskullstrip -hires -openmp 8 -parallel -subjid sub-s483 -sd /out/freesurfer
170301-07:04:35,101 workflow INFO:
	 Executing node Reconstruction2 in dir: /scratch/workflow_enumerator/s483/t1w_preprocessing/Reconstruction2
170301-07:04:35,167 interface INFO:
	 resume recon-all : recon-all -all -noskullstrip -hires -openmp 8 -parallel -subjid sub-s483 -sd /out/freesurfer -T2pial -nomotioncor -notalairach -nonuintensitycor -nonormalization

-T2 flag is being added correctly to recon-all -autorecon1, and -T2pial to recon-all -all.

Waiting to finish to verify that -T2pial runs correctly, but this should be in good shape.

I will note that for hi-res images the inflated surface looks a bit pointy in places, so we may want to reconsider adjusting mris_inflate -n in an expert file. I'm pretty sure the issue I was having with that before is that the output file needed to be marked as needed to avoid being deleted by remove_unnecessary_outputs.

@chrisgorgo
Copy link
Contributor

chrisgorgo commented Mar 1, 2017 via email

@effigies
Copy link
Member Author

effigies commented Mar 1, 2017

It uses brainmask.mgz, which we're injecting from ANTs. See https://surfer.nmr.mgh.harvard.edu/fswiki/ReconAllTableStableV6.0#line-116.

@effigies
Copy link
Member Author

effigies commented Mar 1, 2017

T2 coregisters fine. I want to try adjusting mris_inflate, because the inflated surface (with and without T2) is kind of pointy in places.

@effigies effigies force-pushed the reconall_t2 branch 3 times, most recently from 280be13 to 454af19 Compare March 3, 2017 14:17
@effigies
Copy link
Member Author

effigies commented Mar 3, 2017

Upping mris_inflate -n definitely makes the inflated surface much smoother, so I'm including that.

No expert:
no_expert

expert:
expert

This PR is waiting on nipy/nipype#1857. The expert option for ReconAll is needed to mark the expert.opts file as not to be deleted.

Going to do a clean run on Sherlock and report total time.

@chrisgorgo
Copy link
Contributor

chrisgorgo commented Mar 3, 2017 via email

@effigies
Copy link
Member Author

effigies commented Mar 3, 2017

So reports uses ?h.white and ?h.pial, and I don't think those are affected by mris_inflate. I believe ?h.sphere is affected, which is used for subject-subject surface registration.

@effigies
Copy link
Member Author

effigies commented Mar 3, 2017

?h.white does depend on ?h.inflated in the smoothing stages, as do ?h.sphere. So this isn't purely aesthetic wrt the ?h.inflated surfaces.

@effigies effigies changed the title [WIP] Accept T2w images in recon-all [RTM] Accept T2w images in recon-all Mar 3, 2017
@effigies
Copy link
Member Author

effigies commented Mar 3, 2017

I set this as RTM because it works. If you want to wait on Sherlock build, that's fine. (If I can't get Sherlock to work, I'll run on my laptop overnight and give you an 8-core estimate.)

@oesteban
Copy link
Member

oesteban commented Mar 4, 2017

We also should wait for nipy/nipype#1857 to be merged, right?

@effigies
Copy link
Member Author

effigies commented Mar 4, 2017

Oh right. Yes, somehow I forgot that. I'll mark it [WIP] again. Once a final pin is set, I'll set it back to RTM.

@effigies effigies changed the title [RTM] Accept T2w images in recon-all [WIP] Accept T2w images in recon-all Mar 4, 2017
@effigies
Copy link
Member Author

effigies commented Mar 4, 2017

SLURM Job_id=13250524 Name=sub-s483 Ended, Run time 09:38:39, COMPLETED, ExitCode 0

t1w_ref = nib.load(t1w_list[0])
hires = max(t1w_ref.header.get_zooms()) < 1
hires = round(max(t1w_ref.header.get_zooms()), 1) < 1
Copy link
Member Author

Choose a reason for hiding this comment

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

Woops. Lost the thread in the rebase. Recap:

@oesteban suggested we set an explicit threshold, rather than round.

hires = np.all(np.array(t1w_ref.header.get_zooms()) - 1 < -tol)

Where tol here = 0.05.

If we're going to do that, I'd prefer to stick with the max formulation, and keep constants on the right-hand-side, e.g.:

hires = max(t1w_ref.header.get_zooms()) < 1 - 0.05

I'll do whatever the consensus is, but I think the round(max(zooms), 1) < 1 and max(zooms) < 1 - tol are the most readable options. Opinions, @chrisfilo?

@chrisgorgo
Copy link
Contributor

chrisgorgo commented Mar 4, 2017 via email

@effigies
Copy link
Member Author

effigies commented Mar 4, 2017

I don't see where casting is required... even if zooms are int (Nifti zooms are 'f4', anyway), numerical comparisons aren't going to be affected by an explicit cast. Am I missing something?

@chrisgorgo
Copy link
Contributor

LGTM

@effigies effigies changed the title [WIP] Accept T2w images in recon-all [RTM] Accept T2w images in recon-all Mar 6, 2017
@effigies
Copy link
Member Author

effigies commented Mar 6, 2017

Another run, following the nipype PR: Run time 09:22:15

@oesteban
Copy link
Member

oesteban commented Mar 6, 2017

LGTM too

@chrisgorgo
Copy link
Contributor

chrisgorgo commented Mar 6, 2017 via email

@effigies effigies merged commit 45fff14 into nipreps:master Mar 6, 2017
@effigies effigies deleted the reconall_t2 branch March 6, 2017 15:58
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