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

Support for edits #591

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft

Support for edits #591

wants to merge 2 commits into from

Conversation

dkuegler
Copy link
Member

This PR adds support for edits in FastSurfer.

Edits are enabled by the --edits flag for run_fastsurfer.sh.

Edits supported:
<asegdkt_segfile> via <asegdkt_segfile-w/o-ext>.manedit.
white matter segmentation (wm.mgz) via wm.manedit.mgz
white matter control points (via the standard FreeSurfer control points file)
talairach registration via mri/mri/transforms/talairach.xfm (overwriting talairach registration via mri/mri/transforms/talairach.xfm)
brain.finalsurfs.mgz via brain.finalsurfs.manedit.mgz

This PR also move the allow_root check into functions.sh and introduces run_it and run_it_cmdf function variants that are more clear wrt. argument splitting (see SC2206, SC2207 and similar).

@m-reuter
Copy link
Member

Hi, thanks for the pr. It would be great to fix the spelling errors and also add a readme for edits, which can be pretty short in the first iteration, with a 1-2 sentence description of each possible edit.

@dkuegler
Copy link
Member Author

Spelling should be fixed, documentation will need to be a future thing for now.

recon_surf/recon-surf.sh Outdated Show resolved Hide resolved
@@ -220,6 +227,9 @@ SURFACE PIPELINE:
to exist already in this case.
--3T Use the 3T atlas for talairach registration (gives better
etiv estimates for 3T MR images, default: 1.5T atlas).
--edits Disable the check for existing recon-surf.sh run and enables
edits of mri/wm.mgz and brain.finalsurfs.mgz by manedit
files as well as FreeSurfer-style WM control points.
Copy link
Member

Choose a reason for hiding this comment

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

I think it is strange to have the flag --edits in the help text at multiple places. I think it should be a single help block explaining all of its effects in one location.

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess consolidating this into the first text makes more sense. On hindsight, I agree. I think --no_biasfield also has multiple mentions, so that should also be changed.

@dkuegler
Copy link
Member Author

This branch is currently a mess of fixes and features for 6 different things. Those need to be separated into individual branches and PRs.

At a minimum, this version seems to work for longitudinal processing (still unclear for edits).

@dkuegler dkuegler force-pushed the feature/edits branch 2 times, most recently from 21f9e19 to 82cd0aa Compare October 11, 2024 14:10
neginshirvani and others added 2 commits October 12, 2024 15:29
- Adds the --edits flag
- Add additional log messages for edits
- Support for manedit files for asegdkt_segfile.
- Also propagate asegdkt_segfile into  aseg_segfile and mask_name

recon_surf/recon-surf.sh
- Adds the --edits flag
- Add additional log messages for edits
- Change check for existing run into a message instead a fail criteria in edits mode
- Do not delete logfile in edits mode
- Make mask and aseg_noCC required for edits mode (otherwise it might get unclear what should or was already done between run_fastsurfer and recon-surf)
- Add manedit "search" for mask and aseg_nocc (the latter is

recon_surf/talairach-reg.sh
- Add an extra argument (new argument #3 to indicate whether talairach.reg should support edits)
- Support for edits: some messages and if in edit mode, only run talairach registration if mri/transforms/talairach.xfm and mri/transforms/talairach.auto.xfm are the same (so there are no edits) -- thus edits in talairach.xfm superceed automatic results
- talairch-reg.sh will now fail if mri/transforms/talairach.xfm exists, but the script is not running in edits mode (independent if talairach.auto.xfm is the same or not).

recon_surf/functions.sh
- add the add_file_suffix function, which adds a file suffix (for example manedits) to a file name
@m-reuter
Copy link
Member

I rebased this to current dev which disentangles the edits from the other changes. Please check :

  • that everything is as wanted and
  • no purposeful changes from the earlier commits are undone

Also update your local with a hard reset.

@m-reuter m-reuter mentioned this pull request Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants