[ITK] itk::InvalidRequestedRegionError: Requested region is (at least partially) outside the largest possible region
Le Sun
sunle2009 at gmail.com
Sat Oct 8 22:10:58 EDT 2016
Hi,Dženan,
Thanks very much for your reply. I also spent a lot of time to build it.
Attached is my CMakeLists.txt.
I contacted with
*Aurelien Lucchi last week, but haven't get any answer yet.*
*Best Regards*
*Le*
On 9 October 2016 at 06:48, Dženan Zukić <dzenanz at gmail.com> wrote:
> Hi Le,
>
> the first paragraph of the readme says:
> *This program is distributed in the hope that it will be useful, but
> WITHOUT ANY WARRANTY. If you find any bug, please contact Aurelien Lucchi
> <aurelien.lucchi at gmail.com <aurelien.lucchi at gmail.com>> or Kevin Smith
> <kevin.smith at epfl.ch <kevin.smith at epfl.ch>>.*
> Have you done so?
>
> I tried building the mentioned library, after commenting out the
> hard-coded paths in CMakeLists, I could still not build it. Errors are
> unrelated to ITK, e.g.:
> 2>c:\misc\rays3d\Display.h(23): fatal error C1083: Cannot open include
> file: 'GL/glut.h': No such file or directory
> 2>C:\Misc\rays3d\rays3d_utils.cpp(20): fatal error C1083: Cannot open
> include file: 'dirent.h': No such file or directory
> (I have given a path to GLUT and OpenCV).
>
> Can you create a minimum working example <http://sscce.org/>? Attached
> are my modifications to the CMakeListst.txt.
>
> Regards,
> Dženan
>
> On Sat, Oct 8, 2016 at 4:36 AM, Le Sun <sunle2009 at gmail.com> wrote:
>
>> Hi,
>>
>> I am running the code of 'Segmentation code for the 3D ray features
>> described in our <http://people.inf.ethz.ch/alucchi/code/rays3d.zip>' on
>> page http://people.inf.ethz.ch/alucchi/code.php.
>>
>> When run the first example in the readme.txt in the code
>> package:test3dRays /home/le/Documents/rays3d/data/sphere 1 2 8 16
>>
>> I got the following error:
>> *******************************************************
>> Error while running this filter.
>> itk::InvalidRequestedRegionError (0x2e7ebc0)
>> Location: "void itk::NeighborhoodOperatorImageFilter<TInputImage,
>> TOutputImage, TOperatorValueType>::GenerateInputRequestedRegion() [with
>> TInputImage = itk::Image<float, 3u>; TOutputImage = itk::Image<float, 3u>;
>> TOperatorValueType = double]"
>> File: /usr/local/include/ITK-4.10/itkNeighborhoodOperatorImageFilter.hxx
>> Line: 72
>> Description: Requested region is (at least partially) outside the largest
>> possible region.
>> *******************************************************
>>
>> I added ' -> UpdateLargestPossibleRegion()' for each Filter in the .cpp
>> and .cxx files. However, couldn't solve this problem.
>>
>> Thank you for your help.
>>
>> Best Regards
>> Le
>>
>> _______________________________________________
>> Community mailing list
>> Community at itk.org
>> http://public.kitware.com/mailman/listinfo/community
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20161009/ac6c4a64/attachment.html>
-------------- next part --------------
#######################################################################
# This program is free software; you can redistribute it and/or #
# modify it under the terms of the GNU General Public License #
# version 2 as published by the Free Software Foundation. #
# #
# This program is distributed in the hope that it will be useful, but #
# WITHOUT ANY WARRANTY; without even the implied warranty of #
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
# General Public License for more details. #
# #
# Written and (C) by Aurelien Lucchi and Kevin Smith #
# Contact aurelien.lucchi (at) gmail.com or kevin.smith (at) epfl.ch #
# for comments & bug reports #
#######################################################################
cmake_minimum_required(VERSION 2.4)
PROJECT(rays3d)
INCLUDE_REGULAR_EXPRESSION("^.*$")
set(CMAKE_C_COMPILER "g++")
set(CMAKE_CXX_COMPILER "g++")
SET(CMAKE_BUILD_TYPE Release)
#SET(CMAKE_BUILD_TYPE Debug)
set(CMAKE_MODULE_PATH "modules")
option(USE_OPENGL "use OPENGL library" off)
mark_as_advanced(USE_OPENGL)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -g -pg")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3")
set(CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS})
set(CMAKE_C_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
set(CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})
###################################################################### PACKAGES
#SET(OpenCV_FIND_COMPONENTS CV CXCORE CVAUX HIGHGUI ML)
#SET(OpenCV_FIND_REQUIRED_COMPONENTS CV CXCORE CVAUX HIGHGUI ML)
set(OpenCV_DIR /usr/)
#include_directories(${OpenCV_DIR}/include/)
#include_directories(${OpenCV_DIR}/include/opencv/)
FIND_PACKAGE(OpenCV REQUIRED)
# add include directories
include_directories(${OPENCV_INCLUDE_DIR})
#find_library(ML_LIBRARY NAMES opencv_ml PATHS ${OpenCV_DIR}/lib/)
#find_library(ML_LIBRARY NAMES ml PATHS ${OpenCV_DIR}/lib/)
#SET(OpenCV_LIBS ${OpenCV_LIBS} ${ML_LIBRARY})
message("OpenCV")
message(STATUS ${OpenCV_LIBS})
message(STATUS ${OpenCV_LIBRARIES})
SET(OpenCV_LIBS ${OpenCV_LIBRARIES})
INCLUDE_DIRECTORIES(/usr/include/tclap)
# include_directories(~/src/ThirdParty/OpenCV-2.0.0/include/opencv/)
# set(OpenCV_ROOT_DIR ~/src/ThirdParty/OpenCV-2.0.0/lib/)
# find_library(OpenCV_CV_LIBRARY
# NAMES cv opencv
# PATHS ${OpenCV_ROOT_DIR})
# find_library(OpenCV_CVAUX_LIBRARY
# NAMES cvaux
# PATHS ${OpenCV_ROOT_DIR})
# find_library(OpenCV_CXCORE_LIBRARY
# NAMES cxcore
# PATHS ${OpenCV_ROOT_DIR})
# find_library(OpenCV_HIGHGUI_LIBRARY
# NAMES highgui
# PATHS ${OpenCV_ROOT_DIR})
# find_library(OpenCV_ML_LIBRARY
# NAMES ml
# PATHS ${OpenCV_ROOT_DIR})
# SET(OPENCV_LIBRARIES ${OpenCV_CV_LIBRARY} ${OpenCV_CVAUX_LIBRARY} ${OpenCV_CXCORE_LIBRARY} ${OpenCV_HIGHGUI_LIBRARY} ${OpenCV_ML_LIBRARY})
#if(USE_OPENGL)
#CHECK OPENGL DEPENDENCY
#FIND_PACKAGE(OpenGL REQUIRED)
#IF (OPENGL_FOUND)
# MESSAGE(STATUS "OpenGL Found")
#ELSE (OPENGL_FOUND)
# MESSAGE(FATAL_ERROR "OpenGL Not Found (required to compile modules)")
# SET(BUILD_MODULE FALSE)
#ENDIF (OPENGL_FOUND)
set(OpenGL_DIR /usr/)
FIND_PACKAGE(OpenGL REQUIRED)
# add include directories
include_directories(${OPENGL_INCLUDE_DIR})
message("OpenGL")
message(STATUS ${OpenGL_LIBS})
message(STATUS ${OpenGL_LIBRARIES})
SET(OpenGL_LIBS ${OpenGL_LIBRARIES})
#CHECK GLUT DEPENDENCY
#FIND_PACKAGE(GLUT REQUIRED)
#IF (GLUT_FOUND)
# MESSAGE(STATUS "GLUT Found")
#ELSE (GLUT_FOUND)
# MESSAGE(FATAL_ERROR "GLUT Not Found (required to compile modules)")
# SET(BUILD_MODULE FALSE)
#ENDIF (GLUT_FOUND)
set(GLUT_DIR /usr/)
FIND_PACKAGE(GLUT REQUIRED)
# add include directories
include_directories(${GLUT_INCLUDE_DIR})
message("GLUT")
message(STATUS ${GLUT_LIBS})
message(STATUS ${GLUT_LIBRARIES})
SET(GLUT_LIBS ${GLUT_LIBRARIES})
#include_directories(${GLEW_INCLUDE_DIR}/lib/misc/include)
#find_package(GLEW REQUIRED)
#IF (GLEW_FOUND)
# include_directories(${GLEW_INCLUDE_DIR})
#ELSE (GLEW_FOUND)
# MESSAGE(FATAL_ERROR "GLEW Not Found (required to compile modules)")
# SET(BUILD_MODULE FALSE)
# #include_directories(${GLEW_INCLUDE_DIR}/lib/misc/include)
#ENDIF (GLEW_FOUND)
set(GLEW_DIR /usr/)
FIND_PACKAGE(GLEW REQUIRED)
# add include directories
include_directories(${GLEW_INCLUDE_DIR})
message("GLEW")
message(STATUS ${GLEW_LIBS})
message(STATUS ${GLEW_LIBRARIES})
SET(GLEW_LIBS ${GLEW_LIBRARIES})
#endif(USE_OPENGL)
set(ITK_DIR "/usr/local/src/InsightToolkit-4.10.0")
message(${ITK_DIR})
find_package(ITK REQUIRED)
IF(ITK_FOUND)
INCLUDE(${ITK_USE_FILE})
ENDIF(ITK_FOUND)
###################################################################### EXECUTABLE
ADD_EXECUTABLE(test3dRays
combnk.cpp
pca.cpp
rays3d.cpp
test_rays3d.cpp
rays3d_utils.cpp
rays3dVolume.cpp
Display.cpp
)
#if(USE_OPENGL)
#TARGET_LINK_LIBRARIES(test3dRays ITKIO ITKStatistics ${OPENCV_LIBRARIES} ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${GLEW_LIBRARY})
TARGET_LINK_LIBRARIES(test3dRays ${ITK_LIBRARIES} ITKStatistics ${OpenCV_LIBS} ${OPENCV_LIBRARIES} ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${GLEW_LIBRARY})
#else(USE_OPENGL)
#TARGET_LINK_LIBRARIES(test3dRays ITKIO ITKStatistics ${OPENCV_LIBRARIES})
#TARGET_LINK_LIBRARIES(test3dRays ${ITK_LIBRARIES} ITKStatistics ${OpenCV_LIBS} ${OPENCV_LIBRARIES})
#endif(USE_OPENGL)
SET_TARGET_PROPERTIES(test3dRays PROPERTIES COMPILE_FLAGS -fPIC)
#set(CMAKE_CXX_FLAGS_SAVED ${CMAKE_CXX_FLAGS})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D RAYS_MULTITHREADING")
#SET_SOURCE_FILES_PROPERTIES(rays3d.cpp COMPILE_FLAGS ${CMAKE_CXX_FLAGS})
#SET_SOURCE_FILES_PROPERTIES(rays3d.cpp COMPILE_FLAGS "${CMAKE_CXX_FLAGS} -D EXPORTSWC -D RAYS_TESTING")
#SET_SOURCE_FILES_PROPERTIES(rays3d.cpp COMPILE_FLAGS "${CMAKE_CXX_FLAGS} -D RAYS_TESTING")
#TARGET_LINK_LIBRARIES(test3dRays ${SLICEME_THIRD_PARTY_LIBRARIES}))
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
ADD_LIBRARY(rays3d
combnk.cpp
pca.cpp
rays3d.cpp
rays3d_utils.cpp
)
#set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_SAVED})
#SET_SOURCE_FILES_PROPERTIES(COMPILE_FLAGS ${CMAKE_CXX_FLAGS})
#TARGET_LINK_LIBRARIES(rays3d ITKIO ITKStatistics ${OPENCV_LIBRARIES})
TARGET_LINK_LIBRARIES(rays3d ${ITK_LIBRARIES} ITKStatistics ${OpenCV_LIBS} ${OPENCV_LIBRARIES} ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES} ${GLEW_LIBRARY})
SET_TARGET_PROPERTIES(rays3d PROPERTIES COMPILE_FLAGS -fPIC)
More information about the Community
mailing list