Diff
checker
Testo
Testo
Immagini
Documenti
Excel
Cartelle
Legal
Enterprise
Applicazione per desktop
Prezzi
Accedi
Scarica Diffchecker Desktop
Confronta il testo
Trova la differenza tra due file di testo
Strumenti
Cronologia
Editor live
Comprimi invariate
Senza a capo
Layout
Diviso
Unificato
Livello di dettaglio
Intelligente
Parola
Carattere
Evidenziazione sintassi
Scegli sintassi
Ignora
Trasforma testo
Vai alla prima modifica
Modifica input
Diffchecker Desktop
Il modo più sicuro per usare Diffchecker. Ottieni l'app Diffchecker Desktop: i tuoi diff non lasciano mai il tuo computer!
Ottieni Desktop
process_spinal_levelsv2 vs. README.md
Creato
3 anni fa
Il diff non scade mai
Eliminare
Esporta
Condividere
Spiegare
14 rimozioni
Linee
Totale
Rimosso
Caratteri
Totale
Rimosso
Per continuare a utilizzare questa funzione, aggiorna a
Diff
checker
Pro
Visualizza prezzi
49 linee
Copia tutti
32 aggiunte
Linee
Totale
Aggiunto
Caratteri
Totale
Aggiunto
Per continuare a utilizzare questa funzione, aggiorna a
Diff
checker
Pro
Visualizza prezzi
64 linee
Copia tutti
#!/bin/bash
#!/bin/bash
#
#
Copia
Copiato
Copia
Copiato
# Process
data
.
# Process
Phillips Lab PAM50 spinal levels to match existing PAM50 conventions
.
#
#
# Usage:
# Usage:
# ./process_spinal_levels.sh
# ./process_spinal_levels.sh
Copia
Copiato
Copia
Copiato
#
Run inside /
pam50/S
pinal
Cord L
evels
NIfTI
/
# 1. Clone https://github.com/spinalcordtoolbox/PAM50
# Authors: Sandrine Bédard
# 2. Checkout commit e854bbad9ab550fd93acabeaf43c97cf66b3a4e5
# 3.
Run inside /
PAM50/s
pinal
_l
evels
_PhillipsLab
/
# Authors: Sandrine Bédard
, Joshua Newton
set -x
set -x
# Immediately exit if error
# Immediately exit if error
set -e -o pipefail
set -e -o pipefail
# Exit if user presses CTRL+C (Linux) or CMD+C (OSX)
# Exit if user presses CTRL+C (Linux) or CMD+C (OSX)
trap "echo Caught Keyboard Interrupt within script. Exiting now.; exit" INT
trap "echo Caught Keyboard Interrupt within script. Exiting now.; exit" INT
Copia
Copiato
Copia
Copiato
start=`date +%s`
# Add missing info to the `info_label.txt` file to account for newly-added levels
file_info_label=$(realpath "../spinal_levels/info_label.txt")
extra_spinal_levels="20, Spinal level L1, spinal_level_21.nii.gz
21, Spinal level L2, spinal_level_22.nii.gz
22, Spinal level L3, spinal_level_23.nii.gz
23, Spinal level L4, spinal_level_24.nii.gz
24, Spinal level L5, spinal_level_25.nii.gz"
if [[ $(tail -c 23 "$file_info_label") == "spinal_level_20.nii.gz" ]]
then
echo "$extra_spinal_levels" >> "$file_info_label"
fi
# Retrieve input params
# Retrieve input params
Copia
Copiato
Copia
Copiato
PATH_IN=$
1
PATH_IN=$
PWD
PATH_OUT=
$2
PATH_OUT=
"$PATH_IN
/spinal_levels_processed
"
PATH_SCRIPT=$PWD
for FILE in *
.nii.gz
; do
echo $PATH_IN
file=${FILE/%"
.nii.gz
"}
ext=".nii.gz"
cd
"$PATH_IN
"
for FILE in *
; do
file=${FILE/%"
$ext
"}
echo $file
echo $file
mkdir -p $PATH_OUT/${file}_processed
mkdir -p $PATH_OUT/${file}_processed
rsync -avzh $FILE $PATH_OUT/${file}_processed
rsync -avzh $FILE $PATH_OUT/${file}_processed
cd $PATH_OUT/${file}_processed
cd $PATH_OUT/${file}_processed
# Change file type
# Change file type
sct_image -i ${file}.nii.gz -type float32 -o ${file}_float32.nii.gz
sct_image -i ${file}.nii.gz -type float32 -o ${file}_float32.nii.gz
file="${file}_float32"
file="${file}_float32"
# Copy header of SCT PAM50 template
# Copy header of SCT PAM50 template
sct_image -i $SCT_DIR/data/PAM50/spinal_levels/spinal_level_02.nii.gz -copy-header $file.nii.gz -o ${file}_header.nii.gz
sct_image -i $SCT_DIR/data/PAM50/spinal_levels/spinal_level_02.nii.gz -copy-header $file.nii.gz -o ${file}_header.nii.gz
file="${file}_header"
file="${file}_header"
Copia
Copiato
Copia
Copiato
python $PATH_SCRIPT/process_spinal_levels.py -
filename
${file}
.nii.gz
# Rename the file to the
filename
corresponding to the level (specified by `info_label.txt`)
level=$(echo "$file" | cut -d '_' -f 3)
file_out=$(grep -F "$level," $file_info_label | cut -d "," -f 3)
cp $file
.nii.gz
$file_out
cd "$PATH_IN"
cd "$PATH_IN"
echo $PATH_IN
echo $PATH_IN
done
done
# Display useful info for the log
# Display useful info for the log
end=`date +%s`
end=`date +%s`
runtime=$((end-start))
runtime=$((end-start))
echo
echo
echo "~~~"
echo "~~~"
echo "SCT version: `sct_version`"
echo "SCT version: `sct_version`"
echo "Ran on: `uname -nsr`"
echo "Ran on: `uname -nsr`"
echo "Duration: $(($runtime / 3600))hrs $((($runtime / 60) % 60))min $(($runtime % 60))sec"
echo "Duration: $(($runtime / 3600))hrs $((($runtime / 60) % 60))min $(($runtime % 60))sec"
echo "~~~"
echo "~~~"
Diff salvati
Testo originale
Apri file
#!/bin/bash # # Process data. # # Usage: # ./process_spinal_levels.sh # Run inside /pam50/Spinal Cord Levels NIfTI/ # Authors: Sandrine Bédard set -x # Immediately exit if error set -e -o pipefail # Exit if user presses CTRL+C (Linux) or CMD+C (OSX) trap "echo Caught Keyboard Interrupt within script. Exiting now.; exit" INT # Retrieve input params PATH_IN=$1 PATH_OUT=$2 PATH_SCRIPT=$PWD echo $PATH_IN ext=".nii.gz" cd "$PATH_IN" for FILE in *; do file=${FILE/%"$ext"} echo $file mkdir -p $PATH_OUT/${file}_processed rsync -avzh $FILE $PATH_OUT/${file}_processed cd $PATH_OUT/${file}_processed # Change file type sct_image -i ${file}.nii.gz -type float32 -o ${file}_float32.nii.gz file="${file}_float32" # Copy header of SCT PAM50 template sct_image -i $SCT_DIR/data/PAM50/spinal_levels/spinal_level_02.nii.gz -copy-header $file.nii.gz -o ${file}_header.nii.gz file="${file}_header" python $PATH_SCRIPT/process_spinal_levels.py -filename ${file}.nii.gz cd "$PATH_IN" echo $PATH_IN done # Display useful info for the log end=`date +%s` runtime=$((end-start)) echo echo "~~~" echo "SCT version: `sct_version`" echo "Ran on: `uname -nsr`" echo "Duration: $(($runtime / 3600))hrs $((($runtime / 60) % 60))min $(($runtime % 60))sec" echo "~~~"
Testo modificato
Apri file
#!/bin/bash # # Process Phillips Lab PAM50 spinal levels to match existing PAM50 conventions. # # Usage: # ./process_spinal_levels.sh # 1. Clone https://github.com/spinalcordtoolbox/PAM50 # 2. Checkout commit e854bbad9ab550fd93acabeaf43c97cf66b3a4e5 # 3. Run inside /PAM50/spinal_levels_PhillipsLab/ # Authors: Sandrine Bédard, Joshua Newton set -x # Immediately exit if error set -e -o pipefail # Exit if user presses CTRL+C (Linux) or CMD+C (OSX) trap "echo Caught Keyboard Interrupt within script. Exiting now.; exit" INT start=`date +%s` # Add missing info to the `info_label.txt` file to account for newly-added levels file_info_label=$(realpath "../spinal_levels/info_label.txt") extra_spinal_levels="20, Spinal level L1, spinal_level_21.nii.gz 21, Spinal level L2, spinal_level_22.nii.gz 22, Spinal level L3, spinal_level_23.nii.gz 23, Spinal level L4, spinal_level_24.nii.gz 24, Spinal level L5, spinal_level_25.nii.gz" if [[ $(tail -c 23 "$file_info_label") == "spinal_level_20.nii.gz" ]] then echo "$extra_spinal_levels" >> "$file_info_label" fi # Retrieve input params PATH_IN=$PWD PATH_OUT="$PATH_IN/spinal_levels_processed" for FILE in *.nii.gz; do file=${FILE/%".nii.gz"} echo $file mkdir -p $PATH_OUT/${file}_processed rsync -avzh $FILE $PATH_OUT/${file}_processed cd $PATH_OUT/${file}_processed # Change file type sct_image -i ${file}.nii.gz -type float32 -o ${file}_float32.nii.gz file="${file}_float32" # Copy header of SCT PAM50 template sct_image -i $SCT_DIR/data/PAM50/spinal_levels/spinal_level_02.nii.gz -copy-header $file.nii.gz -o ${file}_header.nii.gz file="${file}_header" # Rename the file to the filename corresponding to the level (specified by `info_label.txt`) level=$(echo "$file" | cut -d '_' -f 3) file_out=$(grep -F "$level," $file_info_label | cut -d "," -f 3) cp $file.nii.gz $file_out cd "$PATH_IN" echo $PATH_IN done # Display useful info for the log end=`date +%s` runtime=$((end-start)) echo echo "~~~" echo "SCT version: `sct_version`" echo "Ran on: `uname -nsr`" echo "Duration: $(($runtime / 3600))hrs $((($runtime / 60) % 60))min $(($runtime % 60))sec" echo "~~~"
Trovare la differenza