- gcc
- clang
env:
- - WITH_CMAKE=true VTK_VERSION=7.0.0 ITK_VERSION=4.9.1 QT_VERSION=5.5.1 C11=false
- - WITH_CMAKE=true VTK_VERSION=7.0.0 ITK_VERSION=4.9.1 QT_VERSION=4.8.7 C11=false
- - WITH_CMAKE=true VTK_VERSION=6.3 ITK_VERSION=4.9.1 QT_VERSION=5.5.1 C11=false
- - WITH_CMAKE=true VTK_VERSION=6.3 ITK_VERSION=4.9.1 QT_VERSION=4.8.7 C11=false
- - WITH_CMAKE=true VTK_VERSION=5.10 ITK_VERSION=4.6 QT_VERSION=4.8.7 C11=false
- - WITH_CMAKE=true VTK_VERSION=7.0.0 ITK_VERSION=4.9.1 QT_VERSION=5.5.1 C11=true
- - WITH_CMAKE=true VTK_VERSION=7.0.0 ITK_VERSION=4.9.1 QT_VERSION=4.8.7 C11=true
- - WITH_CMAKE=true VTK_VERSION=6.3 ITK_VERSION=4.9.1 QT_VERSION=5.5.1 C11=true
- - WITH_CMAKE=true VTK_VERSION=6.3 ITK_VERSION=4.9.1 QT_VERSION=4.8.7 C11=true
- - WITH_CMAKE=true VTK_VERSION=7.0.0 ITK_VERSION=4.13.0 QT_VERSION=5.5.1 C11=false
- - WITH_CMAKE=true VTK_VERSION=6.3 ITK_VERSION=4.13.0 QT_VERSION=5.5.1 C11=false
- - WITH_CMAKE=true VTK_VERSION=7.0.0 ITK_VERSION=4.13.0 QT_VERSION=5.5.1 C11=true
- - WITH_CMAKE=true VTK_VERSION=6.3 ITK_VERSION=4.13.0 QT_VERSION=5.5.1 C11=true
+ - WITH_CMAKE=true VTK_VERSION=v5.10.0 ITK_VERSION=v4.6.0 QT_VERSION=4.8.7 C11=false
+ - WITH_CMAKE=true VTK_VERSION=v6.3.0 ITK_VERSION=v4.9.1 QT_VERSION=4.8.7 C11=false
+ - WITH_CMAKE=true VTK_VERSION=v6.3.0 ITK_VERSION=v4.9.1 QT_VERSION=5.5.1 C11=false
+ - WITH_CMAKE=true VTK_VERSION=v6.3.0 ITK_VERSION=v4.13.0 QT_VERSION=5.5.1 C11=false
+ - WITH_CMAKE=true VTK_VERSION=v7.0.0 ITK_VERSION=v4.9.1 QT_VERSION=4.8.7 C11=false
+ - WITH_CMAKE=true VTK_VERSION=v7.0.0 ITK_VERSION=v4.9.1 QT_VERSION=5.5.1 C11=false
+ - WITH_CMAKE=true VTK_VERSION=v7.0.0 ITK_VERSION=v4.13.0 QT_VERSION=5.5.1 C11=false
+ - WITH_CMAKE=true VTK_VERSION=v8.1.1 ITK_VERSION=v5.0b01 QT_VERSION=5.5.1 C11=false
+ - WITH_CMAKE=true VTK_VERSION=v6.3.0 ITK_VERSION=v4.9.1 QT_VERSION=4.8.7 C11=true
+ - WITH_CMAKE=true VTK_VERSION=v6.3.0 ITK_VERSION=v4.9.1 QT_VERSION=5.5.1 C11=true
+ - WITH_CMAKE=true VTK_VERSION=v6.3.0 ITK_VERSION=v4.13.0 QT_VERSION=5.5.1 C11=true
+ - WITH_CMAKE=true VTK_VERSION=v7.0.0 ITK_VERSION=v4.9.1 QT_VERSION=4.8.7 C11=true
+ - WITH_CMAKE=true VTK_VERSION=v7.0.0 ITK_VERSION=v4.9.1 QT_VERSION=5.5.1 C11=true
+ - WITH_CMAKE=true VTK_VERSION=v7.0.0 ITK_VERSION=v4.13.0 QT_VERSION=5.5.1 C11=true
+ - WITH_CMAKE=true VTK_VERSION=v8.1.1 ITK_VERSION=v5.0b01 QT_VERSION=5.5.1 C11=true
matrix:
exclude:
- - os: osx
- env: WITH_CMAKE=true VTK_VERSION=5.10 ITK_VERSION=4.6 QT_VERSION=4.8.7 C11=false #VTK5.10 doesn't work with osX
- - os: osx
- env: WITH_CMAKE=true VTK_VERSION=5.10 ITK_VERSION=4.6 QT_VERSION=4.8.7 C11=true #VTK5.10 doesn't work with osX
- - os: osx
- env: WITH_CMAKE=true VTK_VERSION=6.3 ITK_VERSION=4.9.1 QT_VERSION=4.8.7 C11=false #Qt4 doesn't work with brew anymore
- - os: osx
- env: WITH_CMAKE=true VTK_VERSION=6.3 ITK_VERSION=4.9.1 QT_VERSION=4.8.7 C11=true #Qt4 doesn't work with brew anymore
- - os: osx
- env: WITH_CMAKE=true VTK_VERSION=7.0.0 ITK_VERSION=4.9.1 QT_VERSION=4.8.7 C11=false
- - os: osx
- env: WITH_CMAKE=true VTK_VERSION=7.0.0 ITK_VERSION=4.9.1 QT_VERSION=4.8.7 C11=true
+ - os: osx #VTK5.10, Qt4, ITK < 4.13 doesn't work with osX
- os: linux
- env: WITH_CMAKE=true VTK_VERSION=5.10 ITK_VERSION=4.6 QT_VERSION=4.8.7 C11=true #Problem with VTK 5.10 and c++11
+ env: WITH_CMAKE=true VTK_VERSION=v5.10.0 ITK_VERSION=v4.6.0 QT_VERSION=4.8.7 C11=true #Problem with VTK 5.10 and c++11
- os: linux
compiler: clang #Remove ITK with clang on linux
include:
- os: linux
compiler: clang
- env: WITH_CMAKE=true VTK_VERSION=7.0.0 ITK_VERSION=4.13.0 QT_VERSION=5.5.1 C11=false
+ env: WITH_CMAKE=true VTK_VERSION=v7.0.0 ITK_VERSION=v4.13.0 QT_VERSION=5.5.1 C11=false
+ - os: linux
+ compiler: clang
+ env: WITH_CMAKE=true VTK_VERSION=v6.3.0 ITK_VERSION=v4.13.0 QT_VERSION=5.5.1 C11=false
- os: linux
compiler: clang
- env: WITH_CMAKE=true VTK_VERSION=6.3 ITK_VERSION=4.13.0 QT_VERSION=5.5.1 C11=false
+ env: WITH_CMAKE=true VTK_VERSION=v8.1.1 ITK_VERSION=v5.0b01 QT_VERSION=5.5.1 C11=false
- os: linux
compiler: clang
- env: WITH_CMAKE=true VTK_VERSION=7.0.0 ITK_VERSION=4.13.0 QT_VERSION=5.5.1 C11=true
+ env: WITH_CMAKE=true VTK_VERSION=v7.0.0 ITK_VERSION=v4.13.0 QT_VERSION=5.5.1 C11=true
- os: linux
compiler: clang
- env: WITH_CMAKE=true VTK_VERSION=6.3 ITK_VERSION=4.13.0 QT_VERSION=5.5.1 C11=true
+ env: WITH_CMAKE=true VTK_VERSION=v6.3.0 ITK_VERSION=v4.13.0 QT_VERSION=5.5.1 C11=true
+ - os: linux
+ compiler: clang
+ env: WITH_CMAKE=true VTK_VERSION=v8.1.1 ITK_VERSION=v5.0b01 QT_VERSION=5.5.1 C11=true
+ - os: osx
+ env: WITH_CMAKE=true VTK_VERSION=v6.3.0 ITK_VERSION=v4.13.0 QT_VERSION=5.5.1 C11=false
+ - os: osx
+ env: WITH_CMAKE=true VTK_VERSION=v7.0.0 ITK_VERSION=v4.13.0 QT_VERSION=5.5.1 C11=false
+ - os: osx
+ env: WITH_CMAKE=true VTK_VERSION=v8.1.1 ITK_VERSION=v5.0b01 QT_VERSION=5.5.1 C11=flase
+ - os: osx
+ env: WITH_CMAKE=true VTK_VERSION=v6.3.0 ITK_VERSION=v4.13.0 QT_VERSION=5.5.1 C11=true
+ - os: osx
+ env: WITH_CMAKE=true VTK_VERSION=v7.0.0 ITK_VERSION=v4.13.0 QT_VERSION=5.5.1 C11=true
+ - os: osx
+ env: WITH_CMAKE=true VTK_VERSION=v8.1.1 ITK_VERSION=v5.0b01 QT_VERSION=5.5.1 C11=true
language: cpp
- export cwd=$(pwd)
- export SCRIPTS=$cwd/travis
- export EXTERNALS_DIR=$HOME
-- export VTK_SOURCE_DIR=${EXTERNALS_DIR}/vtk-${VTK_VERSION}
-- export VTK_DIR=${EXTERNALS_DIR}/vtk-${VTK_VERSION}-build
-- export ITK_SOURCE_DIR=${EXTERNALS_DIR}/itk-${ITK_VERSION}
-- export ITK_DIR=${EXTERNALS_DIR}/itk-${ITK_VERSION}-build
+- export VTK_SOURCE_DIR=${EXTERNALS_DIR}/vtk
+- export VTK_DIR=${EXTERNALS_DIR}/vtk-build
+- export ITK_SOURCE_DIR=${EXTERNALS_DIR}/itk
+- export ITK_DIR=${EXTERNALS_DIR}/itk-build
- export BUILD_DIR=$cwd/build
- if test $TRAVIS_OS_NAME == linux ; then sudo apt-get install -y -qq build-essential cmake; fi
#Install qt5
- $SCRIPTS/travis_build_qt.sh
- if test $TRAVIS_OS_NAME == linux; then sudo apt-get -y install libgdcm2-dev libpq-dev; fi
- if test $TRAVIS_OS_NAME == linux; then if [[ "$QT_VERSION" == "5.5.1" ]] ; then QTDIR="/opt/qt55" && PATH="$PATH:$QTDIR/bin" && qt55-env.sh ; fi; fi
+- if test $TRAVIS_OS_NAME == linux; then cd $HOME && wget https://cmake.org/files/v3.11/cmake-3.11.4-Linux-x86_64.tar.gz && tar -xzf cmake-3.11.4-Linux-x86_64.tar.gz && export PATH=$HOME/cmake-3.11.4-Linux-x86_64/bin:${PATH} ; fi
- if test $TRAVIS_OS_NAME == osx ; then export HOMEBREW_QT_VERSION=$(brew list --versions qt | rev | cut -d' ' -f1 | rev); fi
- if test $TRAVIS_OS_NAME == osx ; then brew install ccache; fi
- if test $TRAVIS_OS_NAME == osx ; then export PATH="/usr/local/opt/qt/bin:/usr/local/opt/ccache/libexec:$PATH"; fi
cache:
- directories:
- - $HOME/vtk-5.10
- - $HOME/vtk-5.10-build
- - $HOME/vtk-6.3
- - $HOME/vtk-6.3-build
- - $HOME/vtk-7.0.0
- - $HOME/vtk-7.0.0-build
- - $HOME/itk-4.6
- - $HOME/itk-4.6-build
- - $HOME/itk-4.9.1
- - $HOME/itk-4.9.1-build
- - $HOME/itk-4.13.0
- - $HOME/itk-4.13.0-build
+ - $HOME/vtk
+ - $HOME/vtk-build
+ - $HOME/itk
+ - $HOME/itk-build
- '$HOME/.sonar/cache'
- timeout: 10000
echo " ${indent}creating ${merged}"
local count=0
start_bar $#
+ source ${doseMerger}
while test $# -gt 0
do
local partial="$1"
then
update_bar ${count} "copying first partial result ${partial}"
cp "${partial}" "${merged}"
+ copyFirstPartialResult -i "${merged}" -o "${merged}" 2> /dev/null > /dev/null || warning "error while calling ${doseMerger}"
continue
fi
update_bar ${count} "adding ${partial}"
- ${doseMerger} -i "${merged}" -j "${partial}" -o "${merged}" 2> /dev/null > /dev/null || warning "error while calling ${doseMerger}"
+ addToPartialResult -i "${merged}" -j "${partial}" -o "${merged}" 2> /dev/null > /dev/null || warning "error while calling ${doseMerger}"
done
+ divideUncertaintyResult -i "${merged}" -o "${merged}" 2> /dev/null > /dev/null || warning "error while calling ${doseMerger}"
end_bar
echo " ${indent}merged ${count} files"
}
set -u
function usage {
- echo "$0 -i <file1> -j <file2> -o <result>"
+ echo "$0 -i <result> -j <file2> -o <result>"
exit 1
}
-if [ $# != 6 ]
-then
- usage
-fi
+function addToPartialResult {
+ IN1=$2 #merged file for previous jobs
+ IN2=$4 # current job
+ RESULT=$6 #output merged file
-IN1=$2
-IN2=$4
-RESULT=$6
+ test -f ${IN1} && test -f ${IN2} || usage
-test -f ${IN1} && test -f ${IN2} || usage
+ TMP="$(mktemp)"
-TMP="$(mktemp)"
-echo "merging dose by regions file"
-# check if all 3 text files have the same number of lines
-nblines=`cat ${IN1} | wc -l`
-nb2=`cat ${IN2} | wc -l`
-nb3=`cat ${RESULT} | wc -l`
+ # check if all 3 text files have the same number of lines
+ nblines=`cat ${IN1} | wc -l`
+ nb2=`cat ${IN2} | wc -l`
+ nb3=`cat ${RESULT} | wc -l`
-if [ $nblines -ne $nb2 ] || [ $nblines -ne $nb3 ]; then
- echo "Files does not have the same size"
- exit 1
-fi
-
-#Copy the 1st line in output
-line1=`sed -n "1p" < ${RESULT}`
-echo "${line1}" >> ${TMP}
-
-# for all lines (except the 1st), split according tab
-# sum the some elements (dose, edep) ...
-for i in $(seq 2 $nblines); do
- #Get the 3 lines
- line1=`sed -n "${i}p" < ${IN1}`
- line2=`sed -n "${i}p" < ${IN2}`
- line3=`sed -n "${i}p" < ${RESULT}`
-
- # sum edep: get the 2 values, sum them and replace it in the line3
- # The /#./0. is important to add 0 for decimal value between 0 and 1
- edep1=$(echo ${line1} | cut -f3 -d' ')
- edep2=$(echo ${line2} | cut -f3 -d' ')
- edep3=$(echo "scale=30;$edep1+$edep2" | bc)
- edep3=${edep3/#./0.}
- line3=$(echo $line3 |awk -v r=${edep3} '{$3=r}1')
-
- # sqrt sum square std_edep: get the 2 values, sum the square, take the sqrt and replace it in the line3
- edep1=$(echo ${line1} | cut -f4 -d' ')
- edep2=$(echo ${line2} | cut -f4 -d' ')
- edep3=$(echo "scale=30;sqrt($edep1*$edep1+$edep2*$edep2)" | bc)
- edep3=${edep3/#./0.}
- line3=$(echo $line3 |awk -v r=${edep3} '{$4=r}1')
-
- # sum square_edep: get the 2 values, sum them and replace it in the line3
- edep1=$(echo ${line1} | cut -f5 -d' ')
- edep2=$(echo ${line2} | cut -f5 -d' ')
- edep3=$(echo "scale=30;$edep1+$edep2" | bc)
- edep3=${edep3/#./0.}
- line3=$(echo $line3 |awk -v r=${edep3} '{$5=r}1')
-
- # sum dose: get the 2 values, sum them and replace it in the line3
- edep1=$(echo ${line1} | cut -f6 -d' ')
- edep2=$(echo ${line2} | cut -f6 -d' ')
- edep3=$(echo "scale=30;$edep1+$edep2" | bc)
- edep3=${edep3/#./0.}
- line3=$(echo $line3 |awk -v r=${edep3} '{$6=r}1')
-
- # sqrt sum square std_dose: get the 2 values, sum the square, take the sqrt and replace it in the line3
- edep1=$(echo ${line1} | cut -f7 -d' ')
- edep2=$(echo ${line2} | cut -f7 -d' ')
- edep3=$(echo "scale=30;sqrt($edep1*$edep1+$edep2*$edep2)" | bc)
- edep3=${edep3/#./0.}
- line3=$(echo $line3 |awk -v r=${edep3} '{$7=r}1')
-
- # sum square_dose: get the 2 values, sum them and replace it in the line3
- edep1=$(echo ${line1} | cut -f8 -d' ')
- edep2=$(echo ${line2} | cut -f8 -d' ')
- edep3=$(echo "scale=30;$edep1+$edep2" | bc)
- edep3=${edep3/#./0.}
- line3=$(echo $line3 |awk -v r=${edep3} '{$8=r}1')
-
- # sum n_hits: get the 2 values, sum them and replace it in the line3
- edep1=$(echo ${line1} | cut -f9 -d' ')
- edep2=$(echo ${line2} | cut -f9 -d' ')
- edep3=$(echo "scale=30;$edep1+$edep2" | bc)
- line3=$(echo $line3 |awk -v r=${edep3} '{$9=r}1')
-
- # sum n_event_hits: get the 2 values, sum them and replace it in the line3
- edep1=$(echo ${line1} | cut -f10 -d' ')
- edep2=$(echo ${line2} | cut -f10 -d' ')
- edep3=$(echo "scale=30;$edep1+$edep2" | bc)
- line3=$(echo $line3 |awk -v r=${edep3} '{$10=r}1')
-
- #Write the output
- echo "${line3}" >> ${TMP}
-done
-mv -f ${TMP} ${RESULT}
+ if [ $nblines -ne $nb2 ] || [ $nblines -ne $nb3 ]; then
+ echo "Files does not have the same size"
+ exit 1
+ fi
+
+ # Find the number of primaries for this job (the same for all line and different of 0)
+ # Get the number of primaries from edep and square_edep to determine the std.
+ nbPrimary=0
+ for i in $(seq 2 $nblines); do
+ #Get the line
+ file2=`sed -n "${i}p" < ${IN2}`
+
+ edep2=$(echo ${file2} | cut -f3 -d' ')
+ stdEdep2=$(echo ${file2} | cut -f4 -d' ')
+ sqEdep2=$(echo ${file2} | cut -f5 -d' ')
+ nbPrimary=$(python <<EOP
+if ($edep2 == 0 or $sqEdep2 == 0):
+ print(0)
+else:
+ temp=pow($edep2,2)*(pow($stdEdep2,2)-1)/(pow($stdEdep2*$edep2,2)-$sqEdep2)
+ print(int(round(temp)))
+EOP
+ )
+ if [ $nbPrimary -ne 0 ]; then
+ break
+ fi
+
+ dose2=$(echo ${file2} | cut -f6 -d' ')
+ stdDose2=$(echo ${file2} | cut -f7 -d' ')
+ sqDose2=$(echo ${file2} | cut -f8 -d' ')
+ nbPrimary=$(python <<EOP
+if ($dose2 == 0 or $sqDose2 == 0):
+ print(0)
+else:
+ temp=pow($dose2,2)*(pow($stdDose2,2)-1)/(pow($stdDose2*$dose2,2)-$sqDose2)
+ print(int(round(temp)))
+EOP
+ )
+ if [ $nbPrimary -ne 0 ]; then
+ break
+ fi
+ done
+
+ #Copy the 1st line in output
+ line1=`sed -n "1p" < ${RESULT}`
+ echo "${line1}" >> ${TMP}
+ # for all lines (except the 1st), split according tab
+ # sum the some elements (dose, edep) ...
+ for i in $(seq 2 $nblines); do
+ #Get the 3 lines
+ file1=`sed -n "${i}p" < ${IN1}`
+ file2=`sed -n "${i}p" < ${IN2}`
+ file3=`sed -n "${i}p" < ${RESULT}`
+
+ # sum edep: get the 2 values, sum them and replace it in the file3
+ # The /#./0. is important to add 0 for decimal value between 0 and 1
+ edep1=$(echo ${file1} | cut -f3 -d' ')
+ edep2=$(echo ${file2} | cut -f3 -d' ')
+ edep3=$(python -c "print($edep1+$edep2)")
+ edep3=${edep3/#./0.}
+ file3=$(echo $file3 |awk -v r=${edep3} '{$3=r}1')
+
+ # sum square_edep: get the 2 values, sum them and replace it in the file3
+ sqEdep1=$(echo ${file1} | cut -f5 -d' ')
+ sqEdep2=$(echo ${file2} | cut -f5 -d' ')
+ sqEdep3=$(python -c "print($sqEdep1+$sqEdep2)")
+ sqEdep3=${sqEdep3/#./0.}
+ file3=$(echo $file3 |awk -v r=${sqEdep3} '{$5=r}1')
+
+ # Get the number of primaries from edep and square_edep to determine the std.
+ # Sum the number of primaries with the latter ones
+ nbPrimaryEdep1=$(echo ${file1} | cut -f4 -d' ')
+ nbPrimaryEdep3=$(python <<EOP
+print($nbPrimary+$nbPrimaryEdep1)
+EOP
+ )
+ nbPrimaryEdep3=${nbPrimaryEdep3/#./0.}
+ file3=$(echo $file3 |awk -v r=${nbPrimaryEdep3} '{$4=r}1')
+
+ # sum dose: get the 2 values, sum them and replace it in the file3
+ dose1=$(echo ${file1} | cut -f6 -d' ')
+ dose2=$(echo ${file2} | cut -f6 -d' ')
+ dose3=$(python -c "print($dose1+$dose2)")
+ dose3=${dose3/#./0.}
+ file3=$(echo $file3 |awk -v r=${dose3} '{$6=r}1')
+
+ # sum square_dose: get the 2 values, sum them and replace it in the file3
+ sqDose1=$(echo ${file1} | cut -f8 -d' ')
+ sqDose2=$(echo ${file2} | cut -f8 -d' ')
+ sqDose3=$(python -c "print($sqDose1+$sqDose2)")
+ sqDose3=${sqDose3/#./0.}
+ file3=$(echo $file3 |awk -v r=${sqDose3} '{$8=r}1')
+
+ # Get the number of primaries from dose and square_dose to determine the std.
+ # Sum the number of primaries with the latter ones
+ nbPrimaryDose1=$(echo ${file1} | cut -f7 -d' ')
+ stdDose2=$(echo ${file2} | cut -f7 -d' ')
+ nbPrimaryDose3=$(python <<EOP
+print($nbPrimary+$nbPrimaryDose1)
+EOP
+ )
+ nbPrimaryDose3=${nbPrimaryDose3/#./0.}
+ file3=$(echo $file3 |awk -v r=${nbPrimaryDose3} '{$7=r}1')
+
+ # sum n_hits: get the 2 values, sum them and replace it in the file3
+ hit1=$(echo ${file1} | cut -f9 -d' ')
+ hit2=$(echo ${file2} | cut -f9 -d' ')
+ hit3=$(python -c "print($hit1+$hit2)")
+ file3=$(echo $file3 |awk -v r=${hit3} '{$9=r}1')
+
+ # sum n_event_hits: get the 2 values, sum them and replace it in the file3
+ event1=$(echo ${file1} | cut -f10 -d' ')
+ event2=$(echo ${file2} | cut -f10 -d' ')
+ event3=$(python -c "print($event1+$event2)")
+ file3=$(echo $file3 |awk -v r=${event3} '{$10=r}1')
+
+ #Write the output
+ echo "${file3}" >> ${TMP}
+ done
+ mv -f ${TMP} ${RESULT}
+}
+
+function copyFirstPartialResult {
+ IN1=$2
+ RESULT=$4
+
+ TMP="$(mktemp)"
+
+ # check if all 2 text files have the same number of lines
+ nblines=`cat ${IN1} | wc -l`
+ nb3=`cat ${RESULT} | wc -l`
+
+ if [ $nblines -ne $nb3 ]; then
+ echo "Files does not have the same size"
+ exit 1
+ fi
+ # Find the number of primaries for this job (the same for all line and different of 0)
+ # Get the number of primaries from edep and square_edep to determine the std.
+ nbPrimary=0
+ for i in $(seq 2 $nblines); do
+ #Get the line
+ file2=`sed -n "${i}p" < ${IN1}`
+
+ edep2=$(echo ${file2} | cut -f3 -d' ')
+ stdEdep2=$(echo ${file2} | cut -f4 -d' ')
+ sqEdep2=$(echo ${file2} | cut -f5 -d' ')
+ nbPrimary=$(python <<EOP
+if ($edep2 == 0 or $sqEdep2 == 0):
+ print(0)
+else:
+ temp=pow($edep2,2)*(pow($stdEdep2,2)-1)/(pow($stdEdep2*$edep2,2)-$sqEdep2)
+ print(int(round(temp)))
+EOP
+ )
+ if [ $nbPrimary -ne 0 ]; then
+ break
+ fi
+
+ dose2=$(echo ${file2} | cut -f6 -d' ')
+ stdDose2=$(echo ${file2} | cut -f7 -d' ')
+ sqDose2=$(echo ${file2} | cut -f8 -d' ')
+ nbPrimary=$(python <<EOP
+if ($dose2 == 0 or $sqDose2 == 0):
+ print(0)
+else:
+ temp=pow($dose2,2)*(pow($stdDose2,2)-1)/(pow($stdDose2*$dose2,2)-$sqDose2)
+ print(int(round(temp)))
+EOP
+ )
+ if [ $nbPrimary -ne 0 ]; then
+ break
+ fi
+ done
+
+ #Copy the 1st line in output
+ line1=`sed -n "1p" < ${RESULT}`
+ echo "${line1}" >> ${TMP}
+ # for all lines (except the 1st), split according tab
+ # write the number of primaries
+ for i in $(seq 2 $nblines); do
+ #Get the lines
+ file3=`sed -n "${i}p" < ${RESULT}`
+
+ file3=$(echo $file3 |awk -v r=${nbPrimary} '{$4=r}1')
+ file3=$(echo $file3 |awk -v r=${nbPrimary} '{$7=r}1')
+
+ #Write the output
+ echo "${file3}" >> ${TMP}
+ done
+ mv -f ${TMP} ${RESULT}
+}
+
+function divideUncertaintyResult {
+ IN1=$2
+ RESULT=$4
+
+ TMP="$(mktemp)"
+
+ # check if all 2 text files have the same number of lines
+ nblines=`cat ${IN1} | wc -l`
+ nb3=`cat ${RESULT} | wc -l`
+
+ if [ $nblines -ne $nb3 ]; then
+ echo "Files does not have the same size"
+ exit 1
+ fi
+
+ #Copy the 1st line in output
+ line1=`sed -n "1p" < ${RESULT}`
+ echo "${line1}" >> ${TMP}
+ # for all lines (except the 1st), split according tab
+ # sum the some elements (dose, edep) ...
+ for i in $(seq 2 $nblines); do
+ #Get the lines
+ file1=`sed -n "${i}p" < ${IN1}`
+ file3=`sed -n "${i}p" < ${RESULT}`
+
+ # Divide uncertainty and replace it in the file3
+ edep1=$(echo ${file1} | cut -f3 -d' ')
+ nbPrimaryEdep1=$(echo ${file1} | cut -f4 -d' ')
+ sqEdep1=$(echo ${file1} | cut -f5 -d' ')
+ stdEdep3=$(python <<EOP
+import math
+if ($edep1 == 0 or $sqEdep1 == 0):
+ print(1.0)
+else:
+ temp=math.sqrt(($sqEdep1/$nbPrimaryEdep1-pow($edep1/$nbPrimaryEdep1, 2))/($nbPrimaryEdep1-1))/($edep1/$nbPrimaryEdep1)
+ print(temp)
+EOP
+ )
+ stdEdep3=${stdEdep3/#./0.}
+ file3=$(echo $file3 |awk -v r=${stdEdep3} '{$4=r}1')
+
+ # Divide uncertainty and replace it in the file3
+ dose1=$(echo ${file1} | cut -f6 -d' ')
+ nbPrimaryDose1=$(echo ${file1} | cut -f7 -d' ')
+ sqDose1=$(echo ${file1} | cut -f8 -d' ')
+ stdDose3=$(python <<EOP
+import math
+if ($edep1 == 0 or $sqEdep1 == 0):
+ print(1.0)
+else:
+ temp=math.sqrt(($sqDose1/$nbPrimaryDose1-pow($dose1/$nbPrimaryDose1, 2))/($nbPrimaryDose1-1))/($dose1/$nbPrimaryDose1)
+ print(temp)
+EOP
+ )
+ stdDose3=${stdDose3/#./0.}
+ file3=$(echo $file3 |awk -v r=${stdDose3} '{$7=r}1')
+
+ #Write the output
+ echo "${file3}" >> ${TMP}
+ done
+ mv -f ${TMP} ${RESULT}
+}
#include "clitkCommon.h"
// itk include
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
// IMPLEMENTATION NOTE:
// The following has been done without the use of vtkGDCMImageReader which directly
// handle RTDOSE image. Another approach would have been to use gdcm::ImageReader
int rc;
#endif
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
m_GdcmImageReader.SetFileName(m_FileName.c_str());
m_GdcmImageReader.Read();
gdcm::File* m_GdcmFile = &m_GdcmImageReader.GetFile();
#endif
/* Modality -- better be RTSTRUCT */
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
gdcm::DataSet &ds = m_GdcmFile->GetDataSet();
gdcm::Attribute<0x8,0x60> at1;
}
/* ImagePositionPatient */
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
gdcm::Attribute<0x20,0x32> at2;
at2.SetFromDataSet(ds);
ipp[0] = at2.GetValue(0);
#endif
/* Rows */
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
gdcm::Attribute<0x28,0x10> at3;
at3.SetFromDataSet(ds);
dim[1] = at3.GetValue();
#endif
/* Columns */
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
gdcm::Attribute<0x28,0x11> at4;
at4.SetFromDataSet(ds);
dim[0] = at4.GetValue();
#endif
/* PixelSpacing */
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
gdcm::Attribute<0x28,0x30> at5;
at5.SetFromDataSet(ds);
spacing[0] = at5.GetValue(0);
#endif
/* GridFrameOffsetVector */
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
gdcm::Attribute<0x3004,0x000C> at6;
const gdcm::DataElement& de6 = ds.GetDataElement( at6.GetTag() );
at6.SetFromDataElement(de6);
#endif
/* DoseGridScaling */
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
gdcm::Attribute<0x3004,0x000E> at7 = { 1. } ;
at7.SetFromDataSet(ds);
m_DoseScaling = at7.GetValue();
// Read Image Information
bool clitk::DicomRTDoseIO::CanReadFile(const char* FileNameToRead)
{
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
gdcm::Reader creader;
creader.SetFileName(FileNameToRead);
if (!creader.Read())
npix *= GetDimensions(i);
/* PixelData */
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
gdcm::Image &i = m_GdcmImageReader.GetImage();
char* image_data = new char[i.GetBufferLength()];
// itk include
#include <itkImageIOBase.h>
#include <gdcmFile.h>
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
#include <gdcmImageReader.h>
#endif
bool mustWriteHeader;
int m_HeaderSize;
std::ofstream file;
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
gdcm::ImageReader m_GdcmImageReader;
#else
gdcm::File *m_GdcmFile;
#include "clitkDicomRT_Contour.h"
#include <vtkCellArray.h>
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
#include "gdcmAttribute.h"
#include "gdcmItem.h"
#endif
//--------------------------------------------------------------------
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
void clitk::DicomRT_Contour::UpdateDicomItem()
{
DD("DicomRT_Contour::UpdateDicomItem");
//--------------------------------------------------------------------
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
bool clitk::DicomRT_Contour::Read(gdcm::Item * item)
{
mItem = item;
#include "clitkCommon.h"
#include <gdcmFile.h>
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
#else
#include <gdcm.h>
#include <gdcmSQItem.h>
void Print(std::ostream & os = std::cout) const;
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
bool Read(gdcm::Item * item);
void UpdateDicomItem();
#else
///Z location of the contour
double mZ;
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
gdcm::Item * mItem;
#else
gdcm::SQItem * mItem;
#include <vtkPolyDataWriter.h>
#include <vtkVersion.h>
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
#include "gdcmAttribute.h"
#include "gdcmItem.h"
#endif
//--------------------------------------------------------------------
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
bool clitk::DicomRT_ROI::Read(gdcm::Item * itemInfo, gdcm::Item * itemContour)
{
//FATAL("Error : compile vv with itk4 + external gdcm");
//--------------------------------------------------------------------
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
//--------------------------------------------------------------------
void clitk::DicomRT_ROI::UpdateDicomItem()
{
void SetName(std::string n) { mName = n; }
// Read from DICOM RT STRUCT
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
bool Read(gdcm::Item * itemInfo, gdcm::Item * itemContour);
void UpdateDicomItem();
#else
double mForegroundValue;
bool m_DicomUptodateFlag;
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
gdcm::Item * mItemInfo;
gdcm::Item * mItemContour;
gdcm::SmartPointer<gdcm::SequenceOfItems> mContoursSequenceOfItems;
//--------------------------------------------------------------------
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
//--------------------------------------------------------------------
int clitk::DicomRT_StructureSet::ReadROINumber(const gdcm::Item & item)
{
//--------------------------------------------------------------------
void clitk::DicomRT_StructureSet::Write(const std::string & filename)
{
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
// Assert that the gdcm file is still open (we can write only if it was readed)
if (mFile == NULL) {
bool clitk::DicomRT_StructureSet::IsDicomRTStruct(const std::string & filename)
{
// Open DICOM
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
// Read gdcm file
mReader = new gdcm::Reader;
mReader->SetFileName(filename.c_str());
#endif
// gdcm
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
// This is not use if CLITK_USE_SYSTEM_GDCM==1
#include "gdcmReader.h"
#include "gdcmWriter.h"
int AddBinaryImageAsNewROI(vvImage * i, std::string name);
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
// Static
static int ReadROINumber(const gdcm::Item & item);
#endif
std::map<int, clitk::DicomRT_ROI::Pointer> mROIs;
std::map<int, std::string> mMapOfROIName;
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
gdcm::Reader * mReader;
gdcm::SmartPointer<gdcm::SequenceOfItems> mROIInfoSequenceOfItems;
gdcm::SmartPointer<gdcm::SequenceOfItems> mROIContoursSequenceOfItems;
}
}
-
- virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError) ITK_OVERRIDE;
+#if ( ( ITK_VERSION_MAJOR == 4 ) && ( ITK_VERSION_MINOR > 12 ) || ( ITK_VERSION_MAJOR > 4 ))
+ virtual void GenerateInputRequestedRegion() ITK_OVERRIDE;
+#else
+ virtual void GenerateInputRequestedRegion() throw(InvalidRequestedRegionError) ITK_OVERRIDE;
+#endif
void EnlargeOutputRequestedRegion (DataObject * output) ITK_OVERRIDE;
protected:
template <class TInputImage, class TOutputImage,class TtNorm>
void
RelativePositionPropImageFilter<TInputImage,TOutputImage,TtNorm>
+#if ( ( ITK_VERSION_MAJOR == 4 ) && ( ITK_VERSION_MINOR > 12 ) || ( ITK_VERSION_MAJOR > 4 ))
+ ::GenerateInputRequestedRegion()
+#else
::GenerateInputRequestedRegion() throw (InvalidRequestedRegionError)
+#endif
{
// call the superclass' implementation of this method
Superclass::GenerateInputRequestedRegion ();
void SetOutputParametersFromImage( const OutputImageConstPointer image );
+#if ( ( ITK_VERSION_MAJOR == 4 ) && ( ITK_VERSION_MINOR > 12 ) || ( ITK_VERSION_MAJOR > 4 ))
+ void Initialize(void);
+#else
void Initialize(void) throw (itk::ExceptionObject);
+#endif
protected:
template <class InputImageType, class OutputImageType>
void
BackProjectImageFilter<InputImageType, OutputImageType>
+#if ( ( ITK_VERSION_MAJOR == 4 ) && ( ITK_VERSION_MINOR > 12 ) || ( ITK_VERSION_MAJOR > 4 ))
+ ::Initialize( void )
+#else
::Initialize( void ) throw (itk::ExceptionObject)
+#endif
{
//Change the origin of the 2D input
typename InputImageType::ConstPointer inputPtr=this->GetInput();
itkSetMacro( Verbose, bool);
itkSetMacro( EdgePaddingValue, PixelType );
itkSetMacro( DeformationField, typename DeformationFieldType::Pointer);
+#if ITK_VERSION_MAJOR <= 4
void SetNumberOfThreads(unsigned int r )
+#else
+ void SetNumberOfWorkUnits(unsigned int r )
+#endif
{
m_NumberOfThreadsIsGiven=true;
+#if ITK_VERSION_MAJOR <= 4
m_NumberOfThreads=r;
+#else
+ m_NumberOfWorkUnits=r;
+#endif
}
itkSetMacro(ThreadSafe, bool);
private:
bool m_Verbose;
bool m_NumberOfThreadsIsGiven;
+#if ITK_VERSION_MAJOR <= 4
unsigned int m_NumberOfThreads;
+#else
+ unsigned int m_NumberOfWorkUnits;
+#endif
PixelType m_EdgePaddingValue;
typename DeformationFieldType::Pointer m_DeformationField;
bool m_ThreadSafe;
typename HelperClass1Type::Pointer helper1=HelperClass1Type::New();
//Set input
- if(m_NumberOfThreadsIsGiven)helper1->SetNumberOfThreads(m_NumberOfThreads);
+ if(m_NumberOfThreadsIsGiven) {
+#if ITK_VERSION_MAJOR <= 4
+ helper1->SetNumberOfThreads(m_NumberOfThreads);
+#else
+ helper1->SetNumberOfWorkUnits(m_NumberOfWorkUnits);
+#endif
+ }
helper1->SetInput(inputPtr);
helper1->SetDeformationField(m_DeformationField);
helper1->SetWeights(weights);
typename HelperClass2Type::Pointer helper2=HelperClass2Type::New();
//Set temporary output as input
- if(m_NumberOfThreadsIsGiven)helper2->SetNumberOfThreads(m_NumberOfThreads);
+ if(m_NumberOfThreadsIsGiven) {
+#if ITK_VERSION_MAJOR <= 4
+ helper2->SetNumberOfThreads(m_NumberOfThreads);
+#else
+ helper2->SetNumberOfWorkUnits(m_NumberOfWorkUnits);
+#endif
+ }
helper2->SetInput(temp);
helper2->SetWeights(weights);
helper2->SetEdgePaddingValue(m_EdgePaddingValue);
//Set Methods(inline)
itkSetMacro( Verbose, bool);
itkSetMacro( EdgePaddingValue, PixelType );
+#if ITK_VERSION_MAJOR <= 4
void SetNumberOfThreads(unsigned int r ) ITK_OVERRIDE
+#else
+ void SetNumberOfWorkUnits(unsigned int r ) ITK_OVERRIDE
+#endif
{
m_NumberOfThreadsIsGiven=true;
+#if ITK_VERSION_MAJOR <= 4
m_NumberOfThreads=r;
+#else
+ m_NumberOfWorkUnits=r;
+#endif
}
itkSetMacro(ThreadSafe, bool);
itkSetMacro(OutputSpacing, SpacingType);
bool m_NumberOfThreadsIsGiven;
SpacingType m_OutputSpacing;
SizeType m_OutputSize;
+#if ITK_VERSION_MAJOR <= 4
unsigned int m_NumberOfThreads;
+#else
+ unsigned int m_NumberOfWorkUnits;
+#endif
PixelType m_EdgePaddingValue;
bool m_ThreadSafe;
};
typename HelperClass1Type::Pointer helper1=HelperClass1Type::New();
//Set input
- if(m_NumberOfThreadsIsGiven)helper1->SetNumberOfThreads(m_NumberOfThreads);
+ if(m_NumberOfThreadsIsGiven) {
+#if ITK_VERSION_MAJOR <= 4
+ helper1->SetNumberOfThreads(m_NumberOfThreads);
+#else
+ helper1->SetNumberOfWorkUnits(m_NumberOfWorkUnits);
+#endif
+ }
helper1->SetInput(inputPtr);
helper1->SetWeights(weights);
typename HelperClass2Type::Pointer helper2=HelperClass2Type::New();
//Set temporary output as input
- if(m_NumberOfThreadsIsGiven)helper2->SetNumberOfThreads(m_NumberOfThreads);
+ if(m_NumberOfThreadsIsGiven) {
+#if ITK_VERSION_MAJOR <= 4
+ helper2->SetNumberOfThreads(m_NumberOfThreads);
+#else
+ helper2->SetNumberOfWorkUnits(m_NumberOfWorkUnits);
+#endif
+ }
helper2->SetInput(temp);
helper2->SetWeights(weights);
helper2->SetEdgePaddingValue(m_EdgePaddingValue);
PasteImageFilter< TInputImage, TSourceImage, TOutputImage >
::PasteImageFilter()
{
- this->ProcessObject::SetNumberOfRequiredInputs(2);
+ //this->ProcessObject::SetNumberOfRequiredInputs(2);
this->InPlaceOff();
this->m_DestinationIndex.Fill(0);
case B_LUT: std::cout << "B-LUT " << m_BSplineOrder << " " << m_BLUTSamplingFactor << std::endl; break;
case WSINC: std::cout << "Windowed Sinc" << std::endl; break;
}
+#if ITK_VERSION_MAJOR <= 4
std::cout << "Threads = " << this->GetNumberOfThreads() << std::endl;
+#else
+ std::cout << "Threads = " << this->GetNumberOfWorkUnits() << std::endl;
+#endif
std::cout << "LastDimIsTime = " << m_LastDimensionIsTime << std::endl;
}
filter->SetOutputSpacing(m_OutputSpacing);
filter->SetOutputOrigin(m_OutputOrigin);
filter->SetDefaultPixelValue(m_DefaultPixelValue);
+#if ITK_VERSION_MAJOR <= 4
filter->SetNumberOfThreads(this->GetNumberOfThreads());
+#else
+ filter->SetNumberOfWorkUnits(this->GetNumberOfWorkUnits());
+#endif
filter->SetOutputDirection(m_OutputDirection); // <-- NEEDED if we want to keep orientation (in case of PermutAxes for example)
// Select interpolator
#=========================================================
+if(CLITK_BUILD_REGISTRATION)
# Add Libraries used in vv and clitk to avoid recompilation
-WRAP_GGO(clitkAffineRegistration_GGO_C clitkAffineRegistration.ggo)
-add_library(clitkAffineRegistrationLib
- clitkAffineRegistrationGenericFilter.cxx
- ${clitkAffineRegistration_GGO_C}
- clitkLBFGSBOptimizer.cxx
- clitkGenericAffineTransform.cxx)
+ WRAP_GGO(clitkAffineRegistration_GGO_C clitkAffineRegistration.ggo)
+ add_library(clitkAffineRegistrationLib
+ clitkAffineRegistrationGenericFilter.cxx
+ ${clitkAffineRegistration_GGO_C}
+ clitkLBFGSBOptimizer.cxx
+ clitkGenericAffineTransform.cxx)
#=========================================================
-if(CLITK_BUILD_REGISTRATION)
############################## registration algorithms
add_executable(clitkAffineRegistration clitkAffineRegistration.cxx)
target_link_libraries(clitkAffineRegistration clitkAffineRegistrationLib clitkCommon)
typename MetricType::Pointer metric=genericMetric->GetMetricPointer();
if (movingMask) metric->SetMovingImageMask(movingMask);
- if (threadsGiven) metric->SetNumberOfThreads( threads );
+ if (threadsGiven) {
+#if ITK_VERSION_MAJOR <= 4
+ metric->SetNumberOfThreads( threads );
+#else
+ metric->SetNumberOfWorkUnits( threads );
+#endif
+ }
//============================================================================
// Initialize using image moments.
typename MetricType::Pointer metric=genericMetric->GetMetricPointer();
if (movingMask) metric->SetMovingImageMask(movingMask);
if (threadsGiven) {
+#if ITK_VERSION_MAJOR <= 4
metric->SetNumberOfThreads( threads );
+#else
+ metric->SetNumberOfWorkUnits( threads );
+#endif
if (m_Verbose) std::cout<< "Using " << threads << " threads." << std::endl;
}
registration->SetInterpolator( interpolator );
registration->SetTransform (regTransform );
if(threadsGiven) {
+#if ITK_VERSION_MAJOR <= 4
registration->SetNumberOfThreads(threads);
+#else
+ registration->SetNumberOfWorkUnits(threads);
+#endif
if (m_Verbose) std::cout<< "Using " << threads << " threads." << std::endl;
}
registration->SetFixedImage( croppedFixedImage );
typedef itk::TransformToDisplacementFieldFilter<DisplacementFieldType, double> ConvertorType;
#endif
typename ConvertorType::Pointer filter= ConvertorType::New();
+#if ITK_VERSION_MAJOR <= 4
filter->SetNumberOfThreads(1);
+#else
+ filter->SetNumberOfWorkUnits(1);
+#endif
if(m_ArgsInfo.itkbspline_flag)
sTransform->SetBulkTransform(ITK_NULLPTR);
else
* (1) making sure that all the components are present and plugged
* together correctly,
* (3) allocate memory for bin data structures. */
+#if ( ( ITK_VERSION_MAJOR == 4 ) && ( ITK_VERSION_MINOR > 12 ) || ( ITK_VERSION_MAJOR > 4 ))
+ virtual void Initialize(void) ITK_OVERRIDE;
+#else
virtual void Initialize(void) throw ( ExceptionObject ) ITK_OVERRIDE;
+#endif
/** Get the derivatives of the match measure. */
void GetDerivative( const TransformParametersType & parameters,
template <class TFixedImage, class TMovingImage>
void
CorrelationRatioImageToImageMetric<TFixedImage,TMovingImage>
+#if ( ( ITK_VERSION_MAJOR == 4 ) && ( ITK_VERSION_MINOR > 12 ) || ( ITK_VERSION_MAJOR > 4 ))
+::Initialize(void)
+#else
::Initialize(void) throw ( ExceptionObject )
+#endif
{
this->Superclass::Initialize();
// =======================================================
// The multiresolution scheme
// =======================================================
- if (threadsGiven) multiResolutionFilter->SetNumberOfThreads(threads);
+ if (threadsGiven) {
+#if ITK_VERSION_MAJOR <= 4
+ multiResolutionFilter->SetNumberOfThreads(threads);
+#else
+ multiResolutionFilter->SetNumberOfWorkUnits(threads);
+#endif
+ }
unsigned int nLevels=m_ArgsInfo.levels_arg;
if (m_Verbose) std::cout<<"Setting the number of resolution levels to "<<nLevels<<"..."<<std::endl;
multiResolutionFilter->SetFixedImage( fixedImage );
multiResolutionFilter->SetNumberOfLevels( nLevels );
multiResolutionFilter->SetFixedImagePyramid( fixedImagePyramid );
multiResolutionFilter->SetMovingImagePyramid( movingImagePyramid );
- if (threadsGiven) multiResolutionFilter->SetNumberOfThreads( threads );
-
+ if (threadsGiven) {
+#if ITK_VERSION_MAJOR <= 4
+ multiResolutionFilter->SetNumberOfThreads( threads );
+#else
+ multiResolutionFilter->SetNumberOfWorkUnits( threads );
+#endif
+ }
+
//------------------------------------
//Set the number of iterations
//------------------------------------
* (2) uniformly select NumberOfSpatialSamples within
* the FixedImageRegion, and
* (3) allocate memory for pdf data structures. */
+#if ( ( ITK_VERSION_MAJOR == 4 ) && ( ITK_VERSION_MINOR > 12 ) || ( ITK_VERSION_MAJOR > 4 ))
+ virtual void Initialize(void) ITK_OVERRIDE;
+#else
virtual void Initialize(void) throw ( itk::ExceptionObject ) ITK_OVERRIDE;
+#endif
/** Get the value. */
MeasureType GetValue( const ParametersType & parameters ) const ITK_OVERRIDE;
template <class TFixedImage, class TMovingImage>
void
NormalizedCorrelationImageToImageMetric<TFixedImage,TMovingImage>
+#if ( ( ITK_VERSION_MAJOR == 4 ) && ( ITK_VERSION_MINOR > 12 ) || ( ITK_VERSION_MAJOR > 4 ))
+::Initialize(void)
+#else
::Initialize(void) throw ( itk::ExceptionObject )
+#endif
{
this->Superclass::Initialize();
if(m_ThreaderSFF != NULL) {
delete [] m_ThreaderSFF;
}
+#if ITK_VERSION_MAJOR <= 4
m_ThreaderSFF = new double[this->m_NumberOfThreads];
+#else
+ m_ThreaderSFF = new double[this->m_NumberOfWorkUnits];
+#endif
if(m_ThreaderSMM != NULL) {
delete [] m_ThreaderSMM;
}
+#if ITK_VERSION_MAJOR <= 4
m_ThreaderSMM = new double[this->m_NumberOfThreads];
+#else
+ m_ThreaderSMM = new double[this->m_NumberOfWorkUnits];
+#endif
if(m_ThreaderSFM != NULL) {
delete [] m_ThreaderSFM;
}
+#if ITK_VERSION_MAJOR <= 4
m_ThreaderSFM = new double[this->m_NumberOfThreads];
+#else
+ m_ThreaderSFM = new double[this->m_NumberOfWorkUnits];
+#endif
if(this->m_SubtractMean) {
if(m_ThreaderSF != NULL) {
delete [] m_ThreaderSF;
}
+#if ITK_VERSION_MAJOR <= 4
m_ThreaderSF = new double[this->m_NumberOfThreads];
+#else
+ m_ThreaderSF = new double[this->m_NumberOfWorkUnits];
+#endif
if(m_ThreaderSM != NULL) {
delete [] m_ThreaderSM;
}
+#if ITK_VERSION_MAJOR <= 4
m_ThreaderSM = new double[this->m_NumberOfThreads];
+#else
+ m_ThreaderSM = new double[this->m_NumberOfWorkUnits];
+#endif
}
if(m_ThreaderDerivativeF != NULL) {
delete [] m_ThreaderDerivativeF;
}
+#if ITK_VERSION_MAJOR <= 4
m_ThreaderDerivativeF = new DerivativeType[this->m_NumberOfThreads];
for(unsigned int threadID=0; threadID<this->m_NumberOfThreads; threadID++) {
+#else
+ m_ThreaderDerivativeF = new DerivativeType[this->m_NumberOfWorkUnits];
+ for(unsigned int threadID=0; threadID<this->m_NumberOfWorkUnits; threadID++) {
+#endif
m_ThreaderDerivativeF[threadID].SetSize( this->m_NumberOfParameters );
}
if(m_ThreaderDerivativeM != NULL) {
delete [] m_ThreaderDerivativeM;
}
+#if ITK_VERSION_MAJOR <= 4
m_ThreaderDerivativeM = new DerivativeType[this->m_NumberOfThreads];
for(unsigned int threadID=0; threadID<this->m_NumberOfThreads; threadID++) {
+#else
+ m_ThreaderDerivativeM = new DerivativeType[this->m_NumberOfWorkUnits];
+ for(unsigned int threadID=0; threadID<this->m_NumberOfWorkUnits; threadID++) {
+#endif
m_ThreaderDerivativeM[threadID].SetSize( this->m_NumberOfParameters );
}
}
//Reset the accumulators
+#if ITK_VERSION_MAJOR <= 4
memset( m_ThreaderSFF, 0, this->m_NumberOfThreads * sizeof(AccumulateType) );
memset( m_ThreaderSMM, 0, this->m_NumberOfThreads * sizeof(AccumulateType) );
memset( m_ThreaderSFM, 0, this->m_NumberOfThreads * sizeof(AccumulateType) );
+#else
+ memset( m_ThreaderSFF, 0, this->m_NumberOfWorkUnits * sizeof(AccumulateType) );
+ memset( m_ThreaderSMM, 0, this->m_NumberOfWorkUnits * sizeof(AccumulateType) );
+ memset( m_ThreaderSFM, 0, this->m_NumberOfWorkUnits * sizeof(AccumulateType) );
+#endif
if(this->m_SubtractMean) {
+#if ITK_VERSION_MAJOR <= 4
memset( m_ThreaderSF, 0, this->m_NumberOfThreads * sizeof(AccumulateType) );
memset( m_ThreaderSM, 0, this->m_NumberOfThreads * sizeof(AccumulateType) );
+#else
+ memset( m_ThreaderSF, 0, this->m_NumberOfWorkUnits * sizeof(AccumulateType) );
+ memset( m_ThreaderSM, 0, this->m_NumberOfWorkUnits * sizeof(AccumulateType) );
+#endif
}
sf = m_ThreaderSF[0];
sm = m_ThreaderSM[0];
+#if ITK_VERSION_MAJOR <= 4
for(unsigned int t=1; t<this->m_NumberOfThreads; t++) {
+#else
+ for(unsigned int t=1; t<this->m_NumberOfWorkUnits; t++) {
+#endif
sff += m_ThreaderSFF[t];
smm += m_ThreaderSMM[t];
sfm += m_ThreaderSFM[t];
{
//No checking for the fixed image, done in the caller
//Reset the accumulators
+#if ITK_VERSION_MAJOR <= 4
memset( m_ThreaderSFF, 0, this->m_NumberOfThreads * sizeof(AccumulateType) );
memset( m_ThreaderSMM, 0, this->m_NumberOfThreads * sizeof(AccumulateType) );
memset( m_ThreaderSFM, 0, this->m_NumberOfThreads * sizeof(AccumulateType) );
+#else
+ memset( m_ThreaderSFF, 0, this->m_NumberOfWorkUnits * sizeof(AccumulateType) );
+ memset( m_ThreaderSMM, 0, this->m_NumberOfWorkUnits * sizeof(AccumulateType) );
+ memset( m_ThreaderSFM, 0, this->m_NumberOfWorkUnits * sizeof(AccumulateType) );
+#endif
if(this->m_SubtractMean) {
+#if ITK_VERSION_MAJOR <= 4
memset( m_ThreaderSF, 0, this->m_NumberOfThreads * sizeof(AccumulateType) );
memset( m_ThreaderSM, 0, this->m_NumberOfThreads * sizeof(AccumulateType) );
+#else
+ memset( m_ThreaderSF, 0, this->m_NumberOfWorkUnits * sizeof(AccumulateType) );
+ memset( m_ThreaderSM, 0, this->m_NumberOfWorkUnits * sizeof(AccumulateType) );
+#endif
}
m_SF = m_ThreaderSF[0];
m_SM = m_ThreaderSM[0];
+#if ITK_VERSION_MAJOR <= 4
for(unsigned int t=1; t<this->m_NumberOfThreads; t++) {
+#else
+ for(unsigned int t=1; t<this->m_NumberOfWorkUnits; t++) {
+#endif
m_SFF += m_ThreaderSFF[t];
m_SMM += m_ThreaderSMM[t];
m_SFM += m_ThreaderSFM[t];
memset( derivative.data_block(),
0,
this->m_NumberOfParameters * sizeof(typename DerivativeType::ValueType) );
-
+#if ITK_VERSION_MAJOR <= 4
for( unsigned int threadID = 0; threadID<this->m_NumberOfThreads; threadID++ ) {
+#else
+ for( unsigned int threadID = 0; threadID<this->m_NumberOfWorkUnits; threadID++ ) {
+#endif
memset( m_ThreaderDerivativeF[threadID].data_block(),
0,
this->m_NumberOfParameters * sizeof(typename DerivativeType::ValueType) );
// Accumulate over the threads
DerivativeType derivativeF(this->m_NumberOfParameters), derivativeM(this->m_NumberOfParameters);
+#if ITK_VERSION_MAJOR <= 4
for(unsigned int t=0; t<this->m_NumberOfThreads; t++) {
+#else
+ for(unsigned int t=0; t<this->m_NumberOfWorkUnits; t++) {
+#endif
for(unsigned int parameter = 0; parameter < this->m_NumberOfParameters; parameter++) {
derivativeF[parameter] += m_ThreaderDerivativeF[t][parameter];
derivativeM[parameter] += m_ThreaderDerivativeM[t][parameter];
* (2) uniformly select NumberOfSpatialSamples within
* the FixedImageRegion, and
* (3) allocate memory for pdf data structures. */
+#if ( ( ITK_VERSION_MAJOR == 4 ) && ( ITK_VERSION_MINOR > 12 ) || ( ITK_VERSION_MAJOR > 4 ))
+ virtual void Initialize(void) ITK_OVERRIDE;
+#else
virtual void Initialize(void) throw ( itk::ExceptionObject ) ITK_OVERRIDE;
+#endif
/** Get the value. */
MeasureType GetValue( const ParametersType & parameters ) const ITK_OVERRIDE;
template <class TFixedImage, class TMovingImage>
void
NormalizedCorrelationImageToImageMetricFor3DBLUTFFD<TFixedImage,TMovingImage>
+#if ( ( ITK_VERSION_MAJOR == 4 ) && ( ITK_VERSION_MINOR > 12 ) || ( ITK_VERSION_MAJOR > 4 ))
+::Initialize(void)
+#else
::Initialize(void) throw ( itk::ExceptionObject )
+#endif
{
this->Superclass::Initialize();
if(m_ThreaderSFF != NULL) {
delete [] m_ThreaderSFF;
}
+#if ITK_VERSION_MAJOR <= 4
m_ThreaderSFF = new double[this->m_NumberOfThreads];
+#else
+ m_ThreaderSFF = new double[this->m_NumberOfWorkUnits];
+#endif
if(m_ThreaderSMM != NULL) {
delete [] m_ThreaderSMM;
}
+#if ITK_VERSION_MAJOR <= 4
m_ThreaderSMM = new double[this->m_NumberOfThreads];
+#else
+ m_ThreaderSMM = new double[this->m_NumberOfWorkUnits];
+#endif
if(m_ThreaderSFM != NULL) {
delete [] m_ThreaderSFM;
}
+#if ITK_VERSION_MAJOR <= 4
m_ThreaderSFM = new double[this->m_NumberOfThreads];
+#else
+ m_ThreaderSFM = new double[this->m_NumberOfWorkUnits];
+#endif
if(this->m_SubtractMean) {
if(m_ThreaderSF != NULL) {
delete [] m_ThreaderSF;
}
+#if ITK_VERSION_MAJOR <= 4
m_ThreaderSF = new double[this->m_NumberOfThreads];
+#else
+ m_ThreaderSF = new double[this->m_NumberOfWorkUnits];
+#endif
if(m_ThreaderSM != NULL) {
delete [] m_ThreaderSM;
}
+#if ITK_VERSION_MAJOR <= 4
m_ThreaderSM = new double[this->m_NumberOfThreads];
+#else
+ m_ThreaderSM = new double[this->m_NumberOfWorkUnits];
+#endif
}
if(m_ThreaderDerivativeF != NULL) {
delete [] m_ThreaderDerivativeF;
}
+#if ITK_VERSION_MAJOR <= 4
m_ThreaderDerivativeF = new DerivativeType[this->m_NumberOfThreads];
for(unsigned int threadID=0; threadID<this->m_NumberOfThreads; threadID++) {
+#else
+ m_ThreaderDerivativeF = new DerivativeType[this->m_NumberOfWorkUnits];
+ for(unsigned int threadID=0; threadID<this->m_NumberOfWorkUnits; threadID++) {
+#endif
m_ThreaderDerivativeF[threadID].SetSize( this->m_NumberOfParameters );
}
if(m_ThreaderDerivativeM != NULL) {
delete [] m_ThreaderDerivativeM;
}
+#if ITK_VERSION_MAJOR <= 4
m_ThreaderDerivativeM = new DerivativeType[this->m_NumberOfThreads];
for(unsigned int threadID=0; threadID<this->m_NumberOfThreads; threadID++) {
+#else
+ m_ThreaderDerivativeM = new DerivativeType[this->m_NumberOfWorkUnits];
+ for(unsigned int threadID=0; threadID<this->m_NumberOfWorkUnits; threadID++) {
+#endif
m_ThreaderDerivativeM[threadID].SetSize( this->m_NumberOfParameters );
}
}
//Reset the accumulators
+#if ITK_VERSION_MAJOR <= 4
memset( m_ThreaderSFF, 0, this->m_NumberOfThreads * sizeof(AccumulateType) );
memset( m_ThreaderSMM, 0, this->m_NumberOfThreads * sizeof(AccumulateType) );
memset( m_ThreaderSFM, 0, this->m_NumberOfThreads * sizeof(AccumulateType) );
+#else
+ memset( m_ThreaderSFF, 0, this->m_NumberOfWorkUnits * sizeof(AccumulateType) );
+ memset( m_ThreaderSMM, 0, this->m_NumberOfWorkUnits * sizeof(AccumulateType) );
+ memset( m_ThreaderSFM, 0, this->m_NumberOfWorkUnits * sizeof(AccumulateType) );
+#endif
if(this->m_SubtractMean) {
+#if ITK_VERSION_MAJOR <= 4
memset( m_ThreaderSF, 0, this->m_NumberOfThreads * sizeof(AccumulateType) );
memset( m_ThreaderSM, 0, this->m_NumberOfThreads * sizeof(AccumulateType) );
+#else
+ memset( m_ThreaderSF, 0, this->m_NumberOfWorkUnits * sizeof(AccumulateType) );
+ memset( m_ThreaderSM, 0, this->m_NumberOfWorkUnits * sizeof(AccumulateType) );
+#endif
}
sf = m_ThreaderSF[0];
sm = m_ThreaderSM[0];
+#if ITK_VERSION_MAJOR <= 4
for(unsigned int t=1; t<this->m_NumberOfThreads; t++) {
+#else
+ for(unsigned int t=1; t<this->m_NumberOfWorkUnits; t++) {
+#endif
sff += m_ThreaderSFF[t];
smm += m_ThreaderSMM[t];
sfm += m_ThreaderSFM[t];
{
//No checking for the fixed image, done in the caller
//Reset the accumulators
+#if ITK_VERSION_MAJOR <= 4
memset( m_ThreaderSFF, 0, this->m_NumberOfThreads * sizeof(AccumulateType) );
memset( m_ThreaderSMM, 0, this->m_NumberOfThreads * sizeof(AccumulateType) );
memset( m_ThreaderSFM, 0, this->m_NumberOfThreads * sizeof(AccumulateType) );
+#else
+ memset( m_ThreaderSFF, 0, this->m_NumberOfWorkUnits * sizeof(AccumulateType) );
+ memset( m_ThreaderSMM, 0, this->m_NumberOfWorkUnits * sizeof(AccumulateType) );
+ memset( m_ThreaderSFM, 0, this->m_NumberOfWorkUnits * sizeof(AccumulateType) );
+#endif
if(this->m_SubtractMean) {
+#if ITK_VERSION_MAJOR <= 4
memset( m_ThreaderSF, 0, this->m_NumberOfThreads * sizeof(AccumulateType) );
memset( m_ThreaderSM, 0, this->m_NumberOfThreads * sizeof(AccumulateType) );
+#else
+ memset( m_ThreaderSF, 0, this->m_NumberOfWorkUnits * sizeof(AccumulateType) );
+ memset( m_ThreaderSM, 0, this->m_NumberOfWorkUnits * sizeof(AccumulateType) );
+#endif
}
m_SF = m_ThreaderSF[0];
m_SM = m_ThreaderSM[0];
+#if ITK_VERSION_MAJOR <= 4
for(unsigned int t=1; t<this->m_NumberOfThreads; t++) {
+#else
+ for(unsigned int t=1; t<this->m_NumberOfWorkUnits; t++) {
+#endif
m_SFF += m_ThreaderSFF[t];
m_SMM += m_ThreaderSMM[t];
m_SFM += m_ThreaderSFM[t];
0,
this->m_NumberOfParameters * sizeof(typename DerivativeType::ValueType) );
+#if ITK_VERSION_MAJOR <= 4
for( unsigned int threadID = 0; threadID<this->m_NumberOfThreads; threadID++ ) {
+#else
+ for( unsigned int threadID = 0; threadID<this->m_NumberOfWorkUnits; threadID++ ) {
+#endif
memset( m_ThreaderDerivativeF[threadID].data_block(),
0,
this->m_NumberOfParameters * sizeof(typename DerivativeType::ValueType) );
// Accumulate over the threads
DerivativeType derivativeF(this->m_NumberOfParameters), derivativeM(this->m_NumberOfParameters);
+#if ITK_VERSION_MAJOR <= 4
for(unsigned int t=0; t<this->m_NumberOfThreads; t++) {
+#else
+ for(unsigned int t=0; t<this->m_NumberOfWorkUnits; t++) {
+#endif
for(unsigned int parameter = 0; parameter < this->m_NumberOfParameters; parameter++) {
derivativeF[parameter] += m_ThreaderDerivativeF[t][parameter];
derivativeM[parameter] += m_ThreaderDerivativeM[t][parameter];
* (2) uniformly select NumberOfSpatialSamples within
* the FixedImageRegion, and
* (3) allocate memory for pdf data structures. */
+#if ( ( ITK_VERSION_MAJOR == 4 ) && ( ITK_VERSION_MINOR > 12 ) || ( ITK_VERSION_MAJOR > 4 ))
+ virtual void Initialize(void) ITK_OVERRIDE;
+#else
virtual void Initialize(void) throw ( ExceptionObject ) ITK_OVERRIDE;
+#endif
/** Get the value. */
MeasureType GetValue( const ParametersType & parameters ) const ITK_OVERRIDE;
template <class TFixedImage, class TMovingImage>
void
MattesMutualInformationImageToImageMetricFor3DBLUTFFD<TFixedImage,TMovingImage>
+#if ( ( ITK_VERSION_MAJOR == 4 ) && ( ITK_VERSION_MINOR > 12 ) || ( ITK_VERSION_MAJOR > 4 ))
+::Initialize(void)
+#else
::Initialize(void) throw ( ExceptionObject )
+#endif
{
this->Superclass::Initialize();
this->Superclass::MultiThreadingInitialize();
typename FixedImageStatisticsFilterType::Pointer fixedImageStats =
FixedImageStatisticsFilterType::New();
fixedImageStats->SetInput( this->m_FixedImage );
+#if ITK_VERSION_MAJOR <= 4
fixedImageStats->SetNumberOfThreads( this->m_NumberOfThreads );
+#else
+ fixedImageStats->SetNumberOfWorkUnits( this->m_NumberOfWorkUnits );
+#endif
fixedImageStats->Update();
m_FixedImageTrueMin = fixedImageStats->GetMinimum();
typename MovingImageStatisticsFilterType::Pointer movingImageStats =
MovingImageStatisticsFilterType::New();
movingImageStats->SetInput( this->m_MovingImage );
+#if ITK_VERSION_MAJOR <= 4
movingImageStats->SetNumberOfThreads( this->m_NumberOfThreads );
+#else
+ movingImageStats->SetNumberOfWorkUnits( this->m_NumberOfWorkUnits );
+#endif
movingImageStats->Update();
m_MovingImageTrueMin = movingImageStats->GetMinimum();
}
// Assumes number of threads doesn't change between calls to Initialize
m_ThreaderFixedImageMarginalPDF = new
- PDFValueType[(this->m_NumberOfThreads-1)
- * m_NumberOfHistogramBins];
+#if ITK_VERSION_MAJOR <= 4
+ PDFValueType[(this->m_NumberOfThreads-1) * m_NumberOfHistogramBins];
+#else
+ PDFValueType[(this->m_NumberOfWorkUnits-1) * m_NumberOfHistogramBins];
+#endif
if(m_ThreaderJointPDF != NULL) {
delete [] m_ThreaderJointPDF;
}
m_ThreaderJointPDF = new typename
+#if ITK_VERSION_MAJOR <= 4
JointPDFType::Pointer[this->m_NumberOfThreads-1];
+#else
+ JointPDFType::Pointer[this->m_NumberOfWorkUnits-1];
+#endif
if(m_ThreaderJointPDFStartBin != NULL) {
delete [] m_ThreaderJointPDFStartBin;
}
+#if ITK_VERSION_MAJOR <= 4
m_ThreaderJointPDFStartBin = new int[this->m_NumberOfThreads];
+#else
+ m_ThreaderJointPDFStartBin = new int[this->m_NumberOfWorkUnits];
+#endif
if(m_ThreaderJointPDFEndBin != NULL) {
delete [] m_ThreaderJointPDFEndBin;
}
+#if ITK_VERSION_MAJOR <= 4
m_ThreaderJointPDFEndBin = new int[this->m_NumberOfThreads];
+#else
+ m_ThreaderJointPDFEndBin = new int[this->m_NumberOfWorkUnits];
+#endif
if(m_ThreaderJointPDFSum != NULL) {
delete [] m_ThreaderJointPDFSum;
}
+#if ITK_VERSION_MAJOR <= 4
m_ThreaderJointPDFSum = new double[this->m_NumberOfThreads];
+#else
+ m_ThreaderJointPDFSum = new double[this->m_NumberOfWorkUnits];
+#endif
unsigned int threadID;
+#if ITK_VERSION_MAJOR <= 4
int binRange = m_NumberOfHistogramBins / this->m_NumberOfThreads;
+#else
+ int binRange = m_NumberOfHistogramBins / this->m_NumberOfWorkUnits;
+#endif
+#if ITK_VERSION_MAJOR <= 4
for(threadID = 0; threadID < this->m_NumberOfThreads-1; threadID++) {
+#else
+ for(threadID = 0; threadID < this->m_NumberOfWorkUnits-1; threadID++) {
+#endif
m_ThreaderJointPDF[threadID] = JointPDFType::New();
m_ThreaderJointPDF[threadID]->SetRegions( jointPDFRegion );
m_ThreaderJointPDF[threadID]->Allocate();
m_ThreaderJointPDFEndBin[threadID] = (threadID + 1) * binRange - 1;
}
- m_ThreaderJointPDFStartBin[this->m_NumberOfThreads-1] =
- (this->m_NumberOfThreads - 1 ) * binRange;
-
+#if ITK_VERSION_MAJOR <= 4
+ m_ThreaderJointPDFStartBin[this->m_NumberOfThreads-1] = (this->m_NumberOfThreads - 1 ) * binRange;
m_ThreaderJointPDFEndBin[this->m_NumberOfThreads-1] = m_NumberOfHistogramBins - 1;
+#else
+ m_ThreaderJointPDFStartBin[this->m_NumberOfWorkUnits-1] = (this->m_NumberOfWorkUnits - 1 ) * binRange;
+ m_ThreaderJointPDFEndBin[this->m_NumberOfWorkUnits-1] = m_NumberOfHistogramBins - 1;
+#endif
// Release memory of arrays that may have been used for
// previous executions of this metric with different settings
if( this->m_UseExplicitPDFDerivatives ) {
m_ThreaderJointPDFDerivatives = new typename
+#if ITK_VERSION_MAJOR <= 4
JointPDFDerivativesType::Pointer[this->m_NumberOfThreads-1];
+#else
+ JointPDFDerivativesType::Pointer[this->m_NumberOfWorkUnits-1];
+#endif
+#if ITK_VERSION_MAJOR <= 4
for(threadID = 0; threadID < this->m_NumberOfThreads-1; threadID++) {
+#else
+ for(threadID = 0; threadID < this->m_NumberOfWorkUnits-1; threadID++) {
+#endif
m_ThreaderJointPDFDerivatives[threadID] = JointPDFDerivativesType::New();
m_ThreaderJointPDFDerivatives[threadID]->SetRegions(
jointPDFDerivativesRegion );
m_ThreaderJointPDFDerivatives[threadID]->Allocate();
}
} else {
+#if ITK_VERSION_MAJOR <= 4
m_ThreaderMetricDerivative = new DerivativeType[this->m_NumberOfThreads-1];
+#else
+ m_ThreaderMetricDerivative = new DerivativeType[this->m_NumberOfWorkUnits-1];
+#endif
+#if ITK_VERSION_MAJOR <= 4
for(threadID = 0; threadID < this->m_NumberOfThreads-1; threadID++) {
+#else
+ for(threadID = 0; threadID < this->m_NumberOfWorkUnits-1; threadID++) {
+#endif
this->m_ThreaderMetricDerivative[threadID] = DerivativeType( this->GetNumberOfParameters() );
}
}
unsigned int tPdfPtrOffset;
tPdfPtrOffset = ( m_ThreaderJointPDFStartBin[threadID]
* m_JointPDF->GetOffsetTable()[1] );
+#if ITK_VERSION_MAJOR <= 4
for(t=0; t<this->m_NumberOfThreads-1; t++) {
+#else
+ for(t=0; t<this->m_NumberOfWorkUnits-1; t++) {
+#endif
pdfPtr = pdfPtrStart;
tPdfPtr = m_ThreaderJointPDF[t]->GetBufferPointer() + tPdfPtrOffset;
tPdfPtrEnd = tPdfPtr + maxI;
// MUST BE CALLED TO INITIATE PROCESSING
this->GetValueMultiThreadedPostProcessInitiate();
+#if ITK_VERSION_MAJOR <= 4
for(unsigned int threadID = 0; threadID<this->m_NumberOfThreads-1; threadID++) {
+#else
+ for(unsigned int threadID = 0; threadID<this->m_NumberOfWorkUnits-1; threadID++) {
+#endif
m_JointPDFSum += m_ThreaderJointPDFSum[threadID];
}
if ( m_JointPDFSum == 0.0 ) {
JointPDFDerivativesValueType *tPdfDPtrEnd;
unsigned int tPdfDPtrOffset;
tPdfDPtrOffset = m_ThreaderJointPDFStartBin[threadID] * rowSize;
+#if ITK_VERSION_MAJOR <= 4
for(unsigned int t=0; t<this->m_NumberOfThreads-1; t++) {
+#else
+ for(unsigned int t=0; t<this->m_NumberOfWorkUnits-1; t++) {
+#endif
pdfDPtr = pdfDPtrStart;
tPdfDPtr = m_ThreaderJointPDFDerivatives[t]->GetBufferPointer()
+ tPdfDPtrOffset;
} else {
this->m_PRatioArray.Fill( 0.0 );
this->m_MetricDerivative.Fill( NumericTraits< MeasureType >::Zero );
+#if ITK_VERSION_MAJOR <= 4
for(unsigned int threadID = 0; threadID < this->m_NumberOfThreads-1; threadID++ ) {
+#else
+ for(unsigned int threadID = 0; threadID < this->m_NumberOfWorkUnits-1; threadID++ ) {
+#endif
this->m_ThreaderMetricDerivative[threadID].Fill( NumericTraits< MeasureType >::Zero );
}
this->m_ImplicitDerivativesSecondPass = false;
// CALL IF DOING THREADED POST PROCESSING
this->GetValueAndDerivativeMultiThreadedPostProcessInitiate();
+#if ITK_VERSION_MAJOR <= 4
for(unsigned int threadID = 0; threadID<this->m_NumberOfThreads-1; threadID++) {
+#else
+ for(unsigned int threadID = 0; threadID<this->m_NumberOfWorkUnits-1; threadID++) {
+#endif
m_JointPDFSum += m_ThreaderJointPDFSum[threadID];
}
if ( m_JointPDFSum == 0.0 ) {
// Consolidate the contributions from each one of the threads to the total
// derivative.
+#if ITK_VERSION_MAJOR <= 4
for(unsigned int t = 0; t < this->m_NumberOfThreads-1; t++ ) {
+#else
+ for(unsigned int t = 0; t < this->m_NumberOfWorkUnits-1; t++ ) {
+#endif
DerivativeType * source = &(this->m_ThreaderMetricDerivative[t]);
for(unsigned int pp=0; pp < this->m_NumberOfParameters; pp++ ) {
this->m_MetricDerivative[pp] += (*source)[pp];
* (2) uniformly select NumberOfSpatialSamples within
* the FixedImageRegion, and
* (3) allocate memory for pdf data structures. */
+#if ( ( ITK_VERSION_MAJOR == 4 ) && ( ITK_VERSION_MINOR > 12 ) || ( ITK_VERSION_MAJOR > 4 ))
+ virtual void Initialize(void) ITK_OVERRIDE;
+#else
virtual void Initialize(void) throw ( ExceptionObject ) ITK_OVERRIDE;
+#endif
/** Get the value. */
MeasureType GetValue( const ParametersType & parameters ) const ITK_OVERRIDE;
template <class TFixedImage, class TMovingImage>
void
MeanSquaresImageToImageMetricFor3DBLUTFFD<TFixedImage,TMovingImage>
+#if ( ( ITK_VERSION_MAJOR == 4 ) && ( ITK_VERSION_MINOR > 12 ) || ( ITK_VERSION_MAJOR > 4 ))
+::Initialize(void)
+#else
::Initialize(void) throw ( ExceptionObject )
+#endif
{
this->Superclass::Initialize();
if(m_ThreaderMSE != NULL) {
delete [] m_ThreaderMSE;
}
+#if ITK_VERSION_MAJOR <= 4
m_ThreaderMSE = new double[this->m_NumberOfThreads];
+#else
+ m_ThreaderMSE = new double[this->m_NumberOfWorkUnits];
+#endif
if(m_ThreaderMSEDerivatives != NULL) {
delete [] m_ThreaderMSEDerivatives;
}
+#if ITK_VERSION_MAJOR <= 4
m_ThreaderMSEDerivatives = new DerivativeType[this->m_NumberOfThreads];
for(unsigned int threadID=0; threadID<this->m_NumberOfThreads; threadID++) {
+#else
+ m_ThreaderMSEDerivatives = new DerivativeType[this->m_NumberOfWorkUnits];
+ for(unsigned int threadID=0; threadID<this->m_NumberOfWorkUnits; threadID++) {
+#endif
m_ThreaderMSEDerivatives[threadID].SetSize( this->m_NumberOfParameters );
}
}
itkExceptionMacro( << "Fixed image has not been assigned" );
}
- memset( m_ThreaderMSE,
- 0,
- this->m_NumberOfThreads * sizeof(MeasureType) );
+#if ITK_VERSION_MAJOR <= 4
+ memset( m_ThreaderMSE, 0, this->m_NumberOfThreads * sizeof(MeasureType) );
+#else
+ memset( m_ThreaderMSE, 0, this->m_NumberOfWorkUnits * sizeof(MeasureType) );
+#endif
// Set up the parameters in the transform
this->m_Transform->SetParameters( parameters );
}
double mse = m_ThreaderMSE[0];
+#if ITK_VERSION_MAJOR <= 4
for(unsigned int t=1; t<this->m_NumberOfThreads; t++) {
+#else
+ for(unsigned int t=1; t<this->m_NumberOfWorkUnits; t++) {
+#endif
mse += m_ThreaderMSE[t];
}
mse /= this->m_NumberOfPixelsCounted;
this->m_Transform->SetParameters( parameters );
// Reset the joint pdfs to zero
- memset( m_ThreaderMSE,
- 0,
- this->m_NumberOfThreads * sizeof(MeasureType) );
+#if ITK_VERSION_MAJOR <= 4
+ memset( m_ThreaderMSE, 0, this->m_NumberOfThreads * sizeof(MeasureType) );
+#else
+ memset( m_ThreaderMSE, 0, this->m_NumberOfWorkUnits * sizeof(MeasureType) );
+#endif
// Set output values to zero
if(derivative.GetSize() != this->m_NumberOfParameters) {
0,
this->m_NumberOfParameters * sizeof(double) );
+#if ITK_VERSION_MAJOR <= 4
for( unsigned int threadID = 0; threadID<this->m_NumberOfThreads; threadID++ ) {
+#else
+ for( unsigned int threadID = 0; threadID<this->m_NumberOfWorkUnits; threadID++ ) {
+#endif
memset( m_ThreaderMSEDerivatives[threadID].data_block(),
0,
this->m_NumberOfParameters * sizeof(double) );
}
value = 0;
+#if ITK_VERSION_MAJOR <= 4
for(unsigned int t=0; t<this->m_NumberOfThreads; t++) {
+#else
+ for(unsigned int t=0; t<this->m_NumberOfWorkUnits; t++) {
+#endif
value += m_ThreaderMSE[t];
for(unsigned int parameter = 0; parameter < this->m_NumberOfParameters;
parameter++) {
target_link_libraries(clitkImageInfo clitkCommon)
set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageInfo)
+ WRAP_GGO(clitkScintivolStats_GGO_C clitkScintivolStats.ggo)
+ add_executable(clitkScintivolStats clitkScintivolStats.cxx ${clitkScintivolStats_GGO_C})
+ target_link_libraries(clitkScintivolStats clitkCommon)
+ set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkScintivolStats)
+
add_executable(clitkImageConvert clitkImageConvert.cxx)
target_link_libraries(clitkImageConvert clitkImageConvertLib clitkCommon)
set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageConvert)
set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkInvertVF)
WRAP_GGO(clitkAffineTransform_GGO_C clitkAffineTransform.ggo)
+ add_library(clitkAffineTransformLib clitkAffineTransform.cxx ${clitkAffineTransform_GGO_C})
add_executable(clitkAffineTransform clitkAffineTransform.cxx ${clitkAffineTransform_GGO_C})
target_link_libraries(clitkAffineTransform clitkCommon )
set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkAffineTransform)
WRAP_GGO(clitkElastixTransformToMatrix_GGO_C clitkElastixTransformToMatrix.ggo)
add_executable(clitkElastixTransformToMatrix clitkElastixTransformToMatrix.cxx ${clitkElastixTransformToMatrix_GGO_C})
- target_link_libraries(clitkElastixTransformToMatrix clitkCommon )
+ target_link_libraries(clitkElastixTransformToMatrix clitkAffineTransformLib clitkCommon )
set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkElastixTransformToMatrix)
WRAP_GGO(clitkMatrixToElastixTransform_GGO_C clitkMatrixToElastixTransform.ggo)
target_link_libraries(clitkImageStatistics clitkCommon)
set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkImageStatistics)
+ WRAP_GGO(clitkSUVPeak_GGO_C clitkSUVPeak.ggo)
+ add_executable(clitkSUVPeak clitkSUVPeak.cxx clitkSUVPeakGenericFilter.cxx ${clitkSUVPeak_GGO_C})
+ target_link_libraries(clitkSUVPeak clitkCommon)
+ set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkSUVPeak)
+
+ WRAP_GGO(clitkRTStructStatistics_GGO_C clitkRTStructStatistics.ggo)
+ add_executable(clitkRTStructStatistics clitkRTStructStatistics.cxx clitkRTStructStatisticsGenericFilter.cxx ${clitkRTStructStatistics_GGO_C})
+ target_link_libraries(clitkRTStructStatistics clitkCommon)
+ set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkRTStructStatistics)
+
WRAP_GGO(clitkVFConvert_GGO_C clitkVFConvert.ggo)
add_executable(clitkVFConvert clitkVFConvert.cxx clitkVFConvertGenericFilter.cxx ${clitkVFConvert_GGO_C})
target_link_libraries(clitkVFConvert clitkCommon )
target_link_libraries(clitkSum clitkCommon)
set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkSum)
+ WRAP_GGO(clitkExtrude_GGO_C clitkExtrude.ggo)
+ add_executable(clitkExtrude clitkExtrude.cxx ${clitkExtrude_GGO_C})
+ target_link_libraries(clitkExtrude clitkCommon)
+ set(TOOLS_INSTALL ${TOOLS_INSTALL} clitkExtrude)
+
WRAP_GGO(clitkTransformLandmarks_GGO_C clitkTransformLandmarks.ggo)
add_executable(clitkTransformLandmarks clitkTransformLandmarks.cxx ${clitkTransformLandmarks_GGO_C})
target_link_libraries(clitkTransformLandmarks clitkCommon)
// if (m_Verbose) std::cout << "Launching filter in "<< Dimension <<"D and signed_char..." << std::endl;
// UpdateWithDimAndPixelType<Dimension, signed char>();
// }
+ else if(PixelType == "double"){
+ if (m_Verbose) std::cout << "Launching filter in "<< Dimension <<"D and double..." << std::endl;
+ UpdateWithDimAndPixelType<Dimension, double>();
+ }
else {
if (m_Verbose) std::cout << "Launching filter in "<< Dimension <<"D and float..." << std::endl;
UpdateWithDimAndPixelType<Dimension, float>();
//================================================================================
template <class InputPixelType> void BackProjectImageGenericFilter::UpdateWithPixelType()
{
-
+
//---------------------------------
// Define the images
//---------------------------------
const unsigned int OutputImageDimension=3;
typedef float OutputPixelType;
typedef itk::Image<OutputPixelType, OutputImageDimension> OutputImageType;
-
+
//Create the BackProjectImageFilter
typedef BackProjectImageFilter<InputImageType, OutputImageType> BackProjectImageFilterType;
typename BackProjectImageFilterType::Pointer filter=BackProjectImageFilterType::New();
-
+
//---------------------------------
//Pass all the necessary parameters
//---------------------------------
unsigned int i=0;
filter->SetInput(input);
- if (m_ArgsInfo.threads_given) filter->SetNumberOfThreads(m_ArgsInfo.threads_arg);
-
+ if (m_ArgsInfo.threads_given) {
+#if ITK_VERSION_MAJOR <= 4
+ filter->SetNumberOfThreads(m_ArgsInfo.threads_arg);
+#else
+ filter->SetNumberOfWorkUnits(m_ArgsInfo.threads_arg);
+#endif
+ }
+
//Projection parameters
OutputImageType::PointType iso;
if (m_ArgsInfo.iso_given)
- {
- for(i=0;i<OutputImageDimension;i++)
- iso[i]=m_ArgsInfo.iso_arg[i];
- filter->SetIsoCenter(iso);
- }
+ {
+ for(i=0;i<OutputImageDimension;i++)
+ iso[i]=m_ArgsInfo.iso_arg[i];
+ filter->SetIsoCenter(iso);
+ }
if (m_ArgsInfo.panel_shift_given)
filter->SetPanelShift(m_ArgsInfo.panel_shift_arg[0], m_ArgsInfo.panel_shift_arg[1]);
filter->SetSourceToScreen(m_ArgsInfo.screen_arg);
filter->SetSourceToAxis(m_ArgsInfo.axis_arg);
filter->SetProjectionAngle(m_ArgsInfo.angle_arg);
if (m_ArgsInfo.matrix_given)
- {
- itk::Matrix<double,4,4> rt =ReadMatrix3D(m_ArgsInfo.matrix_arg);
- filter->SetRigidTransformMatrix(rt);
- }
+ {
+ itk::Matrix<double,4,4> rt =ReadMatrix3D(m_ArgsInfo.matrix_arg);
+ filter->SetRigidTransformMatrix(rt);
+ }
filter->SetEdgePaddingValue(static_cast<OutputPixelType>(m_ArgsInfo.pad_arg));
-
+
//Output image info
if (m_ArgsInfo.like_given)
- {
- typedef itk::ImageFileReader<OutputImageType> ReaderType;
- ReaderType::Pointer reader2=ReaderType::New();
- reader2->SetFileName(m_ArgsInfo.like_arg);
- reader2->Update();
+ {
+ typedef itk::ImageFileReader<OutputImageType> ReaderType;
+ ReaderType::Pointer reader2=ReaderType::New();
+ reader2->SetFileName(m_ArgsInfo.like_arg);
+ reader2->Update();
- OutputImageType::Pointer image=reader2->GetOutput();
- filter->SetOutputParametersFromImage(image);
- }
+ OutputImageType::Pointer image=reader2->GetOutput();
+ filter->SetOutputParametersFromImage(image);
+ }
else
+ {
+ if(m_ArgsInfo.origin_given)
{
- if(m_ArgsInfo.origin_given)
- {
- OutputImageType::PointType origin;
- for(i=0;i<OutputImageDimension;i++)
- origin[i]=m_ArgsInfo.origin_arg[i];
- filter->SetOutputOrigin(origin);
- }
- if (m_ArgsInfo.spacing_given)
- {
- OutputImageType::SpacingType spacing;
- for(i=0;i<OutputImageDimension;i++)
- spacing[i]=m_ArgsInfo.spacing_arg[i];
- filter->SetOutputSpacing(spacing);
- }
- if (m_ArgsInfo.spacing_given)
- {
- OutputImageType::SizeType size;
- for(i=0;i<OutputImageDimension;i++)
- size[i]=m_ArgsInfo.size_arg[i];
- filter->SetOutputSize(size);
- }
+ OutputImageType::PointType origin;
+ for(i=0;i<OutputImageDimension;i++)
+ origin[i]=m_ArgsInfo.origin_arg[i];
+ filter->SetOutputOrigin(origin);
}
+ if (m_ArgsInfo.spacing_given)
+ {
+ OutputImageType::SpacingType spacing;
+ for(i=0;i<OutputImageDimension;i++)
+ spacing[i]=m_ArgsInfo.spacing_arg[i];
+ filter->SetOutputSpacing(spacing);
+ }
+ if (m_ArgsInfo.spacing_given)
+ {
+ OutputImageType::SizeType size;
+ for(i=0;i<OutputImageDimension;i++)
+ size[i]=m_ArgsInfo.size_arg[i];
+ filter->SetOutputSize(size);
+ }
+ }
//Go
filter->Update();
-
+
//Get the output
OutputImageType::Pointer output=filter->GetOutput();
-
+
//Write the output
typedef itk::ImageFileWriter<OutputImageType> OutputWriterType;
OutputWriterType::Pointer outputWriter = OutputWriterType::New();
#File clitkCropImage.ggo
package "clitkCropImage"
version "1.0"
-purpose "Crop an image according to a given extends or AutoCrop with a background value or like another image"
+purpose "Crop an image according to a given extends or AutoCrop with a background value or like another image.
+In all cases, by default, the output origin is set to be able to overlay input and output without registration."
-option "config" - "Config file" string no
-option "imagetypes" - "Display allowed image types" flag off
-option "verbose" v "Verbose" flag off
-option "verboseOption" - "Display options values" flag off
-option "verboseWarningOff" - "Do not display warning" flag off
+option "config" - "Config file" string no
+option "imagetypes" - "Display allowed image types" flag off
+option "verbose" v "Verbose" flag off
+option "verboseOption" - "Display options values" flag off
+option "verboseWarningOff" - "Do not display warning" flag off
section "I/O"
-option "input" i "Input image filename" string yes
-option "output" o "Output image filename" string yes
+option "input" i "Input image filename" string yes
+option "output" o "Output image filename" string yes
section "Used determined crop"
-option "boundingBox" b "Bounding box of the crop region (in 3D: =x1,x2,y1,y2,z1,z2)" int no multiple
-option "lower" l "Size of the lower crop region (multiple values)" int no multiple
-option "upper" u "Size of the upper crop region (multiple values)" int no multiple
-option "origin" - "Set new origin to zero" flag off
+option "boundingBox" b "Bounding box of the crop region in pixel (in 3D: =x1,x2,y1,y2,z1,z2)" int no multiple
+option "lower" l "Size of the lower crop region (multiple values)" int no multiple
+option "upper" u "Size of the upper crop region (multiple values)" int no multiple
+option "origin" - "Set new origin to zero" flag off
section "AutoCrop with BG value"
-option "BG" - "Background value in input." double default="0" no
+option "BG" - "Background value in input." double default="0" no
section "Crop like another image"
-option "like" - "Crop like this image (must have the same spacing" string no
-option "BGLike" - "Background value in output (if like larger)" double default="0" no
-
-
-
-
+option "like" - "Crop like this image (must have the same spacing" string no
+option "updateOrigin" - "By default, with like image, the output origin is the same than the like image. Set to on the flag to keep the origin." flag off
+option "BGLike" - "Background value in output (if like larger)" double default="0" no
// Check options
if (mArgsInfo.BG_given && mArgsInfo.like_given)
clitkExceptionMacro("Do not use --BG and --like at the same time");
+ if (mArgsInfo.updateOrigin_flag && !mArgsInfo.like_given)
+ clitkExceptionMacro("Use --updateOrigin with --like");
// Prepare output
typename ImageType::Pointer output;
typename ImageType::IndexType index = region.GetIndex();
typename ImageType::PointType origin = output->GetOrigin();
typename ImageType::SpacingType spacing = output->GetSpacing();
- if (!mArgsInfo.BG_given) {
+ if (!mArgsInfo.BG_given && (!mArgsInfo.like_given || mArgsInfo.updateOrigin_flag)) {
if (mArgsInfo.verbose_flag) std::cout << "origin before crop " << origin << std::endl;
input->TransformIndexToPhysicalPoint(index,origin);
if (mArgsInfo.verbose_flag) std::cout << "origin after crop " << origin << std::endl;
#include <gdcmFile.h>
#include <vtkVersion.h>
#include <vtkImageChangeInformation.h>
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
#include <gdcmImageHelper.h>
#include <gdcmAttribute.h>
#include <gdcmReader.h>
std::map< int, std::vector<double> > theorientation;
std::map< int, std::vector<double> > sliceLocations;
std::map< int, std::vector<std::string> > seriesFiles;
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
if (args_info.verbose_flag)
std::cout << "Using GDCM-2.x" << std::endl;
#else
for(unsigned int i=0; i<args_info.inputs_num; i++) {
if (args_info.verbose_flag)
std::cout << "Reading <" << input_files[i] << std::endl;
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
gdcm::Reader hreader;
hreader.SetFileName(input_files[i].c_str());
hreader.Read();
series_numbers.insert(series_number);
theorigin[series_number] = gdcm::ImageHelper::GetOriginValue(hreader.GetFile());
theorientation[series_number] = gdcm::ImageHelper::GetDirectionCosinesValue(hreader.GetFile());
- if (args_info.extract_series_flag) {
+ if (args_info.patientSystem_flag) {
double n1 = theorientation[series_number][1]*theorientation[series_number][5]-
theorientation[series_number][2]*theorientation[series_number][4];
double n2 = theorientation[series_number][3]*theorientation[series_number][2]-
}
vvImageWriter::Pointer writer = vvImageWriter::New();
writer->SetInput(image);
- if (args_info.extract_series_flag && !image->GetTransform().empty())
+ if (args_info.patientSystem_flag && !image->GetTransform().empty())
writer->SetSaveTransform(true);
writer->SetOutputFileName(outfile);
writer->Update();
// itk (gdcm) include
#include "gdcmFile.h"
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
#include "gdcmReader.h"
#include "gdcmPrinter.h"
#include "gdcmDict.h"
if (args_info.inputs_num == 0) return 0;
// Study ID
- #if GDCM_MAJOR_VERSION == 2
+ #if GDCM_MAJOR_VERSION >= 2
if (args_info.studyID_flag) {
std::set<std::string> l;
for(unsigned int i=0; i<args_info.inputs_num; i++) {
if (!args_info.studyID_flag)
for(unsigned int i=0; i<args_info.inputs_num; i++) {
if (args_info.filename_flag) std::cout << args_info.inputs[i] << std::endl;
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
gdcm::Reader reader;
reader.SetFileName(args_info.inputs[i]);
reader.Read();
--- /dev/null
+/*=========================================================================
+ Program: vv http://www.creatis.insa-lyon.fr/rio/vv
+
+ Authors belong to:
+ - University of LYON http://www.universite-lyon.fr/
+ - Léon Bérard cancer center http://www.centreleonberard.fr
+ - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the copyright notices for more information.
+
+ It is distributed under dual licence
+
+ - BSD See included LICENSE.txt file
+ - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+===========================================================================**/
+
+// clitk
+#include "clitkExtrude_ggo.h"
+#include "clitkExtrudeGenericFilter.h"
+
+//--------------------------------------------------------------------
+int main(int argc, char * argv[])
+{
+
+ // Init command line
+ GGO(clitkExtrude, args_info);
+ CLITK_INIT;
+
+ // Filter
+ typedef clitk::ExtrudeGenericFilter<args_info_clitkExtrude> FilterType;
+ FilterType::Pointer filter = FilterType::New();
+
+ filter->SetArgsInfo(args_info);
+ try {
+ filter->Update();
+ } catch(std::runtime_error e) {
+ std::cout << e.what() << std::endl;
+ }
+
+ return EXIT_SUCCESS;
+}// end main
+
+//--------------------------------------------------------------------
--- /dev/null
+#File clitkExtrude.ggo
+package "clitkExtrude"
+version "1.0"
+purpose "Extrude an image i along the last+1 dimension repeating the image N times. So the output has 1 dimension more than the input."
+
+option "config" - "Config file" string optional
+option "verbose" v "Verbose" flag off
+
+option "input" i "Input image filename" string required
+option "output" o "Output image filename" string required
+option "size" N "Size in pixel of extrusion" int no default="1"
+option "spacing" s "Spacing of the new dimension" double no default="1.0"
+option "origin" - "Origin of the new dimension" double no default="0.0"
+option "like" l "Size, spacing and origin like this image" string no
--- /dev/null
+/*=========================================================================
+ Program: vv http://www.creatis.insa-lyon.fr/rio/vv
+
+ Authors belong to:
+ - University of LYON http://www.universite-lyon.fr/
+ - Léon Bérard cancer center http://www.centreleonberard.fr
+ - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the copyright notices for more information.
+
+ It is distributed under dual licence
+
+ - BSD See included LICENSE.txt file
+ - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+===========================================================================**/
+#ifndef clitkExtrudeGenericFilter_h
+#define clitkExtrudeGenericFilter_h
+#include "clitkIO.h"
+#include "clitkImageToImageGenericFilter.h"
+
+//--------------------------------------------------------------------
+namespace clitk
+{
+
+template<class args_info_type>
+class ITK_EXPORT ExtrudeGenericFilter:
+ public ImageToImageGenericFilter<ExtrudeGenericFilter<args_info_type> >
+{
+
+public:
+
+ //--------------------------------------------------------------------
+ ExtrudeGenericFilter();
+
+ //--------------------------------------------------------------------
+ typedef ExtrudeGenericFilter Self;
+ typedef itk::SmartPointer<Self> Pointer;
+ typedef itk::SmartPointer<const Self> ConstPointer;
+
+ //--------------------------------------------------------------------
+ // Method for creation through the object factory
+ // and Run-time type information (and related methods)
+ itkNewMacro(Self);
+ itkTypeMacro(ExtrudeGenericFilter, LightObject);
+
+ //--------------------------------------------------------------------
+ void SetArgsInfo(const args_info_type & a);
+
+ //--------------------------------------------------------------------
+ // Main function called each time the filter is updated
+ template<class InputImageType>
+ void UpdateWithInputImageType();
+
+protected:
+ template<unsigned int Dim> void InitializeImageType();
+ args_info_type mArgsInfo;
+
+}; // end class
+//--------------------------------------------------------------------
+
+} // end namespace clitk
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include "clitkExtrudeGenericFilter.txx"
+#endif
+
+#endif // #define clitkExtrudeGenericFilter_h
--- /dev/null
+/*=========================================================================
+ Program: vv http://www.creatis.insa-lyon.fr/rio/vv
+
+ Authors belong to:
+ - University of LYON http://www.universite-lyon.fr/
+ - Léon Bérard cancer center http://www.centreleonberard.fr
+ - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the copyright notices for more information.
+
+ It is distributed under dual licence
+
+ - BSD See included LICENSE.txt file
+ - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+===========================================================================**/
+#ifndef clitkExtrudeGenericFilter_txx
+#define clitkExtrudeGenericFilter_txx
+
+// itk include
+#include <itkImageFileReader.h>
+#include <clitkCommon.h>
+
+namespace clitk
+{
+
+//--------------------------------------------------------------------
+template<class args_info_type>
+ExtrudeGenericFilter<args_info_type>::ExtrudeGenericFilter():
+ ImageToImageGenericFilter<Self>("Extrude")
+{
+ InitializeImageType<2>();
+ InitializeImageType<3>();
+}
+//--------------------------------------------------------------------
+
+
+//--------------------------------------------------------------------
+template<class args_info_type>
+template<unsigned int Dim>
+void ExtrudeGenericFilter<args_info_type>::InitializeImageType()
+{
+ ADD_DEFAULT_IMAGE_TYPES(Dim);
+}
+//--------------------------------------------------------------------
+
+
+//--------------------------------------------------------------------
+template<class args_info_type>
+void ExtrudeGenericFilter<args_info_type>::SetArgsInfo(const args_info_type & a)
+{
+ mArgsInfo=a;
+ this->SetIOVerbose(mArgsInfo.verbose_flag);
+
+ if (mArgsInfo.input_given) {
+ this->SetInputFilename(mArgsInfo.input_arg);
+ }
+ if (mArgsInfo.output_given) {
+ this->SetOutputFilename(mArgsInfo.output_arg);
+ }
+}
+//--------------------------------------------------------------------
+
+//--------------------------------------------------------------------
+// Update with the number of dimensions and the pixeltype
+//--------------------------------------------------------------------
+template<class args_info_type>
+template<class InputImageType>
+void
+ExtrudeGenericFilter<args_info_type>::UpdateWithInputImageType()
+{
+
+ // Reading input
+ typename InputImageType::Pointer input = this->template GetInput<InputImageType>(0);
+
+ // Main filter
+ typedef typename InputImageType::PixelType PixelType;
+ const int Dim = InputImageType::ImageDimension;
+ typedef itk::Image<PixelType,Dim> ImageType;
+ typedef itk::Image<PixelType,Dim+1> OutputImageType;
+
+ //Create the output
+ typename OutputImageType::IndexType start;
+ typename OutputImageType::SizeType size;
+ typename OutputImageType::PointType origin;
+ typename OutputImageType::SpacingType spacing;
+ typename OutputImageType::DirectionType direction;
+ typename OutputImageType::Pointer output = OutputImageType::New();
+
+ start.Fill(0);
+
+ //Check if like is given and not size, origin and spacing
+ int extrusionSize(1);
+ double extrusionOrigin(0.0), extrusionSpacing(1.0);
+
+ if (mArgsInfo.like_given) {
+ if (mArgsInfo.size_given || mArgsInfo.spacing_given || mArgsInfo.origin_given) {
+ std::cerr << "You cannot set --like and --size, --origin or --spacing at the same time" << std::endl;
+ return;
+ }
+
+ // Read the input like image
+ typedef itk::ImageFileReader<OutputImageType> LikeReaderType;
+ typename LikeReaderType::Pointer reader = LikeReaderType::New();
+ reader->SetFileName(mArgsInfo.like_arg);
+ reader->Update();
+ typename OutputImageType::Pointer likeImage = reader->GetOutput();
+
+ extrusionSize = likeImage->GetLargestPossibleRegion().GetSize()[Dim];
+ extrusionSpacing = likeImage->GetSpacing()[Dim];
+ extrusionOrigin = likeImage->GetOrigin()[Dim];
+ } else {
+ if (mArgsInfo.size_given) {
+ if (mArgsInfo.size_arg > 0)
+ extrusionSize = mArgsInfo.size_arg;
+ else {
+ std::cerr << "The size has to be > 0" << std::endl;
+ return;
+ }
+ }
+ if (mArgsInfo.origin_given) {
+ extrusionOrigin = mArgsInfo.origin_arg;
+ }
+ if (mArgsInfo.spacing_given) {
+ if (mArgsInfo.spacing_arg > 0)
+ extrusionSpacing = mArgsInfo.spacing_arg;
+ else {
+ std::cerr << "The spacing has to be > 0" << std::endl;
+ return;
+ }
+ }
+ }
+
+ for (unsigned int i=0; i<Dim; ++i)
+ size[i] = input->GetLargestPossibleRegion().GetSize()[i];
+ size[Dim] = extrusionSize;
+
+ for (unsigned int i=0; i<Dim; ++i)
+ origin[i] = input->GetOrigin()[i];
+ if (mArgsInfo.origin_given)
+ origin[Dim] = mArgsInfo.origin_arg;
+ else
+ origin[Dim] = 0;
+
+ for (unsigned int i=0; i<Dim; ++i)
+ spacing[i] = input->GetSpacing()[i];
+ if (mArgsInfo.spacing_given)
+ spacing[Dim] = mArgsInfo.spacing_arg;
+ else
+ spacing[Dim] = 1;
+
+ for (unsigned int i=0; i<Dim; ++i) {
+ for (unsigned int j=0; j<Dim; ++j)
+ direction[i][j] = input->GetDirection()[i][j];
+ direction[i][Dim] = 0;
+ }
+ for (unsigned int i=0; i<Dim; ++i)
+ direction[Dim][i] = 0;
+ direction[Dim][Dim] = 1;
+
+ typename OutputImageType::RegionType region(start, size);
+ output->SetRegions(region);
+ output->Allocate();
+ output->FillBuffer(0);
+ output->SetOrigin(origin);
+ output->SetSpacing(spacing);
+ output->SetDirection(direction);
+
+ itk::ImageRegionIteratorWithIndex<InputImageType> inputIterator(input, input->GetLargestPossibleRegion());
+ while(!inputIterator.IsAtEnd()) {
+ typename OutputImageType::IndexType pixelIndex;
+ for (unsigned int i=0; i<Dim; ++i)
+ pixelIndex[i] = inputIterator.GetIndex()[i];
+ for (unsigned int i=0; i<extrusionSize; ++i) {
+ pixelIndex[Dim] = i;
+ output->SetPixel(pixelIndex, inputIterator.Get());
+ }
+ ++inputIterator;
+ }
+
+ this->template SetNextOutput<OutputImageType>(output);
+
+}
+//--------------------------------------------------------------------
+
+
+}//end clitk
+
+#endif //#define clitkExtrudeGenericFilter_txx
GateSimulation2DicomGenericFilter<args_info_type>::UpdateWithDimAndPixelType()
{
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
// ImageTypes
typedef itk::Image<PixelType, Dimension> InputImageType;
typedef itk::Image<PixelType, Dimension> OutputImageType;
Image2DicomDoseGenericFilter<args_info_type>::UpdateWithDimAndPixelType()
{
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
// ImageTypes
typedef itk::Image<PixelType, Dimension> InputImageType;
typedef unsigned short int OutputPixelType;
filter->SetInput(input);
filter->SetVerbose(m_Verbose);
- if (m_ArgsInfo.threads_given) filter->SetNumberOfThreads(m_ArgsInfo.threads_arg);
+ if (m_ArgsInfo.threads_given) {
+#if ITK_VERSION_MAJOR <= 4
+ filter->SetNumberOfThreads(m_ArgsInfo.threads_arg);
+#else
+ filter->SetNumberOfWorkUnits(m_ArgsInfo.threads_arg);
+#endif
+ }
if (m_ArgsInfo.pad_given) {
PixelType pad;
if (m_ArgsInfo.pad_given != (pad.GetNumberOfComponents()) )
}
filter->SetVerbose(m_Verbose);
- if (m_ArgsInfo.threads_given) filter->SetNumberOfThreads(m_ArgsInfo.threads_arg);
+ if (m_ArgsInfo.threads_given) {
+#if ITK_VERSION_MAJOR <= 4
+ filter->SetNumberOfThreads(m_ArgsInfo.threads_arg);
+#else
+ filter->SetNumberOfWorkUnits(m_ArgsInfo.threads_arg);
+#endif
+ }
if (m_ArgsInfo.pad_given) {
PixelType pad;
if (m_ArgsInfo.pad_given != (pad.GetNumberOfComponents()) )
PartitionEnergyWindowDicomGenericFilter<args_info_type>::UpdateWithDimAndPixelType()
{
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
// ImageTypes
typedef itk::Image<PixelType, Dimension> InputImageType;
typedef itk::Image<PixelType, Dimension> OutputImageType;
--- /dev/null
+/*=========================================================================SUVP
+ Program: vv http://www.creatis.insa-lyon.fr/rio/vv
+
+ Authors belong to:
+ - University of LYON http://www.universite-lyon.fr/
+ - Léon Bérard cancer center http://www.centreleonberard.fr
+ - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the copyright notices for more information.
+
+ It is distributed under dual licence
+
+ - BSD See included LICENSE.txt file
+ - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+===========================================================================**/
+#ifndef CLITKRTSTRUCTSTATISTICS_CXX
+#define CLITKRTSTRUCTSTATISTICS_CXX
+
+// clitk include
+#include "clitkRTStructStatistics_ggo.h"
+#include "clitkRTStructStatisticsGenericFilter.h"
+#include "clitkIO.h"
+
+//--------------------------------------------------------------------
+int main(int argc, char * argv[])
+{
+
+ // Init command line
+ GGO(clitkRTStructStatistics, args_info);
+ CLITK_INIT;
+
+ // Creation of a generic filter
+ typedef clitk::RTStructStatisticsGenericFilter<args_info_clitkRTStructStatistics> FilterType;
+ FilterType::Pointer filter = FilterType::New();
+
+ // Go !
+ filter->SetArgsInfo(args_info);
+ CLITK_TRY_CATCH_EXIT(filter->Update());
+
+ // this is the end my friend
+ return EXIT_SUCCESS;
+} // end main
+
+#endif //define CLITKRTSTRUCTSTATISTICS_CXX
--- /dev/null
+#File clitkRTStructStatistics.ggo
+package "clitkRTStructStatistics"
+version "2.0"
+purpose "Find the centroid (in mm) and roundness of a binarized image."
+
+option "config" - "Config file" string no
+option "verbose" v "Verbose" flag off
+
+option "input" i "Input image filename (mask)" string yes
--- /dev/null
+/*=========================================================================
+ Program: vv http://www.creatis.insa-lyon.fr/rio/vv
+
+ Authors belong to:
+ - University of LYON http://www.universite-lyon.fr/
+ - Léon Bérard cancer center http://www.centreleonberard.fr
+ - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the copyright notices for more information.
+
+ It is distributed under dual licence
+
+ - BSD See included LICENSE.txt file
+ - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+===========================================================================**/
+#ifndef CLITKRTSTRUCTSTATISTICSGENERICFILTER_CXX
+#define CLITKRTSTRUCTSTATISTICSGENERICFILTER_CXX
+
+#include "clitkRTStructStatisticsGenericFilter.h"
+
+namespace clitk {
+ // Specialisation
+// template<>
+// class RTStructStatisticsGenericFilter<args_info_clitkC>;
+
+
+}
+
+#endif //define CLITKRTSTRUCTSTATISTICSGENERICFILTER_CXX
--- /dev/null
+/*=========================================================================
+ Program: vv http://www.creatis.insa-lyon.fr/rio/vv
+
+ Authors belong to:
+ - University of LYON http://www.universite-lyon.fr/
+ - Léon Bérard cancer center http://www.centreleonberard.fr
+ - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the copyright notices for more information.
+
+ It is distributed under dual licence
+
+ - BSD See included LICENSE.txt file
+ - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+===========================================================================**/
+#ifndef CLITKRTSTRUCTSTATISTICSGENERICFILTER_H
+#define CLITKRTSTRUCTSTATISTICSGENERICFILTER_H
+/**
+ -------------------------------------------------------------------
+ * @file clitkRTStructStatisticsGenericFilter.h
+ * @author Thomas Baudier <thomas.baudier@creatis.insa-lyon.fr>
+ * @date 11 Jul 2016 08:37:53
+
+ * @brief
+ -------------------------------------------------------------------*/
+
+// clitk include
+#include "clitkCommon.h"
+#include "clitkImageToImageGenericFilter.h"
+#include "clitkRTStructStatistics_ggo.h"
+
+// itk include
+#include "itkImage.h"
+#include "itkImageIOBase.h"
+
+//--------------------------------------------------------------------
+namespace clitk {
+
+ template<class args_info_type>
+ class ITK_EXPORT RTStructStatisticsGenericFilter:
+ public clitk::ImageToImageGenericFilter<RTStructStatisticsGenericFilter<args_info_type> > {
+
+ public:
+
+ // Constructor
+ RTStructStatisticsGenericFilter ();
+
+ // Types
+ typedef RTStructStatisticsGenericFilter Self;
+ typedef ImageToImageGenericFilterBase Superclass;
+ typedef itk::SmartPointer<Self> Pointer;
+ typedef itk::SmartPointer<const Self> ConstPointer;
+
+ // New
+ itkNewMacro(Self);
+
+
+
+ //--------------------------------------------------------------------
+ void SetArgsInfo(const args_info_type & a);
+
+ //--------------------------------------------------------------------
+ // Main function called each time the filter is updated
+ template<class InputImageType>
+ void UpdateWithInputImageType();
+
+ protected:
+ template<unsigned int Dim> void InitializeImageType();
+ args_info_type mArgsInfo;
+
+ }; // end class RTStructStatisticsGenericFilter
+
+} // end namespace
+//--------------------------------------------------------------------
+
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include "clitkRTStructStatisticsGenericFilter.txx"
+#endif
+
+#endif //#define CLITKRTSTRUCTSTATISTICSGENERICFILTER_H
+
--- /dev/null
+/*=========================================================================
+ Program: vv http://www.creatis.insa-lyon.fr/rio/vv
+
+ Authors belong to:
+ - University of LYON http://www.universite-lyon.fr/
+ - Léon Bérard cancer center http://www.centreleonberard.fr
+ - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the copyright notices for more information.
+
+ It is distributed under dual licence
+
+ - BSD See included LICENSE.txt file
+ - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+===========================================================================**/
+#ifndef CLITKRTSTRUCTSTATISTICSGENERICFILTER_TXX
+#define CLITKRTSTRUCTSTATISTICSGENERICFILTER_TXX
+
+#include "clitkImageCommon.h"
+
+#include "itkConnectedComponentImageFilter.h"
+#include "itkLabelImageToShapeLabelMapFilter.h"
+
+namespace clitk
+{
+
+//--------------------------------------------------------------------
+template<class args_info_type>
+RTStructStatisticsGenericFilter<args_info_type>::RTStructStatisticsGenericFilter()
+ :ImageToImageGenericFilter<Self>("RTStructStatisticsGenericFilter")
+{
+ InitializeImageType<2>();
+ InitializeImageType<3>();
+ InitializeImageType<4>();
+}
+//--------------------------------------------------------------------
+
+
+//--------------------------------------------------------------------
+template<class args_info_type>
+template<unsigned int Dim>
+void RTStructStatisticsGenericFilter<args_info_type>::InitializeImageType()
+{
+ ADD_DEFAULT_IMAGE_TYPES(Dim);
+}
+//--------------------------------------------------------------------
+
+
+//--------------------------------------------------------------------
+template<class args_info_type>
+void RTStructStatisticsGenericFilter<args_info_type>::SetArgsInfo(const args_info_type & a)
+{
+ mArgsInfo=a;
+
+ // Set value
+ this->SetIOVerbose(mArgsInfo.verbose_flag);
+
+ if (mArgsInfo.input_given) this->AddInputFilename(mArgsInfo.input_arg);
+
+ }
+//--------------------------------------------------------------------
+
+
+//--------------------------------------------------------------------
+template<class args_info_type>
+template<class ImageType>
+void RTStructStatisticsGenericFilter<args_info_type>::UpdateWithInputImageType()
+{
+ // Read mask input
+ typedef itk::Image<unsigned char, ImageType::ImageDimension> MaskInputImageType;
+ typename MaskInputImageType::Pointer mask;
+ mask = this->template GetInput<MaskInputImageType>(0);
+
+ //Create the Shape Label Map from the mask
+ typedef itk::Image< unsigned char, ImageType::ImageDimension > OutputImageType;
+ typedef itk::ShapeLabelObject< unsigned char, ImageType::ImageDimension > ShapeLabelObjectType;
+ typedef itk::LabelMap< ShapeLabelObjectType > LabelMapType;
+ typedef itk::ConnectedComponentImageFilter <MaskInputImageType, OutputImageType > ConnectedComponentImageFilterType;
+ typedef itk::LabelImageToShapeLabelMapFilter< OutputImageType, LabelMapType> I2LType;
+
+ typename ConnectedComponentImageFilterType::Pointer connected = ConnectedComponentImageFilterType::New ();
+ connected->SetInput(mask);
+ connected->FullyConnectedOn();
+ connected->Update();
+
+ //Create a map to contain all connectedComponent (even a little pixel)
+ typename I2LType::Pointer i2l = I2LType::New();
+ i2l->SetInput( connected->GetOutput() );
+ i2l->SetComputePerimeter(true);
+ i2l->Update();
+
+ // Retrieve the biggest component
+ LabelMapType *labelMap = i2l->GetOutput();
+ int largestComponent(0);
+ int nbPixel(0);
+ for (unsigned int n = 0; n < labelMap->GetNumberOfLabelObjects(); ++n)
+ {
+ ShapeLabelObjectType *labelObject = labelMap->GetNthLabelObject(n);
+ if (labelObject->GetNumberOfPixels() > nbPixel)
+ {
+ nbPixel = labelObject->GetNumberOfPixels();
+ largestComponent = n;
+ }
+ }
+
+ //Write statitistics on the largest component
+ ShapeLabelObjectType *labelObject = labelMap->GetNthLabelObject(largestComponent);
+ std::cout << " Centroid position (mm): " << std::endl;
+ std::cout << labelObject->GetCentroid()[0] << std::endl;
+ std::cout << labelObject->GetCentroid()[1] << std::endl;
+ std::cout << labelObject->GetCentroid()[2] << std::endl;
+ std::cout << " Roundness: " << std::endl;
+ std::cout << labelObject->GetRoundness() << std::endl;
+
+}
+//--------------------------------------------------------------------
+
+
+
+} // end namespace
+
+#endif //#define CLITKRTSTRUCTSTATISTICSGENERICFILTER_TXX
--- /dev/null
+/*=========================================================================
+ Program: vv http://www.creatis.insa-lyon.fr/rio/vv
+
+ Authors belong to:
+ - University of LYON http://www.universite-lyon.fr/
+ - Léon Bérard cancer center http://www.centreleonberard.fr
+ - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the copyright notices for more information.
+
+ It is distributed under dual licence
+
+ - BSD See included LICENSE.txt file
+ - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+===========================================================================**/
+#ifndef CLITKSUVPEAK_CXX
+#define CLITKSUVPEAK_CXX
+
+// clitk include
+#include "clitkSUVPeak_ggo.h"
+#include "clitkSUVPeakGenericFilter.h"
+#include "clitkIO.h"
+
+//--------------------------------------------------------------------
+int main(int argc, char * argv[])
+{
+
+ // Init command line
+ GGO(clitkSUVPeak, args_info);
+ CLITK_INIT;
+
+ // Creation of a generic filter
+ typedef clitk::SUVPeakGenericFilter<args_info_clitkSUVPeak> FilterType;
+ FilterType::Pointer filter = FilterType::New();
+
+ // Go !
+ filter->SetArgsInfo(args_info);
+ CLITK_TRY_CATCH_EXIT(filter->Update());
+
+ // this is the end my friend
+ return EXIT_SUCCESS;
+} // end main
+
+#endif //define CLITKSUVPEAK_CXX
--- /dev/null
+#File clitkSUVPeak.ggo
+package "clitkSUVPeak"
+version "2.0"
+purpose "This tool Compute the SUV Peak.
+The output is the position of the SUV Peak (in mm) and its value.
+The filter use a normalized sphere of 1 cc with 1 for voxel inside, 0 for outside.
+And for voxels that intercepted the sphere, it computes the intersection volume using Monte Carlo simulation."
+
+option "config" - "Config file" string no
+option "verbose" v "Verbose" flag off
+
+option "input" i "Input first image filename" string yes
+option "mask" m "Mask image filename (uchar)" string no
+option "allow_resize" r "Resize mask if different from input" flag off
+option "volume" - "Volume of the filter in cc" double default="1" no
--- /dev/null
+/*=========================================================================
+ Program: vv http://www.creatis.insa-lyon.fr/rio/vv
+
+ Authors belong to:
+ - University of LYON http://www.universite-lyon.fr/
+ - Léon Bérard cancer center http://www.centreleonberard.fr
+ - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the copyright notices for more information.
+
+ It is distributed under dual licence
+
+ - BSD See included LICENSE.txt file
+ - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+===========================================================================**/
+#ifndef CLITKSUVPEAKGENERICFILTER_CXX
+#define CLITKSUVPEAKGENERICFILTER_CXX
+
+#include "clitkSUVPeakGenericFilter.h"
+
+namespace clitk {
+ // Specialisation
+// template<>
+// class SUVPeakGenericFilter<args_info_clitkSUVPeak>;
+
+
+}
+
+#endif //define CLITKSUVPEAKGENERICFILTER_CXX
--- /dev/null
+/*=========================================================================
+ Program: vv http://www.creatis.insa-lyon.fr/rio/vv
+
+ Authors belong to:
+ - University of LYON http://www.universite-lyon.fr/
+ - Léon Bérard cancer center http://www.centreleonberard.fr
+ - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the copyright notices for more information.
+
+ It is distributed under dual licence
+
+ - BSD See included LICENSE.txt file
+ - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+===========================================================================**/
+#ifndef CLITKSUVPEAKGENERICFILTER_H
+#define CLITKSUVPEAKGENERICFILTER_H
+/**
+ -------------------------------------------------------------------
+ * @file clitkSUVPeakGenericFilter.h
+ * @author David Sarrut <David.Sarrut@creatis.insa-lyon.fr>
+ * @date 23 Feb 2008 08:37:53
+
+ * @brief
+ -------------------------------------------------------------------*/
+
+// clitk include
+#include "clitkCommon.h"
+#include "clitkImageToImageGenericFilter.h"
+#include "clitkSUVPeak_ggo.h"
+
+// itk include
+#include "itkImage.h"
+#include "itkImageIOBase.h"
+#include "itkImageRegionIterator.h"
+#include "itkImageRegionConstIterator.h"
+
+//--------------------------------------------------------------------
+namespace clitk {
+
+ template<class args_info_type>
+ class ITK_EXPORT SUVPeakGenericFilter:
+ public clitk::ImageToImageGenericFilter<SUVPeakGenericFilter<args_info_type> > {
+
+ public:
+
+ // Constructor
+ SUVPeakGenericFilter ();
+
+ // Types
+ typedef SUVPeakGenericFilter Self;
+ typedef ImageToImageGenericFilterBase Superclass;
+ typedef itk::SmartPointer<Self> Pointer;
+ typedef itk::SmartPointer<const Self> ConstPointer;
+
+ // New
+ itkNewMacro(Self);
+
+
+
+ //--------------------------------------------------------------------
+ void SetArgsInfo(const args_info_type & a);
+
+ //SUVPeak
+ template<class ImageType> typename ImageType::Pointer ComputeMeanFilterKernel(const typename ImageType::SpacingType & spacing, double radius);
+
+ //--------------------------------------------------------------------
+ // Main function called each time the filter is updated
+ template<class InputImageType>
+ void UpdateWithInputImageType();
+
+ protected:
+ template<unsigned int Dim> void InitializeImageType();
+ args_info_type mArgsInfo;
+
+ }; // end class SUVPeakGenericFilter
+
+} // end namespace
+//--------------------------------------------------------------------
+
+
+#ifndef ITK_MANUAL_INSTANTIATION
+#include "clitkSUVPeakGenericFilter.txx"
+#endif
+
+#endif //#define CLITKSUVPEAKGENERICFILTER_H
+
--- /dev/null
+/*=========================================================================
+ Program: vv http://www.creatis.insa-lyon.fr/rio/vv
+
+ Authors belong to:
+ - University of LYON http://www.universite-lyon.fr/
+ - Léon Bérard cancer center http://www.centreleonberard.fr
+ - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the copyright notices for more information.
+
+ It is distributed under dual licence
+
+ - BSD See included LICENSE.txt file
+ - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+===========================================================================**/
+#ifndef CLITKSUVPEAKGENERICFILTER_TXX
+#define CLITKSUVPEAKGENERICFILTER_TXX
+
+#include "clitkImageCommon.h"
+#include "clitkCropLikeImageFilter.h"
+#include "clitkResampleImageWithOptionsFilter.h"
+
+#include <itkConvolutionImageFilter.h>
+
+namespace clitk
+{
+
+//--------------------------------------------------------------------
+template<class args_info_type>
+SUVPeakGenericFilter<args_info_type>::SUVPeakGenericFilter()
+ :ImageToImageGenericFilter<Self>("SUVPeakGenericFilter")
+{
+ InitializeImageType<2>();
+ InitializeImageType<3>();
+ InitializeImageType<4>();
+}
+//--------------------------------------------------------------------
+
+
+//--------------------------------------------------------------------
+template<class args_info_type>
+template<unsigned int Dim>
+void SUVPeakGenericFilter<args_info_type>::InitializeImageType()
+{
+ ADD_DEFAULT_IMAGE_TYPES(Dim);
+}
+//--------------------------------------------------------------------
+
+
+//--------------------------------------------------------------------
+template<class args_info_type>
+void SUVPeakGenericFilter<args_info_type>::SetArgsInfo(const args_info_type & a)
+{
+ mArgsInfo=a;
+
+ // Set value
+ this->SetIOVerbose(mArgsInfo.verbose_flag);
+
+ if (mArgsInfo.input_given) this->AddInputFilename(mArgsInfo.input_arg);
+
+ if (mArgsInfo.mask_given) this->AddInputFilename(mArgsInfo.mask_arg);
+ }
+//--------------------------------------------------------------------
+
+
+//--------------------------------------------------------------------
+template<class args_info_type>
+template<class ImageType>
+void SUVPeakGenericFilter<args_info_type>::UpdateWithInputImageType()
+{
+ // Read input
+ typename ImageType::Pointer input = this->template GetInput<ImageType>(0);
+
+ //Read mask
+ typedef itk::Image<unsigned char, ImageType::ImageDimension> MaskImageType;
+ typename MaskImageType::Pointer mask;
+ if(mArgsInfo.mask_given) {
+ mask = this->template GetInput<MaskImageType>(1);
+ // Check mask sampling/size
+ if (!HaveSameSizeAndSpacing<MaskImageType, ImageType>(mask, input)) {
+ if (mArgsInfo.allow_resize_flag) {
+ if (mArgsInfo.verbose_flag) {
+ std::cout << "Resize mask image like input" << std::endl;
+ }
+ typedef clitk::ResampleImageWithOptionsFilter<MaskImageType> ResamplerType;
+ typename ResamplerType::Pointer resampler = ResamplerType::New();
+ resampler->SetInput(mask); //By default the interpolation in NN, Ok for mask
+ resampler->SetOutputSpacing(input->GetSpacing());
+ resampler->SetOutputOrigin(mask->GetOrigin());
+ resampler->SetGaussianFilteringEnabled(false);
+ resampler->Update();
+ mask = resampler->GetOutput();
+
+ typedef clitk::CropLikeImageFilter<MaskImageType> FilterType;
+ typename FilterType::Pointer crop = FilterType::New();
+ crop->SetInput(mask);
+ crop->SetCropLikeImage(input);
+ crop->Update();
+ mask = crop->GetOutput();
+
+ }
+ else {
+ std::cerr << "Mask image has a different size/spacing than input. Abort. (Use option --allow_resize)" << std::endl;
+ exit(-1);
+ }
+ }
+ }
+ else {
+ mask = MaskImageType::New();
+ mask->SetRegions(input->GetLargestPossibleRegion());
+ mask->SetOrigin(input->GetOrigin());
+ mask->SetSpacing(input->GetSpacing());
+ mask->Allocate();
+ mask->FillBuffer(1);
+ }
+
+ double volume = 1000; //1 cc into mc
+ if (mArgsInfo.volume_given)
+ volume *= mArgsInfo.volume_arg;
+ const double PI = 3.141592653589793238463;
+ double radius = std::pow(3*volume/(4*PI),1./3);
+
+ typename ImageType::Pointer kernel = ComputeMeanFilterKernel<ImageType>(input->GetSpacing(), radius);
+
+ // Perform the convolution
+ typedef itk::ConvolutionImageFilter<ImageType> FilterType;
+ typename FilterType::Pointer filter = FilterType::New();
+ filter->SetInput(input);
+ filter->SetKernelImage(kernel);
+ filter->Update();
+ typename ImageType::Pointer output = filter->GetOutput();
+
+
+ typedef itk::ImageRegionConstIteratorWithIndex<ImageType> IteratorType;
+ typedef itk::ImageRegionConstIteratorWithIndex<MaskImageType> MIteratorType;
+ IteratorType iters(output, output->GetLargestPossibleRegion());
+ MIteratorType iterm(mask, mask->GetLargestPossibleRegion());
+ iters.GoToBegin();
+ iterm.GoToBegin();
+ double max = 0.0;
+ typename ImageType::IndexType index;
+ while (!iters.IsAtEnd()) {
+ if (iterm.Get() == 1) { // inside the mask
+ if (iters.Get() > max) {
+ max = iters.Get();
+ index = iters.GetIndex();
+ }
+ }
+ ++iters;
+ ++iterm;
+ }
+ typename ImageType::PointType p;
+ output->TransformIndexToPhysicalPoint(index, p);
+ std::cout<<"SUV Peak found in "<< p << " mm with the value " << max << std::endl;
+}
+//--------------------------------------------------------------------
+
+
+//--------------------------------------------------------------------
+template<class args_info_type>
+template<class ImageType>
+typename ImageType::Pointer
+SUVPeakGenericFilter<args_info_type>::ComputeMeanFilterKernel(const typename ImageType::SpacingType & spacing, double radius)
+{
+ // Some kind of cache to speed up a bit
+ static std::map<double, typename ImageType::Pointer> cache;
+ if (cache.find(radius) != cache.end()) {
+ return cache.find(radius)->second;
+ }
+
+ // Compute a kernel that corresponds to a sphere with 1 inside, 0
+ // outside and in between proportional to the intersection between
+ // the pixel and the sphere. Computed by Monte-Carlo because I don't
+ // know an equation that compute the intersection volume between a
+ // box and a sphere ...
+ //auto kernel = ImageType::New();
+ typename ImageType::Pointer kernel = ImageType::New();
+
+ // Size of the kernel in pixel (minimum 3 pixels)
+ typename ImageType::SizeType size;
+ size[0] = std::max((int)ceil(radius*2/spacing[0]), 3);
+ size[1] = std::max((int)ceil(radius*2/spacing[1]), 3);
+ size[2] = std::max((int)ceil(radius*2/spacing[2]), 3);
+
+ // Compute the region, such as the origin is at the center
+ typename ImageType::IndexType start;
+ start.Fill(0);
+ typename ImageType::RegionType region;
+ region.SetSize(size);
+ region.SetIndex(start);
+ kernel->SetRegions(region);
+ kernel->SetSpacing(spacing);
+ typename ImageType::PointType origin;
+ origin[0] = -(double)size[0]/2.0*spacing[0]+spacing[0]/2.0;
+ origin[1] = -(double)size[1]/2.0*spacing[1]+spacing[1]/2.0;
+ origin[2] = -(double)size[2]/2.0*spacing[2]+spacing[2]/2.0;
+ kernel->SetOrigin(origin);
+ kernel->Allocate();
+
+ // Fill the kernel
+ itk::ImageRegionIteratorWithIndex<ImageType> iter(kernel, region);
+ typename ImageType::PointType center;
+ center.Fill(0.0);
+ typename ImageType::PointType hh; // half a voxel
+ hh[0] = spacing[0]/2.0;
+ hh[1] = spacing[1]/2.0;
+ hh[2] = spacing[2]/2.0;
+ double h = hh.EuclideanDistanceTo(center); // distance of half a pixel to its center.
+ std::srand(time(NULL));
+ double sum = 0.0;
+ while (!iter.IsAtEnd()) {
+ typename ImageType::IndexType index = iter.GetIndex();
+ typename ImageType::PointType p;
+ kernel->TransformIndexToPhysicalPoint(index, p);
+ double d = p.EuclideanDistanceTo(center) + h;
+ if (d<radius) { // inside the sphere
+ iter.Set(1.0);
+ sum += 1.0;
+ }
+ else { // the box intersect the sphere. We randomly pick point in
+ // the box and compute the probability to be in/out the
+ // sphere
+ int n = 500; // number of samples
+ double w = 0.0;
+ //for(auto i=0; i<n; i++) {
+ for(int i=0; i<n; i++) {
+ // random position inside the current pixel
+ typename ImageType::PointType pos;
+ pos[0] = p[0]+(((double)std::rand()/(double)RAND_MAX)-0.5)*spacing[0];
+ pos[1] = p[1]+(((double)std::rand()/(double)RAND_MAX)-0.5)*spacing[1];
+ pos[2] = p[2]+(((double)std::rand()/(double)RAND_MAX)-0.5)*spacing[2];
+ // distance to center
+ double distance = pos.EuclideanDistanceTo(center);
+ // lower/greater than radius
+ if (distance < radius) w += 1.0;
+ }
+ w = w/(double)n;
+ iter.Set(w);
+ sum += w;
+ }
+ ++iter;
+ }
+
+ // Normalize
+ iter.GoToBegin();
+ while (!iter.IsAtEnd()) {
+ iter.Set(iter.Get()/sum);
+ ++iter;
+ }
+
+ // Put in cache
+ cache[radius] = kernel;
+
+ return kernel;
+}
+//--------------------------------------------------------------------
+
+} // end namespace
+
+#endif //#define CLITKSUVPEAKGENERICFILTER_TXX
--- /dev/null
+/*=========================================================================
+ Program: vv http://www.creatis.insa-lyon.fr/rio/vv
+
+ Authors belong to:
+ - University of LYON http://www.universite-lyon.fr/
+ - Léon Bérard cancer center http://www.centreleonberard.fr
+ - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the copyright notices for more information.
+
+ It is distributed under dual licence
+
+ - BSD See included LICENSE.txt file
+ - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+===========================================================================**/
+#ifndef CLITKSCINTIVOLSTATS_CXX
+#define CLITKSCINTIVOLSTATS_CXX
+
+// clitk include
+#include "clitkScintivolStats_ggo.h"
+#include "clitkIO.h"
+#include "clitkImageCommon.h"
+#include "clitkCommon.h"
+
+#include "itkImageFileReader.h"
+#include "itkBinaryImageToLabelMapFilter.h"
+#include "itkLabelMapToLabelImageFilter.h"
+#include "itkLabelStatisticsImageFilter.h"
+#include "itkStatisticsImageFilter.h"
+#include "itkExtractImageFilter.h"
+
+#include <iostream>
+
+//-------------------------------------------------------------------=
+int main(int argc, char * argv[])
+{
+
+ // init command line
+ GGO(clitkScintivolStats, args_info);
+ CLITK_INIT;
+
+ typedef itk::Image<double, 3> Input3DType;
+ typedef itk::Image<double, 2> Input2DType;
+ typedef itk::Image<char, 3> Input3DMaskType;
+ typedef itk::Image<char, 2> Input2DMaskType;
+ typedef itk::ImageFileReader<Input3DType> InputReader3DType;
+ typedef itk::ImageFileReader<Input3DMaskType> InputReader3DMaskType;
+ typedef itk::ImageFileReader<Input2DMaskType> InputReader2DMaskType;
+ typedef itk::LabelStatisticsImageFilter<Input3DType, Input3DMaskType> LabelStatistics3DImageFilterType;
+ typedef itk::LabelStatisticsImageFilter<Input2DType, Input2DMaskType> LabelStatistics2DImageFilterType;
+ typedef itk::StatisticsImageFilter<Input2DType> Statistics2DImageFilterType;
+ typedef itk::ExtractImageFilter<Input3DType, Input2DType> ExtractImageFilter;
+
+ //Determine nbAcquisitionDynamic1 and nbAcquisitionDynamic2 (ie. the number of slice in dynamic1 and dynamic2)
+ //Start to open the dynamic1 and dynamic2 and get the 3rd dimension size
+ InputReader3DType::Pointer readerDynamic1 = InputReader3DType::New();
+ readerDynamic1->SetFileName(args_info.dynamic1_arg);
+ readerDynamic1->Update();
+ Input3DType::Pointer dynamic1 = readerDynamic1->GetOutput();
+ int nbAcquisitionDynamic1 = dynamic1->GetLargestPossibleRegion().GetSize()[2];
+
+ InputReader3DType::Pointer readerDynamic2 = InputReader3DType::New();
+ readerDynamic2->SetFileName(args_info.dynamic2_arg);
+ readerDynamic2->Update();
+ Input3DType::Pointer dynamic2 = readerDynamic2->GetOutput();
+ int nbAcquisitionDynamic2 = dynamic2->GetLargestPossibleRegion().GetSize()[2];
+
+ //Open the csv file
+ //If it's scatter or attenuation correction, just append results to the csv file
+ //If not open it normally and write the number of dynamic acquisition for the first and the second images (given by the ggo and from the dicom tag)
+ std::ofstream csvFile;
+ if (args_info.append_flag)
+ csvFile.open (args_info.output_arg, std::ios::app);
+ else {
+ csvFile.open (args_info.output_arg);
+ csvFile << "1;" << nbAcquisitionDynamic1 << ";" << nbAcquisitionDynamic2 << "\n";
+ }
+
+ //Read Tomo image, total and remnant masks
+ InputReader3DType::Pointer readerTomo = InputReader3DType::New();
+ readerTomo->SetFileName(args_info.tomo_arg);
+ readerTomo->Update();
+ Input3DType::Pointer tomo = readerTomo->GetOutput();
+
+ InputReader3DMaskType::Pointer readerTotalLiver = InputReader3DMaskType::New();
+ readerTotalLiver->SetFileName(args_info.totalLiverMask_arg);
+ readerTotalLiver->Update();
+
+ InputReader3DMaskType::Pointer readerRemnantLiver = InputReader3DMaskType::New();
+ readerRemnantLiver->SetFileName(args_info.remnantLiverMask_arg);
+ readerRemnantLiver->Update();
+
+ //Find number of counts in tomo for total Liver and remnant Liver
+ LabelStatistics3DImageFilterType::Pointer labelStatisticsImageFilterTotalLiver = LabelStatistics3DImageFilterType::New();
+ labelStatisticsImageFilterTotalLiver->SetLabelInput(readerTotalLiver->GetOutput());
+ labelStatisticsImageFilterTotalLiver->SetInput(tomo);
+ labelStatisticsImageFilterTotalLiver->Update();
+
+ LabelStatistics3DImageFilterType::Pointer labelStatisticsImageFilterRemnantLiver = LabelStatistics3DImageFilterType::New();
+ labelStatisticsImageFilterRemnantLiver->SetLabelInput(readerRemnantLiver->GetOutput());
+ labelStatisticsImageFilterRemnantLiver->SetInput(tomo);
+ labelStatisticsImageFilterRemnantLiver->Update();
+
+ //Write them in the csv file
+ csvFile << args_info.acquisitionTimeTomo_arg << ";" << labelStatisticsImageFilterTotalLiver->GetSum(1) << ";" << labelStatisticsImageFilterRemnantLiver->GetSum(1) << "\n";
+
+ //Read liver and heart masks for dynamic1
+ InputReader2DMaskType::Pointer readerLiver = InputReader2DMaskType::New();
+ readerLiver->SetFileName(args_info.liverMask_arg);
+ readerLiver->Update();
+
+ InputReader2DMaskType::Pointer readerHeart = InputReader2DMaskType::New();
+ readerHeart->SetFileName(args_info.heartMask_arg);
+ readerHeart->Update();
+
+ for (unsigned int i=0; i<nbAcquisitionDynamic1; ++i) {
+ //Compute time frame in s
+ double timeFrame = args_info.frameDurationDynamic1_arg * i + args_info.frameDurationDynamic1_arg;
+
+ //Extract the Region of interest of the dynamic1
+ ExtractImageFilter::Pointer extractSlice = ExtractImageFilter::New();
+ Input3DType::IndexType start;
+ start[0] = 0;
+ start[1] = 0;
+ start[2] = i;
+ Input3DType::SizeType size;
+ size[0] = dynamic1->GetLargestPossibleRegion().GetSize()[0];
+ size[1] = dynamic1->GetLargestPossibleRegion().GetSize()[1];
+ size[2] = 0;
+ Input3DType::RegionType desiredRegion;
+ desiredRegion.SetSize(size);
+ desiredRegion.SetIndex(start);
+ extractSlice->SetExtractionRegion(desiredRegion);
+ extractSlice->SetInput(dynamic1);
+#if ITK_VERSION_MAJOR >= 4
+ extractSlice->SetDirectionCollapseToIdentity();
+#endif
+ extractSlice->Update();
+
+ //Find number of counts in dynamic1 slice for Liver and heart
+ LabelStatistics2DImageFilterType::Pointer labelStatisticsImageFilterLiver = LabelStatistics2DImageFilterType::New();
+ labelStatisticsImageFilterLiver->SetLabelInput(readerLiver->GetOutput());
+ labelStatisticsImageFilterLiver->SetInput(extractSlice->GetOutput());
+ labelStatisticsImageFilterLiver->SetCoordinateTolerance(0.001);
+ labelStatisticsImageFilterLiver->SetDirectionTolerance(0.001);
+ labelStatisticsImageFilterLiver->Update();
+
+ LabelStatistics2DImageFilterType::Pointer labelStatisticsImageFilterHeart = LabelStatistics2DImageFilterType::New();
+ labelStatisticsImageFilterHeart->SetLabelInput(readerHeart->GetOutput());
+ labelStatisticsImageFilterHeart->SetInput(extractSlice->GetOutput());
+ labelStatisticsImageFilterHeart->SetCoordinateTolerance(0.001);
+ labelStatisticsImageFilterHeart->SetDirectionTolerance(0.001);
+ labelStatisticsImageFilterHeart->Update();
+
+ //Find number of counts in dynamic1 slice
+ Statistics2DImageFilterType::Pointer statisticsImageFilterDynamic1 = Statistics2DImageFilterType::New();
+ statisticsImageFilterDynamic1->SetInput(extractSlice->GetOutput());
+ statisticsImageFilterDynamic1->Update();
+
+ //Write them in the csv file
+ csvFile << timeFrame << ";" << labelStatisticsImageFilterLiver->GetSum(1) << ";" << labelStatisticsImageFilterHeart->GetSum(1) << ";" << statisticsImageFilterDynamic1->GetSum() << "\n";
+ }
+
+ //Read parenchyma mask for dynamic2
+ InputReader2DMaskType::Pointer readerParenchyma = InputReader2DMaskType::New();
+ readerParenchyma->SetFileName(args_info.parenchymaMask_arg);
+ readerParenchyma->Update();
+
+ for (unsigned int i=0; i<nbAcquisitionDynamic2; ++i) {
+ //Compute time frame in s
+ double timeFrame = args_info.frameDurationDynamic2_arg * i + args_info.acquisitionTimeDynamic2_arg + args_info.frameDurationDynamic2_arg;
+
+ //Extract the Region of interest of the dynamic1
+ ExtractImageFilter::Pointer extractSlice = ExtractImageFilter::New();
+ Input3DType::IndexType start;
+ start[0] = 0;
+ start[1] = 0;
+ start[2] = i;
+ Input3DType::SizeType size;
+ size[0] = dynamic2->GetLargestPossibleRegion().GetSize()[0];
+ size[1] = dynamic2->GetLargestPossibleRegion().GetSize()[1];
+ size[2] = 0;
+ Input3DType::RegionType desiredRegion;
+ desiredRegion.SetSize(size);
+ desiredRegion.SetIndex(start);
+ extractSlice->SetExtractionRegion(desiredRegion);
+ extractSlice->SetInput(dynamic2);
+#if ITK_VERSION_MAJOR >= 4
+ extractSlice->SetDirectionCollapseToIdentity();
+#endif
+ extractSlice->Update();
+
+ //Find number of counts in dynamic2 slice for parenchyma
+ LabelStatistics2DImageFilterType::Pointer labelStatisticsImageFilterParenchyma = LabelStatistics2DImageFilterType::New();
+ labelStatisticsImageFilterParenchyma->SetLabelInput(readerParenchyma->GetOutput());
+ labelStatisticsImageFilterParenchyma->SetInput(extractSlice->GetOutput());
+ labelStatisticsImageFilterParenchyma->SetCoordinateTolerance(0.001);
+ labelStatisticsImageFilterParenchyma->SetDirectionTolerance(0.001);
+ labelStatisticsImageFilterParenchyma->Update();
+
+ //Write them in the csv file
+ csvFile << timeFrame << ";" << labelStatisticsImageFilterParenchyma->GetSum(1) << "\n";
+ }
+
+ csvFile.close();
+
+ // this is the end my friend
+ return 0;
+}
+//-------------------------------------------------------------------=
+
+#endif /* end #define CLITKSCINTIVOLSTATS_CXX */
--- /dev/null
+# file clitkScintivolStats.ggo
+package "clitkScintivolStats"
+version "1.0"
+purpose "Convert an image into another image.\n\tAllow to change the file format and/or the pixel type. \n\tKnown file formats 2D: jpeg png bmp tif mhd hdr vox dcm \n\tKnown file formats 3D: mhd vox hdr dcm\n\tKnown file formats 4D: mhd \n\tKnown images: 2D 3D or 4D, schar, uchar, short, ushort, int, float and double\n\nIf the -o option is not given, the last parameter of the command line is used as output."
+
+option "config" - "Config file" string no
+option "output" o "Output .csv filename" string yes
+option "append" - "Append results to .csv file (eg: for scatter)" flag off
+
+option "dynamic1" - "Dynamique 1 filename (geometrical mean)" string yes
+option "frameDurationDynamic1" - "Frame duration for dynamique 1" double yes
+option "heartMask" - "Heart mask filename" string yes
+option "liverMask" - "Liver mask filename" string yes
+
+option "dynamic2" - "Dynamique 2 filename (geometrical mean)" string yes
+option "frameDurationDynamic2" - "Frame duration for dynamique 2" double yes
+option "acquisitionTimeDynamic2" - "Start acquisition time of the dynamic2 after dynamic1" double yes
+option "parenchymaMask" - "Parenchyma mask filename" string yes
+
+option "tomo" - "Tomo image filename" string yes
+option "acquisitionTimeTomo" - "Acquisition time for tomo" double yes
+option "totalLiverMask" - "Total liver mask filename" string yes
+option "remnantLiverMask" - "Remnant liver mask filename" string yes
#Prepare cmake arguments following the ITK version
if [ "$C11" == "true" ]; then
- if [ "$ITK_VERSION" == "4.6" ]; then
- itk_repo_str=" --branch v4.6.0 https://github.com/InsightSoftwareConsortium/ITK.git --depth 1"
- cmake_arg_str=" -DCMAKE_CXX_FLAGS=-std=c++11 -DModule_ITKVtkGlue=ON -DVTK_DIR=$VTK_DIR -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF "
- elif [ "$ITK_VERSION" == "4.9.1" ]; then
- itk_repo_str=" --branch v4.9.1 https://github.com/InsightSoftwareConsortium/ITK.git --depth 1"
- cmake_arg_str=" -DCMAKE_CXX_FLAGS=-std=c++11 -DModule_ITKVtkGlue=ON -DVTK_DIR=$VTK_DIR -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF "
- elif [ "$ITK_VERSION" == "4.13.0" ]; then
- itk_repo_str=" --branch v4.13.0 https://github.com/InsightSoftwareConsortium/ITK.git --depth 1"
- cmake_arg_str=" -DCMAKE_CXX_FLAGS=-std=c++11 -DModule_ITKVtkGlue=ON -DVTK_DIR=$VTK_DIR -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF "
- fi
+ itk_repo_str=" --branch "$ITK_VERSION" https://github.com/InsightSoftwareConsortium/ITK.git --depth 1"
+ cmake_arg_str=" -DCMAKE_CXX_FLAGS=-std=c++11 -DModule_ITKVtkGlue=ON -DVTK_DIR=$VTK_DIR -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF "
else
- if [ "$ITK_VERSION" == "4.6" ]; then
- itk_repo_str=" --branch v4.6.0 https://github.com/InsightSoftwareConsortium/ITK.git --depth 1"
- cmake_arg_str=" -DModule_ITKVtkGlue=ON -DVTK_DIR=$VTK_DIR -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF "
- elif [ "$ITK_VERSION" == "4.9.1" ]; then
- itk_repo_str=" --branch v4.9.1 https://github.com/InsightSoftwareConsortium/ITK.git --depth 1"
- cmake_arg_str=" -DModule_ITKVtkGlue=ON -DVTK_DIR=$VTK_DIR -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF "
- elif [ "$ITK_VERSION" == "4.13.0" ]; then
- itk_repo_str=" --branch v4.13.0 https://github.com/InsightSoftwareConsortium/ITK.git --depth 1"
- cmake_arg_str=" -DModule_ITKVtkGlue=ON -DVTK_DIR=$VTK_DIR -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF "
- fi
+ itk_repo_str=" --branch "$ITK_VERSION" https://github.com/InsightSoftwareConsortium/ITK.git --depth 1"
+ cmake_arg_str=" -DModule_ITKVtkGlue=ON -DVTK_DIR=$VTK_DIR -DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF "
fi
if [ -d $ITK_SOURCE_DIR ]; then
elif [ "$QT_VERSION" == "5.5.1" ]; then
if test $TRAVIS_OS_NAME == linux ; then sudo add-apt-repository --yes ppa:beineri/opt-qt551-trusty; fi
if test $TRAVIS_OS_NAME == linux ; then sudo apt-get update -qq; fi
- if test $TRAVIS_OS_NAME == linux ; then sudo apt-get -y --force-yes install qt55tools; fi
+ if test $TRAVIS_OS_NAME == linux ; then sudo apt-get -y --force-yes install qt55tools qt55x11extras; fi
fi
if test $TRAVIS_OS_NAME == osx ; then brew install qt5; fi
if test $TRAVIS_OS_NAME == osx ; then brew link qt5 --force; fi
#Prepare cmake arguments following the VTK version
if [ "$C11" == "true" ]; then
- if [ "$VTK_VERSION" == "5.10" ]; then
- vtk_repo_str=" --branch v5.10.0 https://github.com/Kitware/VTK.git --depth 1"
+ vtk_repo_str=" --branch "$VTK_VERSION" https://github.com/Kitware/VTK.git --depth 1"
+ if [ "$VTK_VERSION" == "v5.10.0" ]; then
cmake_arg_str=" $cmake_arg_str
-DCMAKE_CXX_FLAGS=-std=c++11
-DBUILD_SHARED_LIBS=1
-DVTK_USE_RENDERING=ON
-DVTK_USE_VIEWS=ON
-DVTK_QT_VERSION="$QT_MAJOR_VERSION" "
- elif [ "$VTK_VERSION" == "6.3" ]; then
- vtk_repo_str=" --branch v6.3.0 https://github.com/Kitware/VTK.git --depth 1"
+ elif [ "$VTK_VERSION" == "v6.3.0" ] || [ "$VTK_VERSION" == "v8.1.1" ]; then
cmake_arg_str=" $cmake_arg_str
-DCMAKE_CXX_FLAGS=-std=c++11
-DBUILD_SHARED_LIBS=1
-DModule_vtkRenderingQt=ON
-DModule_vtkViewsQt=ON
-DVTK_QT_VERSION="$QT_MAJOR_VERSION" "
- elif [ "$VTK_VERSION" == "7.0.0" ]; then
- vtk_repo_str=" --branch v7.0.0 https://github.com/Kitware/VTK.git --depth 1"
+ elif [ "$VTK_VERSION" == "v7.0.0" ]; then
cmake_arg_str=" $cmake_arg_str
-DCMAKE_CXX_FLAGS=-std=c++11
-DBUILD_SHARED_LIBS=1
-DVTK_QT_VERSION="$QT_MAJOR_VERSION" "
fi
else
- if [ "$VTK_VERSION" == "5.10" ]; then
- vtk_repo_str=" --branch v5.10.0 https://github.com/Kitware/VTK.git --depth 1"
+ vtk_repo_str=" --branch "$VTK_VERSION" https://github.com/Kitware/VTK.git --depth 1"
+ if [ "$VTK_VERSION" == "v5.10.0" ]; then
cmake_arg_str=" $cmake_arg_str
-DBUILD_SHARED_LIBS=1
-DCMAKE_BUILD_TYPE=Release
-DVTK_USE_RENDERING=ON
-DVTK_USE_VIEWS=ON
-DVTK_QT_VERSION="$QT_MAJOR_VERSION" "
- elif [ "$VTK_VERSION" == "6.3" ]; then
- vtk_repo_str=" --branch v6.3.0 https://github.com/Kitware/VTK.git --depth 1"
+ elif [ "$VTK_VERSION" == "v6.3.0" ] || [ "$VTK_VERSION" == "v8.1.1" ]; then
cmake_arg_str=" $cmake_arg_str
-DBUILD_SHARED_LIBS=1
-DCMAKE_BUILD_TYPE=Release
-DModule_vtkRenderingQt=ON
-DModule_vtkViewsQt=ON
-DVTK_QT_VERSION="$QT_MAJOR_VERSION" "
- elif [ "$VTK_VERSION" == "7.0.0" ]; then
- vtk_repo_str=" --branch v7.0.0 https://github.com/Kitware/VTK.git --depth 1"
+ elif [ "$VTK_VERSION" == "v7.0.0" ]; then
cmake_arg_str=" $cmake_arg_str
-DBUILD_SHARED_LIBS=1
-DCMAKE_BUILD_TYPE=Release
vvToolConvert ## with dummy vvToolConvert.ui
vvToolROIManager
vvToolSegmentation
- vvToolProfile
- vvToolHistogram
## these ones are for tests (not working)
# vvToolTest
# vvToolFoo
# vvToolExtractLung
# vvToolStructureSetManager
)
+#List of vv tools to compile
+#Ensure compatibility with QVTKOpenGL for VTK < v8.1 and QVTKOpenGLNativeWidget for others
+set(vv_TOOLS_VTK7
+ vvToolProfile
+ vvToolHistogram
+)
# dependencies of the tools
# Future issues : when tool depend on other tools ... how to manage that ?
# >> add the relevant $_LIBS variable to the tool that has dependencies?
vvOverlayPanel
vvLandmarksPanel
vvProgressDialog
- vvSegmentationDialog
- vvSurfaceViewerDialog
vvDeformationDialog
vvStructSelector
vvIntensityValueSlider
vvToolInputSelectorWidget
vvRegisterForm
)
+# in COMMON_WITH_UI -> must have .h and .cxx and VTK7.ui
+#Ensure compatibility with QVTKOpenGL for VTK < v8.1 and QVTKOpenGLNativeWidget for others
+set(vv_COMMON_WITH_UI_VTK7
+ vvMainWindow
+ vvSegmentationDialog
+ vvSurfaceViewerDialog
+)
# All others sources
set(vv_SRCS
# variables in vv.cxx for the tools contained in vvLib
if(${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt IS_NEWER_THAN ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h)
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h)
- foreach(tool ${vv_TOOLS})
+ foreach(tool ${vv_TOOLS} ${vv_TOOLS_VTK7})
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "#include \"${tool}.h\"\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "extern const vvToolCreator<${tool}> *dummy${tool};\n")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/vvToolsList.h "const vvToolCreator<${tool}> *dummy${tool}2 = dummy${tool};\n\n")
QT4_WRAP_UI(vv_UI_CXX qt_ui/${tool}.ui)
endif()
endforeach(tool)
+
+ #Special case for Main Window with QVTKWidget according VTK version
+ foreach(tool ${vv_TOOLS_VTK7} ${vv_COMMON_WITH_UI_VTK7})
+ set(vv_SRCS ${vv_SRCS} ${tool}.cxx)
+ if(VTK_VERSION VERSION_GREATER "8.0.0")
+ if(vv_QT_VERSION VERSION_GREATER "4")
+ QT5_WRAP_CPP(vv_SRCS ${tool}.h)
+ QT5_WRAP_UI(vv_UI_CXX qt_ui/${tool}.ui)
+ else()
+ QT4_WRAP_CPP(vv_SRCS ${tool}.h)
+ QT4_WRAP_UI(vv_UI_CXX qt_ui/${tool}.ui)
+ endif()
+ else()
+ if(vv_QT_VERSION VERSION_GREATER "4")
+ QT5_WRAP_CPP(vv_SRCS ${tool}.h)
+ QT5_WRAP_UI(vv_UI_CXX qt_ui/${tool}VTK7.ui)
+ else()
+ QT4_WRAP_CPP(vv_SRCS ${tool}.h)
+ QT4_WRAP_UI(vv_UI_CXX qt_ui/${tool}VTK7.ui)
+ endif()
+ endif()
+ endforeach(tool)
# Add the common source files
foreach(tool ${vv_COMMON})
#=========================================================
#Add each tool's dependencies
-foreach(tool ${vv_TOOLS})
+foreach(tool ${vv_TOOLS} ${vv_TOOLS_VTK7})
set(toolLibs ${toolLibs} ${${tool}_LIBS})
endforeach(tool)
<number>2</number>
</property>
<item row="0" column="0">
- <widget class="QVTKWidget" name="NOViewWidget" native="true">
+ <widget class="QVTKOpenGLNativeWidget" name="NOViewWidget" native="true">
<property name="mouseTracking">
<bool>true</bool>
</property>
<number>2</number>
</property>
<item row="0" column="0">
- <widget class="QVTKWidget" name="SOViewWidget" native="true">
+ <widget class="QVTKOpenGLNativeWidget" name="SOViewWidget" native="true">
<property name="mouseTracking">
<bool>true</bool>
</property>
<number>2</number>
</property>
<item row="0" column="0">
- <widget class="QVTKWidget" name="NEViewWidget" native="true">
+ <widget class="QVTKOpenGLNativeWidget" name="NEViewWidget" native="true">
<property name="mouseTracking">
<bool>true</bool>
</property>
<number>2</number>
</property>
<item row="0" column="0">
- <widget class="QVTKWidget" name="SEViewWidget" native="true">
+ <widget class="QVTKOpenGLNativeWidget" name="SEViewWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
</widget>
<customwidgets>
<customwidget>
- <class>QVTKWidget</class>
+ <class>QVTKOpenGLNativeWidget</class>
<extends>QWidget</extends>
- <header>QVTKWidget.h</header>
+ <header>QVTKOpenGLNativeWidget.h</header>
</customwidget>
<customwidget>
<class>vvInfoPanel</class>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>vvMainWindow</class>
+ <widget class="QMainWindow" name="vvMainWindow">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>1008</width>
+ <height>758</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="windowTitle">
+ <string>vv : the 4D Slicer</string>
+ </property>
+ <property name="windowIcon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/ducky.png</normaloff>:/common/icons/ducky.png</iconset>
+ </property>
+ <property name="statusTip">
+ <string>Type 'F1' on image to display help on navigation</string>
+ </property>
+ <widget class="QWidget" name="centralwidget">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="statusTip">
+ <string>Type 'F1' on image to display help on navigation</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QFrame" name="frame">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>16</width>
+ <height>36</height>
+ </size>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QGridLayout">
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QPushButton" name="goToCursorPushButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>24</width>
+ <height>24</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Go to cursor</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/cross.png</normaloff>:/common/icons/cross.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="Line" name="line">
+ <property name="frameShadow">
+ <enum>QFrame::Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="2">
+ <widget class="QPushButton" name="playButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>24</width>
+ <height>24</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Play Current Image</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/player_play.png</normaloff>:/common/icons/player_play.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="5">
+ <widget class="Line" name="line_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="7">
+ <widget class="QLabel" name="windowLabel">
+ <property name="text">
+ <string>Window :</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="8">
+ <widget class="QDoubleSpinBox" name="windowSpinBox">
+ <property name="decimals">
+ <number>6</number>
+ </property>
+ <property name="minimum">
+ <double>-66000.000000000000000</double>
+ </property>
+ <property name="maximum">
+ <double>66000.000000000000000</double>
+ </property>
+ <property name="singleStep">
+ <double>10.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="9">
+ <widget class="QPushButton" name="inverseButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>24</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Inverse colors</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/invertcolor.png</normaloff>:/common/icons/invertcolor.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="10">
+ <widget class="QLabel" name="levelLabel">
+ <property name="text">
+ <string> Level :</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="11">
+ <widget class="QDoubleSpinBox" name="levelSpinBox">
+ <property name="decimals">
+ <number>6</number>
+ </property>
+ <property name="minimum">
+ <double>-66000.000000000000000</double>
+ </property>
+ <property name="maximum">
+ <double>66000.000000000000000</double>
+ </property>
+ <property name="singleStep">
+ <double>10.000000000000000</double>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="12">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Preset :</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="13">
+ <widget class="QComboBox" name="presetComboBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>100</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <item>
+ <property name="text">
+ <string>Auto Scale</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Hounsfield Full Scale</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Soft Tissue</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Lungs</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Bones</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Head/Brain</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>[0,1] Scale</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>User Scale</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Ventilation Image</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="0" column="14">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>Colormap :</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="15">
+ <widget class="QComboBox" name="colorMapComboBox">
+ <item>
+ <property name="text">
+ <string>B&W</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Heat</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Cold</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Dosimetry</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Full Color</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Segmentation</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Ventilation</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="0" column="21">
+ <widget class="QPushButton" name="viewButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>24</width>
+ <height>24</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Expand window</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/adjustsize.png</normaloff>:/common/icons/adjustsize.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="4">
+ <widget class="QSpinBox" name="frameRateSpinBox">
+ <property name="minimum">
+ <number>1</number>
+ </property>
+ <property name="maximum">
+ <number>100</number>
+ </property>
+ <property name="value">
+ <number>10</number>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="3">
+ <widget class="QLabel" name="frameRateLabel">
+ <property name="text">
+ <string>Speed : </string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="16">
+ <widget class="QPushButton" name="applyWindowLevelToAllButton">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>24</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="toolTip">
+ <string>Apply windowing to all images</string>
+ </property>
+ <property name="text">
+ <string>All</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="19">
+ <widget class="QComboBox" name="slicingPresetComboBox">
+ <item>
+ <property name="text">
+ <string>World</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Voxels</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item row="0" column="18">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Slice to</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="17">
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QSplitter" name="splitter_4">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <widget class="QSplitter" name="splitter">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>1</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="DataTab">
+ <attribute name="title">
+ <string>Images</string>
+ </attribute>
+ <layout class="QGridLayout">
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QTreeWidget" name="DataTree">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="horizontalScrollBarPolicy">
+ <enum>Qt::ScrollBarAsNeeded</enum>
+ </property>
+ <property name="showDropIndicator" stdset="0">
+ <bool>false</bool>
+ </property>
+ <property name="textElideMode">
+ <enum>Qt::ElideLeft</enum>
+ </property>
+ <property name="itemsExpandable">
+ <bool>true</bool>
+ </property>
+ <property name="columnCount">
+ <number>7</number>
+ </property>
+ <column>
+ <property name="text">
+ <string>1</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>2</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>3</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>4</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Data</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>6</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>8</string>
+ </property>
+ </column>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="VFtab">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <attribute name="title">
+ <string>Overlay</string>
+ </attribute>
+ <layout class="QGridLayout">
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="vvOverlayPanel" name="overlayPanel" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="ROItab">
+ <attribute name="title">
+ <string>ROI</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_2"/>
+ </widget>
+ <widget class="QWidget" name="LinkTab">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <attribute name="title">
+ <string>Link</string>
+ </attribute>
+ <layout class="QGridLayout">
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="vvLinkPanel" name="linkPanel" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="Landmarkstab">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <attribute name="title">
+ <string>Landmarks</string>
+ </attribute>
+ <layout class="QGridLayout">
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="vvLandmarksPanel" name="landmarksPanel" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <widget class="vvInfoPanel" name="infoPanel" native="true">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </widget>
+ <widget class="QSplitter" name="splitter_3">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <widget class="QSplitter" name="OSplitter">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <widget class="QWidget" name="NOWidget" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <layout class="QGridLayout">
+ <property name="horizontalSpacing">
+ <number>2</number>
+ </property>
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QVTKWidget" name="NOViewWidget" native="true">
+ <property name="mouseTracking">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QSlider" name="NOVerticalSlider">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QSlider" name="NOHorizontalSlider">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="SOWidget" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="focusPolicy">
+ <enum>Qt::NoFocus</enum>
+ </property>
+ <layout class="QGridLayout">
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QVTKWidget" name="SOViewWidget" native="true">
+ <property name="mouseTracking">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QSlider" name="SOVerticalSlider">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QSlider" name="SOHorizontalSlider">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <widget class="QSplitter" name="ESplitter">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <widget class="QWidget" name="NEWidget" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <layout class="QGridLayout">
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QVTKWidget" name="NEViewWidget" native="true">
+ <property name="mouseTracking">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QSlider" name="NEVerticalSlider">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QSlider" name="NEHorizontalSlider">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="SEWidget" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <layout class="QGridLayout">
+ <property name="margin">
+ <number>2</number>
+ </property>
+ <property name="spacing">
+ <number>2</number>
+ </property>
+ <item row="0" column="0">
+ <widget class="QVTKWidget" name="SEViewWidget" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="mouseTracking">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QSlider" name="SEVerticalSlider">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QSlider" name="SEHorizontalSlider">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QMenuBar" name="menubar">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>1008</width>
+ <height>27</height>
+ </rect>
+ </property>
+ <property name="defaultUp">
+ <bool>false</bool>
+ </property>
+ <widget class="QMenu" name="menuHelp">
+ <property name="title">
+ <string>Help</string>
+ </property>
+ <addaction name="actionNavigation_Help"/>
+ <addaction name="actionDocumentation"/>
+ <addaction name="actionRegister_vv"/>
+ </widget>
+ <widget class="QMenu" name="menuOverlay">
+ <property name="title">
+ <string>Overlay</string>
+ </property>
+ <addaction name="actionAdd_VF_to_current_Image"/>
+ <addaction name="actionAdd_overlay_image_to_current_image"/>
+ <addaction name="actionAdd_fusion_image"/>
+ <addaction name="actionAdd_USSequence_toCT"/>
+ </widget>
+ <widget class="QMenu" name="menuScreenshots">
+ <property name="title">
+ <string>Screenshots</string>
+ </property>
+ <addaction name="actionNorth_West_Window"/>
+ <addaction name="actionNorth_East_Window"/>
+ <addaction name="actionSouth_West_Window"/>
+ <addaction name="actionSouth_East_Window"/>
+ <addaction name="separator"/>
+ <addaction name="actionSave_all_slices"/>
+ </widget>
+ <widget class="QMenu" name="menuExperimental">
+ <property name="title">
+ <string>Experimental</string>
+ </property>
+ <addaction name="actionSurface_Viewer"/>
+ <addaction name="actionDeformable_Registration"/>
+ <addaction name="actionSegmentation"/>
+ <addaction name="actionWarp_image_with_vector_field"/>
+ <addaction name="actionCompute_mid_position_image"/>
+ </widget>
+ <widget class="QMenu" name="menuTools">
+ <property name="title">
+ <string>Tools</string>
+ </property>
+ </widget>
+ <widget class="QMenu" name="menuFile">
+ <property name="title">
+ <string>File</string>
+ </property>
+ <addaction name="actionLoad_images"/>
+ <addaction name="actionOpen_Image_With_Time"/>
+ <addaction name="actionMerge_images_as_n_dim_t"/>
+ <addaction name="separator"/>
+ <addaction name="actionSlice_Image_As_Multiple_Images"/>
+ <addaction name="actionOpen_Multiple_Images_As_One"/>
+ <addaction name="separator"/>
+ <addaction name="actionOpen_Dicom"/>
+ <addaction name="actionOpen_VTK_contour"/>
+ <addaction name="actionConnect_Pacs"/>
+ <addaction name="separator"/>
+ <addaction name="actionSave_As"/>
+ <addaction name="separator"/>
+ <addaction name="actionRead_saved_state"/>
+ <addaction name="actionSave_current_state"/>
+ <addaction name="separator"/>
+ <addaction name="actionExit"/>
+ <addaction name="separator"/>
+ <addaction name="separator"/>
+ </widget>
+ <addaction name="menuFile"/>
+ <addaction name="menuOverlay"/>
+ <addaction name="menuScreenshots"/>
+ <addaction name="menuTools"/>
+ <addaction name="menuExperimental"/>
+ <addaction name="menuHelp"/>
+ </widget>
+ <widget class="QStatusBar" name="statusbar"/>
+ <action name="actionLoad_images">
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/fileopen.png</normaloff>:/common/icons/fileopen.png</iconset>
+ </property>
+ <property name="text">
+ <string>Open image(s)</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+O</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionClose_image">
+ <property name="text">
+ <string>Close images</string>
+ </property>
+ </action>
+ <action name="actionExit">
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/exit.png</normaloff>:/common/icons/exit.png</iconset>
+ </property>
+ <property name="text">
+ <string>Exit</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionSave_screenshot">
+ <property name="text">
+ <string>Save screenshot</string>
+ </property>
+ </action>
+ <action name="actionPickable">
+ <property name="text">
+ <string>pickable</string>
+ </property>
+ </action>
+ <action name="actionDragable">
+ <property name="text">
+ <string>dragable</string>
+ </property>
+ </action>
+ <action name="actionSet_colormap">
+ <property name="text">
+ <string>Set colormap</string>
+ </property>
+ </action>
+ <action name="actionIsoContours">
+ <property name="text">
+ <string>IsoContours</string>
+ </property>
+ </action>
+ <action name="actionAbouts">
+ <property name="text">
+ <string>About QtVTKRender2D</string>
+ </property>
+ </action>
+ <action name="actionDocumentation">
+ <property name="text">
+ <string>About</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionReload_images">
+ <property name="text">
+ <string>Reload images</string>
+ </property>
+ </action>
+ <action name="actionOpen_Dicom">
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/open.png</normaloff>:/common/icons/open.png</iconset>
+ </property>
+ <property name="text">
+ <string>Open Dicom</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionOpen_Multiple_Images_As_One">
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/open.png</normaloff>:/common/icons/open.png</iconset>
+ </property>
+ <property name="text">
+ <string>Merge several nD images into a single (n+1)D image</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionSlice_Image_As_Multiple_Images">
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/open.png</normaloff>:/common/icons/open.png</iconset>
+ </property>
+ <property name="text">
+ <string>Slice a nD image into several (n-1)D images</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionOpen_one_Image_as_Multiple">
+ <property name="text">
+ <string>Open One Image As Multiple</string>
+ </property>
+ </action>
+ <action name="actionSave_As">
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/filesave.png</normaloff>:/common/icons/filesave.png</iconset>
+ </property>
+ <property name="text">
+ <string>Save current image</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+S</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionAdd_VF_to_current_Image">
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/cursor-uparrow.png</normaloff>:/common/icons/cursor-uparrow.png</iconset>
+ </property>
+ <property name="text">
+ <string>Add deformation field to current image</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionNorth_West_Window">
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/NOgrid.png</normaloff>:/common/icons/NOgrid.png</iconset>
+ </property>
+ <property name="text">
+ <string>Save image in TL</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionNorth_East_Window">
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/NEgrid.png</normaloff>:/common/icons/NEgrid.png</iconset>
+ </property>
+ <property name="text">
+ <string>Save image in TR</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionSouth_West_Window">
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/SOgrid.png</normaloff>:/common/icons/SOgrid.png</iconset>
+ </property>
+ <property name="text">
+ <string>Save image in BL</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionSouth_East_Window">
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/SEgrid.png</normaloff>:/common/icons/SEgrid.png</iconset>
+ </property>
+ <property name="text">
+ <string>Save image in BR</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionOpen_Image_With_Time">
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/open.png</normaloff>:/common/icons/open.png</iconset>
+ </property>
+ <property name="text">
+ <string>Open a nD image as a (n-1)D + t image</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionMerge_images_as_n_dim_t">
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/open.png</normaloff>:/common/icons/open.png</iconset>
+ </property>
+ <property name="text">
+ <string>Open several nD images into a single nD+t image</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionAdd_fusion_image">
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/fusion.png</normaloff>:/common/icons/fusion.png</iconset>
+ </property>
+ <property name="text">
+ <string>Add fusion image to current image</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionSegmentation">
+ <property name="text">
+ <string>Segmentation</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionResampler">
+ <property name="text">
+ <string>Resample</string>
+ </property>
+ </action>
+ <action name="actionSurface_Viewer">
+ <property name="text">
+ <string>Surface Viewer</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionDebug">
+ <property name="text">
+ <string>joelDebug</string>
+ </property>
+ </action>
+ <action name="actionDeformable_Registration">
+ <property name="text">
+ <string>Deformable Registration</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionWarp_image_with_vector_field">
+ <property name="text">
+ <string>Verify Registration</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionMaximum_Intensity_Projection">
+ <property name="text">
+ <string>Maximum Intensity Projection</string>
+ </property>
+ </action>
+ <action name="actionOpen_VTK_contour">
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/open.png</normaloff>:/common/icons/open.png</iconset>
+ </property>
+ <property name="text">
+ <string>Open VTK or OBJ contour</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionNavigation_Help">
+ <property name="text">
+ <string>Navigation Help</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ <property name="priority">
+ <enum>QAction::NormalPriority</enum>
+ </property>
+ </action>
+ <action name="actionOpen_Dicom_Struct">
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/open.png</normaloff>:/common/icons/open.png</iconset>
+ </property>
+ <property name="text">
+ <string>Open Dicom-Struct</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionCompute_mid_position_image">
+ <property name="text">
+ <string>Compute mid-position image</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionExperimental">
+ <property name="text">
+ <string>Experimental...</string>
+ </property>
+ </action>
+ <action name="actionRegister_vv">
+ <property name="text">
+ <string>Register vv</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionSave_all_slices">
+ <property name="text">
+ <string>Save all slices (Top-Left view)</string>
+ </property>
+ </action>
+ <action name="actionSave_current_state">
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/filesave.png</normaloff>:/common/icons/filesave.png</iconset>
+ </property>
+ <property name="text">
+ <string>Save current state</string>
+ </property>
+ <property name="toolTip">
+ <string>Save current window and file states</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionRead_saved_state">
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/open.png</normaloff>:/common/icons/open.png</iconset>
+ </property>
+ <property name="text">
+ <string>Read Saved State</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionAdd_overlay_image_to_current_image">
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/GPSup.png</normaloff>:/common/icons/GPSup.png</iconset>
+ </property>
+ <property name="text">
+ <string>Add overlay image to current image</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionAdd_USSequence_toCT">
+ <property name="icon">
+ <iconset resource="../vvIcons.qrc">
+ <normaloff>:/common/icons/rotateright.png</normaloff>:/common/icons/rotateright.png</iconset>
+ </property>
+ <property name="text">
+ <string>Test / Fusion of US & CT sequences</string>
+ </property>
+ <property name="iconVisibleInMenu">
+ <bool>true</bool>
+ </property>
+ </action>
+ <action name="actionConnect_Pacs">
+ <property name="text">
+ <string>Connect Pacs</string>
+ </property>
+ </action>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>QVTKWidget</class>
+ <extends>QWidget</extends>
+ <header>QVTKWidget.h</header>
+ </customwidget>
+ <customwidget>
+ <class>vvInfoPanel</class>
+ <extends>QWidget</extends>
+ <header>vvInfoPanel.h</header>
+ </customwidget>
+ <customwidget>
+ <class>vvLandmarksPanel</class>
+ <extends>QWidget</extends>
+ <header>vvLandmarksPanel.h</header>
+ </customwidget>
+ <customwidget>
+ <class>vvLinkPanel</class>
+ <extends>QWidget</extends>
+ <header>vvLinkPanel.h</header>
+ </customwidget>
+ <customwidget>
+ <class>vvOverlayPanel</class>
+ <extends>QWidget</extends>
+ <header>vvOverlayPanel.h</header>
+ </customwidget>
+ </customwidgets>
+ <tabstops>
+ <tabstop>presetComboBox</tabstop>
+ <tabstop>windowSpinBox</tabstop>
+ <tabstop>levelSpinBox</tabstop>
+ <tabstop>NOViewWidget</tabstop>
+ <tabstop>NOVerticalSlider</tabstop>
+ <tabstop>NOHorizontalSlider</tabstop>
+ <tabstop>SOVerticalSlider</tabstop>
+ <tabstop>SOHorizontalSlider</tabstop>
+ <tabstop>NEVerticalSlider</tabstop>
+ <tabstop>NEHorizontalSlider</tabstop>
+ <tabstop>SEVerticalSlider</tabstop>
+ <tabstop>SEHorizontalSlider</tabstop>
+ <tabstop>viewButton</tabstop>
+ </tabstops>
+ <resources>
+ <include location="../vvIcons.qrc"/>
+ </resources>
+ <connections/>
+</ui>
</widget>
</item>
<item rowspan="4" row="0" column="2" colspan="6" >
- <widget class="QVTKWidget" name="viewWidget" />
+ <widget class="QVTKOpenGLNativeWidget" name="viewWidget" />
</item>
<item row="1" column="0" >
<widget class="QLabel" name="minLabel" >
</widget>
<customwidgets>
<customwidget>
- <class>QVTKWidget</class>
+ <class>QVTKOpenGLNativeWidget</class>
<extends>QWidget</extends>
- <header>QVTKWidget.h</header>
+ <header>QVTKOpenGLNativeWidget.h</header>
</customwidget>
</customwidgets>
<resources/>
--- /dev/null
+<ui version="4.0" >
+ <class>vvSegmentationDialog</class>
+ <widget class="QDialog" name="vvSegmentationDialog" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>561</width>
+ <height>453</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Segmentation tool</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <widget class="QSlider" name="clipping1Slider" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QSlider" name="clipping2Slider" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ </widget>
+ </item>
+ <item rowspan="4" row="0" column="2" colspan="6" >
+ <widget class="QVTKWidget" name="viewWidget" />
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="minLabel" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Min :</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" colspan="2" >
+ <widget class="QLabel" name="maxLabel" >
+ <property name="text" >
+ <string>Max :</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" colspan="2" >
+ <widget class="QPushButton" name="binaryButton" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Binarise</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0" colspan="2" >
+ <widget class="QPushButton" name="erodeButton" >
+ <property name="text" >
+ <string>Erode</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="2" >
+ <widget class="QPushButton" name="dilateButton" >
+ <property name="text" >
+ <string>Dilate</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="3" >
+ <widget class="QLabel" name="label" >
+ <property name="text" >
+ <string>Kernel Size :</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="4" >
+ <widget class="QSpinBox" name="kernelSpinBox" >
+ <property name="minimum" >
+ <number>1</number>
+ </property>
+ <property name="value" >
+ <number>2</number>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="5" >
+ <widget class="QPushButton" name="dimButton" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>3D</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="6" >
+ <widget class="QPushButton" name="saveButton" >
+ <property name="text" >
+ <string>Save As</string>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="7" >
+ <widget class="QPushButton" name="closeButton" >
+ <property name="text" >
+ <string>Close</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0" colspan="5" >
+ <widget class="QLabel" name="infoLabel" >
+ <property name="text" >
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>QVTKWidget</class>
+ <extends>QWidget</extends>
+ <header>QVTKWidget.h</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>closeButton</sender>
+ <signal>clicked()</signal>
+ <receiver>vvSegmentationDialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>528</x>
+ <y>403</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>542</x>
+ <y>423</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
</property>
<layout class="QGridLayout" >
<item row="0" column="0" colspan="3" >
- <widget class="QVTKWidget" name="renderWidget" />
+ <widget class="QVTKOpenGLNativeWidget" name="renderWidget" />
</item>
<item row="1" column="0" >
<spacer>
</widget>
<customwidgets>
<customwidget>
- <class>QVTKWidget</class>
+ <class>QVTKOpenGLNativeWidget</class>
<extends>QWidget</extends>
- <header>QVTKWidget.h</header>
+ <header>QVTKOpenGLNativeWidget.h</header>
</customwidget>
</customwidgets>
<resources/>
--- /dev/null
+<ui version="4.0" >
+ <class>vvSurfaceViewerDialog</class>
+ <widget class="QDialog" name="vvSurfaceViewerDialog" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>554</width>
+ <height>472</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Dialog</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" colspan="3" >
+ <widget class="QVTKWidget" name="renderWidget" />
+ </item>
+ <item row="1" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>311</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QPushButton" name="loadButton" >
+ <property name="text" >
+ <string>Load</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" >
+ <widget class="QPushButton" name="closeButton" >
+ <property name="text" >
+ <string>Close</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>QVTKWidget</class>
+ <extends>QWidget</extends>
+ <header>QVTKWidget.h</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>closeButton</sender>
+ <signal>clicked()</signal>
+ <receiver>vvSurfaceViewerDialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>492</x>
+ <y>436</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>443</x>
+ <y>435</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
</widget>
</item>
<item>
- <widget class="QVTKWidget" name="HistogramWidget" native="true">
+ <widget class="QVTKOpenGLNativeWidget" name="HistogramWidget" native="true">
<property name="minimumSize">
<size>
<width>0</width>
</widget>
<customwidgets>
<customwidget>
- <class>QVTKWidget</class>
+ <class>QVTKOpenGLNativeWidget</class>
<extends>QWidget</extends>
- <header>QVTKWidget.h</header>
+ <header>QVTKOpenGLNativeWidget.h</header>
</customwidget>
</customwidgets>
<resources/>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>vvToolHistogram</class>
+ <widget class="QWidget" name="vvToolHistogram">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>506</width>
+ <height>452</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Histogram image</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <property name="horizontalSpacing">
+ <number>6</number>
+ </property>
+ <item row="2" column="3">
+ <layout class="QHBoxLayout" name="horizontalLayout_6">
+ <item>
+ <widget class="QPushButton" name="mSaveHistogramButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Save Histogram</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="3">
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QLabel" name="mPosPoint2Label">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>200</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_3"/>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="Line" name="line_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QVTKWidget" name="HistogramWidget" native="true">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>300</height>
+ </size>
+ </property>
+ <property name="mouseTracking">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>QVTKWidget</class>
+ <extends>QWidget</extends>
+ <header>QVTKWidget.h</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
</widget>
</item>
<item>
- <widget class="QVTKWidget" name="ProfileWidget" native="true">
+ <widget class="QVTKOpenGLNativeWidget" name="ProfileWidget" native="true">
<property name="minimumSize">
<size>
<width>0</width>
</widget>
<customwidgets>
<customwidget>
- <class>QVTKWidget</class>
+ <class>QVTKOpenGLNativeWidget</class>
<extends>QWidget</extends>
- <header>QVTKWidget.h</header>
+ <header>QVTKOpenGLNativeWidget.h</header>
</customwidget>
</customwidgets>
<resources/>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>vvToolProfile</class>
+ <widget class="QWidget" name="vvToolProfile">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>505</width>
+ <height>452</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Profile image</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <property name="horizontalSpacing">
+ <number>6</number>
+ </property>
+ <item row="2" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QPushButton" name="mSelectPoint2Button">
+ <property name="text">
+ <string>Select point 2</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="Point2">
+ <property name="text">
+ <string>Center of voxel2 (vox):</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="2" column="3">
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QLabel" name="mPosPoint2Label">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>200</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="3" column="3">
+ <layout class="QHBoxLayout" name="horizontalLayout_6">
+ <item>
+ <widget class="QToolButton" name="mCancelPointsButton">
+ <property name="text">
+ <string>Cancel</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="mSaveProfileButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Save Profile</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_7">
+ <item>
+ <widget class="QPushButton" name="mSelectPoint1Button">
+ <property name="text">
+ <string>Select point 1</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="Point1">
+ <property name="text">
+ <string>Center of voxel1 (vox):</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="3">
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="mPosPoint1Label">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>200</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="Line" name="line_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QVTKWidget" name="ProfileWidget" native="true">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>300</height>
+ </size>
+ </property>
+ <property name="mouseTracking">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <customwidgets>
+ <customwidget>
+ <class>QVTKWidget</class>
+ <extends>QWidget</extends>
+ <header>QVTKWidget.h</header>
+ </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>
#include <algorithm>
#include <QMessageBox>
+#include <QMimeData>
#include <QInputDialog>
#include <QTimer>
#include "QTreePushButton.h"
{
setupUi(this); // this sets up the GUI
+ setAcceptDrops(true); // enable to drop into the window
+
setDicomClient();
//Qt::WindowFlags flags = windowFlags();
LoadImages(images, vvImageReader::IMAGE);
}
//------------------------------------------------------------------------------
+void vvMainWindow::dragEnterEvent(QDragEnterEvent *event)
+{
+ if (event->mimeData()->hasUrls()) {
+ event->acceptProposedAction();
+ }
+}
+//------------------------------------------------------------------------------
+void vvMainWindow::dropEvent(QDropEvent *event)
+{
+ const QMimeData * mimeData = event->mimeData();
+ if (!mimeData->hasUrls())
+ return;
+ std::vector<std::string> images;
+ for (int i=0; i<mimeData->urls().size(); ++i) {
+ images.push_back(mimeData->urls()[i].toLocalFile().toStdString());
+ }
+ LoadImages(images, vvImageReader::IMAGE);
+}
+//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvMainWindow::SaveScreenshotAllSlices()
{
+#if (VTK_MAJOR_VERSION == 8 && VTK_MINOR_VERSION >= 1) || VTK_MAJOR_VERSION >= 9
+ QVTKOpenGLNativeWidget *widget = NOViewWidget;
+#else
QVTKWidget *widget = NOViewWidget;
+#endif
int index = 0;// GetSlicerIndexFromItem(DataTree->selectedItems()[0]);
vvSlicerManager * SM = mSlicerManagers[index];
// Screenshot
vtkSmartPointer<vtkWindowToImageFilter> windowToImageFilter = vtkSmartPointer<vtkWindowToImageFilter>::New();
windowToImageFilter->SetInput(renderWindow);
-#if VTK_MAJOR_VERSION >= 8 && VTK_MINOR_VERSION >= 1
+#if (VTK_MAJOR_VERSION >= 8 && VTK_MINOR_VERSION >= 1) || VTK_MAJOR_VERSION >= 9
windowToImageFilter->SetScale(1);
#else
windowToImageFilter->SetMagnification(1);
//------------------------------------------------------------------------------
+#if (VTK_MAJOR_VERSION == 8 && VTK_MINOR_VERSION >= 1) || VTK_MAJOR_VERSION >= 9
+void vvMainWindow::SaveScreenshot(QVTKOpenGLNativeWidget *widget)
+#else
void vvMainWindow::SaveScreenshot(QVTKWidget *widget)
+#endif
{
QString Extensions = "Images( *.png);;";
Extensions += "Images( *.jpg);;";
if (!fileName.isEmpty()) {
vtkSmartPointer<vtkWindowToImageFilter> w2i = vtkSmartPointer<vtkWindowToImageFilter>::New();
w2i->SetInput(widget->GetRenderWindow());
-#if VTK_MAJOR_VERSION >= 8 && VTK_MINOR_VERSION >= 1
+#if (VTK_MAJOR_VERSION >= 8 && VTK_MINOR_VERSION >= 1) || VTK_MAJOR_VERSION >= 9
w2i->SetScale(1);
#else
w2i->SetMagnification(1);
#include <iostream>
#include <vector>
+#include <QDropEvent>
+#include "vtkVersion.h"
+#if (VTK_MAJOR_VERSION == 8 && VTK_MINOR_VERSION >= 1) || VTK_MAJOR_VERSION >= 9
#include "ui_vvMainWindow.h"
+#else
+#include "ui_vvMainWindowVTK7.h"
+#endif
#include "vvMainWindowBase.h"
#include "vvToolManager.h"
#include "vvImageReader.h"
void createRecentlyOpenedFilesMenu();
void updateRecentlyOpenedFilesMenu(const std::list<std::string> &files);
+ // Drag and drop event handlers
+ virtual void dragEnterEvent(QDragEnterEvent *event);
+ virtual void dropEvent(QDropEvent *event);
+
private:
//variables
QString GetVectorIntAsString(std::vector<int> vectorInt);
int GetSlicerIndexFromItem(QTreeWidgetItem* item); //this actually returns the SlicerManager index TODO: rename it to GetSlicerManagerIndexFromItem
QTreeWidgetItem* GetItemFromSlicerManager(vvSlicerManager* sm);
+#if (VTK_MAJOR_VERSION == 8 && VTK_MINOR_VERSION >= 1) || VTK_MAJOR_VERSION >= 9
+ void SaveScreenshot(QVTKOpenGLNativeWidget *widget);
+#else
void SaveScreenshot(QVTKWidget *widget);
+#endif
int GetImageDuplicateFilenameNumber(std::string filename);
QMenu contextMenu;
// gdcm
#include <gdcmFile.h>
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
#include <gdcmReader.h>
#include <gdcmTag.h>
#include <gdcmAttribute.h>
}
#else
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
// duplicate code from clitk::DicomRT_StructureSet::Read
gdcm::Reader * reader = new gdcm::Reader;
std::vector<vvMesh::Pointer> vvMeshReader::readSelectedContours()
{
std::vector<vvMesh::Pointer> result;
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
gdcm::Reader reader;
reader.SetFileName(filename.c_str());
reader.Read();
{
QString fusionValue = "<b>Pixel value in image 2 : </b>";
if (visibility) {
- fusionValue += QString::number(value,'f',1);
+ fusionValue += QString::number(value,'g',3);
}
valueFusionnedLabel->setText(fusionValue);
}
#include <itkGDCMImageIO.h>
#include <itkGDCMSeriesFileNames.h>
#include <gdcmFile.h>
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
#include <gdcmImageReader.h>
#include <gdcmDataSetHelper.h>
#include <gdcmStringFilter.h>
mListOfSeriesFilenames[seriesUID[i]] = filenames;
// store first header
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
mDicomHeader[seriesUID[i]].SetFileName( (*filenames)[0].c_str() );
mDicomHeader[seriesUID[i]].Read();
#else
std::ostringstream s;
QString l;
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
mDicomHeader[mCurrentSerie].GetFile().Print(s);
const gdcm::File& header = mDicomHeader[mCurrentSerie].GetFile();
gdcm::StringFilter sf;
//====================================================================
//====================================================================
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
QString vvDicomSeriesSelector::MakeDicomInfo(std::string & s, const gdcm::Reader& header)
{
QString n = QString("%1").arg(mListOfSeriesFilenames[s]->size());
//====================================================================
QString vvDicomSeriesSelector::AddInfo(const gdcm::File *header, QString n, uint16_t group, uint16_t elem)
{
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
gdcm::StringFilter sf;
sf.SetFile( *header );
gdcm::Tag t( group, elem );
//====================================================================
void vvDicomSeriesSelector::AddSerieToTheTable(int i, std::vector<std::string> & filenames)
{
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
#else
gdcm::File *header = new gdcm::File();
header->SetFileName(filenames[0]);
QString mPreviousPath;
QString mFoldername;
void AddSerieToTheTable(int i, std::vector<std::string> & filenames);
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
QString MakeDicomInfo(std::string & s, const gdcm::Reader& header);
#else
QString MakeDicomInfo(std::string & s, gdcm::File *header);
std::map<std::string, std::vector<std::string>* > mListOfSeriesFilenames;
std::vector<std::string> * mFilenames;
std::map<std::string, QString> mDicomInfo;
-#if GDCM_MAJOR_VERSION == 2
+#if GDCM_MAJOR_VERSION >= 2
std::map<std::string, gdcm::Reader> mDicomHeader;
#else
std::map<std::string, gdcm::File*> mDicomHeader;
===========================================================================**/
#ifndef _VVSEGMENTATIONDIALOG_H
#define _VVSEGMENTATIONDIALOG_H
+#include <vtkVersion.h>
+#if (VTK_MAJOR_VERSION == 8 && VTK_MINOR_VERSION >= 1) || VTK_MAJOR_VERSION >= 9
#include "ui_vvSegmentationDialog.h"
+#else
+#include "ui_vvSegmentationDialogVTK7.h"
+#endif
#include "clitkCommon.h"
#include "vvImage.h"
#include "vvSlicerManager.h"
#else
mVFMapper->SetInputConnection(mGlyphFilter->GetOutputPort());
#endif
+#ifndef VTK_OPENGL2
mVFMapper->ImmediateModeRenderingOn();
+#endif
mVFMapper->SetLookupTable(mVFColorLUT);
if (!mVFActor)
===========================================================================**/
#ifndef _vvSurfaceViewerDialog_H
#define _vvSurfaceViewerDialog_H
+#include <vtkVersion.h>
+#if (VTK_MAJOR_VERSION == 8 && VTK_MINOR_VERSION >= 1) || VTK_MAJOR_VERSION >= 9
#include "ui_vvSurfaceViewerDialog.h"
+#else
+#include "ui_vvSurfaceViewerDialogVTK7.h"
+#endif
class vtkPolyDataMapper;
class vtkActor;
//------------------------------------------------------------------------------
+#if (VTK_MAJOR_VERSION == 8 && VTK_MINOR_VERSION >= 1) || VTK_MAJOR_VERSION >= 9
+QVTKOpenGLNativeWidget* vvToolHistogram::GetHistogramWidget()
+#else
QVTKWidget* vvToolHistogram::GetHistogramWidget()
+#endif
{
return(HistogramWidget);
}
#include "vvToolBase.h"
#include "vvToolWidgetBase.h"
+#include <vtkVersion.h>
+#if (VTK_MAJOR_VERSION == 8 && VTK_MINOR_VERSION >= 1) || VTK_MAJOR_VERSION >= 9
#include "ui_vvToolHistogram.h"
+#else
+#include "ui_vvToolHistogramVTK7.h"
+#endif
#include "clitkHistogramImage_ggo.h"
#include "clitkHistogramImageGenericFilter.h"
void displayHistogram();
+#if (VTK_MAJOR_VERSION == 8 && VTK_MINOR_VERSION >= 1) || VTK_MAJOR_VERSION >= 9
+ QVTKOpenGLNativeWidget* GetHistogramWidget();
+#else
QVTKWidget* GetHistogramWidget();
+#endif
//-----------------------------------------------------
public slots:
#include "vvToolWidgetBase.h"
#include "vvImageContour.h"
#include "vvLandmarks.h"
+#include <vtkVersion.h>
+#if (VTK_MAJOR_VERSION == 8 && VTK_MINOR_VERSION >= 1) || VTK_MAJOR_VERSION >= 9
#include "ui_vvToolProfile.h"
+#else
+#include "ui_vvToolProfileVTK7.h"
+#endif
#include "vvBinaryImageOverlayActor.h"
#include "clitkProfileImage_ggo.h"