Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 3719def1 authored by promayon's avatar promayon
Browse files

NEW CamiTKTestMacro simplifies unit and integration testing (see...

NEW CamiTKTestMacro simplifies unit and integration testing (see tools/lml/test/CMakeLists.txt for an example)
NEW correct test for lml and pml
NEW start cmake macro documentation using doxygen (need more work)
FIXED negative values now possible for region growing threshold
FIXED compilation warning on gcc (double to float precision loss)



git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@670 ec899d31-69d1-42ba-9299-647d76f65fb3
parent c012dd80
...@@ -31,6 +31,8 @@ include(CamiTKInternalBuild) ...@@ -31,6 +31,8 @@ include(CamiTKInternalBuild)
include(CamiTKVariables) include(CamiTKVariables)
# include CamiTK generic macros from CMAKE_MODULE_PATH directory # include CamiTK generic macros from CMAKE_MODULE_PATH directory
include(CamiTKMacros) include(CamiTKMacros)
# include CamiTK test macros
include(CamiTKTestMacros)
# include CamiTK log configuration # include CamiTK log configuration
include(CamiTKLog) include(CamiTKLog)
# include CamiTK auto-documentation generation # include CamiTK auto-documentation generation
......
...@@ -127,8 +127,11 @@ ...@@ -127,8 +127,11 @@
</item> </item>
<item row="0" column="2"> <item row="0" column="2">
<widget class="QSpinBox" name="lowThresholdSpinBox"> <widget class="QSpinBox" name="lowThresholdSpinBox">
<property name="minimum">
<number>-1000000</number>
</property>
<property name="maximum"> <property name="maximum">
<number>9999</number> <number>1000000</number>
</property> </property>
</widget> </widget>
</item> </item>
...@@ -141,6 +144,9 @@ ...@@ -141,6 +144,9 @@
</item> </item>
<item row="1" column="2"> <item row="1" column="2">
<widget class="QSpinBox" name="highThresholdSpinBox"> <widget class="QSpinBox" name="highThresholdSpinBox">
<property name="minimum">
<number>-1000000</number>
</property>
<property name="maximum"> <property name="maximum">
<number>9999</number> <number>9999</number>
</property> </property>
......
# #
# CamiTK Macros # CamitK Macros
# #
# MACRO get_subdirectories # MACRO get_subdirectories
# #
# usage: # usage:
...@@ -130,32 +129,51 @@ macro(get_directory_name FullPathDirectory VariableName) ...@@ -130,32 +129,51 @@ macro(get_directory_name FullPathDirectory VariableName)
string(TOUPPER ${${VariableName}} ${VariableName}_CMAKE) string(TOUPPER ${${VariableName}} ${VariableName}_CMAKE)
endmacro() endmacro()
# MACRO export_headers #!
# #! \addtogroup CamiTKMacros
# Duplicate headers installation: #!
# - one is used at compiled time and puts everything in #! export_headers is a macro that install header files at build and install time
# ${CAMITK_BUILD_DIR}/include/${GroupName}/${ComponentName}/${SubdirName} #!
# - the other one is used at installation time and puts everything in #! Duplicate headers installation:
# ${CAMITK_INSTALL_ROOT}/include/${GroupName}/${ComponentName}/${SubdirName} #! - one is used at compiled time and puts everything in
# #! ${CAMITK_BUILD_DIR}/include/${GroupName}/${ComponentName}/${SubdirName}
# Note: if you use the CEP option, CMAKE_BINARY_DIR is used instead of CAMITK_BUILD_DIR #! - the other one is used at installation time and puts everything in
# and CMAKE_INSTALL_PREFIX is used instead of CAMITK_INSTALL_ROOT #! ${CAMITK_INSTALL_ROOT}/include/${GroupName}/${ComponentName}/${SubdirName}
# #!
# usage: #! \note
# export_headers(HeaderFile1.h HeaderFile2.h ... #! if you use the CEP option, CMAKE_BINARY_DIR is used instead of CAMITK_BUILD_DIR
# COMPONENT ComponentName #! and CMAKE_INSTALL_PREFIX is used instead of CAMITK_INSTALL_ROOT
# [GROUP GroupName] #!
# [SUBDIRECTORY SubdirName] #! Usage:
# [CEP] #! \code
# ) #! export_headers(HeaderFile1.h HeaderFile2.h ...
# #! COMPONENT ComponentName
# FILES = list of files to install #! [GROUP GroupName]
# COMPONENT = name of the component to use. This is also the include subdirectory name #! [SUBDIRECTORY SubdirName]
# used for copying the file #! [CEP]
# GROUP = the name of the group this install should be using group will be #! )
# prepend to the component name. #! \endcode
# SUBDIRECTORY = optional subdirectory to use in ${CAMITK_INCLUDE_DIR}/include/${ComponentName} #!
# CEP = optional, states that the files should installed CEP wise #! \param HeaderFileX.h (required) A list of header files to install
#! \param COMPONENT name of the component to use. This is also the include subdirectory name
#! used for copying the file
#! \param GROUP (optional) the name of the group this install should be using group will be
#! prepend to the component name.
#! \param SUBDIRECTORY (optional) subdirectory to use in ${CAMITK_INCLUDE_DIR}/include/${ComponentName}
#! \param CEP (optional) states that the files should installed CEP wise
#!
#! Example invocation:
#!
#! \code
#!
#! #--------------
#! # installation
#! #--------------
#! export_headers(${MYPROJECT_HEADERS}
#! COMPONENT ${MYPROJECT_NAME}
#! )
#!
#! \endcode
macro(export_headers) macro(export_headers)
parse_arguments(EXPORT_HEADER parse_arguments(EXPORT_HEADER
......
# see also http://www.cmake.org/cmake/help/v2.8.8/cmake.html#section_PropertiesonTests
#!
#! \addtogroup CamiTKMacros
#!
#! camitk_init_test is a macro to initialize a group of test (for the same command)
#! It is used to initialize a series of tests for a given target.
#! Usually this is placed in the same CMakeLists.txt as the add_executable() cmake instruction or
#! camitk_application() macro
#!
#! It does few useful things:
#! - check if the target (name of the executable to run) is properly defined
#! - initialize test id (then automatically incremented in camitk_test_declare
#! - initialize test output directory
#!
#! Usage:
#! \code
#! camitk_init_test(target)
#! \endcode
#!
#! \param target (required) The executable target to use during all the test series
#!
#! Example invocation:
#!
#! \code
#!
#! add_executable(myprogram)
#!
#! ...
#! # Start the test series for myprogram
#! camitk_init_test(myprogram)
#! camitk_add_test(...) # will be called myprogram_1
#! ...
#! camitk_add_test(...) # myprogram_2
#!
#! \endcode
#
#! @sa camitk_add_test
macro(camitk_init_test)
parse_arguments(CAMITK_INIT_TEST
"" # possible lists
""
${ARGN}
)
set(CAMITK_TEST_ID "0")
set(CAMITK_TEST_LIST "")
# check for executable
if(NOT CAMITK_INIT_TEST_DEFAULT_ARGS)
message(FATAL_ERROR "Initializing test ${CAMITK_TEST_BASENAME} cannot proceed: please specify the target in brackets")
else()
if(NOT TARGET ${CAMITK_INIT_TEST_DEFAULT_ARGS})
message(FATAL_ERROR "Initializing test ${CAMITK_TEST_BASENAME} cannot proceed: ${CAMITK_INIT_TEST_DEFAULT_ARGS} is not a proper target")
endif()
endif()
set(CAMITK_TEST_BASENAME ${CAMITK_INIT_TEST_DEFAULT_ARGS})
message(STATUS "Initializing test series for ${CAMITK_TEST_BASENAME}")
set(CAMITK_INIT_TEST_EXECUTABLE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CAMITK_INIT_TEST_DEFAULT_ARGS})
endmacro()
#!
#! \addtogroup CamiTKMacros
#!
#! camitk_add_test is a macro to add a new test to the CTest infrastructure
#! It encapsulates CMake add_test and adds useful way of testing programs.
#! It cannot operate on its on, you need to call camitk_init_test first (and only once) before
#! calling camitk_add_test
#!
#! Details on the runned test can be found in ${CMAKE_BINARY_DIR}/Testing/Temporary/target#
#! where target is the executable name (see camitk_init_test() macro), and # is the test order number.
#!
#! Usage:
#! \code
#! camitk_add_test(EXECUTABLE_ARGS "arg1 arg2 arg3"
#! PASS_FILE pristineOutput
#! PASS_REGULAR_EXPRESSION regexp
#! FAIL_REGULAR_EXPRESSION regexp
#! )
#! \endcode
#!
#! \param EXECUTABLE_ARGS (optional) The executable arguments (all in double quotes), typically each test will have different arguments. Can be empty
#! \param PASS_FILE (optional) If specified the test to perform is to compare the output of the command to this file. It the output is the same, then the test is passed, otherwise it is failed.
#! \param PASS_REGULAR_EXPRESSION (optional) This is equivalent to "PASS_REGULAR_EXPRESSION regexp" property for the test, see http://www.cmake.org/Wiki/CTest:FAQ#My_test_does_not_return_non-zero_on_failure._What_can_I_do.3F
#! \param FAIL_REGULAR_EXPRESSION This is equivalent to "FAIL_REGULAR_EXPRESSION regexp" property for the test, see http://www.cmake.org/Wiki/CTest:FAQ#My_test_does_not_return_non-zero_on_failure._What_can_I_do.3F
#!
#! If no argument are given, it does the equivalent as add_test(name target)
#!
#! \note
#! You can only choose one between nothing, PASS_FILE, PASS_REGULAR_EXPRESSION and FAIL_REGULAR_EXPRESSION
#!
#! Example invocation:
#!
#! \code
#!
#! add_executable(myprogram)
#!
#! ...
#! # Start the test series for myprogram
#! camitk_init_test(myprogram)
#! camitk_add_test(EXECUTABLE_ARGS "-a inputfile.xml -c" PASS_FILE pristineOuputToCompareTo.xml) # will be called myprogram1
#! ...
#! camitk_add_test(...) # myprogram2
#!
#! \endcode
#
#! @sa camitk_init_test
macro(camitk_add_test)
parse_arguments(CAMITK_ADD_TEST
"EXECUTABLE_ARGS;PASS_FILE;PASS_REGULAR_EXPRESSION;FAIL_REGULAR_EXPRESSION" # possible lists
"" # possible options
${ARGN}
)
math(EXPR CAMITK_TEST_ID "${CAMITK_TEST_ID} + 1")
set(CAMITK_TEST_NAME "${CAMITK_TEST_BASENAME}${CAMITK_TEST_ID}")
set(CAMITK_TEST_LIST ${CAMITK_TEST_LIST} ${CAMITK_TEST_NAME})
message(STATUS "Configuring test ${CAMITK_TEST_NAME}")
# create test output directory
set(CAMITK_TEST_OUTPUT_DIR "${CMAKE_BINARY_DIR}/Testing/Temporary/${CAMITK_TEST_NAME}")
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CAMITK_TEST_OUTPUT_DIR})
# check which test is to be done
if(CAMITK_ADD_TEST_PASS_FILE)
add_test(NAME ${CAMITK_TEST_NAME}
COMMAND ${CMAKE_COMMAND}
-DCAMITK_TEST_COMMAND=${CAMITK_INIT_TEST_EXECUTABLE}
-DCAMITK_TEST_COMMAND_ARG=${CAMITK_ADD_TEST_EXECUTABLE_ARGS}
-DCAMITK_TEST_PASS_FILE=${CAMITK_ADD_TEST_PASS_FILE}
-DCAMITK_TEST_OUTPUT_DIR=${CAMITK_TEST_OUTPUT_DIR}
-DCAMITK_TEST_NAME=${CAMITK_TEST_NAME}
-P ${CAMITK_SOURCE_DIR}/cmake/modules/CamiTKTestPassFile.cmake
)
else()
# set output files for more advanced checking/debugging
set(CAMITK_TEST_COMMAND_FILE ${CAMITK_TEST_OUTPUT_DIR}/command) # which command is run to test the exectable
# cleanup
execute_process(COMMAND ${CMAKE_COMMAND} -E remove -f ${CAMITK_TEST_COMMAND_FILE} )
file(WRITE ${CAMITK_TEST_COMMAND_FILE} "Test command: ${CAMITK_INIT_TEST_EXECUTABLE} ${CAMITK_ADD_TEST_EXECUTABLE_ARGS}\nPASS_REGULAR_EXPRESSION: '${CAMITK_ADD_TEST_PASS_REGULAR_EXPRESSION}'\n")
if(CAMITK_ADD_TEST_EXECUTABLE_ARGS)
# expands all arguments
string(REPLACE " " ";" CAMITK_TEST_COMMAND_ARG_LIST ${CAMITK_ADD_TEST_EXECUTABLE_ARGS})
else()
set(CAMITK_TEST_COMMAND_ARG_LIST)
endif()
# add the simple test command
add_test(NAME ${CAMITK_TEST_NAME}
COMMAND ${CAMITK_INIT_TEST_EXECUTABLE} ${CAMITK_TEST_COMMAND_ARG_LIST}
)
# add properties if needed
if(CAMITK_ADD_TEST_PASS_REGULAR_EXPRESSION)
set_tests_properties(${CAMITK_TEST_NAME} PROPERTIES PASS_REGULAR_EXPRESSION ${CAMITK_ADD_TEST_PASS_REGULAR_EXPRESSION})
else()
if(CAMITK_ADD_TEST_FAIL_REGULAR_EXPRESSION)
set_tests_properties(${CAMITK_TEST_NAME} PROPERTIES FAIL_REGULAR_EXPRESSION ${CAMITK_ADD_TEST_FAIL_REGULAR_EXPRESSION})
endif()
endif()
endif()
endmacro()
#! This CMake file run a command and put the output in
#! a given file
#! \note
#! You have to call camitk_test_init(..) first to prepare all variables
#
# Inspired from http://stackoverflow.com/questions/3305545/how-to-adapt-my-unit-tests-to-cmake-and-ctest
# and http://www.cmake.org/pipermail/cmake/2009-July/030619.html
# declare outputfiles
set(CAMITK_TEST_COMMAND_FILE ${CAMITK_TEST_OUTPUT_DIR}/command) # which command is run to test the exectable
set(CAMITK_TEST_COMMAND_RESULT_FILE ${CAMITK_TEST_OUTPUT_DIR}/command-result) # the exit result (0=success, 1=failure) of the tested command goes in this file
set(CAMITK_TEST_COMMAND_OUTPUT_FILE ${CAMITK_TEST_OUTPUT_DIR}/command-output) # the output of the tested command goes in this files
set(CAMITK_TEST_PASS_FILE_COMMAND_FILE ${CAMITK_TEST_OUTPUT_DIR}/test) # which command is run to diff the files
set(CAMITK_TEST_PASS_FILE_OUTPUT_FILE ${CAMITK_TEST_OUTPUT_DIR}/test-output) # output of the diff cmake command
set(CAMITK_TEST_PASS_FILE_RESULT_FILE ${CAMITK_TEST_OUTPUT_DIR}/test-result) # exit result (0=success, 1=failure)
# remove all
execute_process(COMMAND ${CMAKE_COMMAND} -E remove -f ${CAMITK_TEST_COMMAND_FILE} ${CAMITK_TEST_COMMAND_RESULT_FILE} ${CAMITK_TEST_COMMAND_OUTPUT_FILE} ${CAMITK_TEST_PASS_FILE_COMMAND_FILE} ${CAMITK_TEST_PASS_FILE_OUTPUT_FILE} ${CAMITK_TEST_PASS_FILE_RESULT_FILE})
# First run the executable
file(WRITE ${CAMITK_TEST_COMMAND_FILE} "${CAMITK_TEST_COMMAND} ${CAMITK_TEST_COMMAND_ARG}")
# expands all arguments
string(REPLACE " " ";" CAMITK_TEST_COMMAND_ARG_LIST ${CAMITK_TEST_COMMAND_ARG})
execute_process(
COMMAND ${CAMITK_TEST_COMMAND} ${CAMITK_TEST_COMMAND_ARG_LIST}
RESULT_VARIABLE CAMITK_TEST_COMMAND_RESULT
OUTPUT_VARIABLE CAMITK_TEST_COMMAND_OUTPUT
# WORKING_DIRECTORY
)
file(WRITE ${CAMITK_TEST_COMMAND_RESULT_FILE} ${CAMITK_TEST_COMMAND_RESULT})
file(WRITE ${CAMITK_TEST_COMMAND_OUTPUT_FILE} ${CAMITK_TEST_COMMAND_OUTPUT})
# Then compare output
file(WRITE ${CAMITK_TEST_PASS_FILE_COMMAND_FILE} "${CMAKE_COMMAND} -E compare_files ${CAMITK_TEST_PASS_FILE} ${CAMITK_TEST_COMMAND_OUTPUT_FILE}")
execute_process(
COMMAND ${CMAKE_COMMAND} -E compare_files ${CAMITK_TEST_PASS_FILE} ${CAMITK_TEST_COMMAND_OUTPUT_FILE}
RESULT_VARIABLE CAMITK_TEST_PASS_FILE_RESULT
OUTPUT_VARIABLE CAMITK_TEST_PASS_FILE_OUTPUT
OUTPUT_QUIET
ERROR_QUIET
)
file(WRITE ${CAMITK_TEST_PASS_FILE_OUTPUT_FILE} ${CAMITK_TEST_PASS_FILE_OUTPUT})
file(WRITE ${CAMITK_TEST_PASS_FILE_RESULT_FILE} ${CAMITK_TEST_PASS_FILE_RESULT})
# check result
if( CAMITK_TEST_PASS_FILE_RESULT )
message(SEND_ERROR "${CAMITK_TEST_NAME}: ${CAMITK_TEST_COMMAND_OUTPUT_FILE} does not match ${CAMITK_TEST_PASS_FILE}" )
endif()
\ No newline at end of file
...@@ -141,6 +141,7 @@ if(NOT ${CAMITK_INSTALL_ROOT} EQUAL "") ...@@ -141,6 +141,7 @@ if(NOT ${CAMITK_INSTALL_ROOT} EQUAL "")
# include useful modules # include useful modules
include(CamiTKVariables) include(CamiTKVariables)
include(CamiTKMacros) include(CamiTKMacros)
include(CamiTKTestMacros)
# set install path # set install path
set (CMAKE_INSTALL_PREFIX ${CAMITK_INSTALL_ROOT} CACHE PATH "Path to install dir (deduced from CAMITK_INSTALL_ROOT)" FORCE) set (CMAKE_INSTALL_PREFIX ${CAMITK_INSTALL_ROOT} CACHE PATH "Path to install dir (deduced from CAMITK_INSTALL_ROOT)" FORCE)
......
...@@ -91,7 +91,7 @@ WARN_LOGFILE = ...@@ -91,7 +91,7 @@ WARN_LOGFILE =
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
INPUT = @DOXYGEN_INPUT_LIST@ INPUT = @DOXYGEN_INPUT_LIST@
INPUT_ENCODING = UTF-8 INPUT_ENCODING = UTF-8
FILE_PATTERNS = FILE_PATTERNS = *.h *.h.in *.cmake
RECURSIVE = YES RECURSIVE = YES
EXCLUDE = EXCLUDE =
EXCLUDE_SYMLINKS = NO EXCLUDE_SYMLINKS = NO
......
...@@ -87,6 +87,17 @@ ...@@ -87,6 +87,17 @@
* @page wiki CamiTK wiki * @page wiki CamiTK wiki
* Installation instructions, many tips and tutorials are proposed in the <a href="https://forge.imag.fr/plugins/mediawiki/wiki/camitk/index.php/Main_Page">CamiTK wiki</a> (you may want to edit it and share your knowledge). * Installation instructions, many tips and tutorials are proposed in the <a href="https://forge.imag.fr/plugins/mediawiki/wiki/camitk/index.php/Main_Page">CamiTK wiki</a> (you may want to edit it and share your knowledge).
* *
* \namespace CMake
*
* \brief A pseudo-namespace used to group CMake macros and functions.
*
* This is not a regular C++ namespace. It is juse used to group the CMake
* macros and function of the CamiTK build system.
*
* \page CamiTKBuildSystem The CamiTK Build System (based on CMake Macros)
*
* \defgroup CamiTKMacros CamiTK CMake Macros
* This module contains CMake macros and functions which can be used by CamiTK developers.
* *
**/ **/
......
...@@ -368,7 +368,7 @@ public: ...@@ -368,7 +368,7 @@ public:
* @param b the value of the flag (true means "is selected") * @param b the value of the flag (true means "is selected")
* @param recursive if true (default), also updates the children Component selection flags. * @param recursive if true (default), also updates the children Component selection flags.
*/ */
virtual void setSelected(const bool, const bool recursive = true); virtual void setSelected(const bool b, const bool recursive = true);
/// get the file name where the data have to be stored/were stored /// get the file name where the data have to be stored/were stored
const QString getFileName() const; const QString getFileName() const;
......
...@@ -95,15 +95,15 @@ void ImageComponent::init() { ...@@ -95,15 +95,15 @@ void ImageComponent::init() {
coronalSlices = NULL; coronalSlices = NULL;
sagittalSlices = NULL; sagittalSlices = NULL;
arbitrarySlices = NULL; arbitrarySlices = NULL;
volumeRenderingChild = NULL; volumeRenderingChild = NULL;
viewIn3D = false; viewIn3D = false;
currentPixelPicked[0] = -1; currentPixelPicked[0] = -1;
currentPixelPicked[1] = -1; currentPixelPicked[1] = -1;
currentPixelPicked[2] = -1; currentPixelPicked[2] = -1;
lut = vtkSmartPointer<vtkWindowLevelLookupTable>::New(); lut = vtkSmartPointer<vtkWindowLevelLookupTable>::New();
} }
...@@ -182,11 +182,11 @@ void ImageComponent::replaceImageData(vtkSmartPointer<vtkImageData> anImageData, ...@@ -182,11 +182,11 @@ void ImageComponent::replaceImageData(vtkSmartPointer<vtkImageData> anImageData,
arbitrarySlices = NULL; arbitrarySlices = NULL;
} }
if (volumeRenderingChild) { if (volumeRenderingChild) {
removeChild(volumeRenderingChild); removeChild(volumeRenderingChild);
delete volumeRenderingChild; delete volumeRenderingChild;
volumeRenderingChild = NULL; volumeRenderingChild = NULL;
} }
deleteChildren(); deleteChildren();
...@@ -218,7 +218,7 @@ SingleImageComponent * ImageComponent::getArbitrarySlices() { ...@@ -218,7 +218,7 @@ SingleImageComponent * ImageComponent::getArbitrarySlices() {
} }
MeshComponent * ImageComponent::getVolumeRenderingChild() { MeshComponent * ImageComponent::getVolumeRenderingChild() {
return this->volumeRenderingChild; return this->volumeRenderingChild;
} }
// -------------------- setImageName -------------------- // -------------------- setImageName --------------------
...@@ -275,56 +275,57 @@ QVector3D ImageComponent::getImageOrigin() const { ...@@ -275,56 +275,57 @@ QVector3D ImageComponent::getImageOrigin() const {
bool ImageComponent::getViewIn3D() const { bool ImageComponent::getViewIn3D() const {
return viewIn3D; return viewIn3D;
} }
void ImageComponent::setViewIn3D(bool toggle) { void ImageComponent::setViewIn3D(bool toggle) {
viewIn3D = toggle; viewIn3D = toggle;
if (viewIn3D) { if (viewIn3D) {
if (axialSlices) { if (axialSlices) {
axialSlices->setViewSliceIn3D(true); axialSlices->setViewSliceIn3D(true);
} }
if (coronalSlices) { if (coronalSlices) {
coronalSlices->setViewSliceIn3D(true); coronalSlices->setViewSliceIn3D(true);
} }
if (sagittalSlices) { if (sagittalSlices) {
sagittalSlices->setViewSliceIn3D(true); sagittalSlices->setViewSliceIn3D(true);
} }
if (arbitrarySlices) { if (arbitrarySlices) {
// by default not visible in 3D // by default not visible in 3D
arbitrarySlices->setViewSliceIn3D(false); arbitrarySlices->setViewSliceIn3D(false);
} }
if (volumeRenderingChild) { if (volumeRenderingChild) {
volumeRenderingChild->setVisibility(InteractiveViewer::get3DViewer(), true); volumeRenderingChild->setVisibility(InteractiveViewer::get3DViewer(), true);
} }
} }
else { else {
if (axialSlices) { if (axialSlices) {
axialSlices->setViewSliceIn3D(false); axialSlices->setViewSliceIn3D(false);
} }
if (coronalSlices) { if (coronalSlices) {
coronalSlices->setViewSliceIn3D(false); coronalSlices->setViewSliceIn3D(false);
} }
if (sagittalSlices) { if (sagittalSlices) {
sagittalSlices->setViewSliceIn3D(false); sagittalSlices->setViewSliceIn3D(false);
} }
if (arbitrarySlices) { if (arbitrarySlices) {
arbitrarySlices->setViewSliceIn3D(false); arbitrarySlices->setViewSliceIn3D(false);
} }
if (volumeRenderingChild) {
volumeRenderingChild->setVisibility(InteractiveViewer::get3DViewer(), false);
}
}
InteractiveViewer::get3DViewer()->refresh(); if (volumeRenderingChild) {
volumeRenderingChild->setVisibility(InteractiveViewer::get3DViewer(), false);
}
}
InteractiveViewer::get3DViewer()->refresh();
} }
...@@ -345,13 +346,13 @@ void ImageComponent::buildImageComponents() { ...@@ -345,13 +346,13 @@ void ImageComponent::buildImageComponents() {
if (!arbitrarySlices) if (!arbitrarySlices)
arbitrarySlices = new SingleImageComponent(this, InterfaceBitMap::ARBITRARY_ORIENTATION, "Arbitrary view", lut); arbitrarySlices = new SingleImageComponent(this, InterfaceBitMap::ARBITRARY_ORIENTATION, "Arbitrary view", lut);
if (volumeRenderingChild) if (volumeRenderingChild)
delete volumeRenderingChild; delete volumeRenderingChild;
// compute bounding box // compute bounding box
vtkSmartPointer<vtkPolyData> bbox = getBoundingBox(); vtkSmartPointer<vtkPolyData> bbox = getBoundingBox();
volumeRenderingChild = new MeshComponent(this, bbox, "Volume Rendering"); volumeRenderingChild = new MeshComponent(this, bbox, "Volume Rendering");
volumeRenderingChild->setRenderingModes(InterfaceGeometry::Wireframe); volumeRenderingChild->setRenderingModes(InterfaceGeometry::Wireframe);
} }
else { else {
if (coronalSlices)