-
Notifications
You must be signed in to change notification settings - Fork 0
Adding config file for training the 2D segmentation model #3
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
Open
rohanbanerjee
wants to merge
4
commits into
main
Choose a base branch
from
rb/config_2D_segmentation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| #!/bin/bash | ||
| # | ||
| # Process data. | ||
| # For T1 : From raw images, proceeds to resampling and reorientation to RPI. | ||
| # | ||
| # Crop all images. | ||
| # Generates soft segmentations. | ||
| # Usage: | ||
| # ./process_data.sh <SUBJECT> | ||
| # | ||
| # | ||
| # Authors: Rohan Banerjee | ||
|
|
||
| # The following global variables are retrieved from the caller sct_run_batch | ||
| # but could be overwritten by uncommenting the lines below: | ||
| # PATH_DATA_PROCESSED="~/data_processed" | ||
| # PATH_RESULTS="~/results" | ||
| # PATH_LOG="~/log" | ||
| # PATH_QC="~/qc" | ||
|
|
||
| # Uncomment for full verbose | ||
| set -x | ||
|
|
||
| # Exit if user presses CTRL+C (Linux) or CMD+C (OSX) | ||
| trap "echo Caught Keyboard Interrupt within script. Exiting now.; exit" INT | ||
|
|
||
| # Print retrieved variables from sct_run_batch to the log (to allow easier debug) | ||
| echo “Retrieved variables from from the caller sct_run_batch:” | ||
| echo “PATH_DATA: ${PATH_DATA}” | ||
| echo “PATH_DATA_PROCESSED: ${PATH_DATA_PROCESSED}” | ||
| echo “PATH_RESULTS: ${PATH_RESULTS}” | ||
| echo “PATH_LOG: ${PATH_LOG}” | ||
| echo “PATH_QC: ${PATH_QC}” | ||
|
|
||
| # Retrieve input params | ||
| SUBJECT=$1 | ||
|
|
||
| # echo SUBJECT | ||
|
|
||
| # Save script path | ||
| PATH_SCRIPT=$PWD | ||
|
|
||
| get starting time: | ||
| start=`date +%s` | ||
|
|
||
| # SCRIPT STARTS HERE | ||
| # ============================================================================== | ||
| # Display useful info for the log, such as SCT version, RAM and CPU cores available | ||
| sct_check_dependencies -short | ||
|
|
||
| # Go to folder where data will be copied and processed | ||
| cd $PATH_DATA_PROCESSED | ||
|
|
||
|
|
||
| Copy list of participants in processed data folder | ||
| if [[ ! -f "participants.tsv" ]]; then | ||
| rsync -avzh $PATH_DATA/participants.tsv . | ||
| fi | ||
|
|
||
| if [[ ! -f "participants.json" ]]; then | ||
| rsync -avzh $PATH_DATA/participants.json . | ||
| fi | ||
|
|
||
| if [[ ! -f "README.md" ]]; then | ||
| rsync -avzh $PATH_DATA/README.md . | ||
| fi | ||
|
|
||
| if [[ ! -f "dataset_description.tsv" ]]; then | ||
| rsync -avzh $PATH_DATA/dataset_description . | ||
| fi | ||
|
|
||
| # Copy source images | ||
| rsync -avzh $PATH_DATA/$SUBJECT . | ||
|
|
||
| #copy derivatives | ||
| rsync -avzh $PATH_DATA/derivatives . | ||
|
|
||
| # Script starts here | ||
| cd ${SUBJECT}/func | ||
| file_bold=${SUBJECT}_task-rest_bold | ||
| file_bold_seg=${PATH_DATA}/derivatives/labels/${SUBJECT}/func/${SUBJECT}_task-rest_bold_seg-manual | ||
|
|
||
| sct_register_multimodal -i ${file_bold}.nii.gz -d ${file_bold_seg}.nii.gz -o ${file_bold}_to_${file_bold}_reg.nii.gz -identity 0 | ||
| rm warp_${SUBJECT}_task-rest_bold_seg-manual2${SUBJECT}_task-rest_bold.nii.gz warp_${SUBJECT}_task-rest_bold2${SUBJECT}_task-rest_bold_seg-manual.nii.gz ${SUBJECT}_task-rest_bold.nii.gz | ||
| mv ${file_bold}_to_${file_bold}_reg.nii.gz ${file_bold}.nii.gz |
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.
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'd remove 'moco' as this segmentation has nothing to do with moco (yet)