Keep the input verbatim in mri/orig/001.<ext> , and write mri/rawavg.mgz for the tools - #875
Open
m-reuter wants to merge 9 commits into
Open
Keep the input verbatim in mri/orig/001.<ext> , and write mri/rawavg.mgz for the tools#875m-reuter wants to merge 9 commits into
m-reuter wants to merge 9 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mri/orig/001.mgzwas written byrun_prediction.pythrough nibabel, re-encoding the inputinto MGH. For a scaled NIfTI that write raised inside a discarded
Future, so the file wassilently absent; otherwise it was a lossy record of what had been processed.
mri/rawavg.mgzdid not exist, so
recon-surf.shlinked it to the conformedorig.mgzandpctsurfconmeasured the gray/white contrast on the conformed image instead of on the input.
Two files now, with distinct jobs:
mri/orig/001.<ext>is a byte-for-byte copy of the input, under the extension it arrivedwith, placed by
run_fastsurfer.sh. Nothing reads it back. Formats spread over severalfiles, such as an Analyze
.hdrand.imgpair, are copied whole. A T2 is copied the sameway as
mri/orig/T2raw.<ext>, the name recon-all uses.mri/rawavg.mgzis what the tools read. It is a relative symlink to the archival copy whenthe input is already an
.mgz, and a conversion throughsave_imageotherwise, which setsfov. The T2 equivalent ismri/orig/T2raw.mgz, which N4 now reads.Also in this PR:
surf-only run needs, and before the LIT module, so the contrast is measured on real tissue
rather than on inpainted voxels.
different image under the same extension is caught too. One subject directory belongs to one
input.
--basewrites neither file, since its input is the template the pipeline built and it skipspctsurfcon.--longwrites rawavg only.long_prepare_template.shimports each time point throughcopy_input.pyrather thanmri_convert, so the only copy the longitudinal stream keeps of a time point input isverbatim. Both consumers read the resulting
rawavg.mgz.run_prediction.pyholds the conformed-image write in a deque the main loop drains, so afailure in the pool reaches the exit code.
SubjectDirectory.copy_orig_nameand its plumbing are removed.Known consequences:
?h.w-g.pct.statsis now measured on the input. With a zero minimum, conform's rescale is apure multiplication that the contrast cancels, leaving quantisation noise.
mri/rawavg.mgz.of overwriting. The message names the archived copy to pass in order to reprocess the same
input, and asks for a subject id of its own for a different image.
Tests:
test/image/test_copy_input.pycovers the verbatim copy, both rawavg paths, multi-fileinputs, the two conflict cases and
--rawavg_only.expected-files.yamlgained a glob sectionfor outputs whose name depends on the input.