Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-science
analysis
C-MORE brain MRI
Commits
e877a2f9
Commit
e877a2f9
authored
Jul 11, 2021
by
Ludovica Griffanti
Browse files
Upload segIntensity
parent
aa6d68f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
OB_pipeline/cmore_segIntensity.sh
0 → 100644
View file @
e877a2f9
#!/usr/bin/sh
# Description: Script to generate T2-FLAIR intensity values (raw and normalised for WM) from Olfactory Bulbs segmentation
# Author: Ludovica Griffanti
#
# Copyright 2021 University of Oxford
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#main analysis directory containing subjects dirs
direc
=
$1
subjectslist
=
"/path/to/subj/list/subj.txt"
outpath
=
"/path/to/volume/measurement-output/"
for
sub
in
`
cat
${
subjectslist
}
`
;
do
echo
$sub
cd
${
direc
}
/
${
sub
}
/T2_FLAIR
# assuming OB labels in subjects space are in ${sub}/T2_FLAIR dir and called ${sub}_ob_labels_trilinear.nii.gz
fslmaths
${
sub
}
_ob_labels_trilinear.nii.gz
-mul
T2_FLAIR_unbiased.nii.gz
${
sub
}
_FLAIR_mul_ob_trilinear.nii.gz
OBval
=
`
fslstats
${
sub
}
_FLAIR_mul_ob_trilinear.nii.gz
-M
`
# WM mask created duriing main UKB pipeline:
# https://git.fmrib.ox.ac.uk/falmagro/UK_biobank_pipeline_v_1/-/blob/master/bb_structural_pipeline/bb_struct_init
# $FSLDIR/bin/fslmaths T1_fast/T1_brain_pve_2.nii.gz -thr 0.5 -bin T1_fast/T1_brain_WM_mask.nii.gz
WMval
=
`
fslstats T2_FLAIR_unbiased.nii.gz
-k
${
direc
}
/
${
sub
}
/T1/T1_fast/T1_brain_WM_mask.nii.gz
-P
50
`
#saving intensity, reference value and normalised reference
norm_OBval
=
`
echo
"scale=5;
$OBval
/
$WMval
"
| bc
-l
`
echo
$sub
$OBval
$WMval
$norm_OBval
>>
${
outpath
}
/OB_FLAIR_values.txt
done
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment