From matt.mccormick at kitware.com Tue Jul 1 10:42:18 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 1 Jul 2014 10:42:18 -0400 Subject: [ITK-users] [ITK] make: path to ITK build unknown In-Reply-To: <1404163146356-34178.post@n7.nabble.com> References: <1404156895729-34171.post@n7.nabble.com> <1404158799755-34173.post@n7.nabble.com> <1404160568558-34175.post@n7.nabble.com> <1404161490890-34177.post@n7.nabble.com> <1404163146356-34178.post@n7.nabble.com> Message-ID: After testing on Ubuntu 12.04, I confirmed that even without adjusting CMAKE_INSTALL_PREFIX, a 'make install' is sufficient for cmake to automatically find ITK_DIR. This error: fatal error: itkBinaryThresholdImageFilter.h: No such file or directory compilation terminated. Is probably related to an issue in your project's CMakeLists.txt. Please download and unpack the tarball for this example [1], test to verify it builds, and use it as an example for your project. Hope this helps, Matt [1] http://itk.org/ITKExamples/src/Filtering/Thresholding/ThresholdAnImageUsingBinary/Documentation.html On Mon, Jun 30, 2014 at 5:19 PM, donelron wrote: > I just ran > cmake -DCMAKE_INSTALL_PREFIX=/usr . /home/ron/vtk_itk/ITK > make > sudo make install, but the problem is still there - same errror message: > -------------------------------------------------------------------------------- > fatal error: itkBinaryThresholdImageFilter.h: No such file or directory > compilation terminated. > etc.. > -------------------------------------------------------------------------------- > > > > > > > > -- > View this message in context: http://itk-users.7.n7.nabble.com/make-path-to-ITK-build-unknown-tp34171p34178.html > Sent from the ITK - Users mailing list archive at Nabble.com. > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community From e.heim at dkfz-heidelberg.de Tue Jul 1 11:35:45 2014 From: e.heim at dkfz-heidelberg.de (Heim, Eric) Date: Tue, 1 Jul 2014 17:35:45 +0200 Subject: [ITK-users] ITK Python Wrapping vs. SimpleITK Message-ID: <57EE86D11538B44096C712532DBB6C5A0109F25B2D6D@DKFZEX01.ad.dkfz-heidelberg.de> Dear all, I'm currently embedding python into a C/C++ application and want to access ITK through python. The ITK python wrapping requires CableSwig to work, but I can't compile it under newer Visual Studio versions. After looking at the git repository I noticed that the last commit in CableSwig was done ~2 years ago. Some open source projects, like 3DSlicer, are now using SimpleITK in their python wrapping. What are the future development plans of ITK python wrapping, CableSwig and SimpleITK? Would it be more future-proof to embed SimpleITK into an application than ITK? Are there maybe plans to fully integrate SimpleITK into ITK, so there is no need for additional toolkit dependencies except ITK? Cheers, Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Tue Jul 1 12:14:00 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 1 Jul 2014 12:14:00 -0400 Subject: [ITK-users] [ITK] ITK Python Wrapping vs. SimpleITK In-Reply-To: <57EE86D11538B44096C712532DBB6C5A0109F25B2D6D@DKFZEX01.ad.dkfz-heidelberg.de> References: <57EE86D11538B44096C712532DBB6C5A0109F25B2D6D@DKFZEX01.ad.dkfz-heidelberg.de> Message-ID: Hi Eric, ITK no longer requires CableSwig for wrapping. However, it currently does not build on Visual Studio newer that 2008. This due to GCCXML limitations. We have investigated a GCCXML replacement, but it still needs work. SimpleITK is also a good option. It has no dependencies other than ITK. Hope this helps, Matt On Tue, Jul 1, 2014 at 11:35 AM, Heim, Eric wrote: > Dear all, > > > > I?m currently embedding python into a C/C++ application and want to access > ITK through python. > > The ITK python wrapping requires CableSwig to work, but I can?t compile it > under newer Visual Studio versions. > > After looking at the git repository I noticed that the last commit in > CableSwig was done ~2 years ago. > > Some open source projects, like 3DSlicer, are now using SimpleITK in their > python wrapping. > > > > What are the future development plans of ITK python wrapping, CableSwig and > SimpleITK? > > Would it be more future-proof to embed SimpleITK into an application than > ITK? Are there maybe plans > > to fully integrate SimpleITK into ITK, so there is no need for additional > toolkit dependencies except ITK? > > > > Cheers, > > Eric > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > From donelron at web.de Tue Jul 1 17:09:24 2014 From: donelron at web.de (donelron) Date: Tue, 1 Jul 2014 14:09:24 -0700 (PDT) Subject: [ITK-users] [ITK] make: path to ITK build unknown In-Reply-To: References: <1404156895729-34171.post@n7.nabble.com> <1404158799755-34173.post@n7.nabble.com> <1404160568558-34175.post@n7.nabble.com> <1404161490890-34177.post@n7.nabble.com> <1404163146356-34178.post@n7.nabble.com> Message-ID: <1404248964241-34182.post@n7.nabble.com> My CMakeLists.txt looks like: ------------------------------------------------------------------------------------------------- cmake_minimum_required(VERSION 2.4) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) SET(DITK_DIR /home/ron/vtk_itk/ITK) project(BinaryThresholdFilter) include_regular_expression("^.*$") # Find ITK. find_package(ITK REQUIRED) include(${ITK_USE_FILE}) add_executable(BinaryThresholdImageFilter BinaryThresholdImageFilter.cxx ) target_link_libraries(BinaryThresholdImageFilter ${ITK_LIBRARIES}) if(BUILD_TESTING) add_subdirectory(test) endif() ------------------------------------------------------------------------------------------------- I downloaded and compiled the code you mentioned with cmake ../BinaryThresholding/ make and the result here is similar as with the project I was talking about in my initial post: fatal error: itkImageFileReader.h: No such file or directory compilation terminated. make[2]: *** [CMakeFiles/BinaryThresholdImageFilter.dir/BinaryThresholdImageFilter.o] Error 1 make[1]: *** [CMakeFiles/BinaryThresholdImageFilter.dir/all] Error 2 make: *** [all] Error 2 However, if I cmake -DITK_DIR=/home/ron/vtk_itk/ITK ../BinaryThresholding/ make it successfully compiles. -- View this message in context: http://itk-users.7.n7.nabble.com/make-path-to-ITK-build-unknown-tp34171p34182.html Sent from the ITK - Users mailing list archive at Nabble.com. From franciscolopezdelafranca at gmail.com Wed Jul 2 09:19:41 2014 From: franciscolopezdelafranca at gmail.com (=?UTF-8?Q?Francisco_L=C3=B3pez-Franca?=) Date: Wed, 2 Jul 2014 06:19:41 -0700 (PDT) Subject: [ITK-users] Surface extraction problem Message-ID: <1404307181365-7585840.post@n2.nabble.com> Hi everybody. I've created a 3D cylinder by using the class CylinderSpatialObject. After that, I pass the cylinder object to an object of class SpatialObjectToImageFilter in order to prepare the spatial object to be written to file. I've set both the cylinder object and the image filter a value of 0 for background and 255 for foreground. Finally, I pass, as input, the image filter output to an image file writer (ImageFileWriter) object to save it to file (Nifti format, for instance). The result is the attached "cilindro.jpg" figure. Up to here, all is ok. The problem comes next. What I want is to extract the surface of the 3D cylinder. I search for the web and found an example, from which I followed the implementation. I copy below my code and attach the result of the surface extraction ("cilindro_superficie.jpg"), hoping that anyone see if I am committing any error. I expected just the boundary of the 3D cylinder (with no inside points), and it seems like the bounding box of the cylinder what I've got including the inside points. Thank you very much and my best regards. My code is (I've erased the obvious code): typedef itk::Image< PixelType, Dimension > ImageType; typedef itk::Mesh MeshType; typedef itk::ImageFileReader< ImageType > ReaderType; ReaderType::Pointer reader = ReaderType::New(); reader->SetFileName( inputFileName); reader->Update(); typedef itk::BinaryMask3DMeshSource< ImageType, MeshType > MeshSourceType; MeshSourceType::Pointer meshSource = MeshSourceType::New(); meshSource->SetObjectValue( 255); meshSource->SetInput( reader->GetOutput() ); meshSource->Update(); typedef itk::MeshSpatialObject SpatialObjectType; SpatialObjectType::Pointer mesh = SpatialObjectType::New(); mesh->SetMesh(meshSource->GetOutput()); typedef itk::SpatialObjectToImageFilter MeshFilterType; MeshFilterType::Pointer meshFilter = MeshFilterType::New(); meshFilter->SetSize(size); meshFilter->SetOutsideValue(0); meshFilter->SetInsideValue(255); meshFilter->SetInput(mesh); meshFilter->Update(); typedef itk::ImageFileWriter ImageWriterType; ImageWriterType::Pointer imageWriter = ImageWriterType::New(); imageWriter->SetFileName(outputFileName); imageWriter->SetInput(meshFilter->GetOutput()); imageWriter->Update(); -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Surface-extraction-problem-tp7585840.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From mrguilfoyle at gmail.com Wed Jul 2 12:14:03 2014 From: mrguilfoyle at gmail.com (Mathew Guilfoyle) Date: Wed, 2 Jul 2014 17:14:03 +0100 Subject: [ITK-users] [ITK] Resampling after SetDirection() and SetOrigin() In-Reply-To: References: Message-ID: Hi Matt Sorry to labour this point but I'm still confused as to what is going on; my misunderstanding may well be to do with how the pipelines work. As an example: import itk fileNameIn = '/route/to/input.nii' fileNameOut = '/route/to/output.nii' image_type = itk.Image[itk.F, 3] reader = itk.ImageFileReader[image_type].New() reader.SetFileName(fileNameIn) reader.Update() image = reader.GetOutput() #image.GetOrigin() gives [-148, -153, 55] #image.GetDirection().GetVnlMatrix().get(0,0)....(2,2) #gives matrix: 1.0 0 0 # 0 0.95 0.3 # 0 -0.3 0.95 image.GetOrigin().Fill(0) image.GetDirection().SetIdentity() #image.GetOrigin() gives [0, 0, 0] #image.GetDirection().GetVnlMatrix().get(0,0)....(2,2) #gives matrix: 1.0 0 0 # 0 1.0 0 # 0 0 1.0 writer = itk.ImageFileWriter[image_type].New() writer.SetFileName(fileNameOut) writer.SetInput(image) writer.Update() *#output image volume is unchanged when viewed in (e.g.) ImageJ* resampler = itk.ResampleImageFilter[image_type, image_type].New() resampler.SetInput(image) resampler.SetSize(image.GetLargestPossibleRegion().GetSize()) resampler.SetOutputOrigin(image.GetOrigin()) resampler.SetOutputSpacing(image.GetSpacing()) resampler.SetOutputDirection(image.GetDirection()) resampler.Update() writer.SetInput(resampler.GetOutput()) writer.Update() *#now output is translated and rotated by the (inverse) values of the original#origin vector and direction matrix##However, resampler.GetInput().GetOrigin() gives [0,0,0]#and similarly the direction of the input is a 3x3 identity matrix* I don't understand why the resampler changes the image volume since it should not be 'aware' of the original origin/direction. >From your previous reply you suggest that the call to resampler.Update() might cause the reader to re-import the file from disk. Is this the case even when the reader and resampler are not connected in a pipeline (as here). Further, if the reader does re-import the original image and origin/direction parameters why does resampler.GetInput().GetOrigin() report [0, 0, 0] and the input direction matrix is an identity? I want to understand why this is happening as it is clearly important for ensuring I set up more complex pipelines correctly. Many thanks Mathew On 30 June 2014 03:28, Matt McCormick wrote: > Hi Mathew, > > The image does not retain the original parameters somewhere. However, > can must be take, because if the image is generated by a filter in a > pipeline, that filter will reset the original value when the pipeline > is re-run. ChangeInformationImageFilter will ensure this reset does > not happen during a pipeline update. > > The Set methods doo reorient/reposition the whole image volume in > world space. The resampling filter does not select a subregion or > rotates the images -- to get the same out, the sampling locations of > the output image for the ResampleImageFilter must be set as desired. > Set SetOutputOrigin [1], SetOutputDirection [2], etc. > > Hope this helps to clarify. > > I checked by wrapped install, and I have ChangeInformationImageFilter > instantiations for float images. > > Hope this helps, > Matt > > [1] > http://www.itk.org/Doxygen/html/classitk_1_1ResampleImageFilter.html#ac4b197ddefd3b3344bd9c9471acd5b00 > > [2] > http://www.itk.org/Doxygen/html/classitk_1_1ResampleImageFilter.html#a9fdd6b862ab6cbaa03702da393bd0474 > > > On Sun, Jun 29, 2014 at 10:01 PM, Mathew Guilfoyle > wrote: > > Matt, thanks for the reply. > > > > I would be grateful if you could you explain why this is the desired > > behaviour. If I use the SetDirection() or SetOrigin() methods does the > > image object retain the original parameters somewhere? Subsequently > calling > > GetDirection() or GetOrigin() reports the changed parameters. > > > > Intuitively you would expect both Set methods to reorient/reposition the > > whole image volume in world space, and on the face of it that is what > they > > seem to do. However, on passing the image to a resampling filter they > act > > to select a subregion or to rotate the image. I would have thought that > > rotations and region selections should be options passed to the filter > and > > not set in the image itself? > > > > How does the ChangeInformationImageFilter do it differently? > Incidentally I > > have wrapped for float but don't get this as an option for this filter. > > > > Thanks > > Mathew > > > > > > > > On 30 June 2014 01:45, Matt McCormick > wrote: > >> > >> Hi Mathew, > >> > >> Yes, that is the correct and expected behavior. I do not know if > >> ImageJ is using the actual location in world space. > >> > >> It sounds like ChangeInformationImageFilter is what you are looking > >> for. It will be wrapped for float images if wrapped for float images > >> is enabled in you CMake configuration (ITK_WRAP_float). > >> > >> Hope this helps, > >> Matt > >> > >> > >> On Sat, Jun 28, 2014 at 9:55 PM, Mathew Guilfoyle < > mrguilfoyle at gmail.com> > >> wrote: > >> > If I change an image's direction and origin using SetDirection() and > >> > SetOrigin() methods and then write the image back to a file, the > volume > >> > stack viewed in (e.g.) ImageJ is unchanged. This is the behaviour I > >> > would > >> > expect as changing the direction and origin shouldn't alter the array > of > >> > image pixels, just its location and orientation in 'world space'? > >> > > >> > However, if I take the same image, adjust the origin and direction as > >> > before, and then input it to ResampleImageFilter with an identity > >> > transform > >> > (and set spacing, origin, direction, and size to those of the input > >> > image) > >> > the output is a translated and rotated image. > >> > > >> > It seems the difference between the original and adjusted origin and > >> > direction are applied as a translation and rotation during resampling, > >> > even > >> > though GetOrigin() and GetDirection() on the input image to the > >> > resampler > >> > return the adjusted parameters. > >> > > >> > Is this the expected behaviour? Is there another image parameter that > >> > needs > >> > to be changed to correctly alter origin and direction? > >> > > >> > (ChangeInformationImageFilter is not wrapped for float images so I > can't > >> > use > >> > it for my application) > >> > > >> > Thanks > >> > > >> > _____________________________________ > >> > Powered by www.kitware.com > >> > > >> > Visit other Kitware open-source projects at > >> > http://www.kitware.com/opensource/opensource.html > >> > > >> > Kitware offers ITK Training Courses, for more information visit: > >> > http://www.kitware.com/products/protraining.php > >> > > >> > Please keep messages on-topic and check the ITK FAQ at: > >> > http://www.itk.org/Wiki/ITK_FAQ > >> > > >> > Follow this link to subscribe/unsubscribe: > >> > http://public.kitware.com/mailman/listinfo/insight-users > >> > > >> > _______________________________________________ > >> > Community mailing list > >> > Community at itk.org > >> > http://public.kitware.com/mailman/listinfo/community > >> > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gabrielgimenez85 at gmail.com Wed Jul 2 17:43:53 2014 From: gabrielgimenez85 at gmail.com (=?UTF-8?Q?Gabriel_A=2E_Gim=C3=A9nez?=) Date: Wed, 2 Jul 2014 14:43:53 -0700 (PDT) Subject: [ITK-users] MattesMutualInformationImageToImageMetric: Joint PDF summed to zero Message-ID: <1404337433182-7585842.post@n2.nabble.com> Hi everyone, first of all, sorry for my bad English. I modified the ImageRegistration8 example for use the itkOnePlusOneEvolutionaryOptimize and itkMattesMutualInformationImageToImageMetric like in the ImageRegistration11 example. Can help me with this error ? Thanks. 1 -0.536085 [0, 0, 0, 2.4210718274608496, -15.626697762130291, 0.24074437575656304] 2 -0.536085 [0, 0, 0, 2.4210718274608496, -15.626697762130291, 0.24074437575656304] 3 -0.536085 [0, 0, 0, 2.4210718274608496, -15.626697762130291, 0.24074437575656304] ExceptionObject caught ! itk::ExceptionObject (0xa23c098) Location: "itk::MattesMutualInformationImageToImageMetric::MeasureType itk::MattesMutualInformationImageToImageMetric::GetValue(itk::MattesMutualInformationImageToImageMetric::ParametersType&) const [with TFixedImage = itk::Image, TMovingImage = itk::Image, itk::MattesMutualInformationImageToImageMetric::MeasureType = double, itk::MattesMutualInformationImageToImageMetric::ParametersType = itk::OptimizerParameters]" File: /media/datos/FP-UNA/tesis/implementacion/qtCreator/InsightToolkit-4.5.1/Modules/Registration/Common/include/itkMattesMutualInformationImageToImageMetric.hxx Line: 546 Description: itk::ERROR: MattesMutualInformationImageToImageMetric(0xa22f070): Joint PDF summed to zero Image (0xa23bc10) RTTI typeinfo: itk::Image Reference Count: 2 Modified Time: 437 Debug: Off Object Name: Observers: none Source: (none) Source output name: (none) Release Data: Off Data Released: False Global Release Data: Off PipelineMTime: 0 UpdateMTime: 0 RealTimeStamp: 0 seconds LargestPossibleRegion: Dimension: 2 Index: [0, 0] Size: [20, 20] BufferedRegion: Dimension: 2 Index: [0, 0] Size: [20, 20] RequestedRegion: Dimension: 2 Index: [0, 0] Size: [20, 20] Spacing: [15.9375, 15.625] Origin: [0, 0] Direction: 1 0 0 1 IndexToPointMatrix: 15.9375 0 0 15.625 PointToIndexMatrix: 0.0627451 0 0 0.064 Inverse Direction: 1 0 0 1 PixelContainer: ImportImageContainer (0xa23bd58) RTTI typeinfo: itk::ImportImageContainer Reference Count: 1 Modified Time: 438 Debug: Off Object Name: Observers: none Pointer: 0xa4b4880 Container manages memory: true Size: 400 Capacity: 400 -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/MattesMutualInformationImageToImageMetric-Joint-PDF-summed-to-zero-tp7585842.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From blowekamp at mail.nih.gov Wed Jul 2 17:50:37 2014 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Wed, 2 Jul 2014 17:50:37 -0400 Subject: [ITK-users] [ITK] MattesMutualInformationImageToImageMetric: Joint PDF summed to zero In-Reply-To: <1404337433182-7585842.post@n2.nabble.com> References: <1404337433182-7585842.post@n2.nabble.com> Message-ID: Hello, This is likely caused by the images no longer overlapping sufficiently. You didn't indicate how you modified the example. So it's difficult to specifically help. Check your transform, parameter, scales, and initalRadius for the optimizer or similar optimizer parameter. Brad On Jul 2, 2014, at 5:43 PM, Gabriel A. Gim?nez wrote: > Hi everyone, first of all, sorry for my bad English. > > I modified the ImageRegistration8 example for use the > itkOnePlusOneEvolutionaryOptimize and > itkMattesMutualInformationImageToImageMetric like in the ImageRegistration11 > example. > Can help me with this error ? > > Thanks. > > 1 -0.536085 [0, 0, 0, 2.4210718274608496, -15.626697762130291, > 0.24074437575656304] > 2 -0.536085 [0, 0, 0, 2.4210718274608496, -15.626697762130291, > 0.24074437575656304] > 3 -0.536085 [0, 0, 0, 2.4210718274608496, -15.626697762130291, > 0.24074437575656304] > ExceptionObject caught ! > > itk::ExceptionObject (0xa23c098) > Location: "itk::MattesMutualInformationImageToImageMetric TMovingImage>::MeasureType > itk::MattesMutualInformationImageToImageMetric TMovingImage>::GetValue(itk::MattesMutualInformationImageToImageMetric TMovingImage>::ParametersType&) const [with TFixedImage = itk::Image 3u>, TMovingImage = itk::Image, > itk::MattesMutualInformationImageToImageMetric TMovingImage>::MeasureType = double, > itk::MattesMutualInformationImageToImageMetric TMovingImage>::ParametersType = itk::OptimizerParameters]" > File: > /media/datos/FP-UNA/tesis/implementacion/qtCreator/InsightToolkit-4.5.1/Modules/Registration/Common/include/itkMattesMutualInformationImageToImageMetric.hxx > Line: 546 > Description: itk::ERROR: > MattesMutualInformationImageToImageMetric(0xa22f070): Joint PDF summed to > zero > Image (0xa23bc10) > RTTI typeinfo: itk::Image > Reference Count: 2 > Modified Time: 437 > Debug: Off > Object Name: > Observers: > none > Source: (none) > Source output name: (none) > Release Data: Off > Data Released: False > Global Release Data: Off > PipelineMTime: 0 > UpdateMTime: 0 > RealTimeStamp: 0 seconds > LargestPossibleRegion: > Dimension: 2 > Index: [0, 0] > Size: [20, 20] > BufferedRegion: > Dimension: 2 > Index: [0, 0] > Size: [20, 20] > RequestedRegion: > Dimension: 2 > Index: [0, 0] > Size: [20, 20] > Spacing: [15.9375, 15.625] > Origin: [0, 0] > Direction: > 1 0 > 0 1 > > IndexToPointMatrix: > 15.9375 0 > 0 15.625 > > PointToIndexMatrix: > 0.0627451 0 > 0 0.064 > > Inverse Direction: > 1 0 > 0 1 > > PixelContainer: > ImportImageContainer (0xa23bd58) > RTTI typeinfo: itk::ImportImageContainer > Reference Count: 1 > Modified Time: 438 > Debug: Off > Object Name: > Observers: > none > Pointer: 0xa4b4880 > Container manages memory: true > Size: 400 > Capacity: 400 > > > > > -- > View this message in context: http://itk-insight-users.2283740.n2.nabble.com/MattesMutualInformationImageToImageMetric-Joint-PDF-summed-to-zero-tp7585842.html > Sent from the ITK Insight Users mailing list archive at Nabble.com. > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community From j.plumat at auckland.ac.nz Wed Jul 2 19:29:20 2014 From: j.plumat at auckland.ac.nz (Jerome Plumat) Date: Thu, 03 Jul 2014 11:29:20 +1200 Subject: [ITK-users] 3D Affine Registration - no rotation found Message-ID: <53B495D0.4080500@auckland.ac.nz> Hi everyone, I'm facing to a problem with 3D affine multi resolution registration. The pipeline registers two 3D MRI head and necks volumes (600x400x40). These are scans of the same patient at two times. Due to the protocol, volumes are similar expect for MRI artifacts. In fine the algorithm would be used to registered an atlas defined on the fixed image on moving image. The main elements of the pipeline are listed below. It's implemented with itk4 and is mostly based on MutliResImageRegistration2.cxx, I use the Mutual Information metric, linear interpolator, the optimizer is RegularStepGradientDescentOptimizer and CenteredTransformInitializer. The registration is performed without any error and the translation is correctly found but the algorithm can't provide any rotation and I can't figure why. The final results are versor X = [1.00007, 0.000485777, 1.5912e-05] versor Y = [-0.000126483, 0.999922, 1.34996e-05] versor Z = [2.35376e-05, -8.28481e-05, 0.999986] Translation X = 1.35204 Translation Y = 0.647584 Translation Z = -0.132708 Iterations = 96 Metric value = -0.738412 Following http://www.cmake.org/pipermail/insight-users/2006-August/019025.html the final rotation is 0.0003 along axis [-0.155456, -0.0122989, -0.987766]. Moreover, visual validation clearly highlight the fact the rotation is not sufficient. Hope any one has advices. Thanks in advances. Jerome. Part of code: .... // transform typedef itk::AffineTransform< double, Dimension> TransformType; typedef itk::CenteredTransformInitializer< TransformType, FixedImageType, MovingImageType > TransformInitializerType; // optimizer typedef itk::RegularStepGradientDescentOptimizer OptimizerType; // metric typedef itk::MattesMutualInformationImageToImageMetric< MovingImageType, MovingImageType > MetricType; // interpolator typedef itk:: LinearInterpolateImageFunction< MovingImageType, double > InterpolatorType; // registration typedef itk::MultiResolutionImageRegistrationMethod< FixedImageType, MovingImageType > RegistrationType; typedef itk::MultiResolutionPyramidImageFilter< FixedImageType, FixedImageType > FixedImagePyramidType; typedef itk::MultiResolutionPyramidImageFilter< MovingImageType, MovingImageType > MovingImagePyramidType; ... metric->SetNumberOfHistogramBins( 256 ); metric->SetNumberOfSpatialSamples( 50000 ); metric->ReinitializeSeed( 76926294 ); .... // connect the inputs registration->SetFixedImage( fixedImage ); registration->SetMovingImage( movingImage ); // set the regions registration->SetFixedImageRegion( fixedImage->GetLargestPossibleRegion() ); // configure the initializer initializer->SetTransform( transform ); initializer->SetFixedImage( fixedImage ); initializer->SetMovingImage( movingImage ); initializer->MomentsOn(); initializer->InitializeTransform(); registration->SetInitialTransformParameters( transform->GetParameters() ); // optimizer scales typedef OptimizerType::ScalesType OptimizerScalesType; OptimizerScalesType optimizerScales( transform->GetNumberOfParameters() ); const double momentScale = 1; const double translationScale = 1.0 / 1e7; //number of dimensions: N*(N+1) for(unsigned int i=0; i<(Dimension*Dimension); i++ ) { optimizerScales[i] = momentScale; } for( unsigned int i=(Dimension*Dimension); i<((Dimension+1)*Dimension); i++ ) { optimizerScales[i] = translationScale; } optimizer->SetScales( optimizerScales ); // performed registration ... // // deformed the moving image and save it // typedef itk::ResampleImageFilter< MovingImageType, FixedImageType > ResampleFilterType; typedef itk::CastImageFilter< MovingImageType, OutputImageType > CastFilterType; typedef itk::ImageFileWriter< OutputImageType > WriterType; ResampleFilterType::Pointer resampler = ResampleFilterType::New(); WriterType::Pointer writer = WriterType::New(); CastFilterType::Pointer caster = CastFilterType::New(); TransformType::Pointer finalTransform = TransformType::New(); finalTransform->SetParameters( registration->GetLastTransformParameters() ); finalTransform->SetFixedParameters( transform->GetFixedParameters() ); // set transform and initial moving image resampler->SetTransform( finalTransform ); resampler->SetInput( movingImage ); resampler->SetSize( fixedImage->GetLargestPossibleRegion().GetSize() ); resampler->SetOutputOrigin( fixedImage->GetOrigin() ); resampler->SetOutputSpacing( fixedImage->GetSpacing() ); resampler->SetOutputDirection( fixedImage->GetDirection() ); resampler->SetDefaultPixelValue( defaultOutputPixel ); writer->SetFileName( argv[argvOutputImageFile] ); caster->SetInput( resampler->GetOutput() ); writer->SetInput( caster->GetOutput() ); ... -- Jerome ------- School of Medical Sciences University of Auckland If I am not for myself, who will be for me? And if I am only for myself, then what an I? And if not now when? ? Hillel HaZaken From gabrielgimenez85 at gmail.com Wed Jul 2 19:48:49 2014 From: gabrielgimenez85 at gmail.com (=?UTF-8?Q?Gabriel_A=2E_Gim=C3=A9nez?=) Date: Wed, 2 Jul 2014 16:48:49 -0700 (PDT) Subject: [ITK-users] [ITK] MattesMutualInformationImageToImageMetric: Joint PDF summed to zero In-Reply-To: References: <1404337433182-7585842.post@n2.nabble.com> Message-ID: <1404344929836-7585845.post@n2.nabble.com> Basically (enclosed please find my code) , I used the ImageRegistration8.cxx as the major code but replaced the image metric and optimizer part with corresponding code in ImageRegistration11.cxx. What do you recommend? Something to read about this? Thanks! ImageRegistration8Modificado.cxx -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/MattesMutualInformationImageToImageMetric-Joint-PDF-summed-to-zero-tp7585842p7585845.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From nicgallego at gmail.com Thu Jul 3 04:12:59 2014 From: nicgallego at gmail.com (Nicolas Gallego) Date: Thu, 3 Jul 2014 10:12:59 +0200 Subject: [ITK-users] [ITK] 3D Affine Registration - no rotation found In-Reply-To: <53B495D0.4080500@auckland.ac.nz> References: <53B495D0.4080500@auckland.ac.nz> Message-ID: Hi J?r?me, Have you tried changing the optimizer scales? That parameter changes the sensitivity of the optimization process between the translation and rotation of the transform, it seams to me that the value 1.0/1e7 is probably too small and the optimizer is not sensitive enough to rotations. For test purposes you can also set the mutual information metric to compute histograms on the whole image, that may give you a much detailed metric map for the optimizer as well. metric->SetNumberOfSpatialSamples( ); Hope that helps, Nicol?s Gallego-Ortiz Universit? catholique de Louvain, Belgium 2014-07-03 1:29 GMT+02:00 Jerome Plumat : > Hi everyone, > I'm facing to a problem with 3D affine multi resolution registration. > The pipeline registers two 3D MRI head and necks volumes (600x400x40). > These are scans of the same patient at two times. Due to the protocol, > volumes are similar expect for MRI artifacts. In fine the algorithm would > be used to registered an atlas defined on the fixed image on moving image. > > The main elements of the pipeline are listed below. It's implemented with > itk4 and is mostly based on MutliResImageRegistration2.cxx, I use the > Mutual Information metric, linear interpolator, the optimizer is > RegularStepGradientDescentOptimizer and CenteredTransformInitializer. > > The registration is performed without any error and the translation is > correctly found but the algorithm can't provide any rotation and I can't > figure why. > The final results are > versor X = [1.00007, 0.000485777, 1.5912e-05] > versor Y = [-0.000126483, 0.999922, 1.34996e-05] > versor Z = [2.35376e-05, -8.28481e-05, 0.999986] > Translation X = 1.35204 > Translation Y = 0.647584 > Translation Z = -0.132708 > Iterations = 96 > Metric value = -0.738412 > > Following http://www.cmake.org/pipermail/insight-users/2006- > August/019025.html the final rotation is 0.0003 along axis [-0.155456, > -0.0122989, -0.987766]. > Moreover, visual validation clearly highlight the fact the rotation is not > sufficient. > > Hope any one has advices. > Thanks in advances. > > Jerome. > > > Part of code: > > .... > > // transform > typedef itk::AffineTransform< double, Dimension> TransformType; > typedef itk::CenteredTransformInitializer< TransformType, FixedImageType, > MovingImageType > TransformInitializerType; > // optimizer > typedef itk::RegularStepGradientDescentOptimizer OptimizerType; > > // metric > typedef itk::MattesMutualInformationImageToImageMetric< > MovingImageType, > MovingImageType > MetricType; > // interpolator > typedef itk:: LinearInterpolateImageFunction< > MovingImageType, > double > InterpolatorType; > > // registration > typedef itk::MultiResolutionImageRegistrationMethod< > FixedImageType, > MovingImageType > RegistrationType; > > > typedef itk::MultiResolutionPyramidImageFilter< > FixedImageType, > FixedImageType > FixedImagePyramidType; > typedef itk::MultiResolutionPyramidImageFilter< > MovingImageType, > MovingImageType > MovingImagePyramidType; > > > ... > > metric->SetNumberOfHistogramBins( 256 ); > metric->SetNumberOfSpatialSamples( 50000 ); > metric->ReinitializeSeed( 76926294 ); > > .... > > // connect the inputs > registration->SetFixedImage( fixedImage ); > registration->SetMovingImage( movingImage ); > > > // set the regions > registration->SetFixedImageRegion( fixedImage->GetLargestPossibleRegion() > ); > > // configure the initializer > initializer->SetTransform( transform ); > initializer->SetFixedImage( fixedImage ); > initializer->SetMovingImage( movingImage ); > initializer->MomentsOn(); > initializer->InitializeTransform(); > > registration->SetInitialTransformParameters( transform->GetParameters() ); > > // optimizer scales > typedef OptimizerType::ScalesType OptimizerScalesType; > OptimizerScalesType optimizerScales( transform->GetNumberOfParameters() ); > const double momentScale = 1; > const double translationScale = 1.0 / 1e7; > > //number of dimensions: N*(N+1) > for(unsigned int i=0; i<(Dimension*Dimension); i++ ) > { > optimizerScales[i] = momentScale; > } > > for( unsigned int i=(Dimension*Dimension); > i<((Dimension+1)*Dimension); i++ ) > { > optimizerScales[i] = translationScale; > } > optimizer->SetScales( optimizerScales ); > > > // performed registration > ... > > // > // deformed the moving image and save it > // > typedef itk::ResampleImageFilter< > MovingImageType, > FixedImageType > ResampleFilterType; > typedef itk::CastImageFilter< > MovingImageType, > OutputImageType > CastFilterType; > typedef itk::ImageFileWriter< OutputImageType > WriterType; > > ResampleFilterType::Pointer resampler = ResampleFilterType::New(); > WriterType::Pointer writer = WriterType::New(); > CastFilterType::Pointer caster = CastFilterType::New(); > > TransformType::Pointer finalTransform = TransformType::New(); > > finalTransform->SetParameters( > registration->GetLastTransformParameters() ); > finalTransform->SetFixedParameters( > transform->GetFixedParameters() ); > > // set transform and initial moving image > resampler->SetTransform( finalTransform ); > resampler->SetInput( movingImage ); > > resampler->SetSize( fixedImage->GetLargestPossibleRegion().GetSize() ); > resampler->SetOutputOrigin( fixedImage->GetOrigin() ); > resampler->SetOutputSpacing( fixedImage->GetSpacing() ); > resampler->SetOutputDirection( fixedImage->GetDirection() ); > resampler->SetDefaultPixelValue( defaultOutputPixel ); > > writer->SetFileName( argv[argvOutputImageFile] ); > caster->SetInput( resampler->GetOutput() ); > writer->SetInput( caster->GetOutput() ); > > ... > > -- > > Jerome > ------- > School of Medical Sciences > University of Auckland > > If I am not for myself, who will be for me? And if I am only for myself, > then what an I? And if not now when? ? Hillel HaZaken > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elena.bresciani87 at gmail.com Thu Jul 3 10:16:49 2014 From: elena.bresciani87 at gmail.com (elena bresciani) Date: Thu, 3 Jul 2014 16:16:49 +0200 Subject: [ITK-users] Rotate image Message-ID: Hello guys, I need help on image rotation. I have two questions: 1 - how can I modify the code in ResampleImageFilter4.cxx to make the size of the output image following the rotation? More specifically: if image size is Size X >> Size Y and I want a 90? rotation the result (using the code in the example without modifications) is cropped because the new image has now Size Y >> Size X but in the example this is not taken into account. I know I could use Permute Axis but I would like to write something that works both for 90 and 180 degrees rotations. 2 - I would like to do something like in the scheme attached. Actually, as shown I've reached my goal only partially using AutoCropLabelMapFilter. There is a simple way of doing what I want or I have to compute the angle of inclination of my region of interest and rotate and crop accordingly? Images are not binary! Thanks in advance! Elena -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Scheme.pdf Type: application/pdf Size: 15310 bytes Desc: not available URL: From matt.mccormick at kitware.com Thu Jul 3 12:24:47 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 3 Jul 2014 12:24:47 -0400 Subject: [ITK-users] [ITK] Resampling after SetDirection() and SetOrigin() In-Reply-To: References: Message-ID: Hi Mathew, The reader and the resampler are connected in a pipeline by default. The Update() on the writer or the resampler will nullify your modification on "image". To disconnect the pipeline, reader.Update() image = reader.GetOutput() image.DisconnectPipeline() See also [1]. Hope this helps, Matt [1] http://www.itk.org/Doxygen/html/classitk_1_1DataObject.html#a8a70b06ebb65da85628342f3e992bc4c On Wed, Jul 2, 2014 at 12:14 PM, Mathew Guilfoyle wrote: > Hi Matt > > Sorry to labour this point but I'm still confused as to what is going on; my > misunderstanding may well be to do with how the pipelines work. > > As an example: > > import itk > > fileNameIn = '/route/to/input.nii' > fileNameOut = '/route/to/output.nii' > image_type = itk.Image[itk.F, 3] > reader = itk.ImageFileReader[image_type].New() > reader.SetFileName(fileNameIn) > reader.Update() > > image = reader.GetOutput() > #image.GetOrigin() gives [-148, -153, 55] > #image.GetDirection().GetVnlMatrix().get(0,0)....(2,2) > #gives matrix: 1.0 0 0 > # 0 0.95 0.3 > # 0 -0.3 0.95 > > image.GetOrigin().Fill(0) > image.GetDirection().SetIdentity() > #image.GetOrigin() gives [0, 0, 0] > #image.GetDirection().GetVnlMatrix().get(0,0)....(2,2) > #gives matrix: 1.0 0 0 > # 0 1.0 0 > # 0 0 1.0 > > writer = itk.ImageFileWriter[image_type].New() > writer.SetFileName(fileNameOut) > writer.SetInput(image) > writer.Update() > #output image volume is unchanged when viewed in (e.g.) ImageJ > > resampler = itk.ResampleImageFilter[image_type, image_type].New() > resampler.SetInput(image) > resampler.SetSize(image.GetLargestPossibleRegion().GetSize()) > resampler.SetOutputOrigin(image.GetOrigin()) > resampler.SetOutputSpacing(image.GetSpacing()) > resampler.SetOutputDirection(image.GetDirection()) > resampler.Update() > > writer.SetInput(resampler.GetOutput()) > writer.Update() > #now output is translated and rotated by the (inverse) values of the > original > #origin vector and direction matrix > # > #However, resampler.GetInput().GetOrigin() gives [0,0,0] > #and similarly the direction of the input is a 3x3 identity matrix > > I don't understand why the resampler changes the image volume since it > should not be 'aware' of the original origin/direction. > > From your previous reply you suggest that the call to resampler.Update() > might cause the reader to re-import the file from disk. Is this the case > even when the reader and resampler are not connected in a pipeline (as > here). Further, if the reader does re-import the original image and > origin/direction parameters why does resampler.GetInput().GetOrigin() report > [0, 0, 0] and the input direction matrix is an identity? > > I want to understand why this is happening as it is clearly important for > ensuring I set up more complex pipelines correctly. > > Many thanks > Mathew > > > On 30 June 2014 03:28, Matt McCormick wrote: >> >> Hi Mathew, >> >> The image does not retain the original parameters somewhere. However, >> can must be take, because if the image is generated by a filter in a >> pipeline, that filter will reset the original value when the pipeline >> is re-run. ChangeInformationImageFilter will ensure this reset does >> not happen during a pipeline update. >> >> The Set methods doo reorient/reposition the whole image volume in >> world space. The resampling filter does not select a subregion or >> rotates the images -- to get the same out, the sampling locations of >> the output image for the ResampleImageFilter must be set as desired. >> Set SetOutputOrigin [1], SetOutputDirection [2], etc. >> >> Hope this helps to clarify. >> >> I checked by wrapped install, and I have ChangeInformationImageFilter >> instantiations for float images. >> >> Hope this helps, >> Matt >> >> [1] >> http://www.itk.org/Doxygen/html/classitk_1_1ResampleImageFilter.html#ac4b197ddefd3b3344bd9c9471acd5b00 >> >> [2] >> http://www.itk.org/Doxygen/html/classitk_1_1ResampleImageFilter.html#a9fdd6b862ab6cbaa03702da393bd0474 >> >> >> On Sun, Jun 29, 2014 at 10:01 PM, Mathew Guilfoyle >> wrote: >> > Matt, thanks for the reply. >> > >> > I would be grateful if you could you explain why this is the desired >> > behaviour. If I use the SetDirection() or SetOrigin() methods does the >> > image object retain the original parameters somewhere? Subsequently >> > calling >> > GetDirection() or GetOrigin() reports the changed parameters. >> > >> > Intuitively you would expect both Set methods to reorient/reposition the >> > whole image volume in world space, and on the face of it that is what >> > they >> > seem to do. However, on passing the image to a resampling filter they >> > act >> > to select a subregion or to rotate the image. I would have thought that >> > rotations and region selections should be options passed to the filter >> > and >> > not set in the image itself? >> > >> > How does the ChangeInformationImageFilter do it differently? >> > Incidentally I >> > have wrapped for float but don't get this as an option for this filter. >> > >> > Thanks >> > Mathew >> > >> > >> > >> > On 30 June 2014 01:45, Matt McCormick >> > wrote: >> >> >> >> Hi Mathew, >> >> >> >> Yes, that is the correct and expected behavior. I do not know if >> >> ImageJ is using the actual location in world space. >> >> >> >> It sounds like ChangeInformationImageFilter is what you are looking >> >> for. It will be wrapped for float images if wrapped for float images >> >> is enabled in you CMake configuration (ITK_WRAP_float). >> >> >> >> Hope this helps, >> >> Matt >> >> >> >> >> >> On Sat, Jun 28, 2014 at 9:55 PM, Mathew Guilfoyle >> >> >> >> wrote: >> >> > If I change an image's direction and origin using SetDirection() and >> >> > SetOrigin() methods and then write the image back to a file, the >> >> > volume >> >> > stack viewed in (e.g.) ImageJ is unchanged. This is the behaviour I >> >> > would >> >> > expect as changing the direction and origin shouldn't alter the array >> >> > of >> >> > image pixels, just its location and orientation in 'world space'? >> >> > >> >> > However, if I take the same image, adjust the origin and direction as >> >> > before, and then input it to ResampleImageFilter with an identity >> >> > transform >> >> > (and set spacing, origin, direction, and size to those of the input >> >> > image) >> >> > the output is a translated and rotated image. >> >> > >> >> > It seems the difference between the original and adjusted origin and >> >> > direction are applied as a translation and rotation during >> >> > resampling, >> >> > even >> >> > though GetOrigin() and GetDirection() on the input image to the >> >> > resampler >> >> > return the adjusted parameters. >> >> > >> >> > Is this the expected behaviour? Is there another image parameter that >> >> > needs >> >> > to be changed to correctly alter origin and direction? >> >> > >> >> > (ChangeInformationImageFilter is not wrapped for float images so I >> >> > can't >> >> > use >> >> > it for my application) >> >> > >> >> > Thanks >> >> > >> >> > _____________________________________ >> >> > Powered by www.kitware.com >> >> > >> >> > Visit other Kitware open-source projects at >> >> > http://www.kitware.com/opensource/opensource.html >> >> > >> >> > Kitware offers ITK Training Courses, for more information visit: >> >> > http://www.kitware.com/products/protraining.php >> >> > >> >> > Please keep messages on-topic and check the ITK FAQ at: >> >> > http://www.itk.org/Wiki/ITK_FAQ >> >> > >> >> > Follow this link to subscribe/unsubscribe: >> >> > http://public.kitware.com/mailman/listinfo/insight-users >> >> > >> >> > _______________________________________________ >> >> > Community mailing list >> >> > Community at itk.org >> >> > http://public.kitware.com/mailman/listinfo/community >> >> > >> > >> > > > From nicgallego at gmail.com Thu Jul 3 12:52:04 2014 From: nicgallego at gmail.com (Nicolas Gallego) Date: Thu, 3 Jul 2014 18:52:04 +0200 Subject: [ITK-users] [ITK] Rotate image In-Reply-To: References: Message-ID: Hi Elena, If I understand well your task, you have the rotation angle and translation parameters and you would like to transform your image parallel to the cartesian coordinate system and crop/resample it? Conceptually then you could proceed as follows: 1. Create a rigid transformation with given angle and translation in 2D [1] or 3D [2] 2. Apply the transformation to your image via an interpolator and a resampler, like illustrated in the Software Guide Section 8.2 [3] 3. The resampler interface lets you specifiy all the image information for the output: region( start, size) spacing origin direction Connect everything and update and that should do the job, Pay attention to the center of rotation, the example you cite uses the center of the image as center of rotation, that should be fine. I would proceed like that, I am not aware of a filter to do this automatically. If you don't know a priori the rigid transformation parameters to apply, then a registration algorithm can be used to estimate them. [1] http://www.itk.org/Doxygen45/html/classitk_1_1Rigid2DTransform.html [2] http://www.itk.org/Doxygen45/html/classitk_1_1Rigid3DTransform.html [3] http://www.itk.org/ItkSoftwareGuide.pdf hope that helps Nicol?s Gallego-Ortiz Universit? catholique de Louvain, Belgium 2014-07-03 16:16 GMT+02:00 elena bresciani : > Hello guys, > > I need help on image rotation. I have two questions: > > 1 - how can I modify the code in ResampleImageFilter4.cxx to make the size > of the output image following the rotation? More specifically: if image > size is Size X >> Size Y and I want a 90? rotation the result (using the > code in the example without modifications) is cropped because the new image > has now Size Y >> Size X but in the example this is not taken into account. > I know I could use Permute Axis but I would like to write something that > works both for 90 and 180 degrees rotations. > > 2 - I would like to do something like in the scheme attached. Actually, as > shown I've reached my goal only partially using AutoCropLabelMapFilter. > There is a simple way of doing what I want or I have to compute the angle > of inclination of my region of interest and rotate and crop accordingly? > Images are not binary! > > Thanks in advance! > > Elena > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Thu Jul 3 13:35:05 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 3 Jul 2014 13:35:05 -0400 Subject: [ITK-users] [ANNOUNCE] ITK 4.6 Release Candidate 2 has been tagged! Message-ID: On behalf of the Insight Toolkit community, we are proud to announce that ITK 4.6.0 release candidate 2 has been tagged and is available for testing! To obtain the source code, git clone http://itk.org/ITK.git cd ITK git checkout -q --detach v4.6rc02 For more details, please see the Git documentation [1]. Please test the release candidate and share your experiences on the mailing list, issue tracker, and Gerrit Code Review. Please help identify issues submitting an Experimental build to the dashboard [2] with: ctest -M Experimental -T Configure -T Build -T Test -T Submit and notifying the mailing list. Testing your own applications against the RC is also appreciated. Those community members wishing to contribute by cleaning up the dashboard can find a list potential candidates on the issue tracker [3]. Please do not hesitate to ask about any aspect of the contribution process. One of the issues that arose in this release candidate phase was warnings generate by unused typedefs on newer compilers. Assistance working on these warnings is welcome as is testing to ensure that removed typedefs does not break code that builts against the toolkit.. Congratulations and well done to everyone that has contributed to this release. Release candidates are tagged every week. The final release is scheduled for July 14th. [1] http://www.itk.org/Wiki/ITK/Git [2] http://open.cdash.org/index.php?project=Insight [3] https://issues.itk.org/jira/issues/?jql=project%20%3D%20ITK%20AND%20fixVersion%20%3D%20%2220140714_ITKv4.6.0_FINAL%22%20AND%20status%20in%20(Open%2C%20%22In%20Progress%22%2C%20Reopened) New Features ------------------ * CMake improvements - Improved Remote Module support - Add ITK_FORBID_DOWNLOADS for package maintainers - ITK_USE_SYSTEM_EXPAT available * Filtering Improvements - Moved TransformToDisplacementField out of Review - An entire noise image generation module - http://hdl.handle.net/10380/3158 - Better pipeline support for ResampleImageFilter - Move MagnitudeAndPhaseToComplexImageFilter out of Review - Setters for LabelMap overlay filters - More consistent filter progress reporting * ImageO improvements - Register the GE image formats by default - More IO modules are built as shared libraries - OpenFileForReading/Writing methods in ImageIO - Support for system tiff 4.0.0-4.0.2 (e.g. some Ubuntu versions) - Mangling to internal OpenJPEG - SCIFIO improvements * Infrastructure improvements - MetaDataObject print specialization for common types - Improvements to ResourceProbe and RealTimeClock - More Solve methods for VNLSparseLUSolverTraits - Output stream operator for LightObject exposed - FFTW bump to 3.3.3 * New Remote Modules - Skull stripper - http://hdl.handle.net/10380/3353 - Wiki examples - Sphinx examples - Variational registration - http://hdl.handle.net/10380/3460 - AnalyzeObjectMapIO - http://hdl.handle.net/1926/593 - FDFImageIO - SplitComponents - http://hdl.handle.net/10380/320 * Registrationv4 improvements - v4 regular step gradient descent optimizer - v4 amoeba optimizer - v4 exhaustive optimizer - v4 Powell optimizer - v4 one-plus-one-evolutionary optimizer - v4 LBFGS optimizer improvements - Use registration method classes as pipeline filters * Performance improvements - Registrationv4 - Histogram computation - Improved SmartPointer copy - CompositeTransform - Registration Jacobian re-use * Wrapping improvements - pygccxml 1.0.0 - .pth symlink usable in a virtualenv - Cleaner CMake configuration - SWIG and PCRE updated to 3.0.2, 8.34 - Latest GCCXML, which works with GCC 4.9 - Sweeping wrapping generation cleanup * Many style improvements -- ITK gets more stylish with every release! * Improved code coverage -- some measures put us over 85%! * *Lots* of important bug fixes * And more! See details in the log below. List of changes since v4.6rc01 --------------------------------------- Bradley Lowekamp (3): BUG: Do not ENABLED_SHARED for GDCMIO DOC: Add break in brief description of Canny edge filter BUG: Add additional MetaDataObject explicit instantiation. Jean-Christophe Fillion-Robin (2): COMP: Fix "unused-local-typedefs" warnings COMP: Fix "unused-local-typedefs" warning in LandmarkBasedTransformInitializer Kent Williams (1): COMP: Fix typo in ReflectiveImageRegionConstIterator. Matthew McCormick (4): DOC: CMake warning BRANWEB -> BRAINWEB. BUG: Remove -Wno-unused-local-typedefs flag. COMP: Fix IOSTL Doxygen group and Windows shared build. BUG: Use Remote repository explicitly on git fetch. Michka Popoff (6): COMP: Move itkMatrixCoefficients wrapping to Filtering module COMP: Fix wrapping with Core only STYLE: Pep8 cleanup for generators COMP: Fix default wrapping with all modules ENH: Use open() instead of file() for python 3 compatibility ENH: Allow to use methods which pass std::string by reference from python Nick Tustison (1): ENH: Adding generic computation type. From blowekamp at mail.nih.gov Thu Jul 3 13:51:20 2014 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Thu, 3 Jul 2014 13:51:20 -0400 Subject: [ITK-users] [ITK] Rotate image In-Reply-To: References: Message-ID: <1ADBF0ED-8053-46E5-8063-D66ED3B29C64@mail.nih.gov> Hello Elena, After looking at your images, I realized you may be interested in Oriented Bounding Box computation. I have an external ITK module[1] which computes OBBs in the LabelMap infrastructure. One way it presents the OBB is as an origin and Direction[2]. This information is then passed to the Resample filter to extract the OBB[3]. You may be able to re-use the code in this module or find another way to compute your origin and direction based on information specific for you application. Hope this helps, Brad [1] https://github.com/blowekamp/itkOBBLabelMap [2] https://github.com/blowekamp/itkOBBLabelMap/blob/master/include/itkOrientedBoundingBoxLabelObject.h#L91-L111 [3] https://github.com/blowekamp/itkOBBLabelMap/blob/master/test/itkOrientedBoundingBoxLabelMapFilterTest2.cxx#L94-L113 On Jul 3, 2014, at 12:52 PM, Nicolas Gallego wrote: > Hi Elena, > > If I understand well your task, you have the rotation angle and translation parameters and you would like to transform your image parallel to the cartesian coordinate system and crop/resample it? > > Conceptually then you could proceed as follows: > > 1. Create a rigid transformation with given angle and translation in 2D [1] or 3D [2] > > 2. Apply the transformation to your image via an interpolator and a resampler, like illustrated in the Software Guide Section 8.2 [3] > > 3. The resampler interface lets you specifiy all the image information for the output: > region( start, size) > spacing > origin > direction > > Connect everything and update and that should do the job, > > Pay attention to the center of rotation, the example you cite uses the center of the image as center of rotation, that should be fine. > > I would proceed like that, I am not aware of a filter to do this automatically. > > If you don't know a priori the rigid transformation parameters to apply, then a registration algorithm can be used to estimate them. > > [1] http://www.itk.org/Doxygen45/html/classitk_1_1Rigid2DTransform.html > [2] http://www.itk.org/Doxygen45/html/classitk_1_1Rigid3DTransform.html > [3] http://www.itk.org/ItkSoftwareGuide.pdf > > hope that helps > > Nicol?s Gallego-Ortiz > Universit? catholique de Louvain, Belgium > > > 2014-07-03 16:16 GMT+02:00 elena bresciani : > Hello guys, > > I need help on image rotation. I have two questions: > > 1 - how can I modify the code in ResampleImageFilter4.cxx to make the size of the output image following the rotation? More specifically: if image size is Size X >> Size Y and I want a 90? rotation the result (using the code in the example without modifications) is cropped because the new image has now Size Y >> Size X but in the example this is not taken into account. I know I could use Permute Axis but I would like to write something that works both for 90 and 180 degrees rotations. > > 2 - I would like to do something like in the scheme attached. Actually, as shown I've reached my goal only partially using AutoCropLabelMapFilter. There is a simple way of doing what I want or I have to compute the angle of inclination of my region of interest and rotate and crop accordingly? Images are not binary! > > Thanks in advance! > > Elena > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From j.plumat at auckland.ac.nz Thu Jul 3 19:23:08 2014 From: j.plumat at auckland.ac.nz (Jerome Plumat) Date: Fri, 04 Jul 2014 11:23:08 +1200 Subject: [ITK-users] [ITK] 3D Affine Registration - no rotation found In-Reply-To: References: <53B495D0.4080500@auckland.ac.nz> Message-ID: <53B5E5DC.7040500@auckland.ac.nz> Hi Nicol?s, Thank for the answer and advices. Indeed you are right: the value 1/1E7 is too small. I set it to 1/1E2 and the registration is better performed. I also increased the number of samples but the scale value has a huge influence on the results. However, I don't understand why this value has such an impact on the rotation optimization. If I understand well the user guide section 8.7.2 top of page 359 the first optimizerScales[0] to optimizerScales[Dimension*Dimension-1] are relative to the moments of the affine transform while optimizerScales[Dimension*Dimension] to optimizerScales[(Dimensions+1)*Dimension-1] should influence the translations. Any light? Cheers, Jerome Plumat ------- School of Medical Sciences University of Auckland If I am not for myself, who will be for me? And if I am only for myself, then what an I? And if not now when? ? Hillel HaZaken On 03/07/14 20:12, Nicolas Gallego wrote: > Hi J?r?me, > > Have you tried changing the optimizer scales? > That parameter changes the sensitivity of the optimization process > between the translation and rotation of the transform, it seams to me > that the value 1.0/1e7 is probably too small and the optimizer is not > sensitive enough to rotations. > > For test purposes you can also set the mutual information metric to > compute histograms on the whole image, that may give you a much > detailed metric map for the optimizer as well. > > metric->SetNumberOfSpatialSamples(); > > Hope that helps, > > Nicol?s Gallego-Ortiz > Universit? catholique de Louvain, Belgium > > > 2014-07-03 1:29 GMT+02:00 Jerome Plumat >: > > Hi everyone, > I'm facing to a problem with 3D affine multi resolution registration. > The pipeline registers two 3D MRI head and necks volumes > (600x400x40). These are scans of the same patient at two times. > Due to the protocol, volumes are similar expect for MRI artifacts. > In fine the algorithm would be used to registered an atlas defined > on the fixed image on moving image. > > The main elements of the pipeline are listed below. It's > implemented with itk4 and is mostly based on > MutliResImageRegistration2.cxx, I use the Mutual Information > metric, linear interpolator, the optimizer is > RegularStepGradientDescentOptimizer and CenteredTransformInitializer. > > The registration is performed without any error and the > translation is correctly found but the algorithm can't provide any > rotation and I can't figure why. > The final results are > versor X = [1.00007, 0.000485777, 1.5912e-05] > versor Y = [-0.000126483, 0.999922, 1.34996e-05] > versor Z = [2.35376e-05, -8.28481e-05, 0.999986] > Translation X = 1.35204 > Translation Y = 0.647584 > Translation Z = -0.132708 > Iterations = 96 > Metric value = -0.738412 > > Following > http://www.cmake.org/pipermail/insight-users/2006-August/019025.html > the final rotation is 0.0003 along axis [-0.155456, -0.0122989, > -0.987766]. > Moreover, visual validation clearly highlight the fact the > rotation is not sufficient. > > Hope any one has advices. > Thanks in advances. > > Jerome. > > > Part of code: > > .... > > // transform > typedef itk::AffineTransform< double, Dimension> TransformType; > typedef itk::CenteredTransformInitializer< TransformType, > FixedImageType, MovingImageType > TransformInitializerType; > // optimizer > typedef itk::RegularStepGradientDescentOptimizer OptimizerType; > > // metric > typedef itk::MattesMutualInformationImageToImageMetric< > MovingImageType, > MovingImageType > MetricType; > // interpolator > typedef itk:: LinearInterpolateImageFunction< > MovingImageType, > double > InterpolatorType; > > // registration > typedef itk::MultiResolutionImageRegistrationMethod< > FixedImageType, > MovingImageType > RegistrationType; > > > typedef itk::MultiResolutionPyramidImageFilter< > FixedImageType, > FixedImageType > FixedImagePyramidType; > typedef itk::MultiResolutionPyramidImageFilter< > MovingImageType, > MovingImageType > MovingImagePyramidType; > > > ... > > metric->SetNumberOfHistogramBins( 256 ); > metric->SetNumberOfSpatialSamples( 50000 ); > metric->ReinitializeSeed( 76926294 ); > > .... > > // connect the inputs > registration->SetFixedImage( fixedImage ); > registration->SetMovingImage( movingImage ); > > > // set the regions > registration->SetFixedImageRegion( > fixedImage->GetLargestPossibleRegion() ); > > // configure the initializer > initializer->SetTransform( transform ); > initializer->SetFixedImage( fixedImage ); > initializer->SetMovingImage( movingImage ); > initializer->MomentsOn(); > initializer->InitializeTransform(); > > registration->SetInitialTransformParameters( > transform->GetParameters() ); > > // optimizer scales > typedef OptimizerType::ScalesType OptimizerScalesType; > OptimizerScalesType optimizerScales( > transform->GetNumberOfParameters() ); > const double momentScale = 1; > const double translationScale = 1.0 / 1e7; > > //number of dimensions: N*(N+1) > for(unsigned int i=0; i<(Dimension*Dimension); i++ ) > { > optimizerScales[i] = momentScale; > } > > for( unsigned int i=(Dimension*Dimension); > i<((Dimension+1)*Dimension); i++ ) > { > optimizerScales[i] = translationScale; > } > optimizer->SetScales( optimizerScales ); > > > // performed registration > ... > > // > // deformed the moving image and save it > // > typedef itk::ResampleImageFilter< > MovingImageType, > FixedImageType > ResampleFilterType; > typedef itk::CastImageFilter< > MovingImageType, > OutputImageType > CastFilterType; > typedef itk::ImageFileWriter< OutputImageType > WriterType; > > ResampleFilterType::Pointer resampler = ResampleFilterType::New(); > WriterType::Pointer writer = WriterType::New(); > CastFilterType::Pointer caster = CastFilterType::New(); > > TransformType::Pointer finalTransform = TransformType::New(); > > finalTransform->SetParameters( > registration->GetLastTransformParameters() ); > finalTransform->SetFixedParameters( > transform->GetFixedParameters() ); > > // set transform and initial moving image > resampler->SetTransform( finalTransform ); > resampler->SetInput( movingImage ); > > resampler->SetSize( > fixedImage->GetLargestPossibleRegion().GetSize() ); > resampler->SetOutputOrigin( fixedImage->GetOrigin() ); > resampler->SetOutputSpacing( fixedImage->GetSpacing() ); > resampler->SetOutputDirection( fixedImage->GetDirection() ); > resampler->SetDefaultPixelValue( defaultOutputPixel ); > > writer->SetFileName( argv[argvOutputImageFile] ); > caster->SetInput( resampler->GetOutput() ); > writer->SetInput( caster->GetOutput() ); > > ... > > -- > > Jerome > ------- > School of Medical Sciences > University of Auckland > > If I am not for myself, who will be for me? And if I am only for > myself, then what an I? And if not now when? ? Hillel HaZaken > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wsales at gmail.com Fri Jul 4 17:41:50 2014 From: wsales at gmail.com (Wagner Sales) Date: Fri, 4 Jul 2014 18:41:50 -0300 Subject: [ITK-users] Fail to execute TransformReadWrite example Message-ID: Hi all, I'm trying to save transforms and catching an strange error. I tried to execute the simple example on IO directory to validate this, and: --> checking permission wsales at wsales-desktop:/tmp/trf$ touch ihavepermission wsales at wsales-desktop:/tmp/trf$ ls -la total 28464 drwxrwxr-x 2 wsales wsales 4096 Jul 4 17:52 . drwxrwxrwt 31 root root 12288 Jul 4 17:52 .. -rw-rw-r-- 1 wsales wsales 0 Jul 4 17:52 ihavepermission -rwxrwxr-x 1 wsales wsales 29128152 Jul 4 17:52 TransformReadWrite wsales at wsales-desktop:/tmp/trf$ ./TransformReadWrite test Error while saving the transforms itk::ExceptionObject (0x2af4c30) Location: "void itk::TransformFileWriterTemplate::Update() [with ScalarType = double]" File: /home/wsales/Sources/InsightToolkit-4.5.2/Modules/IO/TransformBase/include/itkTransformFileWriter.hxx Line: 200 Description: itk::ERROR: TransformFileWriterTemplate(0x2ae6300): Can't Create IO object for file Transforms.meta Since I can create the file, problem with permissions is not the issue. About my system ( latest Ubuntu, 'll update today ): uname -a Linux wsales-desktop 3.13.0-27-generic #50-Ubuntu SMP Thu May 15 18:06:16 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Compiler: clang --version Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4) Target: x86_64-pc-linux-gnu Thread model: posix Some idea about this? This example was worked fine to me on ITK 3.20, before my version upgrade. Regards, Wagner Sales -------------- next part -------------- An HTML attachment was scrubbed... URL: From wsales at gmail.com Fri Jul 4 18:43:28 2014 From: wsales at gmail.com (Wagner Sales) Date: Fri, 4 Jul 2014 19:43:28 -0300 Subject: [ITK-users] Fail to execute TransformReadWrite example In-Reply-To: References: Message-ID: Hi, I've found the problem. The class HDF5TransformIOTemplate makes an extension check. After change the transform output file to Transforms.hdf, works fine. I think this needs to be changed on Example and on book, since explicity talks: // Then we set the filename using the SetFileName() function. The file's extension // does not matter for the transform reader/writer. Then we call the Update() // function to write the transform(s) onto the disk. The changed code are above: template< typename TInternalComputationValueType > bool HDF5TransformIOTemplate< TInternalComputationValueType > ::CanWriteFile(const char *fileName) { // // all extensions mentioned in wikipedia + 'hd5' // actually HDF doesn't care about extensions at // all and this is just by convention. const char *extensions[] = { ".hdf",".h4",".hdf4",".h5",".hdf5",".he4",".he5",".hd5",0, }; std::string ext (itksys::SystemTools::GetFilenameLastExtension(fileName)); for(unsigned i = 0; extensions[i] != 0; i++) { if(ext == extensions[i]) { return true; } } return false; } Regards, Wagner Sales 2014-07-04 18:41 GMT-03:00 Wagner Sales : > Hi all, > > I'm trying to save transforms and catching an strange error. I tried to > execute the simple example on IO directory to validate this, and: > > --> checking permission > wsales at wsales-desktop:/tmp/trf$ touch ihavepermission > wsales at wsales-desktop:/tmp/trf$ ls -la > total 28464 > drwxrwxr-x 2 wsales wsales 4096 Jul 4 17:52 . > drwxrwxrwt 31 root root 12288 Jul 4 17:52 .. > -rw-rw-r-- 1 wsales wsales 0 Jul 4 17:52 ihavepermission > -rwxrwxr-x 1 wsales wsales 29128152 Jul 4 17:52 TransformReadWrite > > wsales at wsales-desktop:/tmp/trf$ ./TransformReadWrite test > Error while saving the transforms > > itk::ExceptionObject (0x2af4c30) > Location: "void itk::TransformFileWriterTemplate::Update() > [with ScalarType = double]" > File: > /home/wsales/Sources/InsightToolkit-4.5.2/Modules/IO/TransformBase/include/itkTransformFileWriter.hxx > Line: 200 > Description: itk::ERROR: TransformFileWriterTemplate(0x2ae6300): Can't > Create IO object for file Transforms.meta > > Since I can create the file, problem with permissions is not the issue. > About my system ( latest Ubuntu, 'll update today ): > uname -a > Linux wsales-desktop 3.13.0-27-generic #50-Ubuntu SMP Thu May 15 18:06:16 > UTC 2014 x86_64 x86_64 x86_64 GNU/Linux > > Compiler: > clang --version > Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM > 3.4) > Target: x86_64-pc-linux-gnu > Thread model: posix > > Some idea about this? > This example was worked fine to me on ITK 3.20, before my version upgrade. > > Regards, > > Wagner Sales > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Sun Jul 6 02:58:38 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Sun, 6 Jul 2014 02:58:38 -0400 Subject: [ITK-users] [ITK] Fail to execute TransformReadWrite example In-Reply-To: References: Message-ID: Hi Wagner, Here is a patch that addresses the example [1]. Please review [2]. However, test appears to have uncovered a gap in testing coverage, because it fails to write the CompositeTransform. We'll have to look into the issue further. Thanks, Matt [1] http://review.source.kitware.com/#/c/16048/ [2] http://insightsoftwareconsortium.github.io/ITKBarCamp-doc/CommunitySoftwareProcess/PerformAGerritReview/index.html On Fri, Jul 4, 2014 at 6:43 PM, Wagner Sales wrote: > Hi, > I've found the problem. The class HDF5TransformIOTemplate makes an extension > check. After change the transform output file to Transforms.hdf, works fine. > I think this needs to be changed on Example and on book, since explicity > talks: > > // Then we set the filename using the SetFileName() function. The file's > extension > // does not matter for the transform reader/writer. Then we call the > Update() > // function to write the transform(s) onto the disk. > > The changed code are above: > > template< typename TInternalComputationValueType > > > bool > > HDF5TransformIOTemplate< TInternalComputationValueType > > > ::CanWriteFile(const char *fileName) > > { > > // > > // all extensions mentioned in wikipedia + 'hd5' > > // actually HDF doesn't care about extensions at > > // all and this is just by convention. > > const char *extensions[] = > > { > > ".hdf",".h4",".hdf4",".h5",".hdf5",".he4",".he5",".hd5",0, > > }; > > std::string ext > > (itksys::SystemTools::GetFilenameLastExtension(fileName)); > > for(unsigned i = 0; extensions[i] != 0; i++) > > { > > if(ext == extensions[i]) > > { > > return true; > > } > > } > > return false; > > } > > Regards, > > Wagner Sales > > > 2014-07-04 18:41 GMT-03:00 Wagner Sales : > >> Hi all, >> >> I'm trying to save transforms and catching an strange error. I tried to >> execute the simple example on IO directory to validate this, and: >> >> --> checking permission >> wsales at wsales-desktop:/tmp/trf$ touch ihavepermission >> wsales at wsales-desktop:/tmp/trf$ ls -la >> total 28464 >> drwxrwxr-x 2 wsales wsales 4096 Jul 4 17:52 . >> drwxrwxrwt 31 root root 12288 Jul 4 17:52 .. >> -rw-rw-r-- 1 wsales wsales 0 Jul 4 17:52 ihavepermission >> -rwxrwxr-x 1 wsales wsales 29128152 Jul 4 17:52 TransformReadWrite >> >> wsales at wsales-desktop:/tmp/trf$ ./TransformReadWrite test >> Error while saving the transforms >> >> itk::ExceptionObject (0x2af4c30) >> Location: "void itk::TransformFileWriterTemplate::Update() >> [with ScalarType = double]" >> File: >> /home/wsales/Sources/InsightToolkit-4.5.2/Modules/IO/TransformBase/include/itkTransformFileWriter.hxx >> Line: 200 >> Description: itk::ERROR: TransformFileWriterTemplate(0x2ae6300): Can't >> Create IO object for file Transforms.meta >> >> Since I can create the file, problem with permissions is not the issue. >> About my system ( latest Ubuntu, 'll update today ): >> uname -a >> Linux wsales-desktop 3.13.0-27-generic #50-Ubuntu SMP Thu May 15 18:06:16 >> UTC 2014 x86_64 x86_64 x86_64 GNU/Linux >> >> Compiler: >> clang --version >> Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM >> 3.4) >> Target: x86_64-pc-linux-gnu >> Thread model: posix >> >> Some idea about this? >> This example was worked fine to me on ITK 3.20, before my version upgrade. >> >> Regards, >> >> Wagner Sales >> >> >> > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > From stackoverflowabder at gmail.com Sun Jul 6 11:05:06 2014 From: stackoverflowabder at gmail.com (stack overflow) Date: Sun, 6 Jul 2014 17:05:06 +0200 Subject: [ITK-users] What does this statement mean? Message-ID: Hello, Say that we have the following statements: typedef itk::Image FloatImageType; void CreateF(FloatImageType::Pointer image) { ... } I know what :: means in the function. But, in this case, do we read it as follows? *class Pointer is a member of the class FloatImageType* Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vincent.ngai at gmail.com Sun Jul 6 22:36:15 2014 From: vincent.ngai at gmail.com (vincent ngai) Date: Mon, 7 Jul 2014 10:36:15 +0800 Subject: [ITK-users] What does this statement mean? In-Reply-To: References: Message-ID: Hi, It reads as: Pointer is a type scoped within FloatImageType, it simply means Pointer is something(in this case type) found within FloatImageType. Members usually refers to variables or functions. On Sun, Jul 6, 2014 at 11:05 PM, stack overflow < stackoverflowabder at gmail.com> wrote: > Hello, > > Say that we have the following statements: > > typedef itk::Image FloatImageType; > > void CreateF(FloatImageType::Pointer image) > { > ... > } > > I know what :: means in the function. But, in this case, do we read it as > follows? > > *class Pointer is a member of the class FloatImageType* > > Thanks. > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > -- Regards, Vincent -------------- next part -------------- An HTML attachment was scrubbed... URL: From noreply at insightsoftwareconsortium.org Mon Jul 7 12:12:34 2014 From: noreply at insightsoftwareconsortium.org (Insight Journal) Date: Mon, 7 Jul 2014 12:12:34 -0400 (EDT) Subject: [ITK-users] New Submission: Reproducible Research Training at Scipy 2014 Message-ID: <20140707161234.031773D6C070@insightsoftwareconsortium.org> Hello, A new submission has been added to the Insight Journal. Title: Reproducible Research Training at Scipy 2014 Authors: Ibanez L., McCormick M., Fillon J., Chaudri A., Nelson A., Smith S. Abstract: This article illustrates the process of performing reproducible research with existing open source tools. Download and review this publication at: http://hdl.handle.net/10380/3465 Generated by the Insight Journal You are receiving this email because you asked to be informed by the Insight Journal for new submissions. To change your email preference visit http://insight-journal.org/ . From noreply at insightsoftwareconsortium.org Mon Jul 7 13:03:59 2014 From: noreply at insightsoftwareconsortium.org (Insight Journal) Date: Mon, 7 Jul 2014 13:03:59 -0400 (EDT) Subject: [ITK-users] New Submission: Test Message-ID: <20140707170359.828B33D6C1A5@insightsoftwareconsortium.org> Hello, A new submission has been added to the Insight Journal. Title: Test Authors: Ibanez L. Abstract: this is a test Download and review this publication at: http://hdl.handle.net/10380/3466 Generated by the Insight Journal You are receiving this email because you asked to be informed by the Insight Journal for new submissions. To change your email preference visit http://www.insight-journal.org/ . From sureerat.r at gmail.com Mon Jul 7 16:24:53 2014 From: sureerat.r at gmail.com (Sureerat Reaungamornrat) Date: Mon, 7 Jul 2014 16:24:53 -0400 Subject: [ITK-users] MeanSquaresImageToImageMetricv4 with Vector images Message-ID: Dear All, I tested MeanSquaresImageToImageMetricv4 with vector images using following file. ...\Modules\Registration\Metricsv4\test\itkMeanSquaresImageToImageMetricv4OnVectorTest.cxx First, I changed the vector image declaration to const unsigned int vectorLength = 25; typedef itk::Vector VectorType; typedef itk::Image< VectorType, imageDimensionality > ImageType; And I got the following compilation error: error LNK2001: unresolved external symbol "public: static class itk::Vector const itk::NumericTraits >::Zero". Would anyone know what the source of this compilation error or how to fix this? If I commented out 'New()' as follow MetricType::Pointer metric;// = MetricType::New(); The program can be compiled. Second, I tested the metric with itk::VectorImage whose elements are itk::VariableLengthVector. typedef itk::VectorImage ImageType; typedef ImageType::PixelType VectorType; I got compilation error as follow error : 'Length': is not a member of itk::VariableLengthVector error : 'Length': undeclared identifier Both are from itkPixelTraits.h Where does the ImageToImageMetricv4 use PixelTraits? Is there a way to fix this? Thank you very much for time and help, Best regards, Ja -------------- next part -------------- An HTML attachment was scrubbed... URL: From franciscolopezdelafranca at gmail.com Tue Jul 8 01:44:05 2014 From: franciscolopezdelafranca at gmail.com (=?UTF-8?Q?Francisco_L=C3=B3pez-Franca?=) Date: Mon, 7 Jul 2014 22:44:05 -0700 (PDT) Subject: [ITK-users] Surface extraction problem In-Reply-To: <1404307181365-7585840.post@n2.nabble.com> References: <1404307181365-7585840.post@n2.nabble.com> Message-ID: <1404798245092-7585861.post@n2.nabble.com> Hi. I've found what the problem was. The solution is simply to use the MeshFileWriter class to save the mesh that the BinaryMask3DMeshSource class instance outputs. Though the file format cannot be Nifti as it was the format I was using in my application. It must be, for instance, VTK format. Regards. -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Surface-extraction-problem-tp7585840p7585861.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From franciscolopezdelafranca at gmail.com Tue Jul 8 06:51:20 2014 From: franciscolopezdelafranca at gmail.com (=?UTF-8?Q?Francisco_L=C3=B3pez-Franca?=) Date: Tue, 8 Jul 2014 03:51:20 -0700 (PDT) Subject: [ITK-users] Surface extraction problem In-Reply-To: <1404307181365-7585840.post@n2.nabble.com> References: <1404307181365-7585840.post@n2.nabble.com> Message-ID: <1404816680878-7585863.post@n2.nabble.com> Hi again. Another way by which you can save the mesh in Nifti format. It is like this: 1. Read a Nifti file with the 3D object. 2. Create a BinaryMask3DMeshSource object to generate the surface of the object. 3. Create a TriangleMeshToBinaryImageFilter object that receives as input the output of the mesh source object. 4. Save the output of triangle mesh with an ImageFileWriter. Regards. -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Surface-extraction-problem-tp7585840p7585863.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From marco.ulge at gmail.com Wed Jul 9 04:58:18 2014 From: marco.ulge at gmail.com (Marco Ulge) Date: Wed, 9 Jul 2014 01:58:18 -0700 (PDT) Subject: [ITK-users] [Itk-users] Message-ID: <1404896298882-34206.post@n7.nabble.com> Good morning, i was looking at the guide, page 641 about itkImageLinearConstIteratorWithIndex. I found that the example is incomplete, could someone post the full example please? Regards, Marco -- View this message in context: http://itk-users.7.n7.nabble.com/Itk-users-tp34206.html Sent from the ITK - Users mailing list archive at Nabble.com. From jhlegarreta at vicomtech.org Wed Jul 9 05:15:34 2014 From: jhlegarreta at vicomtech.org (Jon Haitz Legarreta) Date: Wed, 9 Jul 2014 11:15:34 +0200 Subject: [ITK-users] [Itk-users] In-Reply-To: <1404896298882-34206.post@n7.nabble.com> References: <1404896298882-34206.post@n7.nabble.com> Message-ID: Dear Marco, as pointed in page 640 of the SW guide, the referred example is an excerpt of the ImageLineaerIteratorWithIndex2.cxx example, found in PATH_TO_SOURCE\Examples\Iterators. Otherwise, you may find it on github [1]. Nearly all (may be even all) examples found in the SW guide are excerpts of examples that you can find in the ITK source tree. The guide just shows the relevant piece of code to understand how the filter works. The guide usually mentions the name of the example at issue. The code excerpts in the SW guide and many parts of the guide itself are extracted automatically from the ITK source code by some sophisticated scripts the people at kitware and other colleagues have developed. HTH, JON HAITZ [1] https://github.com/InsightSoftwareConsortium/ITK/blob/master/Examples/Iterators/ImageLinearIteratorWithIndex2.cxx On 9 July 2014 10:58, Marco Ulge wrote: > Good morning, > > i was looking at the guide, page 641 about > itkImageLinearConstIteratorWithIndex. I found that the example is > incomplete, could someone post the full example please? > > Regards, > Marco > > > > -- > View this message in context: > http://itk-users.7.n7.nabble.com/Itk-users-tp34206.html > Sent from the ITK - Users mailing list archive at Nabble.com. > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.ulge at gmail.com Wed Jul 9 05:32:22 2014 From: marco.ulge at gmail.com (Marco Ulge) Date: Wed, 9 Jul 2014 02:32:22 -0700 (PDT) Subject: [ITK-users] [Itk-users] In-Reply-To: References: Message-ID: <1404898342364-34208.post@n7.nabble.com> Thanks for the reply, by i figured it out immediatly after posting, which is the reason i deleted it but you were too fast in replying me. By the way, instead of opening a new one i'm having a doubt about this iterator (ImageLinearIteratorWithIndex): in the guide it is reported that the NextLine() method "Moves the iterator to the last valid pixel location in the previous line. The origin of the previous line is determined by decrementing the current origin along the fastest increasing dimension of the subspace of the image that excludes the selected dimension." So let's say i have a 3d image and let's assume that this image has three layers each one with 3 lines. 1st layer: line1, line2, line3 2nd layer: line 4, line5, line6 3rd layer: line7, line 8, line9 Following the example in the documentation, how does this iterator walks through the image (i mean which order it processes the lines)? Thank a lot, Marco -- View this message in context: http://itk-users.7.n7.nabble.com/Re-ITK-users-Itk-users-tp34207p34208.html Sent from the ITK - Users mailing list archive at Nabble.com. From nicgallego at gmail.com Wed Jul 9 05:51:09 2014 From: nicgallego at gmail.com (Nicolas Gallego) Date: Wed, 9 Jul 2014 11:51:09 +0200 Subject: [ITK-users] [ITK] [Itk-users] In-Reply-To: <1404896298882-34206.post@n7.nabble.com> References: <1404896298882-34206.post@n7.nabble.com> Message-ID: Hi Marco, Refer to your source code examples folder for the complete code of the examples. In this case ~ \InsightToolkit-4.5.0\Examples\Iterators\ImageLinearIteratorWithIndex2.cxx Nicol?s Gallego-Ortiz Universit? catholique de Louvain, Belgium 2014-07-09 10:58 GMT+02:00 Marco Ulge : > Good morning, > > i was looking at the guide, page 641 about > itkImageLinearConstIteratorWithIndex. I found that the example is > incomplete, could someone post the full example please? > > Regards, > Marco > > > > -- > View this message in context: > http://itk-users.7.n7.nabble.com/Itk-users-tp34206.html > Sent from the ITK - Users mailing list archive at Nabble.com. > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > -------------- next part -------------- An HTML attachment was scrubbed... URL: From grothausmann.roman at mh-hannover.de Wed Jul 9 07:21:33 2014 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Wed, 09 Jul 2014 13:21:33 +0200 Subject: [ITK-users] Surface extraction problem In-Reply-To: <1404307181365-7585840.post@n2.nabble.com> References: <1404307181365-7585840.post@n2.nabble.com> Message-ID: <53BD25BD.1010802@mh-hannover.de> Hi Francisco, What You try to achieve is related to this publication: http://hdl.handle.net/10380/3391 A paraview plugin is also planned. Regards Roman On 02/07/14 15:19, Francisco L?pez-Franca wrote: > Hi everybody. > I've created a 3D cylinder by using the class CylinderSpatialObject. After > that, I pass the cylinder object to an object of class > SpatialObjectToImageFilter in order to prepare the spatial object to be > written to file. > I've set both the cylinder object and the image filter a value of 0 for > background and 255 for foreground. > Finally, I pass, as input, the image filter output to an image file writer > (ImageFileWriter) object to save it to file (Nifti format, for instance). > The result is the attached "cilindro.jpg" figure. > > Up to here, all is ok. The problem comes next. > What I want is to extract the surface of the 3D cylinder. I search for the > web and found an example, from which I followed the implementation. > I copy below my code and attach the result of the surface extraction > ("cilindro_superficie.jpg"), hoping that anyone see if I am committing any > error. I expected just the boundary of the 3D cylinder (with no inside > points), and it seems like the bounding box of the cylinder what I've got > including the inside points. > > Thank you very much and my best regards. > > My code is (I've erased the obvious code): > > > typedef itk::Image< PixelType, Dimension > ImageType; > typedef itk::Mesh MeshType; > > typedef itk::ImageFileReader< ImageType > ReaderType; > ReaderType::Pointer reader = ReaderType::New(); > reader->SetFileName( > inputFileName); > > reader->Update(); > > typedef itk::BinaryMask3DMeshSource< ImageType, MeshType > > MeshSourceType; > MeshSourceType::Pointer meshSource = MeshSourceType::New(); > > meshSource->SetObjectValue( 255); > > meshSource->SetInput( reader->GetOutput() ); > > meshSource->Update(); > > typedef itk::MeshSpatialObject SpatialObjectType; > SpatialObjectType::Pointer mesh = SpatialObjectType::New(); > mesh->SetMesh(meshSource->GetOutput()); > > typedef itk::SpatialObjectToImageFilter > MeshFilterType; > MeshFilterType::Pointer meshFilter = MeshFilterType::New(); > > meshFilter->SetSize(size); > meshFilter->SetOutsideValue(0); > meshFilter->SetInsideValue(255); > meshFilter->SetInput(mesh); > > meshFilter->Update(); > > typedef itk::ImageFileWriter ImageWriterType; > ImageWriterType::Pointer imageWriter = ImageWriterType::New(); > > imageWriter->SetFileName(outputFileName); > imageWriter->SetInput(meshFilter->GetOutput()); > > imageWriter->Update(); > > > > > > > -- > View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Surface-extraction-problem-tp7585840.html > Sent from the ITK Insight Users mailing list archive at Nabble.com. > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-9574 From jerome.velut at kitware.com Wed Jul 9 08:57:18 2014 From: jerome.velut at kitware.com (Jerome Velut) Date: Wed, 9 Jul 2014 14:57:18 +0200 Subject: [ITK-users] ANN: ITK course in Lyon, France - October 2nd Message-ID: Kitware will be holding a developers training course on October 2nd 2014 in Lyon, France. This course will cover the features of ITKv4 : - Overview/Architecture - Segmentation - Registration - Using ITK in your applications Please visit our web site for more information and registration details at : http://formations.kitware.fr/browse/50 Note that the course will be taught in English. If you have any questions, please contact us at courses[at]kitware.com or formations[at]kitware.fr. Best regards, -- J?r?me Velut Research and Development Kitware SAS 26 rue Louis Gu?rin 69100 Villeurbanne, France F: +33 (0)4.37.45.04.15 http://www.kitware.fr http://www.kitware.fr/company/team/velut.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From julien.jomier at kitware.com Wed Jul 9 09:40:32 2014 From: julien.jomier at kitware.com (Julien Jomier) Date: Wed, 09 Jul 2014 15:40:32 +0200 Subject: [ITK-users] ANN: CMake Course - September 29 in Lyon, France Message-ID: <53BD4650.6070909@kitware.com> Kitware will be holding a CMake training course on September 29, 2014 at Kitware's office in Lyon, France. This one-day course will cover CMake, CTest, CPack and CDash. Visit our website for more information and registration details (early registration and student discounts available): http://training.kitware.fr/browse/46 Note that the course will be taught in English. If you have any questions, please contact us at training at kitware.fr. We are looking forward to seeing you in Lyon, Julien -- Kitware SAS 26 rue Louis Gu?rin 69100 Villeurbanne, France http://www.kitware.eu From jhlegarreta at vicomtech.org Wed Jul 9 12:24:24 2014 From: jhlegarreta at vicomtech.org (Jon Haitz Legarreta) Date: Wed, 9 Jul 2014 18:24:24 +0200 Subject: [ITK-users] [Itk-users] In-Reply-To: <1404898342364-34208.post@n7.nabble.com> References: <1404898342364-34208.post@n7.nabble.com> Message-ID: Could the fastest increasing dimension be the lowest dimension? If that's OK, if you have an image whose dimensions are organized as x,y,z, the fastest increasing dimension would be x. JON HAITZ On 9 July 2014 11:32, Marco Ulge wrote: > Thanks for the reply, by i figured it out immediatly after posting, which > is > the reason i deleted it but you were too fast in replying me. > > By the way, instead of opening a new one i'm having a doubt about this > iterator (ImageLinearIteratorWithIndex): > > in the guide it is reported that the NextLine() method "Moves the iterator > to the last valid pixel location in the previous line. The origin of the > previous line is determined by decrementing the current origin along the > fastest increasing dimension of the subspace of the image that excludes the > selected dimension." > > So let's say i have a 3d image and let's assume that this image has three > layers each one with 3 lines. > > 1st layer: line1, line2, line3 > 2nd layer: line 4, line5, line6 > 3rd layer: line7, line 8, line9 > > Following the example in the documentation, how does this iterator walks > through the image (i mean which order it processes the lines)? > > Thank a lot, > > Marco > > > > -- > View this message in context: > http://itk-users.7.n7.nabble.com/Re-ITK-users-Itk-users-tp34207p34208.html > Sent from the ITK - Users mailing list archive at Nabble.com. > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From anja.ende at googlemail.com Thu Jul 10 06:43:42 2014 From: anja.ende at googlemail.com (Anja Ende) Date: Thu, 10 Jul 2014 11:43:42 +0100 Subject: [ITK-users] deformation, displacement and velocity field transforms Message-ID: Hello, I am slightly confused by some terminology in ITK and I was wondering if someone would be kind enough to help me out on this. As far as I understand, a deformation field is the vector field which describes the new of a given point. A displacement field, on the other hand, the distance and the direction that the point has moved. ITK has this ConstantVelocityFieldTransform object. My question is what does the velocity field in ITK encode? If I integrate the velocity field over unit time would I get a deformation or a displacement field? Thanks for any help you can give me. -- Cheers, Anja -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicgallego at gmail.com Thu Jul 10 10:07:28 2014 From: nicgallego at gmail.com (Nicolas Gallego) Date: Thu, 10 Jul 2014 16:07:28 +0200 Subject: [ITK-users] [ITK] deformation, displacement and velocity field transforms In-Reply-To: References: Message-ID: Hi Anja, Yes, as far as I understand the concept, the velocity field lives in the tangent space of the manifold, while the displacement field is the actual manifold, arbitrarily curved. In practice the transformation between the velocity field (tanget space) and the displacement field (curved manifold) is done via the exponential chart, and the inverse via the logaritmic. The exponential is a k times recursive composition of the field with itself starting from a scaled version of it by 2^(-K), such that the initial field is small enough [1]. That is the equivalent of integrating over the unit interval. [1] http://www.itk.org/Doxygen45/html/classitk_1_1ExponentialDisplacementFieldImageFilter.html hope that helps Nicol?s Gallego-Ortiz Universit? catholique de Louvain, Belgium 2014-07-10 12:43 GMT+02:00 Anja Ende : > Hello, > > I am slightly confused by some terminology in ITK and I was wondering if > someone would be kind enough to help me out on this. > > As far as I understand, a deformation field is the vector field which > describes the new of a given point. > > A displacement field, on the other hand, the distance and the direction > that the point has moved. > > ITK has this ConstantVelocityFieldTransform object. My question is what > does the velocity field in ITK encode? If I integrate the velocity field > over unit time would I get a deformation or a displacement field? > > Thanks for any help you can give me. > > -- > Cheers, > > Anja > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vishwanath.somashekar at gmail.com Thu Jul 10 11:01:21 2014 From: vishwanath.somashekar at gmail.com (Vishwa) Date: Thu, 10 Jul 2014 10:01:21 -0500 Subject: [ITK-users] Using MattesMutualMetric in V4 registration framework. Message-ID: Hi All, I am trying to register two 3d images, both OCT's from different patients. Currently, I do the translation to roughly overlap the two volumes of interest, then do the affine transform in 3 levels, and finally do the BSpline transform based registration in just one level. My Volume size is 200 x 200 x 600. I am using a machine with 64GB of memory and 8 core processor. Am using Conjugate gradient line search optimizer for the Affine registration with MMIv4 metric, and using LBFGSBv4 optimizer for the BSpline registration, again using MMIv4 metric. The Bspline grid is 5 x 5 x 5. It takes about 12 hours for the process to complete. Is this normal? Also, in the previous MMIv3 version, I could set the number samples used to calculate the metric. I am not sure how to do that here or whether it even matters in the v4 framework. I see that there is something like setusefixedsamplepointset function for the metric, which is currently set to false. Does it mean it is using all the voxels in the metric calculation? I appreciate anyone helping me out here. Best regards, Vishwa -------------- next part -------------- An HTML attachment was scrubbed... URL: From anja.ende at googlemail.com Thu Jul 10 12:58:04 2014 From: anja.ende at googlemail.com (Anja Ende) Date: Thu, 10 Jul 2014 17:58:04 +0100 Subject: [ITK-users] [ITK] deformation, displacement and velocity field transforms In-Reply-To: References: Message-ID: Thanks Nicolas! So, the transformation through the exponentiation is to the actual displacement/translation of the point rather than the point's new position. On 10 July 2014 15:07, Nicolas Gallego wrote: > Hi Anja, > > Yes, as far as I understand the concept, the velocity field lives in the > tangent space of the manifold, while the displacement field is the actual > manifold, arbitrarily curved. In practice the transformation between the > velocity field (tanget space) and the displacement field (curved manifold) > is done via the exponential chart, and the inverse via the logaritmic. > > The exponential is a k times recursive composition of the field with > itself starting from a scaled version of it by 2^(-K), such that the > initial field is small enough [1]. That is the equivalent of integrating > over the unit interval. > > [1] > http://www.itk.org/Doxygen45/html/classitk_1_1ExponentialDisplacementFieldImageFilter.html > > hope that helps > > > Nicol?s Gallego-Ortiz > Universit? catholique de Louvain, Belgium > > > 2014-07-10 12:43 GMT+02:00 Anja Ende : > >> Hello, >> >> I am slightly confused by some terminology in ITK and I was wondering if >> someone would be kind enough to help me out on this. >> >> As far as I understand, a deformation field is the vector field which >> describes the new of a given point. >> >> A displacement field, on the other hand, the distance and the direction >> that the point has moved. >> >> ITK has this ConstantVelocityFieldTransform object. My question is what >> does the velocity field in ITK encode? If I integrate the velocity field >> over unit time would I get a deformation or a displacement field? >> >> Thanks for any help you can give me. >> >> -- >> Cheers, >> >> Anja >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> >> _______________________________________________ >> Community mailing list >> Community at itk.org >> http://public.kitware.com/mailman/listinfo/community >> >> > -- Cheers, Anja -------------- next part -------------- An HTML attachment was scrubbed... URL: From anja.ende at googlemail.com Thu Jul 10 13:40:07 2014 From: anja.ende at googlemail.com (Anja Ende) Date: Thu, 10 Jul 2014 18:40:07 +0100 Subject: [ITK-users] itk exponential displacement field image filter Message-ID: Hello, I have another question about the itk:: ExponentialDisplacementFieldImageFilter. Looking at the implementation, it performs the exponentiation using the scaling and squaring approach. The initial exponential is computed by doing a first order approximation. However, it is done simply by dividing the input velocity field by the factor 2^N ie. exp(v_0) = v/2^N However, I thought that the linear approximation of exponential of 'x' where x is close to 0 is: 1+x. So, i thought that the expression should be: ie. exp(v_0) = 1 + v/2^N I saw the original Arsigny paper but could not figure this out. I am sure this is a mistake in understanding on my part and would be very grateful if someone can explain why this intercept term is not there? Thanks, Anja -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicgallego at gmail.com Fri Jul 11 04:33:05 2014 From: nicgallego at gmail.com (Nicolas Gallego) Date: Fri, 11 Jul 2014 10:33:05 +0200 Subject: [ITK-users] [ITK] deformation, displacement and velocity field transforms In-Reply-To: References: Message-ID: Hi Anja, Yes, the displacement field is to be applied to the image to warp it to the fixed image grid, so it is actually the displacement field is used in the inverse way, it tells the warper for every pixel of the new image where to look and interpolate from the input image space [1]. The terminology used in actual version is DisplacementField, I saw that the ExponentialDeformationFieldImageFilter class is being depreciated. [1] http://www.itk.org/Doxygen45/html/classitk_1_1WarpImageFilter.html#a75c959bf6fe0d4108a8912723b6337da Nicol?s Gallego-Ortiz Universit? catholique de Louvain, Belgium 2014-07-10 18:58 GMT+02:00 Anja Ende : > Thanks Nicolas! > > So, the transformation through the exponentiation is to the actual > displacement/translation of the point rather than the point's new position. > > > On 10 July 2014 15:07, Nicolas Gallego wrote: > >> Hi Anja, >> >> Yes, as far as I understand the concept, the velocity field lives in the >> tangent space of the manifold, while the displacement field is the actual >> manifold, arbitrarily curved. In practice the transformation between the >> velocity field (tanget space) and the displacement field (curved manifold) >> is done via the exponential chart, and the inverse via the logaritmic. >> >> The exponential is a k times recursive composition of the field with >> itself starting from a scaled version of it by 2^(-K), such that the >> initial field is small enough [1]. That is the equivalent of integrating >> over the unit interval. >> >> [1] >> http://www.itk.org/Doxygen45/html/classitk_1_1ExponentialDisplacementFieldImageFilter.html >> >> hope that helps >> >> >> Nicol?s Gallego-Ortiz >> Universit? catholique de Louvain, Belgium >> >> >> 2014-07-10 12:43 GMT+02:00 Anja Ende : >> >>> Hello, >>> >>> I am slightly confused by some terminology in ITK and I was wondering if >>> someone would be kind enough to help me out on this. >>> >>> As far as I understand, a deformation field is the vector field which >>> describes the new of a given point. >>> >>> A displacement field, on the other hand, the distance and the direction >>> that the point has moved. >>> >>> ITK has this ConstantVelocityFieldTransform object. My question is what >>> does the velocity field in ITK encode? If I integrate the velocity field >>> over unit time would I get a deformation or a displacement field? >>> >>> Thanks for any help you can give me. >>> >>> -- >>> Cheers, >>> >>> Anja >>> >>> _____________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://www.kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the ITK FAQ at: >>> http://www.itk.org/Wiki/ITK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/insight-users >>> >>> _______________________________________________ >>> Community mailing list >>> Community at itk.org >>> http://public.kitware.com/mailman/listinfo/community >>> >>> >> > > > -- > Cheers, > > Anja > -------------- next part -------------- An HTML attachment was scrubbed... URL: From grothausmann.roman at mh-hannover.de Fri Jul 11 07:53:36 2014 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Fri, 11 Jul 2014 13:53:36 +0200 Subject: [ITK-users] itkMeanImageFilter on RGB (how to adjust example MedianFilteringOfAnRGBImage?) Message-ID: <53BFD040.8070009@mh-hannover.de> Dear mailing list members, How would I need to extend/modify the example for MedianFilteringOfAnRGBImage http://itk.org/ITKExamples/src/Filtering/Smoothing/MedianFilteringOfAnRGBImage/Documentation.html to work with itkMeanImageFilter? I modified myRGBPixel like this: namespace itk{ template class myRGBPixel : public RGBPixel{ public: typedef myRGBPixel Self; typedef RGBPixel Superclass; myRGBPixel():Superclass() {} //avoid candidate expects 1 argument, 0 provided myRGBPixel(int i):Superclass(i) {} //avoid candidate expects 0 arguments, 1 provided using RGBPixel::operator=; bool operator<=(const Self & r) const{ return (this->GetLuminance() <= r.GetLuminance()); } bool operator>=(const Self & r) const{ return (this->GetLuminance() >= r.GetLuminance()); } bool operator<(const Self & r) const{ return (this->GetLuminance() < r.GetLuminance()); } bool operator>(const Self & r) const{ return (this->GetLuminance() > r.GetLuminance()); } }; } However gcc still yields this error: In file included from /opt/itk-4.5.1/include/ITK-4.5/itkMeanImageFilter.h:115:0, from /net/home/ghky/itk/simple/mean-CPU_02.cxx:8: /opt/itk-4.5.1/include/ITK-4.5/itkMeanImageFilter.hxx: In instantiation of ?void itk::MeanImageFilter::ThreadedGenerateData(const OutputImageRegionType&, itk::ThreadIdType) [with TInputImage = itk::Image, 3u>; TOutputImage = itk::Image, 3u>; itk::MeanImageFilter::OutputImageRegionType = itk::ImageRegion<3u>; itk::ThreadIdType = unsigned int]?: /net/home/ghky/itk/simple/mean-CPU_02.cxx:335:5: required from here /opt/itk-4.5.1/include/ITK-4.5/itkMeanImageFilter.hxx:81:9: error: invalid static_cast from type ?itk::ConstNeighborhoodIterator, 3u>, itk::ZeroFluxNeumannBoundaryCondition, 3u>, itk::Image, 3u> > >::PixelType {aka itk::myRGBPixel}? to type ?itk::MeanImageFilter, 3u>, itk::Image, 3u> >::InputRealType {aka double}? make[3]: *** [CMakeFiles/mean-CPU_02.dir/mean-CPU_02.cxx.o] Error 1 make[2]: *** [CMakeFiles/mean-CPU_02.dir/all] Error 2 make[1]: *** [CMakeFiles/mean-CPU_02.dir/rule] Error 2 make: *** [mean-CPU_02] Error 2 What am I missing in myRGBPixel? Any help or hints are very much appreciated Roman -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-9574 From bill.lorensen at gmail.com Fri Jul 11 11:26:31 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Fri, 11 Jul 2014 11:26:31 -0400 Subject: [ITK-users] itkMeanImageFilter on RGB (how to adjust example MedianFilteringOfAnRGBImage?) In-Reply-To: <53BFD040.8070009@mh-hannover.de> References: <53BFD040.8070009@mh-hannover.de> Message-ID: You need to define a cast operator. SOmething like: operator TComponent() { return this->GetLuminance(); } But I don't think you will get the result you want. Bill On Fri, Jul 11, 2014 at 7:53 AM, Dr. Roman Grothausmann wrote: > Dear mailing list members, > > > How would I need to extend/modify the example for > MedianFilteringOfAnRGBImage > > http://itk.org/ITKExamples/src/Filtering/Smoothing/MedianFilteringOfAnRGBImage/Documentation.html > > to work with itkMeanImageFilter? > > I modified myRGBPixel like this: > > namespace itk{ > template > class myRGBPixel : public RGBPixel{ > public: > typedef myRGBPixel Self; > typedef RGBPixel Superclass; > > myRGBPixel():Superclass() {} //avoid candidate expects 1 argument, 0 > provided > myRGBPixel(int i):Superclass(i) {} //avoid candidate expects 0 > arguments, 1 provided > > using RGBPixel::operator=; > > bool operator<=(const Self & r) const{ > return (this->GetLuminance() <= r.GetLuminance()); > } > bool operator>=(const Self & r) const{ > return (this->GetLuminance() >= r.GetLuminance()); > } > bool operator<(const Self & r) const{ > return (this->GetLuminance() < r.GetLuminance()); > } > bool operator>(const Self & r) const{ > return (this->GetLuminance() > r.GetLuminance()); > } > }; > } > > > However gcc still yields this error: > > > In file included from > /opt/itk-4.5.1/include/ITK-4.5/itkMeanImageFilter.h:115:0, > from /net/home/ghky/itk/simple/mean-CPU_02.cxx:8: > /opt/itk-4.5.1/include/ITK-4.5/itkMeanImageFilter.hxx: In instantiation of > ?void itk::MeanImageFilter TOutputImage>::ThreadedGenerateData(const OutputImageRegionType&, > itk::ThreadIdType) [with TInputImage = itk::Image char>, 3u>; TOutputImage = itk::Image, 3u>; > itk::MeanImageFilter::OutputImageRegionType = > itk::ImageRegion<3u>; itk::ThreadIdType = unsigned int]?: > /net/home/ghky/itk/simple/mean-CPU_02.cxx:335:5: required from here > /opt/itk-4.5.1/include/ITK-4.5/itkMeanImageFilter.hxx:81:9: error: invalid > static_cast from type > ?itk::ConstNeighborhoodIterator, > 3u>, > itk::ZeroFluxNeumannBoundaryCondition char>, 3u>, itk::Image, 3u> > >::PixelType > {aka itk::myRGBPixel}? to type > ?itk::MeanImageFilter, 3u>, > itk::Image, 3u> >::InputRealType {aka > double}? > make[3]: *** [CMakeFiles/mean-CPU_02.dir/mean-CPU_02.cxx.o] Error 1 > make[2]: *** [CMakeFiles/mean-CPU_02.dir/all] Error 2 > make[1]: *** [CMakeFiles/mean-CPU_02.dir/rule] Error 2 > make: *** [mean-CPU_02] Error 2 > > > What am I missing in myRGBPixel? > > Any help or hints are very much appreciated > Roman > > -- > Dr. Roman Grothausmann > > Tomographie und Digitale Bildverarbeitung > Tomography and Digital Image Analysis > > Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 > Medizinische Hochschule Hannover > Carl-Neuberg-Str. 1 > D-30625 Hannover > > Tel. +49 511 532-9574 > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users -- Unpaid intern in BillsBasement at noware dot com From donelron at web.de Fri Jul 11 12:26:17 2014 From: donelron at web.de (donelron) Date: Fri, 11 Jul 2014 09:26:17 -0700 (PDT) Subject: [ITK-users] How to get the image intensity with the highest frequency count from the histogram of a single-channel grayscale image Message-ID: <1405095977090-34222.post@n7.nabble.com> Hi everybody, I have a simple question with regard to histograms: Consider the following lines of code that calculate the histogram of an ITK grayscale image: ------------------------------------------------------------------------------------------------- const unsigned int MeasurementVectorSize = 1; // Grayscale const unsigned int binsPerDimension = 255; typedef itk::Statistics::ImageToHistogramFilter< GrayscaleImageType > ImageToHistogramFilterType; ImageToHistogramFilterType::HistogramType::MeasurementVectorType lowerBound(binsPerDimension); lowerBound.Fill(0); ImageToHistogramFilterType::HistogramType::MeasurementVectorType upperBound(binsPerDimension); upperBound.Fill(255) ; ImageToHistogramFilterType::HistogramType::SizeType size(MeasurementVectorSize); size.Fill(binsPerDimension); ImageToHistogramFilterType::Pointer imageToHistogramFilter = ImageToHistogramFilterType::New(); imageToHistogramFilter->SetInput( pConnectedComponentFilter->GetOutput() ); imageToHistogramFilter->SetHistogramBinMinimum( lowerBound ); imageToHistogramFilter->SetHistogramBinMaximum( upperBound ); imageToHistogramFilter->SetHistogramSize( size ); try { imageToHistogramFilter->Update(); } catch( itk::ExceptionObject & error ) { std::cerr << "Error: " << error << std::endl; system("pause"); } ImageToHistogramFilterType::HistogramType* histogram = imageToHistogramFilter->GetOutput(); std::cout << "Frequency = [ "; for(unsigned int i = 0; i < histogram->GetSize()[0]; ++i) { std::cout << histogram->GetFrequency(i); if( i != histogram->GetSize()[0] - 1 ) { std::cout << "," << std::endl; } } std::cout << " ]" << std::endl; ------------------------------------------------------------------------------------------------- Is there a way to get the intensity with the highest frequency count from the histogram? I am aware that this is probably included in the Doxygen documentation, but since I am neither an experienced ITK user nor C++ programmer, I couldn't figure it out from the documentation how to do it. Also, none of the code snippets I found, could answer my question or give me a hint. So, if someone could please provide a short code snippet that solves my problem, that would be really nice:) Or else, all hints / clues are also very very welcome. Thank you for your help in advance!!! -- View this message in context: http://itk-users.7.n7.nabble.com/How-to-get-the-image-intensity-with-the-highest-frequency-count-from-the-histogram-of-a-single-channe-tp34222.html Sent from the ITK - Users mailing list archive at Nabble.com. From mat.roscoe at gmail.com Fri Jul 11 19:33:33 2014 From: mat.roscoe at gmail.com (badrobot) Date: Fri, 11 Jul 2014 16:33:33 -0700 (PDT) Subject: [ITK-users] NeighborhoodOperatorImageFilter RunTime Error Message-ID: <1405121613174-34225.post@n7.nabble.com> HI I am fairly new to ITK I have created the following: typedef itk::Image ScalarImage; typedef ScalarImage::Pointer ScalarImagePointer; typedef itk::Image, 2> GradientImage; typedef GradientImage::Pointer GradientImagePointer; typedef itk::NeighborhoodOperatorImageFilter NeighborhoodImageFilter; typedef itk::ForwardDifferenceOperator DerivativeOperator; itk::Size<2> derivative_kernel_radius; derivative_kernel_radius.Fill( 1 ); DLOG(INFO) << "Creating X Derivative Operator"; // Compute the derivative in the X direction. DerivativeOperator DerivativeX; DerivativeX.SetDirection( 0 ); DerivativeX.CreateToRadius( derivative_kernel_radius ); DLOG(INFO) << "Computing X Derivative"; typename NeighborhoodImageFilter::Pointer DerivativeXFilter = NeighborhoodImageFilter::New(); DerivativeXFilter->SetOperator( DerivativeX ); DerivativeXFilter->SetInput( input_depth_map ); DerivativeXFilter->Update(); Everything in this works fine until I run the update command when I get the following output: I0711 20:09:07.657845 4045 DepthDerivative.cpp:62] Creating X Derivative Operator I0711 20:09:07.657874 4045 DepthDerivative.cpp:68] Computing X Derivative terminate called after throwing an instance of 'itk::ExceptionObject' what(): /home/badrobit/InsightToolkit-4.5.2/Modules/Core/Common/src/itkProcessObject.cxx:1370: itk::ERROR: NeighborhoodOperatorImageFilter(0x1c01500): Input Primary is required but not set. Aborted (core dumped) This looks like it should be a fairly simply problem to catch but I am unable to figure it out. I was hoping someone here could help me. -- View this message in context: http://itk-users.7.n7.nabble.com/NeighborhoodOperatorImageFilter-RunTime-Error-tp34225.html Sent from the ITK - Users mailing list archive at Nabble.com. From mat.roscoe at unb.ca Sat Jul 12 00:58:02 2014 From: mat.roscoe at unb.ca (Matthew Roscoe) Date: Sat, 12 Jul 2014 01:58:02 -0300 Subject: [ITK-users] Run Time Errors with NeighborhoodOperatorImageFilter Message-ID: Hello, I am currently trying to get a derivative filter working. I have implemented the following function: void DepthDerivative::ForwardDifferenceDerivative( const ScalarImage::Pointer input_depth_map, GradientImage* const gradient_image ) { DLOG(INFO) << "Setting up Forward Difference Derivative"; // Setup the Derivative Operator, and set its radius to 1. This will give us a kernel that is // 3px x 3px. typedef itk::ForwardDifferenceOperator DerivativeOperator; itk::Size<2> derivative_kernel_radius; derivative_kernel_radius.Fill( 1 ); DLOG(INFO) << "Creating X Derivative Operator"; // Compute the derivative in the X direction. DerivativeOperator DerivativeX; DerivativeX.SetDirection( 0 ); DerivativeX.CreateToRadius( derivative_kernel_radius ); DLOG(INFO) << "Computing X Derivative"; typedef itk::NeighborhoodOperatorImageFilter NeighborhoodImageFilter; NeighborhoodImageFilter::Pointer DerivativeXFilter = NeighborhoodImageFilter::New(); DerivativeXFilter->SetOperator( DerivativeX ); DerivativeXFilter->SetInput( input_depth_map ); DLOG(INFO) << "Primary is set: " << (bool)DerivativeXFilter->HasInput( "Primary" ); DerivativeXFilter->Update(); #ifndef NDEBUG DLOG(INFO) << "Saving X Derivative to File"; SaveImage( DerivativeXFilter->GetOutput(), "xDerivative.png" ); #endif I have done this using the examples on the ITK website. I have also downloaded the example for NeighborhoodOperatorImageFilter and it functions properly. Running this code I get the following output: badrobit at Ubuntu:build {master} $ ./InpaintingDemo I0712 01:52:24.366832 19445 DepthDerivative.cpp:21] Debugging Enabled, Logs will also output to Terminal I0712 01:52:24.366889 19445 DepthDerivative.cpp:27] DephDerivative Initialized I0712 01:52:24.366901 19445 Helpers.hpp:62] Starting Image File Read of: data/test.png I0712 01:52:24.367377 19445 Helpers.hpp:76] Reading in of Image: data/test.png is completed I0712 01:52:24.367399 19445 DepthDerivative.cpp:59] Setting up Forward Difference Derivative I0712 01:52:24.367408 19445 DepthDerivative.cpp:66] Creating X Derivative Operator I0712 01:52:24.367425 19445 DepthDerivative.cpp:72] Computing X Derivative I0712 01:52:24.367441 19445 DepthDerivative.cpp:77] Primary is set: 1 terminate called after throwing an instance of 'itk::ExceptionObject' what(): /home/badrobit/InsightToolkit-4.4.2/Modules/Core/Common/src/itkProcessObject.cxx:1380: itk::ERROR: NeighborhoodOperatorImageFilter(0x26fe4f0): Input Primary is required but not set. Aborted (core dumped) As you can see I am pretty confused because I check before running Update() if Primary has been set and the function is telling me that it is but as soon as I run Update() it disappears... This behaviour is exactly the same in ITK4.5.2 in case you saw the older build number. I am really at a loss for what to do and I am hoping that the community might be able to help me out. Thanks in advance! Mat Roscoe -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Sat Jul 12 09:18:25 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Sat, 12 Jul 2014 09:18:25 -0400 Subject: [ITK-users] itkMeanImageFilter on RGB (how to adjust example MedianFilteringOfAnRGBImage?) In-Reply-To: References: <53BFD040.8070009@mh-hannover.de> Message-ID: You are better off using vector pixels versus rgb pixels. No overriding necessary. You should be able to modify your example by looking at this one: On Fri, Jul 11, 2014 at 11:26 AM, Bill Lorensen wrote: > You need to define a cast operator. SOmething like: > operator TComponent() > { > return this->GetLuminance(); > } > > But I don't think you will get the result you want. > > Bill > > On Fri, Jul 11, 2014 at 7:53 AM, Dr. Roman Grothausmann > wrote: >> Dear mailing list members, >> >> >> How would I need to extend/modify the example for >> MedianFilteringOfAnRGBImage >> >> http://itk.org/ITKExamples/src/Filtering/Smoothing/MedianFilteringOfAnRGBImage/Documentation.html >> >> to work with itkMeanImageFilter? >> >> I modified myRGBPixel like this: >> >> namespace itk{ >> template >> class myRGBPixel : public RGBPixel{ >> public: >> typedef myRGBPixel Self; >> typedef RGBPixel Superclass; >> >> myRGBPixel():Superclass() {} //avoid candidate expects 1 argument, 0 >> provided >> myRGBPixel(int i):Superclass(i) {} //avoid candidate expects 0 >> arguments, 1 provided >> >> using RGBPixel::operator=; >> >> bool operator<=(const Self & r) const{ >> return (this->GetLuminance() <= r.GetLuminance()); >> } >> bool operator>=(const Self & r) const{ >> return (this->GetLuminance() >= r.GetLuminance()); >> } >> bool operator<(const Self & r) const{ >> return (this->GetLuminance() < r.GetLuminance()); >> } >> bool operator>(const Self & r) const{ >> return (this->GetLuminance() > r.GetLuminance()); >> } >> }; >> } >> >> >> However gcc still yields this error: >> >> >> In file included from >> /opt/itk-4.5.1/include/ITK-4.5/itkMeanImageFilter.h:115:0, >> from /net/home/ghky/itk/simple/mean-CPU_02.cxx:8: >> /opt/itk-4.5.1/include/ITK-4.5/itkMeanImageFilter.hxx: In instantiation of >> ?void itk::MeanImageFilter> TOutputImage>::ThreadedGenerateData(const OutputImageRegionType&, >> itk::ThreadIdType) [with TInputImage = itk::Image> char>, 3u>; TOutputImage = itk::Image, 3u>; >> itk::MeanImageFilter::OutputImageRegionType = >> itk::ImageRegion<3u>; itk::ThreadIdType = unsigned int]?: >> /net/home/ghky/itk/simple/mean-CPU_02.cxx:335:5: required from here >> /opt/itk-4.5.1/include/ITK-4.5/itkMeanImageFilter.hxx:81:9: error: invalid >> static_cast from type >> ?itk::ConstNeighborhoodIterator, >> 3u>, >> itk::ZeroFluxNeumannBoundaryCondition> char>, 3u>, itk::Image, 3u> > >::PixelType >> {aka itk::myRGBPixel}? to type >> ?itk::MeanImageFilter, 3u>, >> itk::Image, 3u> >::InputRealType {aka >> double}? >> make[3]: *** [CMakeFiles/mean-CPU_02.dir/mean-CPU_02.cxx.o] Error 1 >> make[2]: *** [CMakeFiles/mean-CPU_02.dir/all] Error 2 >> make[1]: *** [CMakeFiles/mean-CPU_02.dir/rule] Error 2 >> make: *** [mean-CPU_02] Error 2 >> >> >> What am I missing in myRGBPixel? >> >> Any help or hints are very much appreciated >> Roman >> >> -- >> Dr. Roman Grothausmann >> >> Tomographie und Digitale Bildverarbeitung >> Tomography and Digital Image Analysis >> >> Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 >> Medizinische Hochschule Hannover >> Carl-Neuberg-Str. 1 >> D-30625 Hannover >> >> Tel. +49 511 532-9574 >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users > > > > -- > Unpaid intern in BillsBasement at noware dot com -- Unpaid intern in BillsBasement at noware dot com -------------- next part -------------- A non-text attachment was scrubbed... Name: VectorMeanImageFilter.cxx Type: application/octet-stream Size: 2098 bytes Desc: not available URL: From matt.mccormick at kitware.com Sat Jul 12 13:10:32 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Sat, 12 Jul 2014 13:10:32 -0400 Subject: [ITK-users] [ANNOUNCE] ITK 4.6 Release Candidate 3 has been tagged! Message-ID: On behalf of the Insight Toolkit community, we are proud to announce that ITK 4.6.0 release candidate 3 has been tagged and is available for testing! To obtain the source code, git clone http://itk.org/ITK.git cd ITK git checkout -q --detach v4.6rc03 For more details, please see the Git documentation [1]. Please test the release candidate and share your experiences on the mailing list, issue tracker, and Gerrit Code Review. Please help identify issues submitting an Experimental build to the dashboard [2] with: ctest -M Experimental -T Configure -T Build -T Test -T Submit and notifying the mailing list. Testing your own applications against the RC is also appreciated. Those community members wishing to contribute by cleaning up the dashboard can find a list potential candidates on the issue tracker [3]. Please do not hesitate to ask about any aspect of the contribution process. Congratulations and well done to everyone that has contributed to this release. Release candidates are tagged every week. The final release is scheduled for next week. [1] http://www.itk.org/Wiki/ITK/Git [2] http://open.cdash.org/index.php?project=Insight [3] https://issues.itk.org/jira/issues/?jql=project%20%3D%20ITK%20AND%20fixVersion%20%3D%20%2220140714_ITKv4.6.0_FINAL%22%20AND%20status%20in%20(Open%2C%20%22In%20Progress%22%2C%20Reopened) New Features ------------------ * CMake improvements - Improved Remote Module support - Add ITK_FORBID_DOWNLOADS for package maintainers - ITK_USE_SYSTEM_EXPAT available * Filtering Improvements - Moved TransformToDisplacementField out of Review - An entire noise image generation module - http://hdl.handle.net/10380/3158 - Better pipeline support for ResampleImageFilter - Move MagnitudeAndPhaseToComplexImageFilter out of Review - Setters for LabelMap overlay filters - More consistent filter progress reporting * ImageIO improvements - Register the GE image formats by default - More IO modules are built as shared libraries - OpenFileForReading/Writing methods in ImageIO - Support for system tiff 4.0.0-4.0.2 (e.g. some Ubuntu versions) - Mangling to internal OpenJPEG - SCIFIO improvements * Infrastructure improvements - MetaDataObject print specialization for common types - Improvements to ResourceProbe and RealTimeClock - More Solve methods for VNLSparseLUSolverTraits - Output stream operator for LightObject exposed - FFTW bump to 3.3.3 * New Remote Modules - Skull stripper - http://hdl.handle.net/10380/3353 - Wiki examples - Sphinx examples - Variational registration - http://hdl.handle.net/10380/3460 - AnalyzeObjectMapIO - http://hdl.handle.net/1926/593 - FDFImageIO - SplitComponents - http://hdl.handle.net/10380/320 * Registrationv4 improvements - v4 regular step gradient descent optimizer - v4 amoeba optimizer - v4 exhaustive optimizer - v4 Powell optimizer - v4 one-plus-one-evolutionary optimizer - v4 LBFGS optimizer improvements - Use registration method classes as pipeline filters * Performance improvements - Registrationv4 - Histogram computation - Improved SmartPointer copy - CompositeTransform - Registration Jacobian re-use * Wrapping improvements - pygccxml 1.0.0 - .pth symlink usable in a virtualenv - Cleaner CMake configuration - SWIG and PCRE updated to 3.0.2, 8.34 - Latest GCCXML, which works with GCC 4.9 - Sweeping wrapping generation cleanup * Many style improvements -- ITK gets more stylish with every release! * Improved code coverage -- some measures put us over 85%! * *Lots* of important bug fixes * And more! See details in the log below. List of changes since v4.6rc02 --------------------------------------- Ali Ghayoor (1): ENH: Convert seven ImageRegistration examples to ITKv4 Bradley Lowekamp (2): BUG: Remove multiple per-pixel allocations in Mahalanobis Membership COMP: Fix unused-local-typedef warnings in the Registration and Numeric Hans Johnson (1): ENH: Prepare for ITKv4 registration Examples Matthew McCormick (5): BUG: Improve module Group membership detection. COMP: Fix unused-local-typedef warnings in Group Core. BUG: Update TransformReadWrite example. COMP: Fix unused-local-typedef warnings in the Filtering Group. COMP: Remove unused typedefs. Nick Tustison (1): ENH: Missed spec for generic computation type. From medswengineer at gmail.com Sun Jul 13 09:50:59 2014 From: medswengineer at gmail.com (med aweng) Date: Sun, 13 Jul 2014 15:50:59 +0200 Subject: [ITK-users] Gray Level Coocurrence Matrix Message-ID: Hello, I'm new to ITK, and trying to calculate the Gray Level Coocurrence Matrix (GLCM) features of some image. I have started as follows: typedef itk::Image< double, 3 > MyImageType; I found that there are two classes to use for my task: ScalarImageToGreyLevelCooccurrenceMatrixGenerator GreyLevelCooccurrenceMatrixTextureCoefficientsCalculator Can you just kindly guide me on how to go further with building this program, just for me to know how the structure of an ITK program should look like? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dzenanz at gmail.com Mon Jul 14 06:29:47 2014 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Mon, 14 Jul 2014 12:29:47 +0200 Subject: [ITK-users] Gray Level Coocurrence Matrix In-Reply-To: References: Message-ID: Take a look at this example: http://www.itk.org/Wiki/ITK/Examples/Statistics/TextureFeatures You might be interested in this code: https://github.com/blowekamp/itkTextureAnalysis and this thread: http://www.itk.org/pipermail/insight-users/2012-February/043764.html On Sun, Jul 13, 2014 at 3:50 PM, med aweng wrote: > Hello, > > I'm new to ITK, and trying to calculate the Gray Level Coocurrence Matrix > (GLCM) features of some image. > > I have started as follows: > > typedef itk::Image< double, 3 > MyImageType; > > I found that there are two classes to use for my task: > > ScalarImageToGreyLevelCooccurrenceMatrixGenerator > > > GreyLevelCooccurrenceMatrixTextureCoefficientsCalculator > > > Can you just kindly guide me on how to go further with building this > program, just for me to know how the structure of an ITK program should > look like? > > Thanks. > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivans at yahoo.co.jp Mon Jul 14 06:27:09 2014 From: ivans at yahoo.co.jp (Ivan Setiawan) Date: Mon, 14 Jul 2014 19:27:09 +0900 (JST) Subject: [ITK-users] Strange behavior with ResampleImageFilter? Message-ID: <519113.33257.qm@web101320.mail.kks.yahoo.co.jp> Dear All, I have a question regarding a strange behavior of?itk::ResampleImageFilter. Currently I am using v4.4.0. I am registering a 3D moving image to a 3D fixed image using BSplineTransform as the transformer. The registration process seems fine. However, sometimes, the resampling result (i.e., the final moved image) on the first slice looks identical with the original moving image. The other slices seems correctly deform and correctly align with the 3D fixed image. Could you please direct me to the code that should be modified to correct this behavior such that the first slice of the moving image also deforms correctly? Thank you very much and best regards, Ivan -------------- next part -------------- An HTML attachment was scrubbed... URL: From mpinkert at wisc.edu Mon Jul 14 13:58:37 2014 From: mpinkert at wisc.edu (Michael Pinkert) Date: Mon, 14 Jul 2014 10:58:37 -0700 (PDT) Subject: [ITK-users] Largest Connected Region Message-ID: <1405360717980-7585889.post@n2.nabble.com> Hi everyone, I am using the Otsu algorithm as part of a pipeline to segment breast images, but the results consistently have several holes and isolated regions of noise, both of which are large problems I am looking to deal with. I intend to use morphological operators for the hole problem, but I have not had luck finding a method to eliminate the isolated regions of noise while preserving the remainder of the image. The breast is a connected region in the results, and the noise is always a much smaller region. Is there a filter that could obtain the largest connected region from from a binary image, so that the breast may be extracted and the noise removed? I have looked at some of the various connected region algorithms, but they require seeds in order to function, and I have not seen one that can automatically isolate the largest connected region from a binary mask and make it as an output. If none of the existing filters work I intend to write a new one to do so, but I thought it would be best to check first. Best regards, Michael Pinkert -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-users-Largest-Connected-Region-tp7585889.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From matt.mccormick at kitware.com Mon Jul 14 16:09:15 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 14 Jul 2014 16:09:15 -0400 Subject: [ITK-users] [ITK] Largest Connected Region In-Reply-To: <1405360717980-7585889.post@n2.nabble.com> References: <1405360717980-7585889.post@n2.nabble.com> Message-ID: Hi Michael, This filter [1] can keep the largest object. Use filter->SetAttribute( "PhysicalSize" ) and filter->SetNumberOfObject( 1 ) Hope this helps, Matt [1] http://www.itk.org/Doxygen/html/classitk_1_1BinaryShapeKeepNObjectsImageFilter.html On Mon, Jul 14, 2014 at 1:58 PM, Michael Pinkert wrote: > Hi everyone, > > I am using the Otsu algorithm as part of a pipeline to segment breast > images, but the results consistently have several holes and isolated regions > of noise, both of which are large problems I am looking to deal with. I > intend to use morphological operators for the hole problem, but I have not > had luck finding a method to eliminate the isolated regions of noise while > preserving the remainder of the image. > > The breast is a connected region in the results, and the noise is always a > much smaller region. Is there a filter that could obtain the largest > connected region from from a binary image, so that the breast may be > extracted and the noise removed? > > I have looked at some of the various connected region algorithms, but they > require seeds in order to function, and I have not seen one that can > automatically isolate the largest connected region from a binary mask and > make it as an output. > > If none of the existing filters work I intend to write a new one to do so, > but I thought it would be best to check first. > > Best regards, > Michael Pinkert > > > > -- > View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-users-Largest-Connected-Region-tp7585889.html > Sent from the ITK Insight Users mailing list archive at Nabble.com. > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community From Roy.Harnish at ucsf.edu Mon Jul 14 20:19:37 2014 From: Roy.Harnish at ucsf.edu (Harnish, Roy) Date: Tue, 15 Jul 2014 00:19:37 +0000 Subject: [ITK-users] (no subject) Message-ID: Hi, I'm wondering if there is a procedure for adding a dicom dictionary to those that are used by the GDCMImageIO, or a way to parse a private field by furnishing the pertinent info to the right method. I'm trying to access the field 0119,1030, which is pretty much a 3d version of ImageOrientationPatient. I have no problem seeing the field in a dcmdump of an image that contains the field, but am having trouble getting my program to handle the field properly. Here's what a dcmdump of the field looks like: cbl-mbp-3369:Release rharnish$ dcmdump dce.dcm | grep -i imageor (0020,0037) DS [-1\-0\0\-0\-1\0] # 16, 6 ImageOrientationPatient cbl-mbp-3369:Release rharnish$ dcmdump dce.dcm | grep -i 0119,1030 (0119,1030) DS [-1\-0\0\-0\-1\0\0\0\1] # 22, 9 Unknown Tag & Data cbl-mbp-3369:Release rharnish$ This is a section of code that tires to parse the field: std::string tagkey = "0119|1030"; // std::string tagkey = "0020|0037"; std::string labelId; std::string value; if( gdcmImageIO->GetValueFromTag(tagkey, value) ) { std::cout << tagkey << ": "; std::cout << value << std::endl; } Here's the output with std::string tagkey = "0119|1030";: 0119|1030: LTFcLTBcMFwtMFwtMVwwXDBcMFwxIA== Here's the output with std::string tagkey = "0020|0037"; 0020|0037: -1\-0\0\-0\-1\0 Any suggestions would be much appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mpinkert at wisc.edu Mon Jul 14 20:46:02 2014 From: mpinkert at wisc.edu (Michael Pinkert) Date: Mon, 14 Jul 2014 17:46:02 -0700 (PDT) Subject: [ITK-users] [ITK] Largest Connected Region In-Reply-To: References: <1405360717980-7585889.post@n2.nabble.com> Message-ID: <1405385162973-7585892.post@n2.nabble.com> Hi Matt, Thank you very much. This and another filter that was sent to me have both been very helpful. I knew I was probably missing something big. Best regards, Michael Pinkert Matt McCormick-2 wrote > Hi Michael, > > This filter [1] can keep the largest object. Use > > filter->SetAttribute( "PhysicalSize" ) > > and > > filter->SetNumberOfObject( 1 ) > > Hope this helps, > Matt > > [1] > http://www.itk.org/Doxygen/html/classitk_1_1BinaryShapeKeepNObjectsImageFilter.html > > On Mon, Jul 14, 2014 at 1:58 PM, Michael Pinkert < > mpinkert@ > > wrote: >> Hi everyone, >> >> I am using the Otsu algorithm as part of a pipeline to segment breast >> images, but the results consistently have several holes and isolated >> regions >> of noise, both of which are large problems I am looking to deal with. I >> intend to use morphological operators for the hole problem, but I have >> not >> had luck finding a method to eliminate the isolated regions of noise >> while >> preserving the remainder of the image. >> >> The breast is a connected region in the results, and the noise is always >> a >> much smaller region. Is there a filter that could obtain the largest >> connected region from from a binary image, so that the breast may be >> extracted and the noise removed? >> >> I have looked at some of the various connected region algorithms, but >> they >> require seeds in order to function, and I have not seen one that can >> automatically isolate the largest connected region from a binary mask and >> make it as an output. >> >> If none of the existing filters work I intend to write a new one to do >> so, >> but I thought it would be best to check first. >> >> Best regards, >> Michael Pinkert >> >> >> >> -- >> View this message in context: >> http://itk-insight-users.2283740.n2.nabble.com/ITK-users-Largest-Connected-Region-tp7585889.html >> Sent from the ITK Insight Users mailing list archive at Nabble.com. >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> _______________________________________________ >> Community mailing list >> > Community@ >> http://public.kitware.com/mailman/listinfo/community > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-users-Largest-Connected-Region-tp7585889p7585892.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From matt.mccormick at kitware.com Mon Jul 14 20:55:01 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 14 Jul 2014 20:55:01 -0400 Subject: [ITK-users] [ITK] How to make ITK-binaries NOT ignore kernel out of memory messages? In-Reply-To: <53A80327.9050701@mh-hannover.de> References: <53917A66.2060402@mh-hannover.de> <53A80327.9050701@mh-hannover.de> Message-ID: Hi Roman, The CMake configuration variable: ITK_COMPUTER_MEMORY_SIZE is only used to choose which unit tests to run, and has no effect on your program. It may be worth a try to run export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1 before starting your program on the server to see the effect. It is possible that too many threads or being spawned or that the amount of memory consumed is scaling (poorly) with the number of threads used. Hope this helps, Matt On Mon, Jun 23, 2014 at 6:36 AM, Dr. Roman Grothausmann wrote: > Dear Luis, > > > Many thanks for Your reply. It took me some time to reproduce the problem, > because Your test program works as expected on our server: > > ~$ ~/itk/simple/build_itk-4.5.1/memtest_01 1000 > ITK Hello World ! > > ~$ ~/itk/simple/build_itk-4.5.1/memtest_01 10000 > /opt/itk-4.5.1/include/ITK-4.5/itkImportImageContainer.hxx:192: > > Failed to allocate memory for image. > > One program of mine for which the problem exists is below. The problem > occurs when BinaryMask3DMeshSource acquires more memory after running for > some minutes. The very strange thing to me is, that the program is killed by > the kernel as expected on my desktop PC: > > ~/itk/simple/build_itk4_pc3G48243/euler-characteristic_01 13-511_EAA_ot.mha > 255 > component type is: unsigned_char > numDimensions: 3 > component size: 1 > pixel type (string): scalar > pixel type: 1 > _________________________ > > Executing ImageFileReader done. Took 2.78 seconds. > Executing BinaryMask3DMeshSource Killed > > > The header of 13-511_EAA_ot.mha: > > ObjectType = Image > NDims = 3 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = True > CompressedDataSize = 20474538 > TransformMatrix = 1 0 0 0 1 0 0 0 1 > Offset = 0 0 0 > CenterOfRotation = 0 0 0 > AnatomicalOrientation = RAI > ElementSpacing = 1 1 1 > DimSize = 998 998 1034 > ElementType = MET_UCHAR > ElementDataFile = LOCAL > > > However on the server it is not terminated when the RAM runs out, instead > many processes go nuts that had been mostly sleeping and finally the system > does not respond any more at all and a cold start is necessary. The > itk-4.5.1 is configured on the server with (see attached > CMakeCache_itk-4.5.1.txt): > > ITK_COMPUTER_MEMORY_SIZE 190 > > The server has 256GB of RAM an no Swap enabled: > > free > total used free shared buffers cached > Mem: 264498496 1341020 263157476 0 285760 289120 > -/+ buffers/cache: 766140 263732356 > Swap: 0 0 0 > > > Has 12x2 Intel(R) Xeon(R) CPUs: > > cat /proc/cpuinfo > processor : 0 > vendor_id : GenuineIntel > cpu family : 6 > model : 45 > model name : Intel(R) Xeon(R) CPU E5-2630L 0 @ 2.00GHz > stepping : 7 > microcode : 0x710 > cpu MHz : 1200.000 > cache size : 15360 KB > physical id : 0 > siblings : 12 > core id : 0 > cpu cores : 6 > apicid : 0 > initial apicid : 0 > fpu : yes > fpu_exception : yes > cpuid level : 13 > wp : yes > flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca > cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx > pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology > nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 > ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer > aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi > flexpriority ept vpid > bogomips : 4000.56 > clflush size : 64 > cache_alignment : 64 > address sizes : 46 bits physical, 48 bits virtual > power management: > . > . > . > > > The server runs a Debian Wheezy (7.2): > uname -a > Linux img1-serv 3.2.0-4-amd64 #1 SMP Debian 3.2.57-3+deb7u2 x86_64 GNU/Linux > > My desktop PC has the same Debian (also same update state): > uname -a > Linux pc3G48243 3.2.0-4-amd64 #1 SMP Debian 3.2.57-3+deb7u2 x86_64 GNU/Linux > > free > total used free shared buffers cached > Mem: 8180356 1185364 6994992 0 23348 216084 > -/+ buffers/cache: 945932 7234424 > Swap: 0 0 0 > > > and 4 AMD FX(tm)-4100 Quad-Core Processors: > > cat /proc/cpuinfo > processor : 0 > vendor_id : AuthenticAMD > cpu family : 21 > model : 1 > model name : AMD FX(tm)-4100 Quad-Core Processor > stepping : 2 > microcode : 0x6000626 > cpu MHz : 1400.000 > cache size : 2048 KB > physical id : 0 > siblings : 4 > core id : 0 > cpu cores : 2 > apicid : 16 > initial apicid : 0 > fpu : yes > fpu_exception : yes > cpuid level : 13 > wp : yes > flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca > cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt > pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid > aperfmperf pni pclmulqdq monitor ssse3 cx16 sse4_1 sse4_2 popcnt aes xsave > avx lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse > 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 nodeid_msr topoext > perfctr_core arat cpb hw_pstate npt lbrv svm_lock nrip_save tsc_scale > vmcb_clean flushbyasid decodeassists pausefilter pfthreshold > bogomips : 7233.41 > TLB size : 1536 4K pages > clflush size : 64 > cache_alignment : 64 > address sizes : 48 bits physical, 48 bits virtual > power management: ts ttp tm 100mhzsteps hwpstate [9] > > > Knowing now, that itk checks for available RAM, the only sources for this > problem I can think of would be an odd configuration of ITK itself or its > use in programs compiled on the server, or some configuration differences in > the (Debian) system, or some hardware problem. > > Do You have any idea what it could be? > Or do You have any suggestions how I should go on searching for the cause? > > > Any help or hints are very much appriciated. > Many thanks for Your help again! > > Roman > > > _____________________________________________ > > > > ////program to calculate the Euler characteristic of a binary image > converted to itkQuadEdgeMesh > ////THEREFORE does NOT take filled regions into account only covering > surfaces! > ////if fillings should be accounted use instead a vtk program taking 3D > cells into account > > > > #include > //#include > #include //itk marching cubes (mc) very slow > and resource hungry :-( > #include > #include > > > > #include "itkFilterWatcher2.h" > > > > > void dispatch_cT(itk::ImageIOBase::IOPixelType, > itk::ImageIOBase::IOComponentType, size_t, int, char **); > > template > void dispatch_pT(itk::ImageIOBase::IOPixelType pixelType, size_t, int, char > **); > > template > void dispatch_D(size_t, int, char **); > > template Dimension> > int DoIt(int, char *argv[]); > > > > > > template Dimension> > int DoIt(int argc, char *argv[]){ > > typedef InputPixelType OutputPixelType; > > typedef itk::Image InputImageType; > typedef itk::Image OutputImageType; > > > typedef itk::ImageFileReader ReaderType; > typename ReaderType::Pointer reader = ReaderType::New(); > > reader->SetFileName(argv[1]); > FilterWatcher watcherI(reader, "reading"); > watcherI.QuietOn(); > watcherI.ReportTimeOn(); > try > { > reader->Update(); > } > catch (itk::ExceptionObject &ex) > { > if (!strcmp(ex.GetDescription(), "Filter does not have progress.")){ > std::cerr << ex.GetDescription() << std::endl; > return EXIT_FAILURE; > } > } > > > typedef double CoordType; > > //typedef itk::Mesh MeshType; > typedef itk::QuadEdgeMesh InputMeshType; > > const InputPixelType isoValue= static_cast(atof(argv[2])); > > typedef itk::BinaryMask3DMeshSource > MeshSourceType; > typename MeshSourceType::Pointer meshSource = MeshSourceType::New(); > > meshSource->SetInput(reader->GetOutput()); > meshSource->SetObjectValue(isoValue); > > FilterWatcher watcher(meshSource, "BinaryMask3DMeshSource"); > watcher.QuietOn(); > watcher.ReportTimeOn(); > try > { > meshSource->Update(); > } > catch (itk::ExceptionObject &ex) > { > if (!strcmp(ex.GetDescription(), "Filter does not have progress.")){ > std::cerr << ex.GetDescription() << std::endl; > return EXIT_FAILURE; > } > } > > > std::cout << "Nodes = " << meshSource->GetNumberOfNodes() << std::endl; > std::cout << "Cells = " << meshSource->GetNumberOfCells() << std::endl; > > typename InputMeshType::Pointer mesh= meshSource->GetOutput(); > > //// check if meshSource can be represented as an itkQuadEdgeMesh > //// if BinaryMask3DMeshSource caps boundary surfaces this check is not > necessary! > > typedef itk::QuadEdgeMeshTopologyChecker TQEchecker; > typename TQEchecker::Pointer QEchecker = TQEchecker::New(); > QEchecker->SetMesh(mesh); > std::cerr << "Executing > QuadEdgeMeshTopologyChecker->ValidateEulerCharacteristic()"; > if(!QEchecker->ValidateEulerCharacteristic()){ > std::cerr << "Not a valid QuadEdgeMesh! Aborting." << std::endl; > return EXIT_FAILURE; > } > std::cerr << " done." << std::endl; > > //// calc Euler characteristics \xi > //// For closed smooth manifolds, the Euler characteristic coincides with > the Euler number: > http://en.wikipedia.org/wiki/Euler_characteristic#Relations_to_other_invariants > //// general formula see: > http://en.wikipedia.org/wiki/Genus_%28mathematics%29#Orientable_surface > //// > //// > //// > //// good QuadEdge explanation: > http://www.cs.cmu.edu/afs/andrew/scs/cs/15-463/2001/pub/src/a2/quadedge.html > /// from itkQuadEdgeMeshTopologyChecker.hxx > > typedef itk::QuadEdgeMeshBoundaryEdgesMeshFunction > BoundaryEdges; > > typename BoundaryEdges::Pointer boundaryEdges = BoundaryEdges::New(); > > // Number of USED points > typedef typename InputMeshType::PointIdentifier > PointIdentifier; > std::cerr << "ComputeNumberOfPoints"; > PointIdentifier numPoints = mesh->ComputeNumberOfPoints(); > std::cerr << " done." << std::endl; > // Number of USED edges > typedef typename InputMeshType::CellIdentifier > CellIdentifier; > std::cerr << "ComputeNumberOfEdges"; > CellIdentifier numEdges = mesh->ComputeNumberOfEdges(); > std::cerr << " done." << std::endl; > // Number of USED faces > std::cerr << "ComputeNumberOfFaces"; > CellIdentifier numFaces = mesh->ComputeNumberOfFaces(); > std::cerr << " done." << std::endl; > // Number of Boundaries > std::cerr << "ComputeNumberOfBoundaryEdges"; > typename BoundaryEdges::OutputType > listOfBoundaries = boundaryEdges->Evaluate((*mesh)); > std::cerr << " done." << std::endl; > CellIdentifier numBounds = listOfBoundaries->size(); > delete listOfBoundaries; > > /** > * Number of points > * > * There are two methods to get the number of points. > * 1. itk::QuadEdgeMesh::ComputeNumberOfPoints() > * 2. itk::Mesh::GetNumberOfPoints() > * > * As an itk::QuadEdgeMesh is an itk::Mesh by inheritance, the user > * can use both. 1. will returned the number of points actually > * used by at least one edge, while 2. will give you the number > * of points in the container. Number of unused points can be found > * by making the difference between the two values. > */ > if(mesh->GetNumberOfPoints() != numPoints){ > std::cerr << "There are isolated vertices! Aborting." << std::endl; > return EXIT_FAILURE; > } > > // The euler formula states: > // numFaces - numEdges + numPoints == 2 - 2 * genus - numBounds == \xi > // hence 2 * genus= 2 - numBounds - numFaces + numEdges - numPoints must > be an oddeven number. > > typedef ::itk::OffsetValueType OffsetValueType; > > OffsetValueType xi= > + OffsetValueType(numFaces) > - OffsetValueType(numEdges) > + OffsetValueType(numPoints); > > std::cout << "The Euler characteristic Xi is: " << xi << std::endl; > > OffsetValueType twiceGenus= > + OffsetValueType(2) - OffsetValueType(numBounds) > - xi; > > std::cout << "The genus is: " << twiceGenus/OffsetValueType(2) << > std::endl; > > return EXIT_SUCCESS; > > } > > > void dispatch_cT(itk::ImageIOBase::IOComponentType componentType, > itk::ImageIOBase::IOPixelType pixelType, size_t dimensionType, int argc, > char *argv[]){ > > > //http://www.itk.org/Doxygen45/html/classitk_1_1ImageIOBase.html#a8dc783055a0af6f0a5a26cb080feb178 > //http://www.itk.org/Doxygen45/html/itkImageIOBase_8h_source.html#l00107 > //IOComponentType: UNKNOWNCOMPONENTTYPE, UCHAR, CHAR, USHORT, SHORT, UINT, > INT, ULONG, LONG, FLOAT, DOUBLE > > switch (componentType){ > case itk::ImageIOBase::UCHAR:{ > typedef unsigned char InputComponentType; > dispatch_pT(pixelType, dimensionType, argc, argv); > } > break; > case itk::ImageIOBase::CHAR:{ > typedef char InputComponentType; > dispatch_pT(pixelType, dimensionType, argc, argv); > } > break; > case itk::ImageIOBase::USHORT:{ > typedef unsigned short InputComponentType; > dispatch_pT(pixelType, dimensionType, argc, argv); > } > break; > case itk::ImageIOBase::SHORT:{ > typedef short InputComponentType; > dispatch_pT(pixelType, dimensionType, argc, argv); > } > break; > case itk::ImageIOBase::UINT:{ > typedef unsigned int InputComponentType; > dispatch_pT(pixelType, dimensionType, argc, argv); > } > break; > case itk::ImageIOBase::INT:{ > typedef int InputComponentType; > dispatch_pT(pixelType, dimensionType, argc, argv); > } > break; > // case itk::ImageIOBase::ULONG:{ > // typedef unsigned long InputComponentType; > // dispatch_pT(pixelType, dimensionType, argc, > argv); > // } > // break; > // case itk::ImageIOBase::LONG:{ > // typedef long InputComponentType; > // dispatch_pT(pixelType, dimensionType, argc, > argv); > // } > // break; > // case itk::ImageIOBase::FLOAT:{ > // typedef float InputComponentType; > // dispatch_pT(pixelType, dimensionType, argc, > argv); > // } > // break; > // case itk::ImageIOBase::DOUBLE:{ > // typedef double InputComponentType; > // dispatch_pT(pixelType, dimensionType, argc, > argv); > // } > // break; > case itk::ImageIOBase::UNKNOWNCOMPONENTTYPE: > default: > std::cout << "unknown component type" << std::endl; > break; > }//switch > } > > template > void dispatch_pT(itk::ImageIOBase::IOPixelType pixelType, size_t > dimensionType, int argc, char *argv[]){ > > > //http://www.itk.org/Doxygen45/html/classitk_1_1ImageIOBase.html#abd189f096c2a1b3ea559bc3e4849f658 > //http://www.itk.org/Doxygen45/html/itkImageIOBase_8h_source.html#l00099 > //IOPixelType:: UNKNOWNPIXELTYPE, SCALAR, RGB, RGBA, OFFSET, VECTOR, > POINT, COVARIANTVECTOR, SYMMETRICSECONDRANKTENSOR, DIFFUSIONTENSOR3D, > COMPLEX, FIXEDARRAY, MATRIX > > switch (pixelType){ > case itk::ImageIOBase::SCALAR:{ > typedef InputComponentType InputPixelType; > //typedef itk::SCALARPixel InputPixelType; > dispatch_D(dimensionType, argc, > argv); > } > break; > // case itk::ImageIOBase::RGB:{ > // typedef itk::RGBPixel InputPixelType; > // dispatch_D(dimensionType, argc, > argv); > // } > // break; > // case itk::ImageIOBase::RGBA:{ > // typedef itk::RGBAPixel InputPixelType; > // dispatch_D(dimensionType, argc, > argv); > // } > // break; > // case itk::ImageIOBase::VECTOR:{ > // //typedef itk::VECTORPixel InputPixelType; //does > not work! > // typedef itk::VariableLengthVector InputPixelType; > // dispatch_D(dimensionType, argc, > argv); > // } > // break; > case itk::ImageIOBase::UNKNOWNPIXELTYPE: > default: > std::cout << "unknown pixel type" << std::endl; > break; > }//switch > } > > > template > void dispatch_D(size_t dimensionType, int argc, char *argv[]){ > switch (dimensionType){ > // case 1: > // DoIt(argc, argv); > // break; > // case 2: > // DoIt(argc, argv); > // break; > case 3: > DoIt(argc, argv); > break; > case 4: > DoIt(argc, argv); > break; > case 5: > DoIt(argc, argv); > break; > default: > std::cout << "Images of dimension " << dimensionType << " are not > supported!" << std::endl; > break; > } > } > > > > ////from > http://itk-users.7.n7.nabble.com/Pad-image-with-0-but-keep-its-type-what-ever-it-is-td27442.html > //namespace itk{ > // Description: > // Get the PixelType and ComponentType from fileName > > void GetImageType (std::string fileName, > itk::ImageIOBase::IOPixelType &pixelType, > itk::ImageIOBase::IOComponentType &componentType, > size_t &dimensionType > //ImageIOBase::IODimensionType &dimensionType > ){ > typedef itk::Image ImageType; > itk::ImageFileReader::Pointer imageReader= > itk::ImageFileReader::New(); > imageReader->SetFileName(fileName.c_str()); > imageReader->UpdateOutputInformation(); > > pixelType = imageReader->GetImageIO()->GetPixelType(); > componentType = imageReader->GetImageIO()->GetComponentType(); > dimensionType= imageReader->GetImageIO()->GetNumberOfDimensions(); > > //std::cerr << "Pixel Type is " << > imageReader->GetImageIO()->GetComponentTypeAsString(pixelType) << std::endl; > std::cerr << "component type is: " << > imageReader->GetImageIO()->GetComponentTypeAsString(componentType) << > std::endl; > std::cerr << "numDimensions: " << dimensionType << std::endl; > std::cerr << "component size: " << > imageReader->GetImageIO()->GetComponentSize() << std::endl; > std::cerr << "pixel type (string): " << > imageReader->GetImageIO()->GetPixelTypeAsString(imageReader->GetImageIO()->GetPixelType()) > << std::endl; > std::cerr << "pixel type: " << pixelType << std::endl << > "_________________________" << std::endl << std::endl; > > > } > > > > int main(int argc, char *argv[]){ > if ( argc != 3 ) > { > std::cerr << "Missing Parameters: " > << argv[0] > << " Input_Image" > << " isoValue" > << std::endl; > > return EXIT_FAILURE; > } > > std::string ifn = argv[1]; > // std::string ofn = argv[2]; > // int compress= atoi(argv[3]); > > itk::ImageIOBase::IOPixelType pixelType; > typename itk::ImageIOBase::IOComponentType componentType; > //itk::ImageIOBase::IOComponentType componentType1; > //itk::ImageIOBase::IODimensionType dimensionType1; > size_t dimensionType; > > > try > { > GetImageType(argv[1], pixelType, componentType, dimensionType); > > dispatch_cT(componentType, pixelType, dimensionType, argc, argv); > }//try > catch( itk::ExceptionObject &excep) > { > std::cerr << argv[0] << ": exception caught !" << std::endl; > std::cerr << excep << std::endl; > return EXIT_FAILURE; > } > > return EXIT_SUCCESS; > > } > > > > > > > > > > > On 08/06/14 15:51, Luis Ibanez wrote: >> >> >> Roman, >> >> >> Could you please share with the list an example >> of a program where you are observing this behavior ? >> >> In particular, we would like to see if this is occurring with >> Image filters, or rather with other types of ITK objects. >> >> >> >> The itk::Image does listen to the (potential) memory allocation messages >> (that is, the bad_alloc exception). >> >> >> >> The itk::Image class uses a helper class to store the pixel data. >> >> >> >> This helper is the: >> >> itk::ImportImageContainer >> >> >> https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Core/Common/include/itkImportImageContainer.h >> >> >> >> >> and its memory allocation is typically done in the AllocateElements() >> function >> in line: >> >> >> https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Core/Common/include/itkImportImageContainer.hxx#L173 >> >> the code looks like >> >> TElement *data; >> >> try >> { >> if ( UseDefaultConstructor ) >> { >> data = new TElement[size](); //POD types initialized to 0, others >> use >> default constructor. >> } >> else >> { >> data = new TElement[size]; //Faster but uninitialized >> } >> } >> catch ( ... ) >> { >> data = ITK_NULLPTR; >> } >> if ( !data ) >> { >> // We cannot construct an error string here because we may be out >> // of memory. Do not use the exception macro. >> throw MemoryAllocationError(__FILE__, __LINE__, >> "Failed to allocate memory for image.", >> ITK_LOCATION); >> } >> return data; >> >> >> >> As you can see, the case of exceptions is managed in that function. >> >> >> Here is an example of a test program demonstrating that ITK image >> will throw exceptions when allocating memory beyond limits. >> >> >> #include "itkImage.h" >> #include >> >> int main(int argc, char * argv[] ) >> { >> if( argc < 2 ) >> { >> std::cerr << "Missing arguments" << std::endl; >> return 1; >> } >> >> typedef itk::Image< unsigned short, 3 > ImageType; >> >> ImageType::Pointer image = ImageType::New(); >> >> ImageType::RegionType region; >> ImageType::SizeType size; >> >> size_t side = atoi( argv[1] ); >> >> size[0] = side; >> size[1] = side; >> size[2] = side; >> >> region.SetSize( size ); >> >> image->SetRegions( region ); >> >> try >> { >> image->Allocate(); >> } >> catch( std::exception & excp ) >> { >> std::cerr << excp.what() << std::endl; >> return 1; >> } >> >> std::cout << "ITK Hello World !" << std::endl; >> >> return 0; >> } >> >> >> and what happens when executing in an Ubuntu Linux machine with 32GB or >> RAM >> >> >> $ ./HelloWorld 1000 >> ITK Hello World ! >> >> >> $ ./HelloWorld 1000000 >> >> /home/ibanez/src/ITK/Modules/Core/Common/include/itkImportImageContainer.hxx:199: >> Failed to allocate memory for image. >> >> >> >> >> Please share with the list a minimal example of the problem you are >> observing, >> and in this way we will be able to help track the issue. >> >> >> Thanks >> >> >> Luis >> >> > > -- > Dr. Roman Grothausmann > > Tomographie und Digitale Bildverarbeitung > Tomography and Digital Image Analysis > > Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 > Medizinische Hochschule Hannover > Carl-Neuberg-Str. 1 > D-30625 Hannover > > Tel. +49 511 532-9574 > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > From matt.mccormick at kitware.com Mon Jul 14 21:02:41 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 14 Jul 2014 21:02:41 -0400 Subject: [ITK-users] [ITK] (no subject) In-Reply-To: References: Message-ID: Hi Roy, Does ccalling LoadPrivateTagsOn() [1] or LoadSequencesOn() [2] improve the result? Matt [1] http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html#a26ea3d5e85c0e6a7a614cbfbc05c4478 [2] http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html#a7e81a44773f7daf85c6523866312372e On Mon, Jul 14, 2014 at 8:19 PM, Harnish, Roy wrote: > Hi, > > I'm wondering if there is a procedure for adding a dicom dictionary to those > that are used by the GDCMImageIO, or a way to parse a private field by > furnishing the pertinent info to the right method. I'm trying to access the > field 0119,1030, which is pretty much a 3d version of > ImageOrientationPatient. I have no problem seeing the field in a dcmdump of > an image that contains the field, but am having trouble getting my program > to handle the field properly. Here's what a dcmdump of the field looks > like: > > cbl-mbp-3369:Release rharnish$ dcmdump dce.dcm | grep -i imageor > (0020,0037) DS [-1\-0\0\-0\-1\0] # 16, 6 > ImageOrientationPatient > cbl-mbp-3369:Release rharnish$ dcmdump dce.dcm | grep -i 0119,1030 > (0119,1030) DS [-1\-0\0\-0\-1\0\0\0\1] # 22, 9 Unknown Tag > & Data > cbl-mbp-3369:Release rharnish$ > > This is a section of code that tires to parse the field: > > std::string tagkey = "0119|1030"; > // std::string tagkey = "0020|0037"; > std::string labelId; > std::string value; > > > if( gdcmImageIO->GetValueFromTag(tagkey, value) ) > { > std::cout << tagkey << ": "; > std::cout << value << std::endl; > } > > Here's the output with std::string tagkey = "0119|1030";: > > 0119|1030: LTFcLTBcMFwtMFwtMVwwXDBcMFwxIA== > > > Here's the output with std::string tagkey = "0020|0037"; > > 0020|0037: -1\-0\0\-0\-1\0 > > Any suggestions would be much appreciated. > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > From matt.mccormick at kitware.com Mon Jul 14 21:18:46 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 14 Jul 2014 21:18:46 -0400 Subject: [ITK-users] [ITK] (no subject) In-Reply-To: References: Message-ID: Hi Roy, Does calling GetLabelFromTag [1] return true? Thanks, Matt [1] http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html#adad2642a7dab4a896a8bf6afea6ff205 On Mon, Jul 14, 2014 at 9:08 PM, Harnish, Roy wrote: > Hi Matt, > > Thanks for getting back with me so quickly! I just tried turning both of those on, but I get the same result. > > Roy > > > ________________________________________ > From: Matt McCormick [matt.mccormick at kitware.com] > Sent: Monday, July 14, 2014 6:02 PM > To: Harnish, Roy > Cc: insight-users at itk.org > Subject: Re: [ITK] [ITK-users] (no subject) > > Hi Roy, > > Does ccalling LoadPrivateTagsOn() [1] or LoadSequencesOn() [2] improve > the result? > > Matt > > [1] http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html#a26ea3d5e85c0e6a7a614cbfbc05c4478 > > [2] http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html#a7e81a44773f7daf85c6523866312372e > > On Mon, Jul 14, 2014 at 8:19 PM, Harnish, Roy wrote: >> Hi, >> >> I'm wondering if there is a procedure for adding a dicom dictionary to those >> that are used by the GDCMImageIO, or a way to parse a private field by >> furnishing the pertinent info to the right method. I'm trying to access the >> field 0119,1030, which is pretty much a 3d version of >> ImageOrientationPatient. I have no problem seeing the field in a dcmdump of >> an image that contains the field, but am having trouble getting my program >> to handle the field properly. Here's what a dcmdump of the field looks >> like: >> >> cbl-mbp-3369:Release rharnish$ dcmdump dce.dcm | grep -i imageor >> (0020,0037) DS [-1\-0\0\-0\-1\0] # 16, 6 >> ImageOrientationPatient >> cbl-mbp-3369:Release rharnish$ dcmdump dce.dcm | grep -i 0119,1030 >> (0119,1030) DS [-1\-0\0\-0\-1\0\0\0\1] # 22, 9 Unknown Tag >> & Data >> cbl-mbp-3369:Release rharnish$ >> >> This is a section of code that tires to parse the field: >> >> std::string tagkey = "0119|1030"; >> // std::string tagkey = "0020|0037"; >> std::string labelId; >> std::string value; >> >> >> if( gdcmImageIO->GetValueFromTag(tagkey, value) ) >> { >> std::cout << tagkey << ": "; >> std::cout << value << std::endl; >> } >> >> Here's the output with std::string tagkey = "0119|1030";: >> >> 0119|1030: LTFcLTBcMFwtMFwtMVwwXDBcMFwxIA== >> >> >> Here's the output with std::string tagkey = "0020|0037"; >> >> 0020|0037: -1\-0\0\-0\-1\0 >> >> Any suggestions would be much appreciated. >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> >> _______________________________________________ >> Community mailing list >> Community at itk.org >> http://public.kitware.com/mailman/listinfo/community >> > From Roy.Harnish at ucsf.edu Mon Jul 14 21:27:21 2014 From: Roy.Harnish at ucsf.edu (Harnish, Roy) Date: Tue, 15 Jul 2014 01:27:21 +0000 Subject: [ITK-users] [ITK] (no subject) In-Reply-To: References: , Message-ID: Hi Matt, Here's what I'm running: std::string tagkey = "0119|1030"; std::string labelId; std::string value; std::cout << "itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ): "; std::cout << itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ) << std::endl; std::cout << "labelId: " << labelId << std::endl; And here's the output itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ): 0 labelId: Roy ________________________________________ From: Matt McCormick [matt.mccormick at kitware.com] Sent: Monday, July 14, 2014 6:18 PM To: Harnish, Roy; insight-users at itk.org Subject: Re: [ITK] [ITK-users] (no subject) Hi Roy, Does calling GetLabelFromTag [1] return true? Thanks, Matt [1] http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html#adad2642a7dab4a896a8bf6afea6ff205 On Mon, Jul 14, 2014 at 9:08 PM, Harnish, Roy wrote: > Hi Matt, > > Thanks for getting back with me so quickly! I just tried turning both of those on, but I get the same result. > > Roy > > > ________________________________________ > From: Matt McCormick [matt.mccormick at kitware.com] > Sent: Monday, July 14, 2014 6:02 PM > To: Harnish, Roy > Cc: insight-users at itk.org > Subject: Re: [ITK] [ITK-users] (no subject) > > Hi Roy, > > Does ccalling LoadPrivateTagsOn() [1] or LoadSequencesOn() [2] improve > the result? > > Matt > > [1] http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html#a26ea3d5e85c0e6a7a614cbfbc05c4478 > > [2] http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html#a7e81a44773f7daf85c6523866312372e > > On Mon, Jul 14, 2014 at 8:19 PM, Harnish, Roy wrote: >> Hi, >> >> I'm wondering if there is a procedure for adding a dicom dictionary to those >> that are used by the GDCMImageIO, or a way to parse a private field by >> furnishing the pertinent info to the right method. I'm trying to access the >> field 0119,1030, which is pretty much a 3d version of >> ImageOrientationPatient. I have no problem seeing the field in a dcmdump of >> an image that contains the field, but am having trouble getting my program >> to handle the field properly. Here's what a dcmdump of the field looks >> like: >> >> cbl-mbp-3369:Release rharnish$ dcmdump dce.dcm | grep -i imageor >> (0020,0037) DS [-1\-0\0\-0\-1\0] # 16, 6 >> ImageOrientationPatient >> cbl-mbp-3369:Release rharnish$ dcmdump dce.dcm | grep -i 0119,1030 >> (0119,1030) DS [-1\-0\0\-0\-1\0\0\0\1] # 22, 9 Unknown Tag >> & Data >> cbl-mbp-3369:Release rharnish$ >> >> This is a section of code that tires to parse the field: >> >> std::string tagkey = "0119|1030"; >> // std::string tagkey = "0020|0037"; >> std::string labelId; >> std::string value; >> >> >> if( gdcmImageIO->GetValueFromTag(tagkey, value) ) >> { >> std::cout << tagkey << ": "; >> std::cout << value << std::endl; >> } >> >> Here's the output with std::string tagkey = "0119|1030";: >> >> 0119|1030: LTFcLTBcMFwtMFwtMVwwXDBcMFwxIA== >> >> >> Here's the output with std::string tagkey = "0020|0037"; >> >> 0020|0037: -1\-0\0\-0\-1\0 >> >> Any suggestions would be much appreciated. >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> >> _______________________________________________ >> Community mailing list >> Community at itk.org >> http://public.kitware.com/mailman/listinfo/community >> > From Roy.Harnish at ucsf.edu Mon Jul 14 21:31:22 2014 From: Roy.Harnish at ucsf.edu (Harnish, Roy) Date: Tue, 15 Jul 2014 01:31:22 +0000 Subject: [ITK-users] [ITK] (no subject) In-Reply-To: References: , , Message-ID: Correction: Here's what I'm running: std::string tagkey = "0119|1030"; std::string labelId; std::string value; std::cout << "gdcmImageIO->GetValueFromTag( tagkey, labelId ): "; std::cout << gdcmImageIO->GetValueFromTag( tagkey, labelId ) << std::endl; std::cout << "labelId: " << labelId << std::endl; And here's the output: gdcmImageIO->GetValueFromTag( tagkey, labelId ): 1 labelId: LTFcLTBcMFwtMFwtMVwwXDBcMFwxIA== ________________________________________ From: Insight-users [insight-users-bounces at itk.org] on behalf of Harnish, Roy [Roy.Harnish at ucsf.edu] Sent: Monday, July 14, 2014 6:27 PM To: Matt McCormick Cc: insight-users at itk.org Subject: Re: [ITK-users] [ITK] (no subject) Hi Matt, Here's what I'm running: std::string tagkey = "0119|1030"; std::string labelId; std::string value; std::cout << "itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ): "; std::cout << itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ) << std::endl; std::cout << "labelId: " << labelId << std::endl; And here's the output itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ): 0 labelId: Roy ________________________________________ From: Matt McCormick [matt.mccormick at kitware.com] Sent: Monday, July 14, 2014 6:18 PM To: Harnish, Roy; insight-users at itk.org Subject: Re: [ITK] [ITK-users] (no subject) Hi Roy, Does calling GetLabelFromTag [1] return true? Thanks, Matt [1] http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html#adad2642a7dab4a896a8bf6afea6ff205 On Mon, Jul 14, 2014 at 9:08 PM, Harnish, Roy wrote: > Hi Matt, > > Thanks for getting back with me so quickly! I just tried turning both of those on, but I get the same result. > > Roy > > > ________________________________________ > From: Matt McCormick [matt.mccormick at kitware.com] > Sent: Monday, July 14, 2014 6:02 PM > To: Harnish, Roy > Cc: insight-users at itk.org > Subject: Re: [ITK] [ITK-users] (no subject) > > Hi Roy, > > Does ccalling LoadPrivateTagsOn() [1] or LoadSequencesOn() [2] improve > the result? > > Matt > > [1] http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html#a26ea3d5e85c0e6a7a614cbfbc05c4478 > > [2] http://www.itk.org/Doxygen/html/classitk_1_1GDCMImageIO.html#a7e81a44773f7daf85c6523866312372e > > On Mon, Jul 14, 2014 at 8:19 PM, Harnish, Roy wrote: >> Hi, >> >> I'm wondering if there is a procedure for adding a dicom dictionary to those >> that are used by the GDCMImageIO, or a way to parse a private field by >> furnishing the pertinent info to the right method. I'm trying to access the >> field 0119,1030, which is pretty much a 3d version of >> ImageOrientationPatient. I have no problem seeing the field in a dcmdump of >> an image that contains the field, but am having trouble getting my program >> to handle the field properly. Here's what a dcmdump of the field looks >> like: >> >> cbl-mbp-3369:Release rharnish$ dcmdump dce.dcm | grep -i imageor >> (0020,0037) DS [-1\-0\0\-0\-1\0] # 16, 6 >> ImageOrientationPatient >> cbl-mbp-3369:Release rharnish$ dcmdump dce.dcm | grep -i 0119,1030 >> (0119,1030) DS [-1\-0\0\-0\-1\0\0\0\1] # 22, 9 Unknown Tag >> & Data >> cbl-mbp-3369:Release rharnish$ >> >> This is a section of code that tires to parse the field: >> >> std::string tagkey = "0119|1030"; >> // std::string tagkey = "0020|0037"; >> std::string labelId; >> std::string value; >> >> >> if( gdcmImageIO->GetValueFromTag(tagkey, value) ) >> { >> std::cout << tagkey << ": "; >> std::cout << value << std::endl; >> } >> >> Here's the output with std::string tagkey = "0119|1030";: >> >> 0119|1030: LTFcLTBcMFwtMFwtMVwwXDBcMFwxIA== >> >> >> Here's the output with std::string tagkey = "0020|0037"; >> >> 0020|0037: -1\-0\0\-0\-1\0 >> >> Any suggestions would be much appreciated. >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> >> _______________________________________________ >> Community mailing list >> Community at itk.org >> http://public.kitware.com/mailman/listinfo/community >> > _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From matt.mccormick at kitware.com Mon Jul 14 21:39:41 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 14 Jul 2014 21:39:41 -0400 Subject: [ITK-users] [ITK] (no subject) In-Reply-To: References: Message-ID: On Mon, Jul 14, 2014 at 9:27 PM, Harnish, Roy wrote: > Hi Matt, > > Here's what I'm running: > > std::string tagkey = "0119|1030"; > std::string labelId; > std::string value; > std::cout << "itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ): "; > std::cout << itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ) << std::endl; > std::cout << "labelId: " << labelId << std::endl; > > And here's the output > > itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ): 0 > labelId: > This means the tag is not found. For more information, try [1] HTH, Matt [1] http://www.itk.org/Doxygen/html/IO_2DicomImageReadPrintTags_8cxx-example.html#_a2 From Roy.Harnish at ucsf.edu Mon Jul 14 21:48:48 2014 From: Roy.Harnish at ucsf.edu (Harnish, Roy) Date: Tue, 15 Jul 2014 01:48:48 +0000 Subject: [ITK-users] [ITK] (no subject) In-Reply-To: References: , Message-ID: Hi Matt, I wasn't calling GetLabelFromTagWith the instance of GDCMImageIO that had been used to read the image. Here's what I get when I do that: RUNNING: std::string tagkey = "0119|1030"; std::string labelId; std::string value; std::cout << "gdcmImageIO->GetValueFromTag( tagkey, labelId ): "; std::cout << gdcmImageIO->GetValueFromTag( tagkey, labelId ) << std::endl; std::cout << "labelId: " << labelId << std::endl; OUTPUT: gdcmImageIO->GetValueFromTag( tagkey, labelId ): 1 labelId: LTFcLTBcMFwtMFwtMVwwXDBcMFwxIA== So it looks like there is something returned by get value from tag. Thanks for taking a look. Roy ________________________________________ From: Matt McCormick [matt.mccormick at kitware.com] Sent: Monday, July 14, 2014 6:39 PM To: Harnish, Roy Cc: insight-users at itk.org Subject: Re: [ITK] [ITK-users] (no subject) On Mon, Jul 14, 2014 at 9:27 PM, Harnish, Roy wrote: > Hi Matt, > > Here's what I'm running: > > std::string tagkey = "0119|1030"; > std::string labelId; > std::string value; > std::cout << "itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ): "; > std::cout << itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ) << std::endl; > std::cout << "labelId: " << labelId << std::endl; > > And here's the output > > itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ): 0 > labelId: > This means the tag is not found. For more information, try [1] HTH, Matt [1] http://www.itk.org/Doxygen/html/IO_2DicomImageReadPrintTags_8cxx-example.html#_a2 From Roy.Harnish at ucsf.edu Mon Jul 14 21:54:03 2014 From: Roy.Harnish at ucsf.edu (Harnish, Roy) Date: Tue, 15 Jul 2014 01:54:03 +0000 Subject: [ITK-users] [ITK] (no subject) In-Reply-To: References: , , Message-ID: One more iteration here with calls to both GetValueFromTag and GetLabelFromTag CODE: std::string tagkey = "0119|1030"; std::string labelId; std::string value; std::cout << "gdcmImageIO->GetValueFromTag( tagkey, labelId ): "; std::cout << gdcmImageIO->GetValueFromTag( tagkey, value ) << std::endl; std::cout << "value: " << value << std::endl; std::cout << "gdcmImageIO->GetLabelFromTag( tagkey, labelId ): "; std::cout << gdcmImageIO->GetLabelFromTag( tagkey, labelId ) << std::endl; std::cout << "labelId: " << labelId << std::endl; OUTPUT: gdcmImageIO->GetValueFromTag( tagkey, labelId ): 1 value: LTFcLTBcMFwtMFwtMVwwXDBcMFwxIA== gdcmImageIO->GetLabelFromTag( tagkey, labelId ): 0 labelId: ________________________________________ From: Harnish, Roy Sent: Monday, July 14, 2014 6:48 PM To: Matt McCormick Cc: insight-users at itk.org Subject: RE: [ITK] [ITK-users] (no subject) Hi Matt, I wasn't calling GetLabelFromTagWith the instance of GDCMImageIO that had been used to read the image. Here's what I get when I do that: RUNNING: std::string tagkey = "0119|1030"; std::string labelId; std::string value; std::cout << "gdcmImageIO->GetValueFromTag( tagkey, labelId ): "; std::cout << gdcmImageIO->GetValueFromTag( tagkey, labelId ) << std::endl; std::cout << "labelId: " << labelId << std::endl; OUTPUT: gdcmImageIO->GetValueFromTag( tagkey, labelId ): 1 labelId: LTFcLTBcMFwtMFwtMVwwXDBcMFwxIA== So it looks like there is something returned by get value from tag. Thanks for taking a look. Roy ________________________________________ From: Matt McCormick [matt.mccormick at kitware.com] Sent: Monday, July 14, 2014 6:39 PM To: Harnish, Roy Cc: insight-users at itk.org Subject: Re: [ITK] [ITK-users] (no subject) On Mon, Jul 14, 2014 at 9:27 PM, Harnish, Roy wrote: > Hi Matt, > > Here's what I'm running: > > std::string tagkey = "0119|1030"; > std::string labelId; > std::string value; > std::cout << "itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ): "; > std::cout << itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ) << std::endl; > std::cout << "labelId: " << labelId << std::endl; > > And here's the output > > itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ): 0 > labelId: > This means the tag is not found. For more information, try [1] HTH, Matt [1] http://www.itk.org/Doxygen/html/IO_2DicomImageReadPrintTags_8cxx-example.html#_a2 From matt.mccormick at kitware.com Mon Jul 14 22:01:30 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 14 Jul 2014 22:01:30 -0400 Subject: [ITK-users] [ITK] (no subject) In-Reply-To: References: Message-ID: On Mon, Jul 14, 2014 at 9:48 PM, Harnish, Roy wrote: > Hi Matt, > > I wasn't calling GetLabelFromTagWith the instance of GDCMImageIO that had been used to read the image. Re-using the gdcmImageIO that was used to read the image will ensure the MetaDataDictionary is populated. Also, turning on the option to read private tags before reading the image is a good idea. HTH, Matt From Roy.Harnish at ucsf.edu Mon Jul 14 22:19:44 2014 From: Roy.Harnish at ucsf.edu (Harnish, Roy) Date: Tue, 15 Jul 2014 02:19:44 +0000 Subject: [ITK-users] [ITK] (no subject) In-Reply-To: References: , Message-ID: Thanks. I'll continue to work with the same gdcmImageIO, and will use the read private tags option as well. In this particular case, I don't think there is a tag for the group and element I am trying to access (0119,1030). If I grep for both 0119 and 1030 in InsightToolkit-4.5.2/Modules/ThirdParty/GDCM/src/gdcm, I don't see anything (other than an entry I tried putting in privatedicts.xml): cbl-mbp-3369:gdcm rharnish$ pwd /Users/Shared/OSIAV/ITK/InsightToolkit-4.5.2/Modules/ThirdParty/GDCM/src/gdcm cbl-mbp-3369:gdcm rharnish$ grep -R 0119 . | grep 1030 ./Source/DataDictionary/privatedicts.xml: cbl-mbp-3369:gdcm rharnish$ Roy ________________________________________ From: Matt McCormick [matt.mccormick at kitware.com] Sent: Monday, July 14, 2014 7:01 PM To: Harnish, Roy Cc: insight-users at itk.org Subject: Re: [ITK] [ITK-users] (no subject) On Mon, Jul 14, 2014 at 9:48 PM, Harnish, Roy wrote: > Hi Matt, > > I wasn't calling GetLabelFromTagWith the instance of GDCMImageIO that had been used to read the image. Re-using the gdcmImageIO that was used to read the image will ensure the MetaDataDictionary is populated. Also, turning on the option to read private tags before reading the image is a good idea. HTH, Matt From iyas.hamdan at gmail.com Tue Jul 15 05:16:09 2014 From: iyas.hamdan at gmail.com (Iyas Hamdan) Date: Tue, 15 Jul 2014 11:16:09 +0200 Subject: [ITK-users] 3D registration problem Message-ID: Hello itk users, I'm working on 3D image registration, currently I'm trying to register a CT volume to an MRI volume ( the two volumes have different sizes concerning the number of slices used to construct the 3D volume). I'm doing an affine registration using the mutual information as a metric, and I'm having problems registering those two volumes. What I thiink the problem is, I have a different field of view between both volumes, so when I try to register the whole CT volume to the MRI one the registration falis. However, when I deleted a dozen of slices from the CT volume ( so that I had the same field of view in both volumes) it works just fine and I was able to register the volumes. And by "the registration failed" I meant it worked with no errors but the result was really bad! and that the registered volume was nothing like the fixed one, so if I try to find the difference between each two corresponding slices for example , they were not aligned at all! Is that normal that the registration doesnt work when I have a different field of view in each volume ? or should it deform one volume so that it corresponds to the other one even if they had two different fields of view ? Any help would be really appreciated, Thanks in advance, Iyas -------------- next part -------------- An HTML attachment was scrubbed... URL: From iyas.hamdan at gmail.com Tue Jul 15 05:26:17 2014 From: iyas.hamdan at gmail.com (Iyas Hamdan) Date: Tue, 15 Jul 2014 11:26:17 +0200 Subject: [ITK-users] 3D registration problem Message-ID: Hello itk users, I'm working on 3D image registration, currently I'm trying to register a CT volume to an MRI volume ( the two volumes have different sizes concerning the number of slices used to construct the 3D volume). I'm doing an affine registration using the mutual information as a metric, and I'm having problems registering those two volumes. What I thiink the problem is, I have a different field of view between both volumes, so when I try to register the whole CT volume to the MRI one the registration falis. However, when I deleted a dozen of slices from the CT volume ( so that I had the same field of view in both volumes) it works just fine and I was able to register the volumes. And by "the registration failed" I meant it worked with no errors but the result was really bad! and that the registered volume was nothing like the fixed one, so if I try to find the difference between each two corresponding slices for example , they were not aligned at all! Is that normal that the registration doesnt work when I have a different field of view in each volume ? or should it deform one volume so that it corresponds to the other one even if they had two different fields of view ? Any help would be really appreciated, Thanks in advance, Iyas -------------- next part -------------- An HTML attachment was scrubbed... URL: From grothausmann.roman at mh-hannover.de Tue Jul 15 06:51:31 2014 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Tue, 15 Jul 2014 12:51:31 +0200 Subject: [ITK-users] itkMeanImageFilter on RGB (how to adjust example MedianFilteringOfAnRGBImage?) In-Reply-To: References: <53BFD040.8070009@mh-hannover.de> Message-ID: <53C507B3.7070900@mh-hannover.de> Many thanks Bill, both hints are very helpful. On 12/07/14 15:18, Bill Lorensen wrote: > You are better off using vector pixels versus rgb pixels. No > overriding necessary. You should be able to modify your example by > looking at this one: > > On Fri, Jul 11, 2014 at 11:26 AM, Bill Lorensen wrote: >> You need to define a cast operator. SOmething like: >> operator TComponent() >> { >> return this->GetLuminance(); >> } >> >> But I don't think you will get the result you want. >> >> Bill >> >> On Fri, Jul 11, 2014 at 7:53 AM, Dr. Roman Grothausmann >> wrote: >>> Dear mailing list members, >>> >>> >>> How would I need to extend/modify the example for >>> MedianFilteringOfAnRGBImage >>> >>> http://itk.org/ITKExamples/src/Filtering/Smoothing/MedianFilteringOfAnRGBImage/Documentation.html >>> >>> to work with itkMeanImageFilter? >>> >>> I modified myRGBPixel like this: >>> >>> namespace itk{ >>> template >>> class myRGBPixel : public RGBPixel{ >>> public: >>> typedef myRGBPixel Self; >>> typedef RGBPixel Superclass; >>> >>> myRGBPixel():Superclass() {} //avoid candidate expects 1 argument, 0 >>> provided >>> myRGBPixel(int i):Superclass(i) {} //avoid candidate expects 0 >>> arguments, 1 provided >>> >>> using RGBPixel::operator=; >>> >>> bool operator<=(const Self & r) const{ >>> return (this->GetLuminance() <= r.GetLuminance()); >>> } >>> bool operator>=(const Self & r) const{ >>> return (this->GetLuminance() >= r.GetLuminance()); >>> } >>> bool operator<(const Self & r) const{ >>> return (this->GetLuminance() < r.GetLuminance()); >>> } >>> bool operator>(const Self & r) const{ >>> return (this->GetLuminance() > r.GetLuminance()); >>> } >>> }; >>> } >>> >>> >>> However gcc still yields this error: >>> >>> >>> In file included from >>> /opt/itk-4.5.1/include/ITK-4.5/itkMeanImageFilter.h:115:0, >>> from /net/home/ghky/itk/simple/mean-CPU_02.cxx:8: >>> /opt/itk-4.5.1/include/ITK-4.5/itkMeanImageFilter.hxx: In instantiation of >>> ?void itk::MeanImageFilter>> TOutputImage>::ThreadedGenerateData(const OutputImageRegionType&, >>> itk::ThreadIdType) [with TInputImage = itk::Image>> char>, 3u>; TOutputImage = itk::Image, 3u>; >>> itk::MeanImageFilter::OutputImageRegionType = >>> itk::ImageRegion<3u>; itk::ThreadIdType = unsigned int]?: >>> /net/home/ghky/itk/simple/mean-CPU_02.cxx:335:5: required from here >>> /opt/itk-4.5.1/include/ITK-4.5/itkMeanImageFilter.hxx:81:9: error: invalid >>> static_cast from type >>> ?itk::ConstNeighborhoodIterator, >>> 3u>, >>> itk::ZeroFluxNeumannBoundaryCondition>> char>, 3u>, itk::Image, 3u> > >::PixelType >>> {aka itk::myRGBPixel}? to type >>> ?itk::MeanImageFilter, 3u>, >>> itk::Image, 3u> >::InputRealType {aka >>> double}? >>> make[3]: *** [CMakeFiles/mean-CPU_02.dir/mean-CPU_02.cxx.o] Error 1 >>> make[2]: *** [CMakeFiles/mean-CPU_02.dir/all] Error 2 >>> make[1]: *** [CMakeFiles/mean-CPU_02.dir/rule] Error 2 >>> make: *** [mean-CPU_02] Error 2 >>> >>> >>> What am I missing in myRGBPixel? >>> >>> Any help or hints are very much appreciated >>> Roman >>> >>> -- >>> Dr. Roman Grothausmann >>> >>> Tomographie und Digitale Bildverarbeitung >>> Tomography and Digital Image Analysis >>> >>> Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 >>> Medizinische Hochschule Hannover >>> Carl-Neuberg-Str. 1 >>> D-30625 Hannover >>> >>> Tel. +49 511 532-9574 >>> _____________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://www.kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the ITK FAQ at: >>> http://www.itk.org/Wiki/ITK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/insight-users >> >> >> >> -- >> Unpaid intern in BillsBasement at noware dot com > > > -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-9574 From mpinkert at wisc.edu Tue Jul 15 12:27:37 2014 From: mpinkert at wisc.edu (Michael Pinkert) Date: Tue, 15 Jul 2014 09:27:37 -0700 (PDT) Subject: [ITK-users] Connected Threshold Filter crashes but only for large images Message-ID: <1405441657014-7585907.post@n2.nabble.com> Hi everyone, I am working with sets of 3D MRI data from multiple years for my research. I am using the connected threshold filter in a pipeline after a binary thresholding procedure using Otsu segmentation. The algorithm functions when there are 124 slices in the image, but crashes with an abort message when there are 248 slices and when there are 156 slices. I have tested this with multiple data sets and the pattern holds. The strange part is that this still happens even if I resample the number of slices down to 124, so I really am confused as to what is happening. Is there any reason why the filter would be crashing for images that are too large like this, even after being resampled smaller? Best regards, Michael Pinkert -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-users-Connected-Threshold-Filter-crashes-but-only-for-large-images-tp7585907.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From Roy.Harnish at ucsf.edu Tue Jul 15 22:19:03 2014 From: Roy.Harnish at ucsf.edu (Harnish, Roy) Date: Wed, 16 Jul 2014 02:19:03 +0000 Subject: [ITK-users] [Insight-users] GDCM custom tag dictionary Message-ID: Hi, I'm revisiting the thread below since I'm having trouble getting the DicomImageReadPrintTags.cxx example to use the .dic file I provide. I am trying to correctly interpret the (0119,1030) tag from a dicom file. The element is very similar to an ImageOrientationPatient, but defines direction cosines for slices in addition to rows and columns. I'm wondering if I should continue trying to specify my own .dic (or is it XML?), of if there is an alternative. Perhaps I could try to parse the output ((0119|1030) is: LTFcLTBcMFwtMFwtMVwwXDBcMFwxIA==) as a 9 element DS. Syntax suggestions for that would be much appreciated. Yours, Roy This is a comparison of dcmdumps: cbl-mbp-3369:data rharnish$ dcmdump dce.dcm | grep 0119,1030 (0119,1030) DS [-1\-0\0\-0\-1\0\0\0\1] # 22, 9 Unknown Tag & Data cbl-mbp-3369:data rharnish$ dcmdump dce.dcm | grep ImageOri (0020,0037) DS [-1\-0\0\-0\-1\0] # 16, 6 ImageOrientationPatient cbl-mbp-3369:data rharnish$ This is the modified version of DicomImageReadPrintTags.cxx I'm using: #include "itkImageFileReader.h" #include "itkGDCMImageIO.h" #include "itkMetaDataObject.h" #include "gdcmGlobal.h" int main (int argc, char* argv[]) { if (argc < 2) { std::cerr << "Usage: " << argv[0] << " DicomFile [user defined dict]" << std::endl; return EXIT_FAILURE; } typedef unsigned short PixelType; const unsigned int Dimension = 3; typedef itk::Image ImageType; if (argc == 3) { // Specify a path where XML dicts can be found (Part 3/4 & 6) gdcm::Global::GetInstance ().Prepend (itksys::SystemTools::GetFilenamePath (argv[2]).c_str ()); // Load them ! gdcm::Global::GetInstance ().LoadResourcesFiles (); std::cout << argv[2] << std::endl; std::cout << itksys::SystemTools::GetFilenamePath (argv[2]).c_str () << std::endl; } typedef itk::ImageFileReader ReaderType; ReaderType::Pointer reader = ReaderType::New (); typedef itk::GDCMImageIO ImageIOType; ImageIOType::Pointer dicomIO = ImageIOType::New (); dicomIO->LoadSequencesOn (); dicomIO->LoadPrivateTagsOn (); reader->SetFileName (argv[1]); reader->SetImageIO (dicomIO); try { reader->Update (); } catch (itk::ExceptionObject &ex) { std::cout << ex << std::endl; return EXIT_FAILURE; } std::cout << "has key: " << dicomIO->GetMetaDataDictionary ().HasKey ("0119|1030") << std::endl; typedef itk::MetaDataDictionary DictionaryType; const DictionaryType & dictionary = dicomIO->GetMetaDataDictionary (); typedef itk::MetaDataObject MetaDataStringType; DictionaryType::ConstIterator itr = dictionary.Begin (); DictionaryType::ConstIterator end = dictionary.End (); // try to print value of 0119|1030 std::string entryId = "0119|1030"; DictionaryType::ConstIterator tagItr = dictionary.Find (entryId); if (tagItr != end) { MetaDataStringType::ConstPointer entryvalue = dynamic_cast (tagItr->second.GetPointer ()); if (entryvalue) { std::string tagvalue = entryvalue->GetMetaDataObjectValue (); std::cout << "(" << entryId << ") "; std::cout << " is: " << tagvalue.c_str () << std::endl; } } // try to print value of ImageOrientationPatient entryId = "0020|0037"; tagItr = dictionary.Find (entryId); if (tagItr != end) { MetaDataStringType::ConstPointer entryvalue = dynamic_cast (tagItr->second.GetPointer ()); if (entryvalue) { std::string tagvalue = entryvalue->GetMetaDataObjectValue (); std::cout << "(" << entryId << ") "; std::cout << " is: " << tagvalue.c_str () << std::endl; } } return EXIT_SUCCESS; } This is the program output: /Users/rharnish/Projects/itkImageProcessing/io/DicomTags/data/test.dic /Users/rharnish/Projects/itkImageProcessing/io/DicomTags/data has key: 1 (0119|1030) is: LTFcLTBcMFwtMFwtMVwwXDBcMFwxIA== (0020|0037) is: -1\-0\0\-0\-1\0 This is the contents of test.dic: 0119 1030 DS 9 3DDirectionCosines Angela.Y Wang wrote: > I am trying to read processed data in dicom file format and would like > to create a GDCM dictionary for the private tags. In a previous > message, it was suggested to create a custom tag dictionary and put it > in the GDCM search path. Could somebody please tell me how to go about > doing this? Hi Angela, I have added an example on how to user dynamically loaded user defined DICOM dictionary: $ cvs ci -m"ENH: Add example on how to use a user defined dict" /cvsroot/Insight/Insight/Examples/IO/DicomImageReadPrintTags.cxx,v <-- DicomImageReadPrintTags.cxx new revision: 1.16; previous revision: 1.15 /cvsroot/Insight/Insight/Examples/IO/itk.dic,v <-- itk.dic initial revision: 1.1 You should be able to now type in: $ ./bin/DicomImageReadPrintTags /path/to/012345.002.050 /path/to/Insight/Examples/IO/itk.dic First argument is the DICOM file, second (optional) argument is a user defined dictionary which should look like: http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Examples/IO/itk.dic?rev=1.1&root=Insight HTH Mathieu From grothausmann.roman at mh-hannover.de Wed Jul 16 09:06:05 2014 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Wed, 16 Jul 2014 15:06:05 +0200 Subject: [ITK-users] [ITK] How to make ITK-binaries NOT ignore kernel out of memory messages? In-Reply-To: References: <53917A66.2060402@mh-hannover.de> <53A80327.9050701@mh-hannover.de> Message-ID: <53C678BD.2040908@mh-hannover.de> Hi Matt, Many thanks for Your reply. I'll check if ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1 prevents the problems. Although I'd be astonished if it does because BinaryMask3DMeshSource seems to use only one core anyway. Thanks again for Your help Roman On 15/07/14 02:55, Matt McCormick wrote: > Hi Roman, > > The CMake configuration variable: > > ITK_COMPUTER_MEMORY_SIZE > > is only used to choose which unit tests to run, and has no effect on > your program. > > > It may be worth a try to run > > export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1 > > before starting your program on the server to see the effect. It is > possible that too many threads or being spawned or that the amount of > memory consumed is scaling (poorly) with the number of threads used. > > Hope this helps, > Matt > > On Mon, Jun 23, 2014 at 6:36 AM, Dr. Roman Grothausmann > wrote: >> Dear Luis, >> >> >> Many thanks for Your reply. It took me some time to reproduce the problem, >> because Your test program works as expected on our server: >> >> ~$ ~/itk/simple/build_itk-4.5.1/memtest_01 1000 >> ITK Hello World ! >> >> ~$ ~/itk/simple/build_itk-4.5.1/memtest_01 10000 >> /opt/itk-4.5.1/include/ITK-4.5/itkImportImageContainer.hxx:192: >> >> Failed to allocate memory for image. >> >> One program of mine for which the problem exists is below. The problem >> occurs when BinaryMask3DMeshSource acquires more memory after running for >> some minutes. The very strange thing to me is, that the program is killed by >> the kernel as expected on my desktop PC: >> >> ~/itk/simple/build_itk4_pc3G48243/euler-characteristic_01 13-511_EAA_ot.mha >> 255 >> component type is: unsigned_char >> numDimensions: 3 >> component size: 1 >> pixel type (string): scalar >> pixel type: 1 >> _________________________ >> >> Executing ImageFileReader done. Took 2.78 seconds. >> Executing BinaryMask3DMeshSource Killed >> >> >> The header of 13-511_EAA_ot.mha: >> >> ObjectType = Image >> NDims = 3 >> BinaryData = True >> BinaryDataByteOrderMSB = False >> CompressedData = True >> CompressedDataSize = 20474538 >> TransformMatrix = 1 0 0 0 1 0 0 0 1 >> Offset = 0 0 0 >> CenterOfRotation = 0 0 0 >> AnatomicalOrientation = RAI >> ElementSpacing = 1 1 1 >> DimSize = 998 998 1034 >> ElementType = MET_UCHAR >> ElementDataFile = LOCAL >> >> >> However on the server it is not terminated when the RAM runs out, instead >> many processes go nuts that had been mostly sleeping and finally the system >> does not respond any more at all and a cold start is necessary. The >> itk-4.5.1 is configured on the server with (see attached >> CMakeCache_itk-4.5.1.txt): >> >> ITK_COMPUTER_MEMORY_SIZE 190 >> >> The server has 256GB of RAM an no Swap enabled: >> >> free >> total used free shared buffers cached >> Mem: 264498496 1341020 263157476 0 285760 289120 >> -/+ buffers/cache: 766140 263732356 >> Swap: 0 0 0 >> >> >> Has 12x2 Intel(R) Xeon(R) CPUs: >> >> cat /proc/cpuinfo >> processor : 0 >> vendor_id : GenuineIntel >> cpu family : 6 >> model : 45 >> model name : Intel(R) Xeon(R) CPU E5-2630L 0 @ 2.00GHz >> stepping : 7 >> microcode : 0x710 >> cpu MHz : 1200.000 >> cache size : 15360 KB >> physical id : 0 >> siblings : 12 >> core id : 0 >> cpu cores : 6 >> apicid : 0 >> initial apicid : 0 >> fpu : yes >> fpu_exception : yes >> cpuid level : 13 >> wp : yes >> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca >> cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx >> pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology >> nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 >> ssse3 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer >> aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi >> flexpriority ept vpid >> bogomips : 4000.56 >> clflush size : 64 >> cache_alignment : 64 >> address sizes : 46 bits physical, 48 bits virtual >> power management: >> . >> . >> . >> >> >> The server runs a Debian Wheezy (7.2): >> uname -a >> Linux img1-serv 3.2.0-4-amd64 #1 SMP Debian 3.2.57-3+deb7u2 x86_64 GNU/Linux >> >> My desktop PC has the same Debian (also same update state): >> uname -a >> Linux pc3G48243 3.2.0-4-amd64 #1 SMP Debian 3.2.57-3+deb7u2 x86_64 GNU/Linux >> >> free >> total used free shared buffers cached >> Mem: 8180356 1185364 6994992 0 23348 216084 >> -/+ buffers/cache: 945932 7234424 >> Swap: 0 0 0 >> >> >> and 4 AMD FX(tm)-4100 Quad-Core Processors: >> >> cat /proc/cpuinfo >> processor : 0 >> vendor_id : AuthenticAMD >> cpu family : 21 >> model : 1 >> model name : AMD FX(tm)-4100 Quad-Core Processor >> stepping : 2 >> microcode : 0x6000626 >> cpu MHz : 1400.000 >> cache size : 2048 KB >> physical id : 0 >> siblings : 4 >> core id : 0 >> cpu cores : 2 >> apicid : 16 >> initial apicid : 0 >> fpu : yes >> fpu_exception : yes >> cpuid level : 13 >> wp : yes >> flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca >> cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt >> pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc extd_apicid >> aperfmperf pni pclmulqdq monitor ssse3 cx16 sse4_1 sse4_2 popcnt aes xsave >> avx lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse >> 3dnowprefetch osvw ibs xop skinit wdt lwp fma4 nodeid_msr topoext >> perfctr_core arat cpb hw_pstate npt lbrv svm_lock nrip_save tsc_scale >> vmcb_clean flushbyasid decodeassists pausefilter pfthreshold >> bogomips : 7233.41 >> TLB size : 1536 4K pages >> clflush size : 64 >> cache_alignment : 64 >> address sizes : 48 bits physical, 48 bits virtual >> power management: ts ttp tm 100mhzsteps hwpstate [9] >> >> >> Knowing now, that itk checks for available RAM, the only sources for this >> problem I can think of would be an odd configuration of ITK itself or its >> use in programs compiled on the server, or some configuration differences in >> the (Debian) system, or some hardware problem. >> >> Do You have any idea what it could be? >> Or do You have any suggestions how I should go on searching for the cause? >> >> >> Any help or hints are very much appriciated. >> Many thanks for Your help again! >> >> Roman >> >> >> _____________________________________________ >> >> >> >> ////program to calculate the Euler characteristic of a binary image >> converted to itkQuadEdgeMesh >> ////THEREFORE does NOT take filled regions into account only covering >> surfaces! >> ////if fillings should be accounted use instead a vtk program taking 3D >> cells into account >> >> >> >> #include >> //#include >> #include //itk marching cubes (mc) very slow >> and resource hungry :-( >> #include >> #include >> >> >> >> #include "itkFilterWatcher2.h" >> >> >> >> >> void dispatch_cT(itk::ImageIOBase::IOPixelType, >> itk::ImageIOBase::IOComponentType, size_t, int, char **); >> >> template >> void dispatch_pT(itk::ImageIOBase::IOPixelType pixelType, size_t, int, char >> **); >> >> template >> void dispatch_D(size_t, int, char **); >> >> template> Dimension> >> int DoIt(int, char *argv[]); >> >> >> >> >> >> template> Dimension> >> int DoIt(int argc, char *argv[]){ >> >> typedef InputPixelType OutputPixelType; >> >> typedef itk::Image InputImageType; >> typedef itk::Image OutputImageType; >> >> >> typedef itk::ImageFileReader ReaderType; >> typename ReaderType::Pointer reader = ReaderType::New(); >> >> reader->SetFileName(argv[1]); >> FilterWatcher watcherI(reader, "reading"); >> watcherI.QuietOn(); >> watcherI.ReportTimeOn(); >> try >> { >> reader->Update(); >> } >> catch (itk::ExceptionObject &ex) >> { >> if (!strcmp(ex.GetDescription(), "Filter does not have progress.")){ >> std::cerr << ex.GetDescription() << std::endl; >> return EXIT_FAILURE; >> } >> } >> >> >> typedef double CoordType; >> >> //typedef itk::Mesh MeshType; >> typedef itk::QuadEdgeMesh InputMeshType; >> >> const InputPixelType isoValue= static_cast(atof(argv[2])); >> >> typedef itk::BinaryMask3DMeshSource >> MeshSourceType; >> typename MeshSourceType::Pointer meshSource = MeshSourceType::New(); >> >> meshSource->SetInput(reader->GetOutput()); >> meshSource->SetObjectValue(isoValue); >> >> FilterWatcher watcher(meshSource, "BinaryMask3DMeshSource"); >> watcher.QuietOn(); >> watcher.ReportTimeOn(); >> try >> { >> meshSource->Update(); >> } >> catch (itk::ExceptionObject &ex) >> { >> if (!strcmp(ex.GetDescription(), "Filter does not have progress.")){ >> std::cerr << ex.GetDescription() << std::endl; >> return EXIT_FAILURE; >> } >> } >> >> >> std::cout << "Nodes = " << meshSource->GetNumberOfNodes() << std::endl; >> std::cout << "Cells = " << meshSource->GetNumberOfCells() << std::endl; >> >> typename InputMeshType::Pointer mesh= meshSource->GetOutput(); >> >> //// check if meshSource can be represented as an itkQuadEdgeMesh >> //// if BinaryMask3DMeshSource caps boundary surfaces this check is not >> necessary! >> >> typedef itk::QuadEdgeMeshTopologyChecker TQEchecker; >> typename TQEchecker::Pointer QEchecker = TQEchecker::New(); >> QEchecker->SetMesh(mesh); >> std::cerr << "Executing >> QuadEdgeMeshTopologyChecker->ValidateEulerCharacteristic()"; >> if(!QEchecker->ValidateEulerCharacteristic()){ >> std::cerr << "Not a valid QuadEdgeMesh! Aborting." << std::endl; >> return EXIT_FAILURE; >> } >> std::cerr << " done." << std::endl; >> >> //// calc Euler characteristics \xi >> //// For closed smooth manifolds, the Euler characteristic coincides with >> the Euler number: >> http://en.wikipedia.org/wiki/Euler_characteristic#Relations_to_other_invariants >> //// general formula see: >> http://en.wikipedia.org/wiki/Genus_%28mathematics%29#Orientable_surface >> //// >> //// >> //// >> //// good QuadEdge explanation: >> http://www.cs.cmu.edu/afs/andrew/scs/cs/15-463/2001/pub/src/a2/quadedge.html >> /// from itkQuadEdgeMeshTopologyChecker.hxx >> >> typedef itk::QuadEdgeMeshBoundaryEdgesMeshFunction >> BoundaryEdges; >> >> typename BoundaryEdges::Pointer boundaryEdges = BoundaryEdges::New(); >> >> // Number of USED points >> typedef typename InputMeshType::PointIdentifier >> PointIdentifier; >> std::cerr << "ComputeNumberOfPoints"; >> PointIdentifier numPoints = mesh->ComputeNumberOfPoints(); >> std::cerr << " done." << std::endl; >> // Number of USED edges >> typedef typename InputMeshType::CellIdentifier >> CellIdentifier; >> std::cerr << "ComputeNumberOfEdges"; >> CellIdentifier numEdges = mesh->ComputeNumberOfEdges(); >> std::cerr << " done." << std::endl; >> // Number of USED faces >> std::cerr << "ComputeNumberOfFaces"; >> CellIdentifier numFaces = mesh->ComputeNumberOfFaces(); >> std::cerr << " done." << std::endl; >> // Number of Boundaries >> std::cerr << "ComputeNumberOfBoundaryEdges"; >> typename BoundaryEdges::OutputType >> listOfBoundaries = boundaryEdges->Evaluate((*mesh)); >> std::cerr << " done." << std::endl; >> CellIdentifier numBounds = listOfBoundaries->size(); >> delete listOfBoundaries; >> >> /** >> * Number of points >> * >> * There are two methods to get the number of points. >> * 1. itk::QuadEdgeMesh::ComputeNumberOfPoints() >> * 2. itk::Mesh::GetNumberOfPoints() >> * >> * As an itk::QuadEdgeMesh is an itk::Mesh by inheritance, the user >> * can use both. 1. will returned the number of points actually >> * used by at least one edge, while 2. will give you the number >> * of points in the container. Number of unused points can be found >> * by making the difference between the two values. >> */ >> if(mesh->GetNumberOfPoints() != numPoints){ >> std::cerr << "There are isolated vertices! Aborting." << std::endl; >> return EXIT_FAILURE; >> } >> >> // The euler formula states: >> // numFaces - numEdges + numPoints == 2 - 2 * genus - numBounds == \xi >> // hence 2 * genus= 2 - numBounds - numFaces + numEdges - numPoints must >> be an oddeven number. >> >> typedef ::itk::OffsetValueType OffsetValueType; >> >> OffsetValueType xi= >> + OffsetValueType(numFaces) >> - OffsetValueType(numEdges) >> + OffsetValueType(numPoints); >> >> std::cout << "The Euler characteristic Xi is: " << xi << std::endl; >> >> OffsetValueType twiceGenus= >> + OffsetValueType(2) - OffsetValueType(numBounds) >> - xi; >> >> std::cout << "The genus is: " << twiceGenus/OffsetValueType(2) << >> std::endl; >> >> return EXIT_SUCCESS; >> >> } >> >> >> void dispatch_cT(itk::ImageIOBase::IOComponentType componentType, >> itk::ImageIOBase::IOPixelType pixelType, size_t dimensionType, int argc, >> char *argv[]){ >> >> >> //http://www.itk.org/Doxygen45/html/classitk_1_1ImageIOBase.html#a8dc783055a0af6f0a5a26cb080feb178 >> //http://www.itk.org/Doxygen45/html/itkImageIOBase_8h_source.html#l00107 >> //IOComponentType: UNKNOWNCOMPONENTTYPE, UCHAR, CHAR, USHORT, SHORT, UINT, >> INT, ULONG, LONG, FLOAT, DOUBLE >> >> switch (componentType){ >> case itk::ImageIOBase::UCHAR:{ >> typedef unsigned char InputComponentType; >> dispatch_pT(pixelType, dimensionType, argc, argv); >> } >> break; >> case itk::ImageIOBase::CHAR:{ >> typedef char InputComponentType; >> dispatch_pT(pixelType, dimensionType, argc, argv); >> } >> break; >> case itk::ImageIOBase::USHORT:{ >> typedef unsigned short InputComponentType; >> dispatch_pT(pixelType, dimensionType, argc, argv); >> } >> break; >> case itk::ImageIOBase::SHORT:{ >> typedef short InputComponentType; >> dispatch_pT(pixelType, dimensionType, argc, argv); >> } >> break; >> case itk::ImageIOBase::UINT:{ >> typedef unsigned int InputComponentType; >> dispatch_pT(pixelType, dimensionType, argc, argv); >> } >> break; >> case itk::ImageIOBase::INT:{ >> typedef int InputComponentType; >> dispatch_pT(pixelType, dimensionType, argc, argv); >> } >> break; >> // case itk::ImageIOBase::ULONG:{ >> // typedef unsigned long InputComponentType; >> // dispatch_pT(pixelType, dimensionType, argc, >> argv); >> // } >> // break; >> // case itk::ImageIOBase::LONG:{ >> // typedef long InputComponentType; >> // dispatch_pT(pixelType, dimensionType, argc, >> argv); >> // } >> // break; >> // case itk::ImageIOBase::FLOAT:{ >> // typedef float InputComponentType; >> // dispatch_pT(pixelType, dimensionType, argc, >> argv); >> // } >> // break; >> // case itk::ImageIOBase::DOUBLE:{ >> // typedef double InputComponentType; >> // dispatch_pT(pixelType, dimensionType, argc, >> argv); >> // } >> // break; >> case itk::ImageIOBase::UNKNOWNCOMPONENTTYPE: >> default: >> std::cout << "unknown component type" << std::endl; >> break; >> }//switch >> } >> >> template >> void dispatch_pT(itk::ImageIOBase::IOPixelType pixelType, size_t >> dimensionType, int argc, char *argv[]){ >> >> >> //http://www.itk.org/Doxygen45/html/classitk_1_1ImageIOBase.html#abd189f096c2a1b3ea559bc3e4849f658 >> //http://www.itk.org/Doxygen45/html/itkImageIOBase_8h_source.html#l00099 >> //IOPixelType:: UNKNOWNPIXELTYPE, SCALAR, RGB, RGBA, OFFSET, VECTOR, >> POINT, COVARIANTVECTOR, SYMMETRICSECONDRANKTENSOR, DIFFUSIONTENSOR3D, >> COMPLEX, FIXEDARRAY, MATRIX >> >> switch (pixelType){ >> case itk::ImageIOBase::SCALAR:{ >> typedef InputComponentType InputPixelType; >> //typedef itk::SCALARPixel InputPixelType; >> dispatch_D(dimensionType, argc, >> argv); >> } >> break; >> // case itk::ImageIOBase::RGB:{ >> // typedef itk::RGBPixel InputPixelType; >> // dispatch_D(dimensionType, argc, >> argv); >> // } >> // break; >> // case itk::ImageIOBase::RGBA:{ >> // typedef itk::RGBAPixel InputPixelType; >> // dispatch_D(dimensionType, argc, >> argv); >> // } >> // break; >> // case itk::ImageIOBase::VECTOR:{ >> // //typedef itk::VECTORPixel InputPixelType; //does >> not work! >> // typedef itk::VariableLengthVector InputPixelType; >> // dispatch_D(dimensionType, argc, >> argv); >> // } >> // break; >> case itk::ImageIOBase::UNKNOWNPIXELTYPE: >> default: >> std::cout << "unknown pixel type" << std::endl; >> break; >> }//switch >> } >> >> >> template >> void dispatch_D(size_t dimensionType, int argc, char *argv[]){ >> switch (dimensionType){ >> // case 1: >> // DoIt(argc, argv); >> // break; >> // case 2: >> // DoIt(argc, argv); >> // break; >> case 3: >> DoIt(argc, argv); >> break; >> case 4: >> DoIt(argc, argv); >> break; >> case 5: >> DoIt(argc, argv); >> break; >> default: >> std::cout << "Images of dimension " << dimensionType << " are not >> supported!" << std::endl; >> break; >> } >> } >> >> >> >> ////from >> http://itk-users.7.n7.nabble.com/Pad-image-with-0-but-keep-its-type-what-ever-it-is-td27442.html >> //namespace itk{ >> // Description: >> // Get the PixelType and ComponentType from fileName >> >> void GetImageType (std::string fileName, >> itk::ImageIOBase::IOPixelType &pixelType, >> itk::ImageIOBase::IOComponentType &componentType, >> size_t &dimensionType >> //ImageIOBase::IODimensionType &dimensionType >> ){ >> typedef itk::Image ImageType; >> itk::ImageFileReader::Pointer imageReader= >> itk::ImageFileReader::New(); >> imageReader->SetFileName(fileName.c_str()); >> imageReader->UpdateOutputInformation(); >> >> pixelType = imageReader->GetImageIO()->GetPixelType(); >> componentType = imageReader->GetImageIO()->GetComponentType(); >> dimensionType= imageReader->GetImageIO()->GetNumberOfDimensions(); >> >> //std::cerr << "Pixel Type is " << >> imageReader->GetImageIO()->GetComponentTypeAsString(pixelType) << std::endl; >> std::cerr << "component type is: " << >> imageReader->GetImageIO()->GetComponentTypeAsString(componentType) << >> std::endl; >> std::cerr << "numDimensions: " << dimensionType << std::endl; >> std::cerr << "component size: " << >> imageReader->GetImageIO()->GetComponentSize() << std::endl; >> std::cerr << "pixel type (string): " << >> imageReader->GetImageIO()->GetPixelTypeAsString(imageReader->GetImageIO()->GetPixelType()) >> << std::endl; >> std::cerr << "pixel type: " << pixelType << std::endl << >> "_________________________" << std::endl << std::endl; >> >> >> } >> >> >> >> int main(int argc, char *argv[]){ >> if ( argc != 3 ) >> { >> std::cerr << "Missing Parameters: " >> << argv[0] >> << " Input_Image" >> << " isoValue" >> << std::endl; >> >> return EXIT_FAILURE; >> } >> >> std::string ifn = argv[1]; >> // std::string ofn = argv[2]; >> // int compress= atoi(argv[3]); >> >> itk::ImageIOBase::IOPixelType pixelType; >> typename itk::ImageIOBase::IOComponentType componentType; >> //itk::ImageIOBase::IOComponentType componentType1; >> //itk::ImageIOBase::IODimensionType dimensionType1; >> size_t dimensionType; >> >> >> try >> { >> GetImageType(argv[1], pixelType, componentType, dimensionType); >> >> dispatch_cT(componentType, pixelType, dimensionType, argc, argv); >> }//try >> catch( itk::ExceptionObject &excep) >> { >> std::cerr << argv[0] << ": exception caught !" << std::endl; >> std::cerr << excep << std::endl; >> return EXIT_FAILURE; >> } >> >> return EXIT_SUCCESS; >> >> } >> >> >> >> >> >> >> >> >> >> >> On 08/06/14 15:51, Luis Ibanez wrote: >>> >>> >>> Roman, >>> >>> >>> Could you please share with the list an example >>> of a program where you are observing this behavior ? >>> >>> In particular, we would like to see if this is occurring with >>> Image filters, or rather with other types of ITK objects. >>> >>> >>> >>> The itk::Image does listen to the (potential) memory allocation messages >>> (that is, the bad_alloc exception). >>> >>> >>> >>> The itk::Image class uses a helper class to store the pixel data. >>> >>> >>> >>> This helper is the: >>> >>> itk::ImportImageContainer >>> >>> >>> https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Core/Common/include/itkImportImageContainer.h >>> >>> >>> >>> >>> and its memory allocation is typically done in the AllocateElements() >>> function >>> in line: >>> >>> >>> https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Core/Common/include/itkImportImageContainer.hxx#L173 >>> >>> the code looks like >>> >>> TElement *data; >>> >>> try >>> { >>> if ( UseDefaultConstructor ) >>> { >>> data = new TElement[size](); //POD types initialized to 0, others >>> use >>> default constructor. >>> } >>> else >>> { >>> data = new TElement[size]; //Faster but uninitialized >>> } >>> } >>> catch ( ... ) >>> { >>> data = ITK_NULLPTR; >>> } >>> if ( !data ) >>> { >>> // We cannot construct an error string here because we may be out >>> // of memory. Do not use the exception macro. >>> throw MemoryAllocationError(__FILE__, __LINE__, >>> "Failed to allocate memory for image.", >>> ITK_LOCATION); >>> } >>> return data; >>> >>> >>> >>> As you can see, the case of exceptions is managed in that function. >>> >>> >>> Here is an example of a test program demonstrating that ITK image >>> will throw exceptions when allocating memory beyond limits. >>> >>> >>> #include "itkImage.h" >>> #include >>> >>> int main(int argc, char * argv[] ) >>> { >>> if( argc < 2 ) >>> { >>> std::cerr << "Missing arguments" << std::endl; >>> return 1; >>> } >>> >>> typedef itk::Image< unsigned short, 3 > ImageType; >>> >>> ImageType::Pointer image = ImageType::New(); >>> >>> ImageType::RegionType region; >>> ImageType::SizeType size; >>> >>> size_t side = atoi( argv[1] ); >>> >>> size[0] = side; >>> size[1] = side; >>> size[2] = side; >>> >>> region.SetSize( size ); >>> >>> image->SetRegions( region ); >>> >>> try >>> { >>> image->Allocate(); >>> } >>> catch( std::exception & excp ) >>> { >>> std::cerr << excp.what() << std::endl; >>> return 1; >>> } >>> >>> std::cout << "ITK Hello World !" << std::endl; >>> >>> return 0; >>> } >>> >>> >>> and what happens when executing in an Ubuntu Linux machine with 32GB or >>> RAM >>> >>> >>> $ ./HelloWorld 1000 >>> ITK Hello World ! >>> >>> >>> $ ./HelloWorld 1000000 >>> >>> /home/ibanez/src/ITK/Modules/Core/Common/include/itkImportImageContainer.hxx:199: >>> Failed to allocate memory for image. >>> >>> >>> >>> >>> Please share with the list a minimal example of the problem you are >>> observing, >>> and in this way we will be able to help track the issue. >>> >>> >>> Thanks >>> >>> >>> Luis >>> >>> >> >> -- >> Dr. Roman Grothausmann >> >> Tomographie und Digitale Bildverarbeitung >> Tomography and Digital Image Analysis >> >> Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 >> Medizinische Hochschule Hannover >> Carl-Neuberg-Str. 1 >> D-30625 Hannover >> >> Tel. +49 511 532-9574 >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-9574 From blowekamp at mail.nih.gov Wed Jul 16 09:13:47 2014 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Wed, 16 Jul 2014 09:13:47 -0400 Subject: [ITK-users] Connected Threshold Filter crashes but only for large images In-Reply-To: <1405441657014-7585907.post@n2.nabble.com> References: <1405441657014-7585907.post@n2.nabble.com> Message-ID: <4C3F118B-E049-4168-9542-FC8D288FC38E@mail.nih.gov> Hello, I have had great success running this algorithm on very large data sets. And consider the implementation very robust. There could be something different about your pipeline, or something unique about your image, or how you compiled it. First are you running 32 or 64-bits? Perhaps you are running out of memory? Perhaps there is something odd about your pipeline. If you just do a ImageFileRead->Connected Threshold->ImageFileWrite does it still crash? If you are familiar with Python, perhaps you could try running this filter with a binary download of SimpleITK? This would check to see if there is something intrinsically wrong with the algorithm? Just some ideas to help narrow it down... Brad On Jul 15, 2014, at 12:27 PM, Michael Pinkert wrote: > Hi everyone, > > I am working with sets of 3D MRI data from multiple years for my research. > I am using the connected threshold filter in a pipeline after a binary > thresholding procedure using Otsu segmentation. > > The algorithm functions when there are 124 slices in the image, but crashes > with an abort message when there are 248 slices and when there are 156 > slices. > > I have tested this with multiple data sets and the pattern holds. The > strange part is that this still happens even if I resample the number of > slices down to 124, so I really am confused as to what is happening. > > Is there any reason why the filter would be crashing for images that are too > large like this, even after being resampled smaller? > > Best regards, > Michael Pinkert > > > > -- > View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-users-Connected-Threshold-Filter-crashes-but-only-for-large-images-tp7585907.html > Sent from the ITK Insight Users mailing list archive at Nabble.com. > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users From blowekamp at mail.nih.gov Wed Jul 16 09:17:59 2014 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Wed, 16 Jul 2014 09:17:59 -0400 Subject: [ITK-users] 3D registration problem In-Reply-To: References: Message-ID: <261FEDF7-8004-40D8-A84F-5E489AACD127@mail.nih.gov> Hello, This not the expected behavior for a good registration program. Is your initialization good? You haven't shared anything about the registration components you are using. Perhaps you scales are way off? How does the convergence look when monitoring the output? Perhaps you have too many free parameters? Maybe you are trying to optimize an transform with too many parameters when you are not close. Perhaps you need to do a Translation + Rotation transform such as Euler or Versor first? Hope that helps, Brad On Jul 15, 2014, at 5:26 AM, Iyas Hamdan wrote: > Hello itk users, > > I'm working on 3D image registration, currently I'm trying to register a CT volume to an MRI volume ( the two volumes have different sizes concerning the number of slices used to construct the 3D volume). > > I'm doing an affine registration using the mutual information as a metric, and I'm having problems registering those two volumes. > > What I thiink the problem is, I have a different field of view between both volumes, so when I try to register the whole CT volume to the MRI one the registration falis. However, when I deleted a dozen of slices from the CT volume ( so that I had the same field of view in both volumes) it works just fine and I was able to register the volumes. > > > And by "the registration failed" I meant it worked with no errors but the result was really bad! and that the registered volume was nothing like the fixed one, so if I try to find the difference between each two corresponding slices for example , they were not aligned at all! > > Is that normal that the registration doesnt work when I have a different field of view in each volume ? or should it deform one volume so that it corresponds to the other one even if they had two different fields of view ? > > Any help would be really appreciated, > > Thanks in advance, > > Iyas > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users From iyas.hamdan at gmail.com Wed Jul 16 09:52:43 2014 From: iyas.hamdan at gmail.com (Iyas Hamdan) Date: Wed, 16 Jul 2014 15:52:43 +0200 Subject: [ITK-users] 3D registration problem In-Reply-To: <261FEDF7-8004-40D8-A84F-5E489AACD127@mail.nih.gov> References: <261FEDF7-8004-40D8-A84F-5E489AACD127@mail.nih.gov> Message-ID: Hello, Thanks for your reply! It's true I haven't shared alot of information about the methode I'm using sorry about that. My code is based on the example "ImageRegistration20.cxx" with some modifications; So I'm basically using a 3D Affine registration with Mattes mutual information being the metric and the regular step gradient descent as the optimizer and finally a linear interpolator. For the initialization, its good and there's no problem here. But for the result, concerning the registered volume, the scale is good as well but the problem is that the its not aligned with the fixed volume. And for the parameters, I have only a few ones for the metric ( number of histogram bins and spatial samples ) and I dont think they would have that much of effect on the output, but I tried to change them and I ended up always with almost the same result. And for the optimizer, same as before I tried so many values for the relaxation factor and the max/min step lengths as well. So the problem is not the scale nor the parameters but the registration itself; since it can't find, for each slice of the fixed volume, the slice in the moving volume that corresponds the maximum. So on the output I have a volume that has the same scale as the fixed one but they are not aligned and have no mutual information between them I would say. Even though I tried to change the initialization to prevent the local minimas and I'm starting now with a good initialization but still the same result. And what I found wierd is that when I deleted few slices from the end of the moving volume, the registration worked perfectly and I had good results! Hope this was clear and these information was enough, and please let me know if you have any other suggestions or advices. Thanks in advance, Iyas On Wed, Jul 16, 2014 at 3:17 PM, Bradley Lowekamp wrote: > Hello, > > This not the expected behavior for a good registration program. > > Is your initialization good? > > You haven't shared anything about the registration components you are > using. Perhaps you scales are way off? How does the convergence look when > monitoring the output? > > Perhaps you have too many free parameters? Maybe you are trying to > optimize an transform with too many parameters when you are not close. > Perhaps you need to do a Translation + Rotation transform such as Euler or > Versor first? > > Hope that helps, > Brad > > On Jul 15, 2014, at 5:26 AM, Iyas Hamdan wrote: > > > Hello itk users, > > > > I'm working on 3D image registration, currently I'm trying to register a > CT volume to an MRI volume ( the two volumes have different sizes > concerning the number of slices used to construct the 3D volume). > > > > I'm doing an affine registration using the mutual information as a > metric, and I'm having problems registering those two volumes. > > > > What I thiink the problem is, I have a different field of view between > both volumes, so when I try to register the whole CT volume to the MRI one > the registration falis. However, when I deleted a dozen of slices from the > CT volume ( so that I had the same field of view in both volumes) it works > just fine and I was able to register the volumes. > > > > > > And by "the registration failed" I meant it worked with no errors but > the result was really bad! and that the registered volume was nothing like > the fixed one, so if I try to find the difference between each two > corresponding slices for example , they were not aligned at all! > > > > Is that normal that the registration doesnt work when I have a different > field of view in each volume ? or should it deform one volume so that it > corresponds to the other one even if they had two different fields of view ? > > > > Any help would be really appreciated, > > > > Thanks in advance, > > > > Iyas > > _____________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Kitware offers ITK Training Courses, for more information visit: > > http://www.kitware.com/products/protraining.php > > > > Please keep messages on-topic and check the ITK FAQ at: > > http://www.itk.org/Wiki/ITK_FAQ > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/insight-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Wed Jul 16 10:03:38 2014 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Wed, 16 Jul 2014 10:03:38 -0400 Subject: [ITK-users] 3D registration problem In-Reply-To: References: <261FEDF7-8004-40D8-A84F-5E489AACD127@mail.nih.gov> Message-ID: Have you looked at the histograms of the two image with the parameters provided to the metric? Perhaps this example will be of use: http://www.itk.org/Doxygen/html/RegistrationITKv3_2ImageRegistrationHistogramPlotter_8cxx-example.html Brad On Jul 16, 2014, at 9:52 AM, Iyas Hamdan wrote: > Hello, > > Thanks for your reply! > > It's true I haven't shared alot of information about the methode I'm using sorry about that. > > My code is based on the example "ImageRegistration20.cxx" with some modifications; > > So I'm basically using a 3D Affine registration with Mattes mutual information being the metric and the regular step gradient descent as the optimizer and finally a linear interpolator. > > For the initialization, its good and there's no problem here. > > But for the result, concerning the registered volume, the scale is good as well but the problem is that the its not aligned with the fixed volume. > > And for the parameters, I have only a few ones for the metric ( number of histogram bins and spatial samples ) and I dont think they would have that much of effect on the output, but I tried to change them and I ended up always with almost the same result. > And for the optimizer, same as before I tried so many values for the relaxation factor and the max/min step lengths as well. > > So the problem is not the scale nor the parameters but the registration itself; since it can't find, for each slice of the fixed volume, the slice in the moving volume that corresponds the maximum. So on the output I have a volume that has the same scale as the fixed one but they are not aligned and have no mutual information between them I would say. Even though I tried to change the initialization to prevent the local minimas and I'm starting now with a good initialization but still the same result. > > > And what I found wierd is that when I deleted few slices from the end of the moving volume, the registration worked perfectly and I had good results! > > > > Hope this was clear and these information was enough, and please let me know if you have any other suggestions or advices. > > Thanks in advance, > > Iyas > > > On Wed, Jul 16, 2014 at 3:17 PM, Bradley Lowekamp wrote: > Hello, > > This not the expected behavior for a good registration program. > > Is your initialization good? > > You haven't shared anything about the registration components you are using. Perhaps you scales are way off? How does the convergence look when monitoring the output? > > Perhaps you have too many free parameters? Maybe you are trying to optimize an transform with too many parameters when you are not close. Perhaps you need to do a Translation + Rotation transform such as Euler or Versor first? > > Hope that helps, > Brad > > On Jul 15, 2014, at 5:26 AM, Iyas Hamdan wrote: > > > Hello itk users, > > > > I'm working on 3D image registration, currently I'm trying to register a CT volume to an MRI volume ( the two volumes have different sizes concerning the number of slices used to construct the 3D volume). > > > > I'm doing an affine registration using the mutual information as a metric, and I'm having problems registering those two volumes. > > > > What I thiink the problem is, I have a different field of view between both volumes, so when I try to register the whole CT volume to the MRI one the registration falis. However, when I deleted a dozen of slices from the CT volume ( so that I had the same field of view in both volumes) it works just fine and I was able to register the volumes. > > > > > > And by "the registration failed" I meant it worked with no errors but the result was really bad! and that the registered volume was nothing like the fixed one, so if I try to find the difference between each two corresponding slices for example , they were not aligned at all! > > > > Is that normal that the registration doesnt work when I have a different field of view in each volume ? or should it deform one volume so that it corresponds to the other one even if they had two different fields of view ? > > > > Any help would be really appreciated, > > > > Thanks in advance, > > > > Iyas > > _____________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Kitware offers ITK Training Courses, for more information visit: > > http://www.kitware.com/products/protraining.php > > > > Please keep messages on-topic and check the ITK FAQ at: > > http://www.itk.org/Wiki/ITK_FAQ > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/insight-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mpinkert at wisc.edu Wed Jul 16 13:53:12 2014 From: mpinkert at wisc.edu (Michael Pinkert) Date: Wed, 16 Jul 2014 10:53:12 -0700 (PDT) Subject: [ITK-users] Connected Threshold Filter crashes but only for large images In-Reply-To: <4C3F118B-E049-4168-9542-FC8D288FC38E@mail.nih.gov> References: <1405441657014-7585907.post@n2.nabble.com> <4C3F118B-E049-4168-9542-FC8D288FC38E@mail.nih.gov> Message-ID: <1405533192912-7585914.post@n2.nabble.com> Hi, I think the problem may be unique to the data set I was working with. New scans I acquired from different patients have been working fine, so it looks like it is something wrong with the images that is the issue. Thank you for your help, and I'll keep your advice in mind in case I run into this problem again. Best regards, Michael Pinkert Bradley Lowekamp wrote > Hello, > > I have had great success running this algorithm on very large data sets. > And consider the implementation very robust. > > There could be something different about your pipeline, or something > unique about your image, or how you compiled it. > > First are you running 32 or 64-bits? Perhaps you are running out of > memory? > > Perhaps there is something odd about your pipeline. If you just do a > ImageFileRead->Connected Threshold->ImageFileWrite does it still crash? > > If you are familiar with Python, perhaps you could try running this filter > with a binary download of SimpleITK? This would check to see if there is > something intrinsically wrong with the algorithm? > > Just some ideas to help narrow it down... > Brad > > > On Jul 15, 2014, at 12:27 PM, Michael Pinkert < > mpinkert@ > > wrote: > >> Hi everyone, >> >> I am working with sets of 3D MRI data from multiple years for my >> research. >> I am using the connected threshold filter in a pipeline after a binary >> thresholding procedure using Otsu segmentation. >> >> The algorithm functions when there are 124 slices in the image, but >> crashes >> with an abort message when there are 248 slices and when there are 156 >> slices. >> >> I have tested this with multiple data sets and the pattern holds. The >> strange part is that this still happens even if I resample the number of >> slices down to 124, so I really am confused as to what is happening. >> >> Is there any reason why the filter would be crashing for images that are >> too >> large like this, even after being resampled smaller? >> >> Best regards, >> Michael Pinkert >> >> >> >> -- >> View this message in context: >> http://itk-insight-users.2283740.n2.nabble.com/ITK-users-Connected-Threshold-Filter-crashes-but-only-for-large-images-tp7585907.html >> Sent from the ITK Insight Users mailing list archive at Nabble.com. >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-users-Connected-Threshold-Filter-crashes-but-only-for-large-images-tp7585907p7585914.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From marco.ulge at gmail.com Wed Jul 16 17:34:34 2014 From: marco.ulge at gmail.com (Marco Ulge) Date: Wed, 16 Jul 2014 14:34:34 -0700 (PDT) Subject: [ITK-users] [ITK-Users] Help with ITK and CMake Message-ID: <1405546474692-7585915.post@n2.nabble.com> Good evening, I need to create a .dll (and a .so for linux) with ITK code inside. I was wandering if anyone of you knows how i should write my cmakelists to make the dll standalone. Actually i got no problem generating the dll file but it is not standalone and i'm struggling to figure out why. Any help's appreciated Regards, Marco -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-Users-Help-with-ITK-and-CMake-tp7585915.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From k09tranhoan at gmail.com Thu Jul 17 03:36:21 2014 From: k09tranhoan at gmail.com (zoro) Date: Thu, 17 Jul 2014 00:36:21 -0700 (PDT) Subject: [ITK-users] L-BFGS optimizer's in versor space Message-ID: <1405582581330-7585916.post@n2.nabble.com> Dear all, I tried to implement L-BFGS optimizer in the versor space and registration framework with the algorithm as below: http://en.wikipedia.org/wiki/Limited-memory_BFGS L-BFGS produced the direction and base on that, I used the line-search to update parameters ( number of parameters is 6, anyway). But sometimes, direction goes to irregular places where translation direction is extremely large. And the convergence is not good. It does not show the effect of BFGS but only line-search. I thought that with constraint of versor space (in unit cube surface), it's not straight as the algorithm above. For example, in versor space (vec_a - vec_b) actually equal to composition of vec_a and Conjugate of vec_b. Calculating (vec_a - vec_b) in simple way (in the algorithm above) leads to problem of irregular jumping in parameters space. Is anyone who deals with L-BFGS in versor space? I will appreciate if you give me some advice. Thank you! Regards, -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/L-BFGS-optimizer-s-in-versor-space-tp7585916.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From iyas.hamdan at gmail.com Thu Jul 17 05:16:21 2014 From: iyas.hamdan at gmail.com (Iyas Hamdan) Date: Thu, 17 Jul 2014 11:16:21 +0200 Subject: [ITK-users] 3D registration problem In-Reply-To: References: <261FEDF7-8004-40D8-A84F-5E489AACD127@mail.nih.gov> Message-ID: Hello, and thanks again for your reply Brad, I haven't actually give it a look yet, but I think it won't help in my case since I'm working with images from different modalities. I mean I know that the joint histogram should be concentrated in the diagnoal but isn't that the case only when we're working with images from the same modalities ? or should it work as well in my case ? regards, Iyas On Wed, Jul 16, 2014 at 4:03 PM, Bradley Lowekamp wrote: > Have you looked at the histograms of the two image with the parameters > provided to the metric? > > Perhaps this example will be of use: > > http://www.itk.org/Doxygen/html/RegistrationITKv3_2ImageRegistrationHistogramPlotter_8cxx-example.html > > Brad > > On Jul 16, 2014, at 9:52 AM, Iyas Hamdan wrote: > > Hello, > > Thanks for your reply! > > It's true I haven't shared alot of information about the methode I'm using > sorry about that. > > My code is based on the example "ImageRegistration20.cxx" with some > modifications; > > So I'm basically using a 3D Affine registration with Mattes mutual > information being the metric and the regular step gradient descent as the > optimizer and finally a linear interpolator. > > For the initialization, its good and there's no problem here. > > But for the result, concerning the registered volume, the scale is good as > well but the problem is that the its not aligned with the fixed volume. > > And for the parameters, I have only a few ones for the metric ( number of > histogram bins and spatial samples ) and I dont think they would have that > much of effect on the output, but I tried to change them and I ended up > always with almost the same result. > And for the optimizer, same as before I tried so many values for the > relaxation factor and the max/min step lengths as well. > > So the problem is not the scale nor the parameters but the registration > itself; since it can't find, for each slice of the fixed volume, the slice > in the moving volume that corresponds the maximum. So on the output I have > a volume that has the same scale as the fixed one but they are not aligned > and have no mutual information between them I would say. Even though I > tried to change the initialization to prevent the local minimas and I'm > starting now with a good initialization but still the same result. > > > And what I found wierd is that when I deleted few slices from the end of > the moving volume, the registration worked perfectly and I had good results! > > > > Hope this was clear and these information was enough, and please let me > know if you have any other suggestions or advices. > > Thanks in advance, > > Iyas > > > On Wed, Jul 16, 2014 at 3:17 PM, Bradley Lowekamp > wrote: > >> Hello, >> >> This not the expected behavior for a good registration program. >> >> Is your initialization good? >> >> You haven't shared anything about the registration components you are >> using. Perhaps you scales are way off? How does the convergence look when >> monitoring the output? >> >> Perhaps you have too many free parameters? Maybe you are trying to >> optimize an transform with too many parameters when you are not close. >> Perhaps you need to do a Translation + Rotation transform such as Euler or >> Versor first? >> >> Hope that helps, >> Brad >> >> On Jul 15, 2014, at 5:26 AM, Iyas Hamdan wrote: >> >> > Hello itk users, >> > >> > I'm working on 3D image registration, currently I'm trying to register >> a CT volume to an MRI volume ( the two volumes have different sizes >> concerning the number of slices used to construct the 3D volume). >> > >> > I'm doing an affine registration using the mutual information as a >> metric, and I'm having problems registering those two volumes. >> > >> > What I thiink the problem is, I have a different field of view between >> both volumes, so when I try to register the whole CT volume to the MRI one >> the registration falis. However, when I deleted a dozen of slices from the >> CT volume ( so that I had the same field of view in both volumes) it works >> just fine and I was able to register the volumes. >> > >> > >> > And by "the registration failed" I meant it worked with no errors but >> the result was really bad! and that the registered volume was nothing like >> the fixed one, so if I try to find the difference between each two >> corresponding slices for example , they were not aligned at all! >> > >> > Is that normal that the registration doesnt work when I have a >> different field of view in each volume ? or should it deform one volume so >> that it corresponds to the other one even if they had two different fields >> of view ? >> > >> > Any help would be really appreciated, >> > >> > Thanks in advance, >> > >> > Iyas >> > _____________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Kitware offers ITK Training Courses, for more information visit: >> > http://www.kitware.com/products/protraining.php >> > >> > Please keep messages on-topic and check the ITK FAQ at: >> > http://www.itk.org/Wiki/ITK_FAQ >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/insight-users >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elena.bresciani87 at gmail.com Thu Jul 17 08:43:46 2014 From: elena.bresciani87 at gmail.com (elena bresciani) Date: Thu, 17 Jul 2014 14:43:46 +0200 Subject: [ITK-users] Using C++ functions in ITK pipeline Message-ID: Hello guys, I'm developing a really complicated pipeline and to avoid repetitions and unreadeble code I thought of writing the different pieces of code as functions, each with a single specific purpose. Since I'm not really a C++ master I started with a very simple pipeline (reader -> rescale intensity filter -> writer), where the rescale intensity filter is in a separate function, outside the main(). The code compiles and it even runs but the output is not what it would have to be. Can someone help me find where is the error? Attached you can find my code, a test image and the respective output. Thanks in advance Elena -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TEST.jpg Type: image/jpeg Size: 3641 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: testFunzioni.cxx Type: text/x-c++src Size: 1895 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: TEST_out.jpg Type: image/jpeg Size: 17543 bytes Desc: not available URL: From nicgallego at gmail.com Thu Jul 17 09:46:19 2014 From: nicgallego at gmail.com (Nicolas Gallego) Date: Thu, 17 Jul 2014 15:46:19 +0200 Subject: [ITK-users] Fwd: [ITK] Using C++ functions in ITK pipeline In-Reply-To: References: Message-ID: Hi Elena, I compiled and tested your example code. I found that there was a conflict between the return of the function and the argument (output), also I think output allocation on the function is not necesary since you assign it a valid output. Here a version of your code that worked. Nicol?s Gallego-Ortiz Universit? catholique de Louvain, Belgium 2014-07-17 14:43 GMT+02:00 elena bresciani : > Hello guys, > > I'm developing a really complicated pipeline and to avoid repetitions and > unreadeble code I thought of writing the different pieces of code as > functions, each with a single specific purpose. > Since I'm not really a C++ master I started with a very simple pipeline > (reader -> rescale intensity filter -> writer), where the rescale intensity > filter is in a separate function, outside the main(). > The code compiles and it even runs but the output is not what it would > have to be. > > Can someone help me find where is the error? > > Attached you can find my code, a test image and the respective output. > > Thanks in advance > > Elena > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- PROJECT(funzioni) CMAKE_MINIMUM_REQUIRED(VERSION 2.8) FIND_PACKAGE(ITK) IF(ITK_FOUND) INCLUDE(${ITK_USE_FILE}) ELSE(ITK_FOUND) MESSAGE(FATAL_ERROR "ITK not found. Please set ITK_DIR.") ENDIF(ITK_FOUND) ADD_EXECUTABLE( testFunzioni testFunzioni.cxx ) TARGET_LINK_LIBRARIES( testFunzioni ${ITK_LIBRARIES} ) -------------- next part -------------- A non-text attachment was scrubbed... Name: TEST.jpg Type: image/jpeg Size: 3641 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: myTestOut.jpg Type: image/jpeg Size: 2342 bytes Desc: not available URL: -------------- next part -------------- #include #include "itkImage.h" #include "itkImageFileReader.h" #include "itkImageFileWriter.h" #include "itkRescaleIntensityImageFilter.h" typedef itk::Image < unsigned char, 2 > ImageType; // may be a conflict between return value and outImage as argument by reference //ImageType::Pointer RescaleIntensity (ImageType::Pointer inputImage, ImageType::Pointer outputImage); ImageType::Pointer RescaleIntensity (ImageType::Pointer inputImage); int main (int argc, char * argv[]) { typedef itk::ImageFileReader < ImageType > ReaderType; ReaderType::Pointer reader = ReaderType::New(); reader -> SetFileName (argv[1]); try { reader -> Update(); } catch (itk::ExceptionObject & excp) { std::cerr << "Problem encountered while reading file: " << std::endl; std::cerr << excp << std::endl; return EXIT_FAILURE; } ImageType::Pointer inputImg = reader -> GetOutput(); // ImageType::Pointer outputImage = ImageType::New(); ImageType::Pointer outputImage = RescaleIntensity( inputImg ); // RescaleIntensity (inputImg, outputImage); typedef itk::ImageFileWriter < ImageType > WriterType; WriterType::Pointer writer = WriterType::New(); writer -> SetFileName (argv[2]); writer -> SetInput (outputImage); // writer->SetInput( rescale->GetOutput() ); try { writer->Update(); } catch (itk::ExceptionObject & excp) { std::cerr << "Problem encountered while writing file: " << std::endl; std::cerr << excp << std::endl; return EXIT_FAILURE; } return EXIT_SUCCESS; } //ImageType::Pointer RescaleIntensity (ImageType::Pointer inputImage, ImageType::Pointer outputImage) ImageType::Pointer RescaleIntensity(ImageType::Pointer inputImage) { // std::cout << inputImage << std::endl; // outputImage -> SetRegions (inputImage -> GetLargestPossibleRegion()); // outputImage -> SetSpacing (inputImage ->GetSpacing()); // outputImage -> Allocate(); typedef itk::RescaleIntensityImageFilter < ImageType, ImageType > RescaleType; RescaleType::Pointer rescale = RescaleType::New(); rescale -> SetInput (inputImage); rescale -> SetOutputMinimum (0); rescale -> SetOutputMaximum (255); rescale -> Update(); return rescale->GetOutput(); // outputImage = rescale -> GetOutput(); // return outputImage; } ////////////// //typedef itk::RescaleIntensityImageFilter < ImageType, ImageType > RescaleType; //RescaleType::Pointer rescale = RescaleType::New(); //rescale -> SetInput ( reader->GetOutput() ); //rescale -> SetOutputMinimum (0); //rescale -> SetOutputMaximum (255); From elena.bresciani87 at gmail.com Thu Jul 17 09:57:10 2014 From: elena.bresciani87 at gmail.com (elena bresciani) Date: Thu, 17 Jul 2014 15:57:10 +0200 Subject: [ITK-users] Fwd: [ITK] Using C++ functions in ITK pipeline In-Reply-To: References: Message-ID: Thank you very much Nicolas! Cheers Elena 2014-07-17 15:46 GMT+02:00 Nicolas Gallego : > > Hi Elena, > I compiled and tested your example code. > I found that there was a conflict between the return of the function and > the argument (output), > also I think output allocation on the function is not necesary since you > assign it a valid output. > Here a version of your code that worked. > > > Nicol?s Gallego-Ortiz > Universit? catholique de Louvain, Belgium > > > 2014-07-17 14:43 GMT+02:00 elena bresciani : > >> Hello guys, >> >> I'm developing a really complicated pipeline and to avoid repetitions and >> unreadeble code I thought of writing the different pieces of code as >> functions, each with a single specific purpose. >> Since I'm not really a C++ master I started with a very simple pipeline >> (reader -> rescale intensity filter -> writer), where the rescale intensity >> filter is in a separate function, outside the main(). >> The code compiles and it even runs but the output is not what it would >> have to be. >> >> Can someone help me find where is the error? >> >> Attached you can find my code, a test image and the respective output. >> >> Thanks in advance >> >> Elena >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> >> _______________________________________________ >> Community mailing list >> Community at itk.org >> http://public.kitware.com/mailman/listinfo/community >> >> > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jchoate at ononesoftware.com Fri Jul 18 15:39:54 2014 From: jchoate at ononesoftware.com (Jim Choate) Date: Fri, 18 Jul 2014 12:39:54 -0700 Subject: [ITK-users] Does ITK 4.6 support C++11 for OSX? Message-ID: <1258083356-318480384@mail.ononesoftware.com> Hi, has anyone successfully used ITK 4.6 with a project built in XCode 5 for C++11? Right now, we're getting 'Undefined symbols for architecture x86_64' for many symbols, such as itk::ProcessObject::MakeOutput when linking. The owner of ITK on our team says this is caused by ITK not supporting C++11.? Is this true? He rebuilt ITK 4.6 with C++11 flags. Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean at rogue-research.com Fri Jul 18 16:21:12 2014 From: sean at rogue-research.com (Sean McBride) Date: Fri, 18 Jul 2014 16:21:12 -0400 Subject: [ITK-users] Does ITK 4.6 support C++11 for OSX? In-Reply-To: <1258083356-318480384@mail.ononesoftware.com> References: <1258083356-318480384@mail.ononesoftware.com> Message-ID: <20140718202112.1276685154@mail.rogue-research.com> On Fri, 18 Jul 2014 12:39:54 -0700, Jim Choate said: >Hi, has anyone successfully used ITK 4.6 with a project built in XCode 5 >for C++11? > >Right now, we're getting 'Undefined symbols for architecture x86_64' for >many symbols, such as itk::ProcessObject::MakeOutput when linking. Are you building both the ITK libraries and your application with the same exact compiler, same STL library, and same C++ variant? ex: don't build one with gcc, libstdc++, C++03 and the other with clang, libc++, and C++11. You have to match them up. Cheers, -- ____________________________________________________________ Sean McBride, B. Eng sean at rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montr?al, Qu?bec, Canada From Jared.Becksfort at STJUDE.ORG Fri Jul 18 16:27:17 2014 From: Jared.Becksfort at STJUDE.ORG (Becksfort, Jared) Date: Fri, 18 Jul 2014 15:27:17 -0500 Subject: [ITK-users] Does ITK 4.6 support C++11 for OSX? In-Reply-To: <1258083356-318480384@mail.ononesoftware.com> References: <1258083356-318480384@mail.ononesoftware.com> Message-ID: <8172D639BA76A14AA5C9DE7E13E0CEBE7362BE71CF@10.stjude.org> I had trouble at one point with a C++11 build. My problem was that OSX 10.8 did not use the correct standard library by default. It used (I believe) cstdlib, but libc++ is what is needed. You can try your luck at using libc++ in the build commands or upgrade to 10.9 if you haven?t already. I am 99% sure I build ITK version 4.6 on it. I don?t have that computer handy at the moment so I can?t check. The computer is a work computer, so I actually just had it re-imaged to 10.9 rather than a straight upgrade. That could result in some differences potentially. Good Luck, Jared From: Insight-users [mailto:insight-users-bounces at itk.org] On Behalf Of Jim Choate Sent: Friday, July 18, 2014 2:40 PM To: insight-users at itk.org Subject: [ITK-users] Does ITK 4.6 support C++11 for OSX? Hi, has anyone successfully used ITK 4.6 with a project built in XCode 5 for C++11? Right now, we're getting 'Undefined symbols for architecture x86_64' for many symbols, such as itk::ProcessObject::MakeOutput when linking. The owner of ITK on our team says this is caused by ITK not supporting C++11. Is this true? He rebuilt ITK 4.6 with C++11 flags. Thank you! ________________________________ Email Disclaimer: www.stjude.org/emaildisclaimer Consultation Disclaimer: www.stjude.org/consultationdisclaimer -------------- next part -------------- An HTML attachment was scrubbed... URL: From dr.tim.allman at gmail.com Fri Jul 18 18:53:49 2014 From: dr.tim.allman at gmail.com (Tim Allman) Date: Fri, 18 Jul 2014 18:53:49 -0400 Subject: [ITK-users] Does ITK 4.6 support C++11 for OSX? In-Reply-To: <8172D639BA76A14AA5C9DE7E13E0CEBE7362BE71CF@10.stjude.org> References: <1258083356-318480384@mail.ononesoftware.com> <8172D639BA76A14AA5C9DE7E13E0CEBE7362BE71CF@10.stjude.org> Message-ID: <1D8EC044-D594-4A82-B83D-A094BAC13D9A@gmail.com> I have compiled ITK 4.6 successfully on OSX 10.9. The options I used in CMAKE_CXX_FLAGS are -std=gnu++11 -stdlib=libstdc++. The important option is -stdlib. The current default for clang++ is libc++ but the default for Xcode 5 is libstdc++ so if you are not careful you will get ITK built with one and your project built with the other. This will give linker errors. Tim On Jul 18, 2014, at 16:27 , Becksfort, Jared wrote: > I had trouble at one point with a C++11 build. My problem was that OSX 10.8 did not use the correct standard library by default. It used (I believe) cstdlib, but libc++ is what is needed. You can try your luck at using libc++ in the build commands or upgrade to 10.9 if you haven?t already. > > I am 99% sure I build ITK version 4.6 on it. I don?t have that computer handy at the moment so I can?t check. The computer is a work computer, so I actually just had it re-imaged to 10.9 rather than a straight upgrade. That could result in some differences potentially. > > Good Luck, > Jared > > From: Insight-users [mailto:insight-users-bounces at itk.org] On Behalf Of Jim Choate > Sent: Friday, July 18, 2014 2:40 PM > To: insight-users at itk.org > Subject: [ITK-users] Does ITK 4.6 support C++11 for OSX? > > Hi, has anyone successfully used ITK 4.6 with a project built in XCode 5 for C++11? > > Right now, we're getting 'Undefined symbols for architecture x86_64' for many symbols, such as itk::ProcessObject::MakeOutput when linking. > > The owner of ITK on our team says this is caused by ITK not supporting C++11. Is this true? > > He rebuilt ITK 4.6 with C++11 flags. > > Thank you! > > Email Disclaimer: www.stjude.org/emaildisclaimer > Consultation Disclaimer: www.stjude.org/consultationdisclaimer > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users From medswengineer at gmail.com Sun Jul 20 06:40:33 2014 From: medswengineer at gmail.com (med aweng) Date: Sun, 20 Jul 2014 12:40:33 +0200 Subject: [ITK-users] Gray Level Coocurrence Matrix In-Reply-To: References: Message-ID: Thanks a lot Dzenan for your kind reply. On Mon, Jul 14, 2014 at 12:29 PM, D?enan Zuki? wrote: > Take a look at this example: > http://www.itk.org/Wiki/ITK/Examples/Statistics/TextureFeatures > > You might be interested in this code: > https://github.com/blowekamp/itkTextureAnalysis > and this thread: > http://www.itk.org/pipermail/insight-users/2012-February/043764.html > > > On Sun, Jul 13, 2014 at 3:50 PM, med aweng > wrote: > >> Hello, >> >> I'm new to ITK, and trying to calculate the Gray Level Coocurrence Matrix >> (GLCM) features of some image. >> >> I have started as follows: >> >> typedef itk::Image< double, 3 > MyImageType; >> >> I found that there are two classes to use for my task: >> >> ScalarImageToGreyLevelCooccurrenceMatrixGenerator >> >> >> GreyLevelCooccurrenceMatrixTextureCoefficientsCalculator >> >> >> Can you just kindly guide me on how to go further with building this >> program, just for me to know how the structure of an ITK program should >> look like? >> >> Thanks. >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From medswengineer at gmail.com Sun Jul 20 06:43:27 2014 From: medswengineer at gmail.com (med aweng) Date: Sun, 20 Jul 2014 12:43:27 +0200 Subject: [ITK-users] Grey Level Run Length Matrix Message-ID: I'm trying to implement the "Grey Level Run Length Matrix" in ITK. I'm just having some issues on how to start with that. I came to the following function: http://www.itk.org/Doxygen/html/classitk_1_1Statistics_1_1ScalarImageToRunLengthMatrixFilter.html Would that function be the starting point? Can you just kindly guide me how to start with that? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From medswengineer at gmail.com Sun Jul 20 09:30:27 2014 From: medswengineer at gmail.com (med aweng) Date: Sun, 20 Jul 2014 15:30:27 +0200 Subject: [ITK-users] Question about "ScalarImageToRunLengthMatrixFilter" Message-ID: Hello, I have a question about the "ScalarImageToRunLengthMatrixFilter" here: http://www.itk.org/Doxygen/html/classitk_1_1Statistics_1_1ScalarImageToRunLengthMatrixFilter.html - What does the "THistogramFrequencyContainer" mean? - How can I obtain its value? -------------- next part -------------- An HTML attachment was scrubbed... URL: From medswengineer at gmail.com Mon Jul 21 07:44:12 2014 From: medswengineer at gmail.com (med aweng) Date: Mon, 21 Jul 2014 13:44:12 +0200 Subject: [ITK-users] (no subject) Message-ID: Hello, In the following example: http://www.itk.org/Wiki/ITK/Examples/Statistics/TextureFeatures When it says: //calculate features for one offset What does this mean? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From medswengineer at gmail.com Mon Jul 21 10:53:18 2014 From: medswengineer at gmail.com (med aweng) Date: Mon, 21 Jul 2014 16:53:18 +0200 Subject: [ITK-users] Offset type Message-ID: Hi, What is meant by the "OffsetType" in this code? https://github.com/ComplexSystemsModeling/DCMTK-ITK/blob/master/Modules/Numerics/Statistics/test/itkScalarImageToRunLengthMatrixFilterTest.cxx Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Mon Jul 21 12:44:09 2014 From: daviddoria at gmail.com (David Doria) Date: Mon, 21 Jul 2014 12:44:09 -0400 Subject: [ITK-users] Offset type In-Reply-To: References: Message-ID: On Mon, Jul 21, 2014 at 10:53 AM, med aweng wrote: > Hi, > > What is meant by the "OffsetType" in this code? > > > https://github.com/ComplexSystemsModeling/DCMTK-ITK/blob/master/Modules/Numerics/Statistics/test/itkScalarImageToRunLengthMatrixFilterTest.cxx > > Thanks. > OffsetType is an instance of this class: http://www.itk.org/Doxygen/html/classitk_1_1Offset.html that is compatible with the ImageType. David -------------- next part -------------- An HTML attachment was scrubbed... URL: From medswengineer at gmail.com Mon Jul 21 14:24:07 2014 From: medswengineer at gmail.com (med aweng) Date: Mon, 21 Jul 2014 20:24:07 +0200 Subject: [ITK-users] Offset directions Message-ID: Hello, For the directions (degrees): 0, 45, 90, 135, if I want to apply them on an image, I knew that for instance here: https://github.com/ComplexSystemsModeling/DCMTK-ITK/blob/master/Modules/Numerics/Statistics/test/itkScalarImageToRunLengthMatrixFilterTest.cxx {0,-1} is "vertical", and {-1,0} is "horizontal". Can you kindly just clarify to me how it was known that the first is vertical and the later is horizontal? And, if we want to represent 35 degrees and 135 degrees, how will this be represented? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahmed at mufradat.com Tue Jul 22 03:37:05 2014 From: ahmed at mufradat.com (ahmed at mufradat.com) Date: Tue, 22 Jul 2014 09:37:05 +0200 Subject: [ITK-users] Smartpointer as a default parameter for a function Message-ID: <74500304cea08473af6cfd3b37c686c6@mufradat.com> Hello All, Suppose I have class like class A{ public: A(int a, ImageType::Pointer ptr){ // whatever! } }; My question is, what's the default value for that ptr? I'd like to be able to create an instance of that class using A myA(5); so for the definition of the constructor of A: A(int a, ImageType::Pointer ptr = WHAT?) Best regards, Ahmed From bilgincc at gmail.com Tue Jul 22 03:58:17 2014 From: bilgincc at gmail.com (Cagatay Bilgin) Date: Tue, 22 Jul 2014 00:58:17 -0700 Subject: [ITK-users] Motion under Mean Curvature with LevelSetv4 Framework Message-ID: Dear ITK Community, I am trying to familiarize myself with the new level set classes. My goal is to simulate motion under mean curvature using the new design. I have put together the following, looking at the examples and tests. http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3872740/ is a great source to understand the design and tests in source directory are very helpful, thank you for the resources! The test scenario I have is a L shaped object. I would expect the object to become somewhat ellipse and then disappear at the end of the evolution. However I get the following results attached to the email. I don't quite follow these results. Am I missing something obvious? Here is the code and CMakeLists.txt. I ran the program with ./Motion 100 0 0 0.05 #include "itkBinaryImageToLevelSetImageAdaptor.h" #include "itkImageFileReader.h" #include "itkLevelSetContainer.h" #include "itkLevelSetEquationPropagationTerm.h" #include "itkLevelSetEquationAdvectionTerm2.h" #include "itkLevelSetEquationContainer.h" #include "itkLevelSetEquationTermContainer.h" #include "itkLevelSetEvolution.h" #include "itkLevelSetEvolutionNumberOfIterationsStoppingCriterion.h" #include "itkLevelSetDenseImage.h" #include "itkVTKVisualizeImageLevelSetIsoValues.h" #include "itkSinRegularizedHeavisideStepFunction.h" #include "itkLevelSetIterationUpdateCommand.h" #include "itkLevelSetEquationCurvatureTerm.h" #include "itkCastImageFilter.h" #include "itkWhitakerSparseLevelSetImage.h" #include "itkSpatialObjectToImageFilter.h" #include "itkEllipseSpatialObject.h" typedef itk::Image< float, 2 > FIT; /* * L Shape */ void CreateSquareImage(FIT::Pointer image) { FIT::RegionType region; FIT::IndexType start; start[0] = 0; start[1] = 0; FIT::SizeType size; size[0] = 200; size[1] = 300; region.SetSize(size); region.SetIndex(start); image->SetRegions(region); image->Allocate(); // Set pixels in a square to one value for(unsigned int r = 20; r < 160; r++) { for(unsigned int c = 30; c < 100; c++) { FIT::IndexType pixelIndex; pixelIndex[0] = r; pixelIndex[1] = c; image->SetPixel(pixelIndex, 255); } } for(unsigned int r = 20; r < 80; r++) { for(unsigned int c = 100; c < 200; c++) { FIT::IndexType pixelIndex; pixelIndex[0] = r; pixelIndex[1] = c; image->SetPixel(pixelIndex, 255); } } } /* */ int main( int argc, char* argv[] ) { if( argc != 5) { std::cerr << "Missing Arguments" << std::endl; std::cerr << argv[0] << std::endl; std::cerr << "1- Number of Iterations" << std::endl; std::cerr << "2- Propagation Term" << std::endl; std::cerr << "3- Advection Term" << std::endl; std::cerr << "4- Curvature Term" << std::endl; return EXIT_FAILURE; } // Image Dimension const unsigned int Dimension = 2; typedef unsigned char InputPixelType; typedef itk::Image< InputPixelType, Dimension > IIT; typedef itk::Image< float, 2 > FIT; FIT::Pointer input = FIT::New(); CreateSquareImage(input); int numberOfIterations = atoi( argv[1]); typedef float LevelSetPixelType; typedef itk::Image< LevelSetPixelType, Dimension > LSIT; typedef itk::LevelSetDenseImage< LSIT > LST; //typedef itk::WhitakerSparseLevelSetImage< LevelSetPixelType, 2 > LST; typedef LST::OutputType LevelSetOutputType; typedef LST::OutputRealType LevelSetRealType; // convert a binary mask to a level-set function typedef itk::BinaryImageToLevelSetImageAdaptor BI2LST; BI2LST::Pointer adaptor = BI2LST::New(); adaptor->SetInputImage( input ); adaptor->Initialize(); LST::Pointer levelSet = adaptor->GetLevelSet(); // The Heaviside function typedef itk::SinRegularizedHeavisideStepFunction< LevelSetRealType, LevelSetRealType > HeavisideFunctionType; HeavisideFunctionType::Pointer heaviside = HeavisideFunctionType::New(); heaviside->SetEpsilon( 1 ); // Create the level set container typedef itk::LevelSetContainer< itk::IdentifierType, LST > LSContainerT; LSContainerT::Pointer levelSetContainer = LSContainerT::New(); levelSetContainer->SetHeaviside( heaviside ); levelSetContainer->AddLevelSet( 0, levelSet ); // Create the terms. typedef itk::LevelSetEquationPropagationTerm PropagationTermType; PropagationTermType::Pointer propagationTerm = PropagationTermType::New(); propagationTerm->SetInput(input); propagationTerm->SetCoefficient(atof(argv[2])); typedef itk::LevelSetEquationAdvectionTerm2 AdvectionTermType; AdvectionTermType::Pointer advectionTerm = AdvectionTermType::New(); advectionTerm->SetInput(input); advectionTerm->SetCoefficient(atof(argv[3])); typedef itk::LevelSetEquationCurvatureTerm CurvatureTermType; CurvatureTermType::Pointer curvatureTerm = CurvatureTermType::New(); //curvatureTerm->SetInput(input); curvatureTerm->SetCoefficient(atof(argv[4])); // Create term container (equation rhs) typedef itk::LevelSetEquationTermContainer< FIT, LSContainerT > TermContainerType; TermContainerType::Pointer termContainer = TermContainerType::New(); termContainer->SetLevelSetContainer( levelSetContainer ); termContainer->SetInput( input ); //termContainer->AddTerm( 0, propagationTerm ); //termContainer->AddTerm( 1, advectionTerm ); termContainer->AddTerm( 0, curvatureTerm ); // Create equation container typedef itk::LevelSetEquationContainer< TermContainerType > EquationContainerType; EquationContainerType::Pointer equationContainer = EquationContainerType::New(); equationContainer->SetLevelSetContainer( levelSetContainer ); equationContainer->AddEquation( 0, termContainer ); // Create stopping criteria typedef itk::LevelSetEvolutionNumberOfIterationsStoppingCriterion< LSContainerT > StoppingCriterionType; StoppingCriterionType::Pointer criterion = StoppingCriterionType::New(); criterion->SetNumberOfIterations( numberOfIterations ); // Create the visualizer typedef itk::VTKVisualizeImageLevelSetIsoValues< FIT, LST > VisualizationType; VisualizationType::Pointer visualizer = VisualizationType::New(); visualizer->SetInputImage( input ); visualizer->SetLevelSet( levelSet ); visualizer->SetScreenCapture( true ); // Create evolution class typedef itk::LevelSetEvolution< EquationContainerType, LST > LevelSetEvolutionType; LevelSetEvolutionType::Pointer evolution = LevelSetEvolutionType::New(); evolution->SetEquationContainer( equationContainer ); evolution->SetStoppingCriterion( criterion ); evolution->SetLevelSetContainer( levelSetContainer ); typedef itk::LevelSetIterationUpdateCommand< LevelSetEvolutionType, VisualizationType > IterationUpdateCommandType; IterationUpdateCommandType::Pointer iterationUpdateCommand = IterationUpdateCommandType::New(); iterationUpdateCommand->SetFilterToUpdate( visualizer ); iterationUpdateCommand->SetUpdatePeriod( 1 ); evolution->AddObserver( itk::IterationEvent(), iterationUpdateCommand ); evolution->Update(); return EXIT_SUCCESS; } cmake_minimum_required(VERSION 2.8) project(CurvatureMotion) find_package(ITK REQUIRED) include(${ITK_USE_FILE}) find_package(VTK REQUIRED) include(${VTK_USE_FILE}) add_executable(Motion main.cpp) target_link_libraries(Motion ${ITK_LIBRARIES} ${VTK_LIBRARIES}) [image: Inline image 4][image: Inline image 3] -- Cemal Cagatay Bilgin, PhD Life Sciences Division Lawrence Berkeley National Lab MS977, One Cyclotron Road Berkeley, CA 94720, USA Email: ccbilgin at lbl.gov -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: levelset_000.png Type: image/png Size: 2652 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: levelset_040.png Type: image/png Size: 3421 bytes Desc: not available URL: From marco.ulge at gmail.com Tue Jul 22 04:39:22 2014 From: marco.ulge at gmail.com (Marco Ulge) Date: Tue, 22 Jul 2014 01:39:22 -0700 (PDT) Subject: [ITK-users] Offset directions In-Reply-To: References: Message-ID: <1406018362419-34277.post@n7.nabble.com> Offsets are defined in ITK wether you are using them for GLCM or Neighborhood Iterators for example. I believe you can find a complete list off offset in the Software Guide in the Neighborhood Iterator section (chapter 11). Anyway here's the list of offsets (with distance = 1): 0 degree : {1,0} 45 degree: {1, -1} 90 degree: {0,-1} 135 degree: {-1,-1} 180 degree: {-1,0} 225 degree: {-1,1} 270 degree: {0,1} 315 degree: {1,1} Please notice that there is no offset for 35 degrees, that just doesn't make sense Marco -- View this message in context: http://itk-users.7.n7.nabble.com/ITK-users-Offset-directions-tp34274p34277.html Sent from the ITK - Users mailing list archive at Nabble.com. From vincent.ngai at gmail.com Tue Jul 22 04:49:02 2014 From: vincent.ngai at gmail.com (vincent ngai) Date: Tue, 22 Jul 2014 16:49:02 +0800 Subject: [ITK-users] Smartpointer as a default parameter for a function In-Reply-To: <74500304cea08473af6cfd3b37c686c6@mufradat.com> References: <74500304cea08473af6cfd3b37c686c6@mufradat.com> Message-ID: Technically it should be A(int a, ImageType::Pointer ptr = ImageType::Pointer() ); But I"m not sure if parameter defaults are supported on non-POD parameter types. Why not just overload the ctor and create another class A { A(int a, ImageType::Pointer ptr); A( int a ); }; On Tue, Jul 22, 2014 at 3:37 PM, wrote: > Hello All, > > Suppose I have class like > > class A{ > public: > A(int a, ImageType::Pointer ptr){ > // whatever! > } > }; > > My question is, what's the default value for that ptr? I'd like to be able > to create an instance of that class using > > A myA(5); > > so for the definition of the constructor of A: > > A(int a, ImageType::Pointer ptr = WHAT?) > > Best regards, > Ahmed > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > -- Regards, Vincent -------------- next part -------------- An HTML attachment was scrubbed... URL: From medswengineer at gmail.com Tue Jul 22 06:26:12 2014 From: medswengineer at gmail.com (med aweng) Date: Tue, 22 Jul 2014 12:26:12 +0200 Subject: [ITK-users] Should we use two braces with the offset? Message-ID: Hi, As you can see in the following statement: InputImageType::OffsetType offset1 = {{0, -1}}; >From here:https://github.com/ComplexSystemsModeling/DCMTK-ITK/blob/master/Modules/Numerics/Statistics/test/itkScalarImageToRunLengthMatrixFilterTest.cxx Two braces have been used with the "offset". Should this be done? Why is that? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From medswengineer at gmail.com Tue Jul 22 06:32:54 2014 From: medswengineer at gmail.com (med aweng) Date: Tue, 22 Jul 2014 12:32:54 +0200 Subject: [ITK-users] OffsetVectorPointer and OffsetVector Message-ID: Hi, Following the code here: https://github.com/ComplexSystemsModeling/DCMTK-ITK/blob/master/Modules/Numerics/Statistics/test/itkScalarImageToRunLengthMatrixFilterTest.cxx I came to the following statement: FilterType::OffsetVectorPointer offsetV = FilterType::OffsetVector::New(); - What do "OffsetVectorPointer" and "OffsetVector" mean? Why do we need them here? - I tried to find the documentation for them, but couldn't find the documentation. Do you know a link that refers to those? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Tue Jul 22 07:51:22 2014 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Tue, 22 Jul 2014 07:51:22 -0400 Subject: [ITK-users] Should we use two braces with the offset? In-Reply-To: References: Message-ID: How this helps: http://en.cppreference.com/w/cpp/language/aggregate_initialization On Jul 22, 2014, at 6:26 AM, med aweng wrote: > Hi, > > As you can see in the following statement: > > InputImageType::OffsetType offset1 = {{0, -1}}; > > > From here:https://github.com/ComplexSystemsModeling/DCMTK-ITK/blob/master/Modules/Numerics/Statistics/test/itkScalarImageToRunLengthMatrixFilterTest.cxx > > > Two braces have been used with the "offset". Should this be done? Why is that? > > Thanks. > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From medswengineer at gmail.com Tue Jul 22 08:04:48 2014 From: medswengineer at gmail.com (med aweng) Date: Tue, 22 Jul 2014 14:04:48 +0200 Subject: [ITK-users] Should we use two braces with the offset? In-Reply-To: References: Message-ID: Thanks a lot Bradely... On Tue, Jul 22, 2014 at 1:51 PM, Bradley Lowekamp wrote: > How this helps: > > http://en.cppreference.com/w/cpp/language/aggregate_initialization > > > On Jul 22, 2014, at 6:26 AM, med aweng wrote: > > Hi, > > As you can see in the following statement: > > InputImageType::OffsetType offset1 = {{0, -1}}; > > From here:https://github.com/ComplexSystemsModeling/DCMTK-ITK/blob/master/Modules/Numerics/Statistics/test/itkScalarImageToRunLengthMatrixFilterTest.cxx > > Two braces have been used with the "offset". Should this be done? Why is that? > > Thanks. > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From medswengineer at gmail.com Tue Jul 22 08:05:30 2014 From: medswengineer at gmail.com (med aweng) Date: Tue, 22 Jul 2014 14:05:30 +0200 Subject: [ITK-users] Offset directions In-Reply-To: References: <1406018362419-34277.post@n7.nabble.com> Message-ID: > > Thanks a lot Marco for your thorough explanation. I know how the degrees > will look like, but, the main issue was for instance why 45 degrees' offset > is {1,-1}, and likewise for the other degrees. Is that just a convention? > Or, there is a way to find that 45 degrees is {1,-1}? > > Thanks. > > > On Tue, Jul 22, 2014 at 12:52 PM, Marco Ulgelmo > wrote: > >> Let's make an example, let's suppose that you have a 4x4 matrix defined >> this way: >> >> A = [0, 1, 0, 2 >> 0, 2 , 1, 1 >> 3, 1, 0, 0 >> 0, 0, 2, 3] >> >> with distance 1 and direction = 45 degrees >> >> The GLCM associated to A will be a 4x4 matrix because values in A are >> from 0 to 3. If A had values ranging from 0 to 7 than the GLCM would have >> been 8x8. GLCM by definition tells you the grey level occurrences. >> >> Now our goal is to understand how we should populate the GLCM matrix. >> Let's start from GLCM[0][0]. Since as i said before the GLCM tells you the >> occurrences in gray level, GLCM[0][0] will be the number of occurrences of >> (0, 0) according to 45 degrees. >> So you take each pixel in the A matrix which is 0 and count the pairs for >> each 0 which has a 0 with distance 1 in its 45 degree diagonal. In A we can >> easily observe the only A[3][1] satisfies this property, in fact we take >> take pixel, we notice that the pixel according to 45 degree direction will >> be 0 so we found a pair (0,0) with the required direction. >> >> Since there is only 1 occurrence of (0, 0) with direction= 45 degrees, >> GLCM[0][0] will be 1 (infact 1 is the number of occurrences). >> >> In the same way, GLCM[1][0] will look for all the occurrences of pair >> (1,0) with direction 45 degrees and we can observe that there are no >> occurrences in A so GLCM[1][0] = 0. >> >> GLCM[2][0] = 2 (A[1][1] and A[3][2] satify the direction) and so on. >> >> I suggest you taking a look at this example: >> http://www.itk.org/Wiki/ITK/Examples/Statistics/TextureFeatures >> >> Beside what this code does (which is not what you are looking for maybe), >> you can see that it's enough changin the line >> >> glcmGenerator->SetOffset(offset); >> >> >> with the offset you want. >> >> >> If you need to compute GLCM for different directions (obtaining a single >> GLCM as result), you first compute GLCM for each direction and then compute >> finalGLCM as a mean of the others GLCM >> >> Regards, >> >> Marco >> >> >> 2014-07-22 12:13 GMT+02:00 med aweng : >> >> Dear Marco, >>> >>> Thanks a lot for your reply and very helpful answer. For instance, when >>> we say that {1,-1} is 45 degrees. How can this be understood geometrically? >>> In other words, say that I have an image represented as a set of pixels >>> (squares). How can I derive that {1,-1} for instance mean 45 degrees, and >>> likewise for the other degrees? >>> >>> Thanks. >>> >>> >>> On Tue, Jul 22, 2014 at 10:39 AM, Marco Ulge >>> wrote: >>> >>>> Offsets are defined in ITK wether you are using them for GLCM or >>>> Neighborhood >>>> Iterators for example. I believe you can find a complete list off >>>> offset in >>>> the Software Guide in the Neighborhood Iterator section (chapter 11). >>>> >>>> Anyway here's the list of offsets (with distance = 1): >>>> >>>> 0 degree : {1,0} >>>> 45 degree: {1, -1} >>>> 90 degree: {0,-1} >>>> 135 degree: {-1,-1} >>>> 180 degree: {-1,0} >>>> 225 degree: {-1,1} >>>> 270 degree: {0,1} >>>> 315 degree: {1,1} >>>> >>>> Please notice that there is no offset for 35 degrees, that just doesn't >>>> make >>>> sense >>>> >>>> Marco >>>> >>>> >>>> >>>> >>>> -- >>>> View this message in context: >>>> http://itk-users.7.n7.nabble.com/ITK-users-Offset-directions-tp34274p34277.html >>>> Sent from the ITK - Users mailing list archive at Nabble.com. >>>> _____________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Kitware offers ITK Training Courses, for more information visit: >>>> http://www.kitware.com/products/protraining.php >>>> >>>> Please keep messages on-topic and check the ITK FAQ at: >>>> http://www.itk.org/Wiki/ITK_FAQ >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/insight-users >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Tue Jul 22 08:37:43 2014 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Tue, 22 Jul 2014 08:37:43 -0400 Subject: [ITK-users] [ITK] Smartpointer as a default parameter for a function In-Reply-To: References: <74500304cea08473af6cfd3b37c686c6@mufradat.com> Message-ID: <32E9224C-0DE8-41F0-B796-B89BEAA63A63@mail.nih.gov> Hello, You can use just about any object type for a default parameter, and pass parameters to the constructor too. You want to be very careful with constructor with only one parameter especial just an integer. A constructor with just one parameter can be used for implicit conversion. Add the "explicit" keyword before to prevent this: class A { explicit A(int A, PointerType ptr = NULL ) }; And that takes advantage of the implicit conversion with the smart pointer constructor. Hope that help, Brad On Jul 22, 2014, at 4:49 AM, vincent ngai wrote: > Technically it should be A(int a, ImageType::Pointer ptr = ImageType::Pointer() ); > > But I"m not sure if parameter defaults are supported on non-POD parameter types. Why not just overload the ctor and create another > class A > { > A(int a, ImageType::Pointer ptr); > A( int a ); > }; > > > On Tue, Jul 22, 2014 at 3:37 PM, wrote: > Hello All, > > Suppose I have class like > > class A{ > public: > A(int a, ImageType::Pointer ptr){ > // whatever! > } > }; > > My question is, what's the default value for that ptr? I'd like to be able to create an instance of that class using > > A myA(5); > > so for the definition of the constructor of A: > > A(int a, ImageType::Pointer ptr = WHAT?) > > Best regards, > Ahmed > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > > > -- > Regards, > Vincent > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community -------------- next part -------------- An HTML attachment was scrubbed... URL: From davis.vigneault at gmail.com Tue Jul 22 17:53:01 2014 From: davis.vigneault at gmail.com (DVigneault) Date: Tue, 22 Jul 2014 14:53:01 -0700 (PDT) Subject: [ITK-users] Assigning to VariableSizeMatrix Message-ID: <1406065981751-34285.post@n7.nabble.com> All-- I'm getting a segmentation fault upon attempting to assign to an itk::VariableSizeMatrix. I tried to find an example of its usage in the doxygen, wiki, and software manual, but didn't see one. Here's a minimal example of my problem: #include "itkVariableSizeMatrix.h" int main( int argc, char * argv[] ) { if( argc != 1 ) { std::cerr << "Usage: " << argv[0] << std::endl; return EXIT_FAILURE; } typedef itk::VariableSizeMatrix< double > MatrixType; MatrixType matrix; matrix(0,0) = 1.0; // Segmentation fault: 11 return EXIT_SUCCESS; } Can anyone point out my mistake, or point me toward an example? Best, and thanks, --Davis -- View this message in context: http://itk-users.7.n7.nabble.com/Assigning-to-VariableSizeMatrix-tp34285.html Sent from the ITK - Users mailing list archive at Nabble.com. From blowekamp at mail.nih.gov Tue Jul 22 17:58:29 2014 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Tue, 22 Jul 2014 17:58:29 -0400 Subject: [ITK-users] Assigning to VariableSizeMatrix In-Reply-To: <1406065981751-34285.post@n7.nabble.com> References: <1406065981751-34285.post@n7.nabble.com> Message-ID: Where do you set the size of the matrix? Likely this the buffer is initialized to NULL and being dereferenced. Likely you should do it in the constructor[1] or with the SetSize method[2]. Brad [1] http://www.itk.org/Doxygen/html/classitk_1_1VariableSizeMatrix.html#a42fd764a36e3a229de900bcec3997de7 [2] http://www.itk.org/Doxygen/html/classitk_1_1VariableSizeMatrix.html#a422d01338a63aa30041b1fc7c7e504a2 On Jul 22, 2014, at 5:53 PM, DVigneault wrote: > All-- > > I'm getting a segmentation fault upon attempting to assign to an > itk::VariableSizeMatrix. I tried to find an example of its usage in the > doxygen, wiki, and software manual, but didn't see one. Here's a minimal > example of my problem: > > #include "itkVariableSizeMatrix.h" > > int main( int argc, char * argv[] ) > { > > if( argc != 1 ) > { > std::cerr << "Usage: " << argv[0] << std::endl; > return EXIT_FAILURE; > } > > typedef itk::VariableSizeMatrix< double > MatrixType; > > MatrixType matrix; > matrix(0,0) = 1.0; // Segmentation fault: 11 > > return EXIT_SUCCESS; > > } > > Can anyone point out my mistake, or point me toward an example? > > Best, and thanks, > > --Davis > > > > -- > View this message in context: http://itk-users.7.n7.nabble.com/Assigning-to-VariableSizeMatrix-tp34285.html > Sent from the ITK - Users mailing list archive at Nabble.com. > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users From davis.vigneault at gmail.com Tue Jul 22 18:29:25 2014 From: davis.vigneault at gmail.com (DVigneault) Date: Tue, 22 Jul 2014 15:29:25 -0700 (PDT) Subject: [ITK-users] Assigning to VariableSizeMatrix In-Reply-To: References: <1406065981751-34285.post@n7.nabble.com> Message-ID: <1406068165960-34287.post@n7.nabble.com> Thanks very much, Brad! I did not set the size--I thought that in a variable matrix the size would be implied from the index I gave it when assigning to it. Thanks again, --Davis -- View this message in context: http://itk-users.7.n7.nabble.com/Assigning-to-VariableSizeMatrix-tp34285p34287.html Sent from the ITK - Users mailing list archive at Nabble.com. From nady.khalily at gmail.com Wed Jul 23 05:19:58 2014 From: nady.khalily at gmail.com (Nadieh Khalili) Date: Wed, 23 Jul 2014 11:19:58 +0200 Subject: [ITK-users] 4D Dicom sorting Message-ID: Hi I have 4D DCE images and already wrote a code to order and make 3d images from 4D dicom images, for sorting of images, I used acquisition number from dicom tags and divide total number of slices to got slice number, but in two of my data the acquisition number is not true(don't know why). So when I look at 3D image, it is one and half of normal image. I am thinking to use slice number tags directly( 0054,0081) but because I have 3d images, my program just crash during debugging. Do you have any idea how to use that? any other ideas for achieving slice number are well com. Cheers, Nady -------------- next part -------------- An HTML attachment was scrubbed... URL: From medswengineer at gmail.com Wed Jul 23 06:19:06 2014 From: medswengineer at gmail.com (med aweng) Date: Wed, 23 Jul 2014 12:19:06 +0200 Subject: [ITK-users] VectorContainer Message-ID: Hi, I came about the VectorContainer here: http://www.itk.org/Doxygen/html/classitk_1_1VectorContainer.html The description of the class was not clear. Can you kindly clarify what is the purpose of this class? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From elena.bresciani87 at gmail.com Wed Jul 23 06:20:56 2014 From: elena.bresciani87 at gmail.com (elena bresciani) Date: Wed, 23 Jul 2014 12:20:56 +0200 Subject: [ITK-users] Fwd: ERROR: MeanSquaresImageToImageMetric: Too many samples map outside moving image buffer In-Reply-To: References: Message-ID: Hello folks, I have a registration problem for you. I'm using the code in the example ImageRegistration5.cxx in order to align image of drugs blisters to assess if they are the same or not. The code works well even though for certain images couples I get the error in this message object. I thought the problem could be the relative difference in images size and tried to pad the smallest one to have the same size as the biggest: same error. After reading comments on the same topic I tried to add to the code the line registration -> SetFixedImageRegion (fixedImage -> GetBufferedRegion()); again not solving my problem. Attached you can find example images: while I can register image "1" on image "0", if I try to register "2" on "1" I get the ERROR. Any guess? Cheers, Elena [image: Immagine in linea 3][image: Immagine in linea 2][image: Immagine in linea 1] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 2.jpg Type: image/jpeg Size: 43787 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0.jpg Type: image/jpeg Size: 43096 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 1.jpg Type: image/jpeg Size: 43321 bytes Desc: not available URL: From medswengineer at gmail.com Wed Jul 23 06:52:53 2014 From: medswengineer at gmail.com (med aweng) Date: Wed, 23 Jul 2014 12:52:53 +0200 Subject: [ITK-users] typename keyword Message-ID: Hi, I know that this question may be a C++ more question, but thought of asking it here as I couldn't find a clear explanation of the issue. In the page here: https://github.com/ComplexSystemsModeling/DCMTK-ITK/blob/master/Modules/Numerics/Statistics/include/itkScalarImageToRunLengthMatrixFilter.h#L129 I came about this statement: typedef typename ImageType::OffsetType OffsetType; What does "typename" mean here? When do we use it? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From daviddoria at gmail.com Wed Jul 23 07:04:10 2014 From: daviddoria at gmail.com (David Doria) Date: Wed, 23 Jul 2014 07:04:10 -0400 Subject: [ITK-users] typename keyword In-Reply-To: References: Message-ID: On Wed, Jul 23, 2014 at 6:52 AM, med aweng wrote: > Hi, > > I know that this question may be a C++ more question, but thought of > asking it here as I couldn't find a clear explanation of the issue. > > In the page here: > https://github.com/ComplexSystemsModeling/DCMTK-ITK/blob/master/Modules/Numerics/Statistics/include/itkScalarImageToRunLengthMatrixFilter.h#L129 > > I came about this statement: > > typedef typename ImageType::OffsetType OffsetType; > > What does "typename" mean here? When do we use it? > > Thanks. > > http://en.wikipedia.org/wiki/Typename -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Wed Jul 23 07:47:51 2014 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Wed, 23 Jul 2014 07:47:51 -0400 Subject: [ITK-users] ERROR: MeanSquaresImageToImageMetric: Too many samples map outside moving image buffer In-Reply-To: References: Message-ID: What is the error you are getting? Brad On Jul 23, 2014, at 6:20 AM, elena bresciani wrote: > Hello folks, > > I have a registration problem for you. I'm using the code in the example ImageRegistration5.cxx in order to align image of drugs blisters to assess if they are the same or not. > > The code works well even though for certain images couples I get the error in this message object. > I thought the problem could be the relative difference in images size and tried to pad the smallest one to have the same size as the biggest: same error. > After reading comments on the same topic I tried to add to the code the line > > registration -> SetFixedImageRegion (fixedImage -> GetBufferedRegion()); > > again not solving my problem. > Attached you can find example images: while I can register image "1" on image "0", if I try to register "2" on "1" I get the ERROR. > > Any guess? > > Cheers, > Elena > > > > <0.jpg><1.jpg><2.jpg> > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users From blowekamp at mail.nih.gov Wed Jul 23 07:49:48 2014 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Wed, 23 Jul 2014 07:49:48 -0400 Subject: [ITK-users] [ITK] VectorContainer In-Reply-To: References: Message-ID: <2064C252-C343-42CF-9D83-26BA8086B044@mail.nih.gov> Hello, This class is a wrapper for std::vector in a class derived from itk::Object. This allows the object to be used with ITK smart pointers, and other features in the base class. Brad On Jul 23, 2014, at 6:19 AM, med aweng wrote: > Hi, > > I came about the VectorContainer here: http://www.itk.org/Doxygen/html/classitk_1_1VectorContainer.html > > The description of the class was not clear. Can you kindly clarify what is the purpose of this class? > > Thanks. > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community -------------- next part -------------- An HTML attachment was scrubbed... URL: From medswengineer at gmail.com Wed Jul 23 07:53:52 2014 From: medswengineer at gmail.com (med aweng) Date: Wed, 23 Jul 2014 13:53:52 +0200 Subject: [ITK-users] push_back Message-ID: Hello, What is "push_back" used for in ITK? I tried to find a documentation for that but wasn't able to. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From medswengineer at gmail.com Wed Jul 23 07:55:25 2014 From: medswengineer at gmail.com (med aweng) Date: Wed, 23 Jul 2014 13:55:25 +0200 Subject: [ITK-users] [ITK] VectorContainer In-Reply-To: <2064C252-C343-42CF-9D83-26BA8086B044@mail.nih.gov> References: <2064C252-C343-42CF-9D83-26BA8086B044@mail.nih.gov> Message-ID: Hello Bradely, Thanks for your kind reply. So, it is basically a "vector", is that right? But, made to be used with ITK? Thanks. On Wed, Jul 23, 2014 at 1:49 PM, Bradley Lowekamp wrote: > Hello, > > This class is a wrapper for std::vector in a class derived from > itk::Object. This allows the object to be used with ITK smart pointers, and > other features in the base class. > > Brad > > On Jul 23, 2014, at 6:19 AM, med aweng wrote: > > Hi, > > I came about the VectorContainer here: > http://www.itk.org/Doxygen/html/classitk_1_1VectorContainer.html > > The description of the class was not clear. Can you kindly clarify what is > the purpose of this class? > > Thanks. > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Wed Jul 23 07:59:01 2014 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Wed, 23 Jul 2014 07:59:01 -0400 Subject: [ITK-users] push_back In-Reply-To: References: Message-ID: <1D841E04-01AD-41B8-9135-9F0A081F3415@mail.nih.gov> Hello, I am unfortunately not sure how to help you again with this question. Perhaps this would help: http://www.vtk.org/Wiki/VTK/FAQ#How_should_I_ask_questions_on_the_mailing_lists.3F Brad On Jul 23, 2014, at 7:53 AM, med aweng wrote: > Hello, > > What is "push_back" used for in ITK? I tried to find a documentation for that but wasn't able to. > > Thanks. > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users From medswengineer at gmail.com Wed Jul 23 08:07:24 2014 From: medswengineer at gmail.com (med aweng) Date: Wed, 23 Jul 2014 14:07:24 +0200 Subject: [ITK-users] Implementing the Gray Level Run Length algorithm Message-ID: Hello, I have understood how the "Gray Level Run Length" method works, and trying to implement that in ITK. I'm kind of new to ITK, and just need some guidance on how to proceed. This is what I have done so far for instance: typedef itk::Image InputImageType; typedef itk::Statistics::ScalarImageToRunLengthMatrixFilter FilterType; typedef VectorContainer OffsetVector; typedef typename OffsetVector::Pointer OffsetVectorPointer; InputImageType::Pointer image = InputImageType::New(); FilterType::Pointer filter = FilterType::New(); filter->SetInput(image); InputImageType::OffsetType offset1 ={{1,0}}; FilterType::OffsetVectorPointer offsetV = FilterType::OffsetVector::New(); offsetV.push_back(offset1); filter->SetOffsets(offsetV); Any guidance or hints on how to proceed on that? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jhlegarreta at vicomtech.org Wed Jul 23 08:16:59 2014 From: jhlegarreta at vicomtech.org (Jon Haitz Legarreta) Date: Wed, 23 Jul 2014 14:16:59 +0200 Subject: [ITK-users] Implementing the Gray Level Run Length algorithm In-Reply-To: References: Message-ID: Hi, I haven't used it personally, but just in case you haven't done it yet, having a look ar the Insight Journal article [1] that first proposed the related classes, functions or analysis may be of help. It includes a paper on the features of the original filters, and the source code, including a test that shows how to use them. HTH, JON HAITZ [1] http://www.insight-journal.org/browse/publication/231 On 23 July 2014 14:07, med aweng wrote: > Hello, > > I have understood how the "Gray Level Run Length" method works, and trying > to implement that in ITK. > > I'm kind of new to ITK, and just need some guidance on how to proceed. > > This is what I have done so far for instance: > > typedef itk::Image InputImageType; > typedef > itk::Statistics::ScalarImageToRunLengthMatrixFilter > FilterType; > typedef VectorContainer OffsetVector; > typedef typename OffsetVector::Pointer OffsetVectorPointer; > InputImageType::Pointer image = InputImageType::New(); > FilterType::Pointer filter = FilterType::New(); > filter->SetInput(image); > > InputImageType::OffsetType offset1 ={{1,0}}; > > FilterType::OffsetVectorPointer offsetV = FilterType::OffsetVector::New(); > offsetV.push_back(offset1); > > filter->SetOffsets(offsetV); > > Any guidance or hints on how to proceed on that? > > Thanks. > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From medswengineer at gmail.com Wed Jul 23 08:19:45 2014 From: medswengineer at gmail.com (med aweng) Date: Wed, 23 Jul 2014 14:19:45 +0200 Subject: [ITK-users] Implementing the Gray Level Run Length algorithm In-Reply-To: References: Message-ID: Hi Jon, Thanks for your kind reply. For the test, would this be the file I should be looking at? https://github.com/midas-journal/midas-journal-231/blob/master/Source/itkRunLengthFeaturesTest.cxx Thanks. On Wed, Jul 23, 2014 at 2:16 PM, Jon Haitz Legarreta < jhlegarreta at vicomtech.org> wrote: > Hi, > I haven't used it personally, but just in case you haven't done it yet, > having a look ar the Insight Journal article [1] that first proposed the > related classes, functions or analysis may be of help. > > It includes a paper on the features of the original filters, and the > source code, including a test that shows how to use them. > > HTH, > JON HAITZ > > > [1] http://www.insight-journal.org/browse/publication/231 > > > On 23 July 2014 14:07, med aweng wrote: > >> Hello, >> >> I have understood how the "Gray Level Run Length" method works, and >> trying to implement that in ITK. >> >> I'm kind of new to ITK, and just need some guidance on how to proceed. >> >> This is what I have done so far for instance: >> >> typedef itk::Image InputImageType; >> typedef >> itk::Statistics::ScalarImageToRunLengthMatrixFilter >> FilterType; >> typedef VectorContainer OffsetVector; >> typedef typename OffsetVector::Pointer OffsetVectorPointer; >> InputImageType::Pointer image = InputImageType::New(); >> FilterType::Pointer filter = FilterType::New(); >> filter->SetInput(image); >> >> InputImageType::OffsetType offset1 ={{1,0}}; >> >> FilterType::OffsetVectorPointer offsetV = FilterType::OffsetVector::New(); >> offsetV.push_back(offset1); >> >> filter->SetOffsets(offsetV); >> >> Any guidance or hints on how to proceed on that? >> >> Thanks. >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jhlegarreta at vicomtech.org Wed Jul 23 08:24:46 2014 From: jhlegarreta at vicomtech.org (Jon Haitz Legarreta) Date: Wed, 23 Jul 2014 14:24:46 +0200 Subject: [ITK-users] Implementing the Gray Level Run Length algorithm In-Reply-To: References: Message-ID: Yes. JON HAITZ On 23 July 2014 14:19, med aweng wrote: > Hi Jon, > > Thanks for your kind reply. For the test, would this be the file I should > be looking at? > https://github.com/midas-journal/midas-journal-231/blob/master/Source/itkRunLengthFeaturesTest.cxx > > Thanks. > > > On Wed, Jul 23, 2014 at 2:16 PM, Jon Haitz Legarreta < > jhlegarreta at vicomtech.org> wrote: > >> Hi, >> I haven't used it personally, but just in case you haven't done it yet, >> having a look ar the Insight Journal article [1] that first proposed the >> related classes, functions or analysis may be of help. >> >> It includes a paper on the features of the original filters, and the >> source code, including a test that shows how to use them. >> >> HTH, >> JON HAITZ >> >> >> [1] http://www.insight-journal.org/browse/publication/231 >> >> >> On 23 July 2014 14:07, med aweng wrote: >> >>> Hello, >>> >>> I have understood how the "Gray Level Run Length" method works, and >>> trying to implement that in ITK. >>> >>> I'm kind of new to ITK, and just need some guidance on how to proceed. >>> >>> This is what I have done so far for instance: >>> >>> typedef itk::Image InputImageType; >>> typedef >>> itk::Statistics::ScalarImageToRunLengthMatrixFilter >>> FilterType; >>> typedef VectorContainer OffsetVector; >>> typedef typename OffsetVector::Pointer OffsetVectorPointer; >>> InputImageType::Pointer image = InputImageType::New(); >>> FilterType::Pointer filter = FilterType::New(); >>> filter->SetInput(image); >>> >>> InputImageType::OffsetType offset1 ={{1,0}}; >>> >>> FilterType::OffsetVectorPointer offsetV = >>> FilterType::OffsetVector::New(); >>> offsetV.push_back(offset1); >>> >>> filter->SetOffsets(offsetV); >>> >>> Any guidance or hints on how to proceed on that? >>> >>> Thanks. >>> >>> _____________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://www.kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the ITK FAQ at: >>> http://www.itk.org/Wiki/ITK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/insight-users >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elena.bresciani87 at gmail.com Wed Jul 23 08:30:32 2014 From: elena.bresciani87 at gmail.com (elena bresciani) Date: Wed, 23 Jul 2014 14:30:32 +0200 Subject: [ITK-users] ERROR: MeanSquaresImageToImageMetric: Too many samples map outside moving image buffer In-Reply-To: References: Message-ID: ExceptionObject caught ! itk::ExceptionObject (0x3043350) Location: "void itk::MeanSquaresImageToImageMetric::GetValueAndDerivative(const ParametersType&, itk::MeanSquaresImageToImageMetric::MeasureType&, itk::MeanSquaresImageToImageMetric::DerivativeType&) const [with TFixedImage = itk::Image; TMovingImage = itk::Image; itk::MeanSquaresImageToImageMetric::ParametersType = itk::OptimizerParameters; itk::MeanSquaresImageToImageMetric::MeasureType = double; itk::MeanSquaresImageToImageMetric::DerivativeType = itk::Array]" File: /usr/local/include/ITK-4.5/itkMeanSquaresImageToImageMetric.hxx Line: 257 Description: itk::ERROR: MeanSquaresImageToImageMetric(0x30384c0): Too many samples map outside moving image buffer: 4042 / 568832 2014-07-23 13:47 GMT+02:00 Bradley Lowekamp : > What is the error you are getting? > > Brad > On Jul 23, 2014, at 6:20 AM, elena bresciani > wrote: > > > Hello folks, > > > > I have a registration problem for you. I'm using the code in the example > ImageRegistration5.cxx in order to align image of drugs blisters to assess > if they are the same or not. > > > > The code works well even though for certain images couples I get the > error in this message object. > > I thought the problem could be the relative difference in images size > and tried to pad the smallest one to have the same size as the biggest: > same error. > > After reading comments on the same topic I tried to add to the code the > line > > > > registration -> SetFixedImageRegion (fixedImage -> GetBufferedRegion()); > > > > again not solving my problem. > > Attached you can find example images: while I can register image "1" on > image "0", if I try to register "2" on "1" I get the ERROR. > > > > Any guess? > > > > Cheers, > > Elena > > > > > > > > <0.jpg><1.jpg><2.jpg> > > > > _____________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Kitware offers ITK Training Courses, for more information visit: > > http://www.kitware.com/products/protraining.php > > > > Please keep messages on-topic and check the ITK FAQ at: > > http://www.itk.org/Wiki/ITK_FAQ > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/insight-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From medswengineer at gmail.com Wed Jul 23 08:45:12 2014 From: medswengineer at gmail.com (med aweng) Date: Wed, 23 Jul 2014 14:45:12 +0200 Subject: [ITK-users] Implementing the Gray Level Run Length algorithm In-Reply-To: References: Message-ID: Thanks a lot Jon for your kind replies. On Wed, Jul 23, 2014 at 2:24 PM, Jon Haitz Legarreta < jhlegarreta at vicomtech.org> wrote: > Yes. > > JON HAITZ > > > > On 23 July 2014 14:19, med aweng wrote: > >> Hi Jon, >> >> Thanks for your kind reply. For the test, would this be the file I should >> be looking at? >> https://github.com/midas-journal/midas-journal-231/blob/master/Source/itkRunLengthFeaturesTest.cxx >> >> Thanks. >> >> >> On Wed, Jul 23, 2014 at 2:16 PM, Jon Haitz Legarreta < >> jhlegarreta at vicomtech.org> wrote: >> >>> Hi, >>> I haven't used it personally, but just in case you haven't done it yet, >>> having a look ar the Insight Journal article [1] that first proposed the >>> related classes, functions or analysis may be of help. >>> >>> It includes a paper on the features of the original filters, and the >>> source code, including a test that shows how to use them. >>> >>> HTH, >>> JON HAITZ >>> >>> >>> [1] http://www.insight-journal.org/browse/publication/231 >>> >>> >>> On 23 July 2014 14:07, med aweng wrote: >>> >>>> Hello, >>>> >>>> I have understood how the "Gray Level Run Length" method works, and >>>> trying to implement that in ITK. >>>> >>>> I'm kind of new to ITK, and just need some guidance on how to proceed. >>>> >>>> This is what I have done so far for instance: >>>> >>>> typedef itk::Image InputImageType; >>>> typedef >>>> itk::Statistics::ScalarImageToRunLengthMatrixFilter >>>> FilterType; >>>> typedef VectorContainer OffsetVector; >>>> typedef typename OffsetVector::Pointer OffsetVectorPointer; >>>> InputImageType::Pointer image = InputImageType::New(); >>>> FilterType::Pointer filter = FilterType::New(); >>>> filter->SetInput(image); >>>> >>>> InputImageType::OffsetType offset1 ={{1,0}}; >>>> >>>> FilterType::OffsetVectorPointer offsetV = >>>> FilterType::OffsetVector::New(); >>>> offsetV.push_back(offset1); >>>> >>>> filter->SetOffsets(offsetV); >>>> >>>> Any guidance or hints on how to proceed on that? >>>> >>>> Thanks. >>>> >>>> _____________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Kitware offers ITK Training Courses, for more information visit: >>>> http://www.kitware.com/products/protraining.php >>>> >>>> Please keep messages on-topic and check the ITK FAQ at: >>>> http://www.itk.org/Wiki/ITK_FAQ >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/insight-users >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From medswengineer at gmail.com Wed Jul 23 08:47:40 2014 From: medswengineer at gmail.com (med aweng) Date: Wed, 23 Jul 2014 14:47:40 +0200 Subject: [ITK-users] < > or " " in #include Message-ID: Hello, Does it matter if I use " " or < > in the following #include? #include Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Wed Jul 23 08:48:25 2014 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Wed, 23 Jul 2014 08:48:25 -0400 Subject: [ITK-users] ERROR: MeanSquaresImageToImageMetric: Too many samples map outside moving image buffer In-Reply-To: References: Message-ID: Is this at the first iteration of after a few? Are iterations converging, diverging or erratic? If it's the first it's an indication that initial transform is poor and they don't overlap much. There for the results of the transform initializer should be evaluated. If it's after a few iterations, then is the iteration of the metric and optimizer needs to be examine. Is the value of the metric correct and correlated with the correct solution? Is the step size too big? Would smoothing the fixed and moving images smooth optimization? etc? These registration examples are not designed to be turn key solution, they are a stepping stone to learn about the registration framework, and begin analyzing the behavior of the components so that a solution to your problem can be constructed. Brad On Jul 23, 2014, at 8:30 AM, elena bresciani wrote: > ExceptionObject caught ! > > itk::ExceptionObject (0x3043350) > Location: "void itk::MeanSquaresImageToImageMetric::GetValueAndDerivative(const ParametersType&, itk::MeanSquaresImageToImageMetric::MeasureType&, itk::MeanSquaresImageToImageMetric::DerivativeType&) const [with TFixedImage = itk::Image; TMovingImage = itk::Image; itk::MeanSquaresImageToImageMetric::ParametersType = itk::OptimizerParameters; itk::MeanSquaresImageToImageMetric::MeasureType = double; itk::MeanSquaresImageToImageMetric::DerivativeType = itk::Array]" > File: /usr/local/include/ITK-4.5/itkMeanSquaresImageToImageMetric.hxx > Line: 257 > Description: itk::ERROR: MeanSquaresImageToImageMetric(0x30384c0): Too many samples map outside moving image buffer: 4042 / 568832 > > > 2014-07-23 13:47 GMT+02:00 Bradley Lowekamp : > What is the error you are getting? > > Brad > On Jul 23, 2014, at 6:20 AM, elena bresciani wrote: > > > Hello folks, > > > > I have a registration problem for you. I'm using the code in the example ImageRegistration5.cxx in order to align image of drugs blisters to assess if they are the same or not. > > > > The code works well even though for certain images couples I get the error in this message object. > > I thought the problem could be the relative difference in images size and tried to pad the smallest one to have the same size as the biggest: same error. > > After reading comments on the same topic I tried to add to the code the line > > > > registration -> SetFixedImageRegion (fixedImage -> GetBufferedRegion()); > > > > again not solving my problem. > > Attached you can find example images: while I can register image "1" on image "0", if I try to register "2" on "1" I get the ERROR. > > > > Any guess? > > > > Cheers, > > Elena > > > > > > > > <0.jpg><1.jpg><2.jpg> > > > > _____________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Kitware offers ITK Training Courses, for more information visit: > > http://www.kitware.com/products/protraining.php > > > > Please keep messages on-topic and check the ITK FAQ at: > > http://www.itk.org/Wiki/ITK_FAQ > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/insight-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elena.bresciani87 at gmail.com Wed Jul 23 08:52:59 2014 From: elena.bresciani87 at gmail.com (elena bresciani) Date: Wed, 23 Jul 2014 14:52:59 +0200 Subject: [ITK-users] ERROR: MeanSquaresImageToImageMetric: Too many samples map outside moving image buffer In-Reply-To: References: Message-ID: I get the error immediately after running the script, so I think the problem is in the transform initialization. Should I try with itkCenteredTransformInitializer.h ? 2014-07-23 14:48 GMT+02:00 Bradley Lowekamp : > Is this at the first iteration of after a few? Are iterations converging, > diverging or erratic? > > If it's the first it's an indication that initial transform is poor and > they don't overlap much. There for the results of the transform initializer > should be evaluated. > > If it's after a few iterations, then is the iteration of the metric and > optimizer needs to be examine. Is the value of the metric correct and > correlated with the correct solution? Is the step size too big? Would > smoothing the fixed and moving images smooth optimization? etc? > > These registration examples are not designed to be turn key solution, they > are a stepping stone to learn about the registration framework, and begin > analyzing the behavior of the components so that a solution to your problem > can be constructed. > > Brad > > On Jul 23, 2014, at 8:30 AM, elena bresciani > wrote: > > ExceptionObject caught ! > > itk::ExceptionObject (0x3043350) > Location: "void itk::MeanSquaresImageToImageMetric TMovingImage>::GetValueAndDerivative(const ParametersType&, > itk::MeanSquaresImageToImageMetric TMovingImage>::MeasureType&, > itk::MeanSquaresImageToImageMetric TMovingImage>::DerivativeType&) const [with TFixedImage = > itk::Image; TMovingImage = itk::Image 2u>; itk::MeanSquaresImageToImageMetric TMovingImage>::ParametersType = itk::OptimizerParameters; > itk::MeanSquaresImageToImageMetric::MeasureType > = double; itk::MeanSquaresImageToImageMetric TMovingImage>::DerivativeType = itk::Array]" > File: /usr/local/include/ITK-4.5/itkMeanSquaresImageToImageMetric.hxx > Line: 257 > Description: itk::ERROR: MeanSquaresImageToImageMetric(0x30384c0): Too > many samples map outside moving image buffer: 4042 / 568832 > > > 2014-07-23 13:47 GMT+02:00 Bradley Lowekamp : > >> What is the error you are getting? >> >> Brad >> On Jul 23, 2014, at 6:20 AM, elena bresciani >> wrote: >> >> > Hello folks, >> > >> > I have a registration problem for you. I'm using the code in the >> example ImageRegistration5.cxx in order to align image of drugs blisters to >> assess if they are the same or not. >> > >> > The code works well even though for certain images couples I get the >> error in this message object. >> > I thought the problem could be the relative difference in images size >> and tried to pad the smallest one to have the same size as the biggest: >> same error. >> > After reading comments on the same topic I tried to add to the code the >> line >> > >> > registration -> SetFixedImageRegion (fixedImage -> GetBufferedRegion()); >> > >> > again not solving my problem. >> > Attached you can find example images: while I can register image "1" on >> image "0", if I try to register "2" on "1" I get the ERROR. >> > >> > Any guess? >> > >> > Cheers, >> > Elena >> > >> > >> > >> > <0.jpg><1.jpg><2.jpg> >> > >> > _____________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Kitware offers ITK Training Courses, for more information visit: >> > http://www.kitware.com/products/protraining.php >> > >> > Please keep messages on-topic and check the ITK FAQ at: >> > http://www.itk.org/Wiki/ITK_FAQ >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/insight-users >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From medswengineer at gmail.com Wed Jul 23 09:01:04 2014 From: medswengineer at gmail.com (med aweng) Date: Wed, 23 Jul 2014 15:01:04 +0200 Subject: [ITK-users] GetOutput() Message-ID: Hello, Say that I have used the following code portion: ReaderType::Pointer ImageReader = ReaderType::New(); .... .... filter->SetInput(ImageReader->GetOutput()); What does GetOutput() mean here? I couldn't find a description for this function. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From drescherjm at gmail.com Wed Jul 23 09:02:51 2014 From: drescherjm at gmail.com (John Drescher) Date: Wed, 23 Jul 2014 09:02:51 -0400 Subject: [ITK-users] < > or " " in #include In-Reply-To: References: Message-ID: > Does it matter if I use " " or < > in the following #include? http://stackoverflow.com/questions/21593/what-is-the-difference-between-include-filename-and-include-filename John From medswengineer at gmail.com Wed Jul 23 09:08:12 2014 From: medswengineer at gmail.com (med aweng) Date: Wed, 23 Jul 2014 15:08:12 +0200 Subject: [ITK-users] < > or " " in #include In-Reply-To: References: Message-ID: Thanks John... On Wed, Jul 23, 2014 at 3:02 PM, John Drescher wrote: > > Does it matter if I use " " or < > in the following #include? > > > http://stackoverflow.com/questions/21593/what-is-the-difference-between-include-filename-and-include-filename > John > -------------- next part -------------- An HTML attachment was scrubbed... URL: From medswengineer at gmail.com Wed Jul 23 09:11:02 2014 From: medswengineer at gmail.com (med aweng) Date: Wed, 23 Jul 2014 15:11:02 +0200 Subject: [ITK-users] Questions about some code Message-ID: Hello, In the following code: https://github.com/midas-journal/midas-journal-231/blob/master/Source/itkRunLengthFeaturesTest.cxx I want to ask about this code portion: RunLengthFilterType::FeatureValueVectorPointer means = runLengthFilter->GetFeatureMeans(); const RunLengthFilterType::FeatureNameVector* names = runLengthFilter->GetRequestedFeatures(); RunLengthFilterType::FeatureValueVector::ConstIterator mIt = means->Begin(); RunLengthFilterType::FeatureNameVector::ConstIterator nIt = names->Begin(); What is it trying to find here? I'm actually facing some issues with reading the documentation, and thus not able to understand what the classes above mean. Thanks for your guidance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chinander at gmail.com Wed Jul 23 09:11:22 2014 From: chinander at gmail.com (Mike Chinander) Date: Wed, 23 Jul 2014 08:11:22 -0500 Subject: [ITK-users] GetOutput() In-Reply-To: References: Message-ID: The ITK Software Guide covers many of your questions with a lot of examples. You will save a lot of time by reading it. http://www.itk.org/ItkSoftwareGuide.pdf On Wed, Jul 23, 2014 at 8:01 AM, med aweng wrote: > Hello, > > Say that I have used the following code portion: > > ReaderType::Pointer ImageReader = ReaderType::New(); > .... > .... > filter->SetInput(ImageReader->GetOutput()); > > What does GetOutput() mean here? I couldn't find a description for this > function. > > Thanks. > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From medswengineer at gmail.com Wed Jul 23 09:14:30 2014 From: medswengineer at gmail.com (med aweng) Date: Wed, 23 Jul 2014 15:14:30 +0200 Subject: [ITK-users] GetOutput() In-Reply-To: References: Message-ID: Thanks Mike for your reply On Wed, Jul 23, 2014 at 3:11 PM, Mike Chinander wrote: > The ITK Software Guide covers many of your questions with a lot of > examples. You will save a lot of time by reading it. > > http://www.itk.org/ItkSoftwareGuide.pdf > > > On Wed, Jul 23, 2014 at 8:01 AM, med aweng > wrote: > >> Hello, >> >> Say that I have used the following code portion: >> >> ReaderType::Pointer ImageReader = ReaderType::New(); >> .... >> .... >> filter->SetInput(ImageReader->GetOutput()); >> >> What does GetOutput() mean here? I couldn't find a description for this >> function. >> >> Thanks. >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> >> > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davis.vigneault at gmail.com Wed Jul 23 10:22:29 2014 From: davis.vigneault at gmail.com (DVigneault) Date: Wed, 23 Jul 2014 07:22:29 -0700 (PDT) Subject: [ITK-users] Does VUL need to be installed separately from ITK? Message-ID: <1406125349302-7585971.post@n2.nabble.com> All-- I noticed that some parts of vxl (such as vnl) are installed with ITK, whereas others (such as vul) are not. Is there a ccmake flag I can use when building ITK that will cause vul to be built along with ITK, or does it need to be installed separately? I looked down the list of the flags in the ccmake command line interface, but nothing jumped out at me. Best, --Davis -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Does-VUL-need-to-be-installed-separately-from-ITK-tp7585971.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From blowekamp at mail.nih.gov Wed Jul 23 10:27:59 2014 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Wed, 23 Jul 2014 10:27:59 -0400 Subject: [ITK-users] Does VUL need to be installed separately from ITK? In-Reply-To: <1406125349302-7585971.post@n2.nabble.com> References: <1406125349302-7585971.post@n2.nabble.com> Message-ID: <00F63070-7EEF-4963-B32F-D486D7D62E20@mail.nih.gov> Hello, You are correct that ITK only has a subset of VXL, mainly VNL, and VCL. However, ITK does support using a "system" vxl with ITK, with the ITK_USE_SYSTEM_VXL. Which would be the option to enable when you are installing VXL yourself. Brad On Jul 23, 2014, at 10:22 AM, DVigneault wrote: > All-- > > I noticed that some parts of vxl (such as vnl) are installed with ITK, > whereas others (such as vul) are not. Is there a ccmake flag I can use when > building ITK that will cause vul to be built along with ITK, or does it need > to be installed separately? I looked down the list of the flags in the > ccmake command line interface, but nothing jumped out at me. > > Best, > > --Davis > > > > -- > View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Does-VUL-need-to-be-installed-separately-from-ITK-tp7585971.html > Sent from the ITK Insight Users mailing list archive at Nabble.com. > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users From ksatyananda at gmail.com Wed Jul 23 11:11:16 2014 From: ksatyananda at gmail.com (Satyananda Kashyap) Date: Wed, 23 Jul 2014 10:11:16 -0500 Subject: [ITK-users] Suggestions about Python wrapping of cpp project Message-ID: Hello, I am looking for your expert opinions here. I have a relatively large C++ project I am working on which uses ITK mainly (hence the question here) and to some extent VTK and OpenCV. I do think that my code is fairly well written. I was thinking of wrapping my code to python using either SWIG or boost.python. Here are my questions : 1. I am led to believe that prototyping and code development is much faster in Python. Given that I have such a big cpp base code is it really worth the effort to wrap into python and then continue there. 2. From what I have read ITK uses SWIG wrappings for wrapping into Python while VTK uses the boost.python route. My initial attempts with both have been relatively unsuccessful. Any opinion on which one is more user friendly/better when I have to wrap my own custom classes which use a combination of both ITK and VTK in them. 3. Any suggestion on a road map as to how to proceed. I am not sure at what base class level I should wrap them and rewrite the dependencies in python. Thanks, Regards, Kashyap -------------- next part -------------- An HTML attachment was scrubbed... URL: From davis.vigneault at gmail.com Wed Jul 23 11:19:56 2014 From: davis.vigneault at gmail.com (DVigneault) Date: Wed, 23 Jul 2014 08:19:56 -0700 (PDT) Subject: [ITK-users] vnl_svd Segfaults on 3xn matrix, but not on nx3? Message-ID: <1406128796561-7585974.post@n2.nabble.com> All-- I'm trying to fit a plane through an image (treating indices as x and y and pixel value as z) by reading an image into a 3xn matrix and computing the singular value decomposition with vnl. However, I'm getting a segfault when I call the SVD function. I do not get a segfault when I call the SVD on the transpose of the same matrix. Could anyone suggest (a) why this is segfaulting or (b) a better way to fit a plane to an image in ITK? Below is a minimal example of the problem. (Apologies for the many questions--I very much appreciate Brad's and other's help.) #include "itkImageFileReader.h" #include "itkImageRegionIteratorWithIndex.h" #include "itkVariableSizeMatrix.h" #include "vnl/vnl_matrix.h" const unsigned int Dimension = 2; typedef double WorkPixelType; typedef itk::Image< WorkPixelType, Dimension > WorkImageType; typedef itk::ImageFileReader< WorkImageType > ReaderType; typedef itk::VariableSizeMatrix< WorkPixelType > MatrixType; typedef itk::ImageRegionIteratorWithIndex< WorkImageType > ItType; int main( int argc, char * argv[] ) { // Read in file ReaderType::Pointer reader = ReaderType::New(); reader->SetFileName( "../data/input/wrapped_WT_square.png" ); reader->Update(); WorkImageType::Pointer input = reader->GetOutput(); MatrixType matrix; matrix.SetSize(3, input->GetLargestPossibleRegion().GetSize()[0]*input->GetLargestPossibleRegion().GetSize()[0]); ItType inputIt( input, input->GetLargestPossibleRegion() ); inputIt.GoToBegin(); unsigned int count = 0; while(!inputIt.IsAtEnd()) { matrix(0,count) = inputIt.GetIndex()[0]; matrix(1,count) = inputIt.GetIndex()[1]; matrix(2,count) = inputIt.Get(); ++count; ++inputIt; } vnl_matrix< double > VNLMatrix = matrix.GetVnlMatrix(); // n x 3 matrix works: vnl_svd svdTranspose(VNLMatrix.transpose()); // Segmentation fault: 11 std::cout << svdTranspose << std::endl; // 3 x n matrix segfaults: vnl_svd svd(VNLMatrix); // Segmentation fault: 11 std::cout << svd << std::endl; // Doesn't make it this far return EXIT_SUCCESS; } -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/vnl-svd-Segfaults-on-3xn-matrix-but-not-on-nx3-tp7585974.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From norman-k-williams at uiowa.edu Wed Jul 23 11:23:50 2014 From: norman-k-williams at uiowa.edu (Williams, Norman K) Date: Wed, 23 Jul 2014 15:23:50 +0000 Subject: [ITK-users] Undefined IOFactoryRegister__Private methods? Message-ID: We have a bunch of big Cmake build systems that until very recently (I noticed it yesterday) were working fine. Now we get link errors like this: "itk::BMPImageIOFactoryRegister__Private()", referenced from: itk::(anonymous namespace)::ImageIOFactoryRegisterRegisterList in libmaxcurvatureLib.a(maxcurvature.cxx.o) "itk::GE4ImageIOFactoryRegister__Private()", referenced from: itk::(anonymous namespace)::ImageIOFactoryRegisterRegisterList in libmaxcurvatureLib.a(maxcurvature.cxx.o) When I go looking for these symbols, I see them where you?d expect them ? libITKBMPIO-4.6.a etc. The problem seems to be that the IO libraries are being LEFT OUT of the ITK_LIBRARIES Cmake variable. We use a pretty recent version of ITK: commit 06d5bfec67805bfadb5dc344b08ab554381592c6 Merge: b960bce c1bcfb7 Author: Matt McCormick Date: Tue Jul 15 16:05:22 2014 -0400 o Merge topic 'FixThresholdMaxCCWarning' c1bcfb73 COMP: Fix implicit conversion warnings ________________________________ Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you. ________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Wed Jul 23 11:28:12 2014 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Wed, 23 Jul 2014 11:28:12 -0400 Subject: [ITK-users] [ITK-dev] Undefined IOFactoryRegister__Private methods? In-Reply-To: References: Message-ID: <8A284992-A0BD-42FA-A2FA-F9CDCB5C60FC@mail.nih.gov> How are you "finding" and "using" ITK in the CMake code? Are you using ITK via components? Brad On Jul 23, 2014, at 11:23 AM, Williams, Norman K wrote: > We have a bunch of big Cmake build systems that until very recently (I noticed it yesterday) were working fine. Now we get link errors like this: > > "itk::BMPImageIOFactoryRegister__Private()", referenced from: > itk::(anonymous namespace)::ImageIOFactoryRegisterRegisterList in libmaxcurvatureLib.a(maxcurvature.cxx.o) > "itk::GE4ImageIOFactoryRegister__Private()", referenced from: > itk::(anonymous namespace)::ImageIOFactoryRegisterRegisterList in libmaxcurvatureLib.a(maxcurvature.cxx.o) > > When I go looking for these symbols, I see them where you?d expect them ? libITKBMPIO-4.6.a etc. > > The problem seems to be that the IO libraries are being LEFT OUT of the ITK_LIBRARIES Cmake variable. > > We use a pretty recent version of ITK: > commit 06d5bfec67805bfadb5dc344b08ab554381592c6 > Merge: b960bce c1bcfb7 > Author: Matt McCormick > Date: Tue Jul 15 16:05:22 2014 -0400 > o > Merge topic 'FixThresholdMaxCCWarning' > > c1bcfb73 COMP: Fix implicit conversion warnings > > > > Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-developers -------------- next part -------------- An HTML attachment was scrubbed... URL: From emilroz at gmail.com Wed Jul 23 11:44:14 2014 From: emilroz at gmail.com (Emil Rozbicki) Date: Wed, 23 Jul 2014 16:44:14 +0100 Subject: [ITK-users] Error: no override found for 'vtkRayCastImageDisplayHelper' In-Reply-To: <1400765505.497471738@f181.i.mail.ru> References: <1400765505.497471738@f181.i.mail.ru> Message-ID: Hi, I'm experiencing similar issue although only when using QT and not sure why. I've compiled the same code with XTools and Qt both compiled using clang. The executable from Xtools works fine no error, QT one crushes and says: "Generic Warning: In /tmp/vtk-TFA4/Rendering/Volume/vtkRayCastImageDisplayHelper.cxx, line 20 Error: no override found for 'vtkRayCastImageDisplayHelper'." I've tried QT 5 and 4 in combination with VTK 5 and 6 (6.1 and 6.2) the same issue persists. I'm on OS X 10.8.5. Any advice how to overcome it much appreciated. Cheers, Emil On Thu, May 22, 2014 at 2:31 PM, ????? ?????????? wrote: > > > Hi all, > > i try this example > https://github.com/Kitware/VTK/blob/master/Examples/VolumeRendering/Cxx/GPURenderDemo.cxx > > > But when i run it, i get this error "no override found for > 'vtkRayCastImageDisplayHelper". > > Thank you for your help > > Roman > > > ------------------------------ > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.itk.org/mailman/listinfo/insight-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From norman-k-williams at uiowa.edu Wed Jul 23 11:42:33 2014 From: norman-k-williams at uiowa.edu (Williams, Norman K) Date: Wed, 23 Jul 2014 15:42:33 +0000 Subject: [ITK-users] [ITK-dev] Undefined IOFactoryRegister__Private methods? In-Reply-To: <8A284992-A0BD-42FA-A2FA-F9CDCB5C60FC@mail.nih.gov> References: <8A284992-A0BD-42FA-A2FA-F9CDCB5C60FC@mail.nih.gov> Message-ID: The ?usual way? I?m trying to track down where this goes wrong; I wondered if anyone else had run into this problem. It?s with a package that might need some TLC with its Cmake build system. http://www.nitrc.org/projects/dtiprocess/ find_package(ITK REQUIRED) include(${ITK_USE_FILE}) From: Bradley Lowekamp Date: Wednesday, July 23, 2014 at 10:28 AM To: Mushly McMushmaster Cc: Insight , ITK Subject: Re: [ITK-dev] Undefined IOFactoryRegister__Private methods? How are you "finding" and "using" ITK in the CMake code? Are you using ITK via components? Brad On Jul 23, 2014, at 11:23 AM, Williams, Norman K wrote: We have a bunch of big Cmake build systems that until very recently (I noticed it yesterday) were working fine. Now we get link errors like this: "itk::BMPImageIOFactoryRegister__Private()", referenced from: itk::(anonymous namespace)::ImageIOFactoryRegisterRegisterList in libmaxcurvatureLib.a(maxcurvature.cxx.o) "itk::GE4ImageIOFactoryRegister__Private()", referenced from: itk::(anonymous namespace)::ImageIOFactoryRegisterRegisterList in libmaxcurvatureLib.a(maxcurvature.cxx.o) When I go looking for these symbols, I see them where you?d expect them ? libITKBMPIO-4.6.a etc. The problem seems to be that the IO libraries are being LEFT OUT of the ITK_LIBRARIES Cmake variable. We use a pretty recent version of ITK: commit 06d5bfec67805bfadb5dc344b08ab554381592c6 Merge: b960bce c1bcfb7 Author: Matt McCormick Date: Tue Jul 15 16:05:22 2014 -0400 o Merge topic 'FixThresholdMaxCCWarning' c1bcfb73 COMP: Fix implicit conversion warnings ________________________________________ Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you. ________________________________________ _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers ________________________________ Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you. ________________________________ From norman-k-williams at uiowa.edu Wed Jul 23 14:39:18 2014 From: norman-k-williams at uiowa.edu (Williams, Norman K) Date: Wed, 23 Jul 2014 18:39:18 +0000 Subject: [ITK-users] [ITK-dev] Undefined IOFactoryRegister__Private methods? In-Reply-To: <8A284992-A0BD-42FA-A2FA-F9CDCB5C60FC@mail.nih.gov> References: <8A284992-A0BD-42FA-A2FA-F9CDCB5C60FC@mail.nih.gov> Message-ID: This is an issue with recent changes to SlicerExecutionModel, and JC is on the job ;-) From: Bradley Lowekamp > Date: Wednesday, July 23, 2014 at 10:28 AM To: Mushly McMushmaster > Cc: Insight >, ITK > Subject: Re: [ITK-dev] Undefined IOFactoryRegister__Private methods? How are you "finding" and "using" ITK in the CMake code? Are you using ITK via components? Brad On Jul 23, 2014, at 11:23 AM, Williams, Norman K > wrote: We have a bunch of big Cmake build systems that until very recently (I noticed it yesterday) were working fine. Now we get link errors like this: "itk::BMPImageIOFactoryRegister__Private()", referenced from: itk::(anonymous namespace)::ImageIOFactoryRegisterRegisterList in libmaxcurvatureLib.a(maxcurvature.cxx.o) "itk::GE4ImageIOFactoryRegister__Private()", referenced from: itk::(anonymous namespace)::ImageIOFactoryRegisterRegisterList in libmaxcurvatureLib.a(maxcurvature.cxx.o) When I go looking for these symbols, I see them where you?d expect them ? libITKBMPIO-4.6.a etc. The problem seems to be that the IO libraries are being LEFT OUT of the ITK_LIBRARIES Cmake variable. We use a pretty recent version of ITK: commit 06d5bfec67805bfadb5dc344b08ab554381592c6 Merge: b960bce c1bcfb7 Author: Matt McCormick > Date: Tue Jul 15 16:05:22 2014 -0400 o Merge topic 'FixThresholdMaxCCWarning' c1bcfb73 COMP: Fix implicit conversion warnings ________________________________ Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you. ________________________________ _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers ________________________________ Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you. ________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From wgt at sjtu.edu.cn Thu Jul 24 04:41:26 2014 From: wgt at sjtu.edu.cn (guotai) Date: Thu, 24 Jul 2014 01:41:26 -0700 (PDT) Subject: [ITK-users] GDCM Update from 2.0.14 to 2.0.15, linker error In-Reply-To: <1378883369210-32321.post@n7.nabble.com> References: <1378883369210-32321.post@n7.nabble.com> Message-ID: <1406191286576-7585981.post@n2.nabble.com> Hi, I also have this problem. Have you fixed it ? Could you tell me how did you fix this problem? Thanks Guotai -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/GDCM-Update-from-2-0-14-to-2-0-15-linker-error-tp5432003p7585981.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From michkapopoff at gmail.com Thu Jul 24 04:54:52 2014 From: michkapopoff at gmail.com (Michka Popoff) Date: Thu, 24 Jul 2014 10:54:52 +0200 Subject: [ITK-users] Suggestions about Python wrapping of cpp project In-Reply-To: References: Message-ID: Hi I am currently maintaining the Python part of ITK, but I don?t know if I can help you. I just started with this some time ago and can not really compare it to the boost python method as I don?t know it. There is an old (but outdated) discussion about boost and swig here [1]. But this was written for swig 1.34, and now we already have swig 3.0.2, which brought a lot of improvements. Swig has been under heavy development lately. What I find nice with Swig is that you get other languages for free, it does not only support python but also Java, Ruby, TCL, ? (you will need to write some code for this support though). The Swig method is nice once you automatized your process. Depending on the c++ code you wrote, you don?t even need to write interface files for Swig. For ITK, we have a small pipeline which reads the c++ code with gccxml, and uses a python script [3] (which uses pygccxml) to create interface files from the xml files. What problems did you encounter when trying the Swig route ? Maybe I can help. Michka [1] https://dev.lsstcorp.org/trac/wiki/SwigVsBoostPython [2] https://github.com/swig/swig [3] https://github.com/InsightSoftwareConsortium/ITK/blob/master/Wrapping/Generators/SwigInterface/igenerator.py On 23 juil. 2014, at 17:11, Satyananda Kashyap wrote: > Hello, > > I am looking for your expert opinions here. I have a relatively large C++ project I am working on which uses ITK mainly (hence the question here) and to some extent VTK and OpenCV. I do think that my code is fairly well written. I was thinking of wrapping my code to python using either SWIG or boost.python. Here are my questions : > > > 1. I am led to believe that prototyping and code development is much faster in Python. Given that I have such a big cpp base code is it really worth the effort to wrap into python and then continue there. > > 2. From what I have read ITK uses SWIG wrappings for wrapping into Python while VTK uses the boost.python route. My initial attempts with both have been relatively unsuccessful. Any opinion on which one is more user friendly/better when I have to wrap my own custom classes which use a combination of both ITK and VTK in them. > > 3. Any suggestion on a road map as to how to proceed. I am not sure at what base class level I should wrap them and rewrite the dependencies in python. > > Thanks, > Regards, > Kashyap > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users From medswengineer at gmail.com Thu Jul 24 05:40:28 2014 From: medswengineer at gmail.com (med aweng) Date: Thu, 24 Jul 2014 11:40:28 +0200 Subject: [ITK-users] GetFeatureMeans() Message-ID: Hello, Does "GetFeatureMeans()" here: https://github.com/midas-journal/midas-journal-231/blob/master/Source/itkRunLengthFeaturesTest.cxx means that we want to retrieve the "mean" value of the features? Is there some description for that in the documentation, since I couldn't find a description for this method. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From medswengineer at gmail.com Thu Jul 24 05:43:52 2014 From: medswengineer at gmail.com (med aweng) Date: Thu, 24 Jul 2014 11:43:52 +0200 Subject: [ITK-users] GetRequestedFeatures() Message-ID: Hello, What does the method "GetRequestedFeatures()" mean, here: https://github.com/midas-journal/midas-journal-231/blob/master/Source/itkRunLengthFeaturesTest.cxx I couldn't find a description for that in the documentation. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From medswengineer at gmail.com Thu Jul 24 05:47:28 2014 From: medswengineer at gmail.com (med aweng) Date: Thu, 24 Jul 2014 11:47:28 +0200 Subject: [ITK-users] ConstIterator Message-ID: Hello, What is the purpose of the "ConstIterator". Where can I find its description? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.ulge at gmail.com Thu Jul 24 06:07:26 2014 From: marco.ulge at gmail.com (Marco Ulgelmo) Date: Thu, 24 Jul 2014 12:07:26 +0200 Subject: [ITK-users] ConstIterator In-Reply-To: References: Message-ID: A ConstIterator an iterator which is used to iterate over a constant container, which means that data in the container can't be modified (unless you use const_cast). You can find it in the ITK documentation. Marco 2014-07-24 11:47 GMT+02:00 med aweng : > Hello, > > What is the purpose of the "ConstIterator". Where can I find its > description? > > Thanks. > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.ulge at gmail.com Thu Jul 24 06:08:59 2014 From: marco.ulge at gmail.com (Marco Ulgelmo) Date: Thu, 24 Jul 2014 12:08:59 +0200 Subject: [ITK-users] GetFeatureMeans() In-Reply-To: References: Message-ID: Take a look at: http://www.itk.org/Doxygen/html/classitk_1_1Statistics_1_1ScalarImageToTextureFeaturesFilter.html which answers your other question too. Marco 2014-07-24 11:40 GMT+02:00 med aweng : > Hello, > > Does "GetFeatureMeans()" here: > https://github.com/midas-journal/midas-journal-231/blob/master/Source/itkRunLengthFeaturesTest.cxx > > means that we want to retrieve the "mean" value of the features? > > Is there some description for that in the documentation, since I couldn't > find a description for this method. > > Thanks. > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From medswengineer at gmail.com Thu Jul 24 06:09:52 2014 From: medswengineer at gmail.com (med aweng) Date: Thu, 24 Jul 2014 12:09:52 +0200 Subject: [ITK-users] ConstIterator In-Reply-To: References: Message-ID: Thanks Marco. Is that description in the itk documentation? I really couldn't find such clear explanation. Thanks. On Thu, Jul 24, 2014 at 12:07 PM, Marco Ulgelmo wrote: > A ConstIterator an iterator which is used to iterate over a constant > container, which means that data in the container can't be modified (unless > you use const_cast). You can find it in the ITK documentation. > > Marco > > > 2014-07-24 11:47 GMT+02:00 med aweng : > >> Hello, >> >> What is the purpose of the "ConstIterator". Where can I find its >> description? >> >> Thanks. >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From medswengineer at gmail.com Thu Jul 24 06:11:32 2014 From: medswengineer at gmail.com (med aweng) Date: Thu, 24 Jul 2014 12:11:32 +0200 Subject: [ITK-users] GetFeatureMeans() In-Reply-To: References: Message-ID: Thanks Marco. Since I'm new to itk, I just noticed the description. I was able to reach that point (the link you posted), but didn't notice there was a description for the methods. I can see them now. Thanks. On Thu, Jul 24, 2014 at 12:08 PM, Marco Ulgelmo wrote: > Take a look at: > > > http://www.itk.org/Doxygen/html/classitk_1_1Statistics_1_1ScalarImageToTextureFeaturesFilter.html > > which answers your other question too. > > Marco > > > > > 2014-07-24 11:40 GMT+02:00 med aweng : > >> Hello, >> >> Does "GetFeatureMeans()" here: >> https://github.com/midas-journal/midas-journal-231/blob/master/Source/itkRunLengthFeaturesTest.cxx >> >> means that we want to retrieve the "mean" value of the features? >> >> Is there some description for that in the documentation, since I couldn't >> find a description for this method. >> >> Thanks. >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From CHernando at telespazio.es Thu Jul 24 10:25:29 2014 From: CHernando at telespazio.es (Carlos Hernando Ramiro) Date: Thu, 24 Jul 2014 16:25:29 +0200 Subject: [ITK-users] Use more samples than available in region to compute Mattes MI metric Message-ID: <800D4DFDAF353641B990F5CEB49F05E179B9C9@GORDONS.aurensis.com> Dear all, I wanted to compute MattesMutualInformationImageToImageMetric just for a window of my image, so I have set an specific region with SetFixedImageRegion(region). As I did not know the existence of UseAllPixelsOn(), I initially calculate the size of my window and set the number of samples "manually" with SetNumberOfSpatialSamples() according to that size. I was calculating the size wrongly and I was giving SetNumberOfSpatialSamples() a number higher than the size of the region. However, after computing the metric and checking the number of pixels used with GetNumberOfPixelsCounted(), it says that it has used all the specified pixels, although they are more than the available in the region. When I discovered the error, I thought that although it gave me a number larger than the region it was actually using all the pixels available anyway. However, I did some tests with different numbers of pixels, which were larger than the size of the region and they provide different metric results. So my question is, is this behaviour normal? If so, where does the metric take the extra pixels from? PD. Using UseAllPixelsOn() it seems to work well because at least GetNumberOfPixelsCounted() gives me the number of pixels available in the region, but it would be great if I could somehow confirm it. Best regards Carlos From ksatyananda at gmail.com Thu Jul 24 11:41:00 2014 From: ksatyananda at gmail.com (Satyananda Kashyap) Date: Thu, 24 Jul 2014 10:41:00 -0500 Subject: [ITK-users] Suggestions about Python wrapping of cpp project In-Reply-To: References: Message-ID: Hi Mickha, When using SWIG I read that it cannot handle nested classes and that the interface classes would be needed to expose them separately to python. So I did actually try to use the interface file pipeline designed for ITK with gccxml to see if I could exposes the classes I had written. I am using a Visual Studio 2010 build. I had two main issues with it : 1. gccxml does not seem to be compatible with versions beyond VS2008. Now I wasn't sure if redoing my full cpp development in VS2008 would be a good idea. I could not find a workaround for this (Hence my attempt to try and use boost.python). 2. Also I needed to modify the interface files so that the other packages dependencies (i.e. VTK and OpenCV) could also work. I was not sure how to do that. Any suggestions on how/where I could start modifying. I like the fact that I will be able to automate the process and not write any interface files once I can get it working. Thanks, Regards, Kashyap On Thu, Jul 24, 2014 at 3:54 AM, Michka Popoff wrote: > Hi > > I am currently maintaining the Python part of ITK, but I don?t know if I > can help you. I just started with this some time ago and can not really > compare it to the boost python method as I don?t know it. > There is an old (but outdated) discussion about boost and swig here [1]. > But this was written for swig 1.34, and now we already have swig 3.0.2, > which brought a lot of improvements. > > Swig has been under heavy development lately. What I find nice with Swig > is that you get other languages for free, it does not only support python > but also Java, Ruby, TCL, ? (you will need to write some code for this > support though). > The Swig method is nice once you automatized your process. Depending on > the c++ code you wrote, you don?t even need to write interface files for > Swig. > For ITK, we have a small pipeline which reads the c++ code with gccxml, > and uses a python script [3] (which uses pygccxml) to create interface > files from the xml files. > > What problems did you encounter when trying the Swig route ? Maybe I can > help. > > Michka > > [1] https://dev.lsstcorp.org/trac/wiki/SwigVsBoostPython > [2] https://github.com/swig/swig > [3] > https://github.com/InsightSoftwareConsortium/ITK/blob/master/Wrapping/Generators/SwigInterface/igenerator.py > > On 23 juil. 2014, at 17:11, Satyananda Kashyap > wrote: > > > Hello, > > > > I am looking for your expert opinions here. I have a relatively large > C++ project I am working on which uses ITK mainly (hence the question here) > and to some extent VTK and OpenCV. I do think that my code is fairly well > written. I was thinking of wrapping my code to python using either SWIG or > boost.python. Here are my questions : > > > > > > 1. I am led to believe that prototyping and code development is much > faster in Python. Given that I have such a big cpp base code is it really > worth the effort to wrap into python and then continue there. > > > > 2. From what I have read ITK uses SWIG wrappings for wrapping into > Python while VTK uses the boost.python route. My initial attempts with both > have been relatively unsuccessful. Any opinion on which one is more user > friendly/better when I have to wrap my own custom classes which use a > combination of both ITK and VTK in them. > > > > 3. Any suggestion on a road map as to how to proceed. I am not sure at > what base class level I should wrap them and rewrite the dependencies in > python. > > > > Thanks, > > Regards, > > Kashyap > > _____________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Kitware offers ITK Training Courses, for more information visit: > > http://www.kitware.com/products/protraining.php > > > > Please keep messages on-topic and check the ITK FAQ at: > > http://www.itk.org/Wiki/ITK_FAQ > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/insight-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michkapopoff at gmail.com Thu Jul 24 13:15:59 2014 From: michkapopoff at gmail.com (Michka Popoff) Date: Thu, 24 Jul 2014 19:15:59 +0200 Subject: [ITK-users] Suggestions about Python wrapping of cpp project In-Reply-To: References: Message-ID: <735BADAE-8685-4268-84CE-21BF9A8391B3@gmail.com> Nested classes are supported by Swig 3.0.0 natively: http://www.swig.org/Doc3.0/SWIGDocumentation.html#SWIGPlus_nested_classes I have no clue if we have nested classes in ITK, and how it was wrapped. Maybe I?ll stumble upon this one day. So I can not really help here but should work. 1. gccxml is limited to VS2008, and we have no replacement for it. This is a known limitation which is also blocking for ITK. 2. For VTK, is this deeply nested in your c++ code ? Maybe you could just rewrite the VTK part using python directly ? This would remove one dependency. For OpenCV, I don?t know how this could be done. This would need to be researched on google, I found this blog post for example: Michka On 24 juil. 2014, at 17:41, Satyananda Kashyap wrote: > Hi Mickha, > > When using SWIG I read that it cannot handle nested classes and that the interface classes would be needed to expose them separately to python. So I did actually try to use the interface file pipeline designed for ITK with gccxml to see if I could exposes the classes I had written. I am using a Visual Studio 2010 build. I had two main issues with it : > > 1. gccxml does not seem to be compatible with versions beyond VS2008. Now I wasn't sure if redoing my full cpp development in VS2008 would be a good idea. I could not find a workaround for this (Hence my attempt to try and use boost.python). > > 2. Also I needed to modify the interface files so that the other packages dependencies (i.e. VTK and OpenCV) could also work. I was not sure how to do that. > > Any suggestions on how/where I could start modifying. I like the fact that I will be able to automate the process and not write any interface files once I can get it working. > > Thanks, > Regards, > Kashyap > > > On Thu, Jul 24, 2014 at 3:54 AM, Michka Popoff wrote: > Hi > > I am currently maintaining the Python part of ITK, but I don?t know if I can help you. I just started with this some time ago and can not really compare it to the boost python method as I don?t know it. > There is an old (but outdated) discussion about boost and swig here [1]. But this was written for swig 1.34, and now we already have swig 3.0.2, which brought a lot of improvements. > > Swig has been under heavy development lately. What I find nice with Swig is that you get other languages for free, it does not only support python but also Java, Ruby, TCL, ? (you will need to write some code for this support though). > The Swig method is nice once you automatized your process. Depending on the c++ code you wrote, you don?t even need to write interface files for Swig. > For ITK, we have a small pipeline which reads the c++ code with gccxml, and uses a python script [3] (which uses pygccxml) to create interface files from the xml files. > > What problems did you encounter when trying the Swig route ? Maybe I can help. > > Michka > > [1] https://dev.lsstcorp.org/trac/wiki/SwigVsBoostPython > [2] https://github.com/swig/swig > [3] https://github.com/InsightSoftwareConsortium/ITK/blob/master/Wrapping/Generators/SwigInterface/igenerator.py > > On 23 juil. 2014, at 17:11, Satyananda Kashyap wrote: > > > Hello, > > > > I am looking for your expert opinions here. I have a relatively large C++ project I am working on which uses ITK mainly (hence the question here) and to some extent VTK and OpenCV. I do think that my code is fairly well written. I was thinking of wrapping my code to python using either SWIG or boost.python. Here are my questions : > > > > > > 1. I am led to believe that prototyping and code development is much faster in Python. Given that I have such a big cpp base code is it really worth the effort to wrap into python and then continue there. > > > > 2. From what I have read ITK uses SWIG wrappings for wrapping into Python while VTK uses the boost.python route. My initial attempts with both have been relatively unsuccessful. Any opinion on which one is more user friendly/better when I have to wrap my own custom classes which use a combination of both ITK and VTK in them. > > > > 3. Any suggestion on a road map as to how to proceed. I am not sure at what base class level I should wrap them and rewrite the dependencies in python. > > > > Thanks, > > Regards, > > Kashyap > > _____________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Kitware offers ITK Training Courses, for more information visit: > > http://www.kitware.com/products/protraining.php > > > > Please keep messages on-topic and check the ITK FAQ at: > > http://www.itk.org/Wiki/ITK_FAQ > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/insight-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ksatyananda at gmail.com Thu Jul 24 14:47:54 2014 From: ksatyananda at gmail.com (Satyananda Kashyap) Date: Thu, 24 Jul 2014 13:47:54 -0500 Subject: [ITK-users] Suggestions about Python wrapping of cpp project In-Reply-To: <735BADAE-8685-4268-84CE-21BF9A8391B3@gmail.com> References: <735BADAE-8685-4268-84CE-21BF9A8391B3@gmail.com> Message-ID: Thank you for that. VTK is pretty deeply nested in my code. I will have to write a similar interface file. Can you suggest a starting point in the ITK interface files I can start looking at. I want to try and wrap a simple piece of my code modifying them. Regards, Kashyap On Thu, Jul 24, 2014 at 12:15 PM, Michka Popoff wrote: > Nested classes are supported by Swig 3.0.0 natively: > http://www.swig.org/Doc3.0/SWIGDocumentation.html#SWIGPlus_nested_classes > I have no clue if we have nested classes in ITK, and how it was wrapped. > Maybe I?ll stumble upon this one day. > So I can not really help here but should work. > > 1. gccxml is limited to VS2008, and we have no replacement for it. This is > a known limitation which is also blocking for ITK. > > 2. For VTK, is this deeply nested in your c++ code ? Maybe you could just > rewrite the VTK part using python directly ? This would remove one > dependency. > For OpenCV, I don?t know how this could be done. This would need to be > researched on google, I found this blog post for example: > > > Michka > > > > On 24 juil. 2014, at 17:41, Satyananda Kashyap > wrote: > > Hi Mickha, > > When using SWIG I read that it cannot handle nested classes and that the > interface classes would be needed to expose them separately to python. So I > did actually try to use the interface file pipeline designed for ITK with > gccxml to see if I could exposes the classes I had written. I am using a > Visual Studio 2010 build. I had two main issues with it : > > 1. gccxml does not seem to be compatible with versions beyond VS2008. Now > I wasn't sure if redoing my full cpp development in VS2008 would be a good > idea. I could not find a workaround for this (Hence my attempt to try and > use boost.python). > > 2. Also I needed to modify the interface files so that the other packages > dependencies (i.e. VTK and OpenCV) could also work. I was not sure how to > do that. > > Any suggestions on how/where I could start modifying. I like the fact that > I will be able to automate the process and not write any interface files > once I can get it working. > > Thanks, > Regards, > Kashyap > > > On Thu, Jul 24, 2014 at 3:54 AM, Michka Popoff > wrote: > >> Hi >> >> I am currently maintaining the Python part of ITK, but I don?t know if I >> can help you. I just started with this some time ago and can not really >> compare it to the boost python method as I don?t know it. >> There is an old (but outdated) discussion about boost and swig here [1]. >> But this was written for swig 1.34, and now we already have swig 3.0.2, >> which brought a lot of improvements. >> >> Swig has been under heavy development lately. What I find nice with Swig >> is that you get other languages for free, it does not only support python >> but also Java, Ruby, TCL, ? (you will need to write some code for this >> support though). >> The Swig method is nice once you automatized your process. Depending on >> the c++ code you wrote, you don?t even need to write interface files for >> Swig. >> For ITK, we have a small pipeline which reads the c++ code with gccxml, >> and uses a python script [3] (which uses pygccxml) to create interface >> files from the xml files. >> >> What problems did you encounter when trying the Swig route ? Maybe I can >> help. >> >> Michka >> >> [1] https://dev.lsstcorp.org/trac/wiki/SwigVsBoostPython >> [2] https://github.com/swig/swig >> [3] >> https://github.com/InsightSoftwareConsortium/ITK/blob/master/Wrapping/Generators/SwigInterface/igenerator.py >> >> On 23 juil. 2014, at 17:11, Satyananda Kashyap >> wrote: >> >> > Hello, >> > >> > I am looking for your expert opinions here. I have a relatively large >> C++ project I am working on which uses ITK mainly (hence the question here) >> and to some extent VTK and OpenCV. I do think that my code is fairly well >> written. I was thinking of wrapping my code to python using either SWIG or >> boost.python. Here are my questions : >> > >> > >> > 1. I am led to believe that prototyping and code development is much >> faster in Python. Given that I have such a big cpp base code is it really >> worth the effort to wrap into python and then continue there. >> > >> > 2. From what I have read ITK uses SWIG wrappings for wrapping into >> Python while VTK uses the boost.python route. My initial attempts with both >> have been relatively unsuccessful. Any opinion on which one is more user >> friendly/better when I have to wrap my own custom classes which use a >> combination of both ITK and VTK in them. >> > >> > 3. Any suggestion on a road map as to how to proceed. I am not sure at >> what base class level I should wrap them and rewrite the dependencies in >> python. >> > >> > Thanks, >> > Regards, >> > Kashyap >> > _____________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Kitware offers ITK Training Courses, for more information visit: >> > http://www.kitware.com/products/protraining.php >> > >> > Please keep messages on-topic and check the ITK FAQ at: >> > http://www.itk.org/Wiki/ITK_FAQ >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/insight-users >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michkapopoff at gmail.com Thu Jul 24 16:39:35 2014 From: michkapopoff at gmail.com (Michka Popoff) Date: Thu, 24 Jul 2014 22:39:35 +0200 Subject: [ITK-users] Suggestions about Python wrapping of cpp project In-Reply-To: References: <735BADAE-8685-4268-84CE-21BF9A8391B3@gmail.com> Message-ID: For VTK, I don?t know what would be the best way to tacle the problem. For the interface files, the best would be you compile the whole ITK project once to get the .i files. (You can set the wrapped images dimensions from 2;3 to 2 only, and wrap only the core group, to compile faster). You can then find the .i files in some folder of the build (I don?t remember in which folder exactly, you will have to search a little bit for them). You can also look at the base .i file we use, though I will not be able to help you a lot with it, as I did not write it, so it may take some time to decipher: https://github.com/InsightSoftwareConsortium/ITK/blob/master/Wrapping/Generators/Python/PyBase/pyBase.i So maybe the starting point would to have a first part of your code compiled with Swig. Build a minimal c++ dummy example to understand how it all works, And then you?ll need to go step by step. I can not guarantee you will succeed, but I would be definitively interested if it works. Maybe if you find something out, it would be very nice to have a tutorial on how to do this. Ho, and I just thought about something else. Once ITK is compiled and installed, you can use it as an external project, even with python: See one example: https://github.com/InsightSoftwareConsortium/itkPyBuffer Or this one, at the very end of the page: http://cmake.org/Wiki/index.php?title=ITK/Release_4/Wrapping/BuildProcess&oldid=44313 This is not a tested feature for the moment so you may run into some trouble. Michka On 24 juil. 2014, at 20:47, Satyananda Kashyap wrote: > Thank you for that. VTK is pretty deeply nested in my code. I will have to write a similar interface file. > > Can you suggest a starting point in the ITK interface files I can start looking at. I want to try and wrap a simple piece of my code modifying them. > > Regards, > Kashyap > > > On Thu, Jul 24, 2014 at 12:15 PM, Michka Popoff wrote: > Nested classes are supported by Swig 3.0.0 natively: > http://www.swig.org/Doc3.0/SWIGDocumentation.html#SWIGPlus_nested_classes > I have no clue if we have nested classes in ITK, and how it was wrapped. Maybe I?ll stumble upon this one day. > So I can not really help here but should work. > > 1. gccxml is limited to VS2008, and we have no replacement for it. This is a known limitation which is also blocking for ITK. > > 2. For VTK, is this deeply nested in your c++ code ? Maybe you could just rewrite the VTK part using python directly ? This would remove one dependency. > For OpenCV, I don?t know how this could be done. This would need to be researched on google, I found this blog post for example: > > > Michka > > > > On 24 juil. 2014, at 17:41, Satyananda Kashyap wrote: > >> Hi Mickha, >> >> When using SWIG I read that it cannot handle nested classes and that the interface classes would be needed to expose them separately to python. So I did actually try to use the interface file pipeline designed for ITK with gccxml to see if I could exposes the classes I had written. I am using a Visual Studio 2010 build. I had two main issues with it : >> >> 1. gccxml does not seem to be compatible with versions beyond VS2008. Now I wasn't sure if redoing my full cpp development in VS2008 would be a good idea. I could not find a workaround for this (Hence my attempt to try and use boost.python). >> >> 2. Also I needed to modify the interface files so that the other packages dependencies (i.e. VTK and OpenCV) could also work. I was not sure how to do that. >> >> Any suggestions on how/where I could start modifying. I like the fact that I will be able to automate the process and not write any interface files once I can get it working. >> >> Thanks, >> Regards, >> Kashyap >> >> >> On Thu, Jul 24, 2014 at 3:54 AM, Michka Popoff wrote: >> Hi >> >> I am currently maintaining the Python part of ITK, but I don?t know if I can help you. I just started with this some time ago and can not really compare it to the boost python method as I don?t know it. >> There is an old (but outdated) discussion about boost and swig here [1]. But this was written for swig 1.34, and now we already have swig 3.0.2, which brought a lot of improvements. >> >> Swig has been under heavy development lately. What I find nice with Swig is that you get other languages for free, it does not only support python but also Java, Ruby, TCL, ? (you will need to write some code for this support though). >> The Swig method is nice once you automatized your process. Depending on the c++ code you wrote, you don?t even need to write interface files for Swig. >> For ITK, we have a small pipeline which reads the c++ code with gccxml, and uses a python script [3] (which uses pygccxml) to create interface files from the xml files. >> >> What problems did you encounter when trying the Swig route ? Maybe I can help. >> >> Michka >> >> [1] https://dev.lsstcorp.org/trac/wiki/SwigVsBoostPython >> [2] https://github.com/swig/swig >> [3] https://github.com/InsightSoftwareConsortium/ITK/blob/master/Wrapping/Generators/SwigInterface/igenerator.py >> >> On 23 juil. 2014, at 17:11, Satyananda Kashyap wrote: >> >> > Hello, >> > >> > I am looking for your expert opinions here. I have a relatively large C++ project I am working on which uses ITK mainly (hence the question here) and to some extent VTK and OpenCV. I do think that my code is fairly well written. I was thinking of wrapping my code to python using either SWIG or boost.python. Here are my questions : >> > >> > >> > 1. I am led to believe that prototyping and code development is much faster in Python. Given that I have such a big cpp base code is it really worth the effort to wrap into python and then continue there. >> > >> > 2. From what I have read ITK uses SWIG wrappings for wrapping into Python while VTK uses the boost.python route. My initial attempts with both have been relatively unsuccessful. Any opinion on which one is more user friendly/better when I have to wrap my own custom classes which use a combination of both ITK and VTK in them. >> > >> > 3. Any suggestion on a road map as to how to proceed. I am not sure at what base class level I should wrap them and rewrite the dependencies in python. >> > >> > Thanks, >> > Regards, >> > Kashyap >> > _____________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Kitware offers ITK Training Courses, for more information visit: >> > http://www.kitware.com/products/protraining.php >> > >> > Please keep messages on-topic and check the ITK FAQ at: >> > http://www.itk.org/Wiki/ITK_FAQ >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/insight-users >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vincent.ngai at gmail.com Thu Jul 24 23:18:17 2014 From: vincent.ngai at gmail.com (vincent ngai) Date: Fri, 25 Jul 2014 11:18:17 +0800 Subject: [ITK-users] Suggestions about Python wrapping of cpp project In-Reply-To: References: Message-ID: I'm no expert, but previously when I worked on projects where we exposed almost all core functionalities via scripts, it seemed like a good initially, but what really happened is a shifting of complexities. Rather than have the complexity on the C++/Compiled codebase side shifted over to the scripts, in situation where you need to be able to change functionality without recompiling the source, or even have access to the source, scripts are the way to go. But shifting complexities to the runtime/script side has its own issues, I'm happy with the C/C++ toolchain maturity, Visual C++, GCC, GDB etc, you have very comprehensive debugging and editor facilities available for C++, but on the script side you have far less tools, and debugging may be a hassle. Also for scripts that are scoped by whitespace/tabs and are not strictly typed, we found that scripts exceeding 1/2 pages in length tend to be less maintainable, and the chances of nuking a whitespace or overwriting a variable gets higher. Just my 2 cents On Wed, Jul 23, 2014 at 11:11 PM, Satyananda Kashyap wrote: > Hello, > > I am looking for your expert opinions here. I have a relatively large C++ > project I am working on which uses ITK mainly (hence the question here) and > to some extent VTK and OpenCV. I do think that my code is fairly well > written. I was thinking of wrapping my code to python using either SWIG or > boost.python. Here are my questions : > > > 1. I am led to believe that prototyping and code development is much > faster in Python. Given that I have such a big cpp base code is it really > worth the effort to wrap into python and then continue there. > > 2. From what I have read ITK uses SWIG wrappings for wrapping into Python > while VTK uses the boost.python route. My initial attempts with both have > been relatively unsuccessful. Any opinion on which one is more user > friendly/better when I have to wrap my own custom classes which use a > combination of both ITK and VTK in them. > > 3. Any suggestion on a road map as to how to proceed. I am not sure at > what base class level I should wrap them and rewrite the dependencies in > python. > > Thanks, > Regards, > Kashyap > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > -- Regards, Vincent -------------- next part -------------- An HTML attachment was scrubbed... URL: From ksatyananda at gmail.com Fri Jul 25 00:22:36 2014 From: ksatyananda at gmail.com (Satyananda Kashyap) Date: Thu, 24 Jul 2014 23:22:36 -0500 Subject: [ITK-users] Suggestions about Python wrapping of cpp project In-Reply-To: References: Message-ID: Thanks for your perspective Vincent. One of my initial questions were about the productivity boost which you get when using scripting languages. I am reasonably comfortable coding in C++ toolchain. From your experience do you really see a spike in productivity when you shift over. Is it worth the effort ? I think I will do some of the core development in C++ and expose them to Python. I wanted to use the scripting side more for prototyping and testing purposes. Regards, Kashyap On Thu, Jul 24, 2014 at 10:18 PM, vincent ngai wrote: > I'm no expert, but previously when I worked on projects where we exposed > almost all core functionalities via scripts, it seemed like a good > initially, but what really happened is a shifting of complexities. Rather > than have the complexity on the C++/Compiled codebase side shifted over to > the scripts, in situation where you need to be able to change functionality > without recompiling the source, or even have access to the source, scripts > are the way to go. But shifting complexities to the runtime/script side has > its own issues, I'm happy with the C/C++ toolchain maturity, Visual C++, > GCC, GDB etc, you have very comprehensive debugging and editor facilities > available for C++, but on the script side you have far less tools, and > debugging may be a hassle. > > Also for scripts that are scoped by whitespace/tabs and are not strictly > typed, we found that scripts exceeding 1/2 pages in length tend to be less > maintainable, and the chances of nuking a whitespace or overwriting a > variable gets higher. > > Just my 2 cents > > On Wed, Jul 23, 2014 at 11:11 PM, Satyananda Kashyap < > ksatyananda at gmail.com> wrote: > >> Hello, >> >> I am looking for your expert opinions here. I have a relatively large C++ >> project I am working on which uses ITK mainly (hence the question here) and >> to some extent VTK and OpenCV. I do think that my code is fairly well >> written. I was thinking of wrapping my code to python using either SWIG or >> boost.python. Here are my questions : >> >> >> 1. I am led to believe that prototyping and code development is much >> faster in Python. Given that I have such a big cpp base code is it really >> worth the effort to wrap into python and then continue there. >> >> 2. From what I have read ITK uses SWIG wrappings for wrapping into Python >> while VTK uses the boost.python route. My initial attempts with both have >> been relatively unsuccessful. Any opinion on which one is more user >> friendly/better when I have to wrap my own custom classes which use a >> combination of both ITK and VTK in them. >> >> 3. Any suggestion on a road map as to how to proceed. I am not sure at >> what base class level I should wrap them and rewrite the dependencies in >> python. >> >> Thanks, >> Regards, >> Kashyap >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> >> > > > -- > Regards, > Vincent > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michkapopoff at gmail.com Fri Jul 25 02:58:50 2014 From: michkapopoff at gmail.com (Michka Popoff) Date: Fri, 25 Jul 2014 08:58:50 +0200 Subject: [ITK-users] Suggestions about Python wrapping of cpp project In-Reply-To: References: Message-ID: <8830C7A1-250B-4E85-A718-30E510F34D2F@gmail.com> Vincent is right in the fact you have less debugging tools (in python for example). Still, I never needed one for what I was doing, and my app has 50000 pure python lines. You have also very nice tools that integrate to vim, emacs and sublime text that do pep8, pyflakes and pylint checks each time you save the file, so that indentation or syntax errors get statically checked. About strict types, it depends a lot on what type of application you are running, and if this is really critical to you, you should not use python. If you need only integers, floats and strings, you may not need to care. And when code starts to be too long, break it up in classes and methods in different modules, and refactor :) If your software will be used by beginners, letting them use it with python is very nice, and a lot of softwares are doing it (Paraview for example, but there are many others). Even for more advanced users, it?s sometimes easier to start off with some python in a software they don?t know. But I would not say you would get a spike in productivity for advanced users, they already know how to code in c++. Still, Python is very mature, and as I said, I am running a pure python app to do multiprocessing computing on big files ? and I am happy with it. The question if it is worth to add python support is a difficult question. It depends how many time and the ressources you have to throw at it :) On 25 juil. 2014, at 06:22, Satyananda Kashyap wrote: > Thanks for your perspective Vincent. > > One of my initial questions were about the productivity boost which you get when using scripting languages. I am reasonably comfortable coding in C++ toolchain. From your experience do you really see a spike in productivity when you shift over. Is it worth the effort ? > > I think I will do some of the core development in C++ and expose them to Python. I wanted to use the scripting side more for prototyping and testing purposes. > > Regards, > Kashyap > > > On Thu, Jul 24, 2014 at 10:18 PM, vincent ngai wrote: > I'm no expert, but previously when I worked on projects where we exposed almost all core functionalities via scripts, it seemed like a good initially, but what really happened is a shifting of complexities. Rather than have the complexity on the C++/Compiled codebase side shifted over to the scripts, in situation where you need to be able to change functionality without recompiling the source, or even have access to the source, scripts are the way to go. But shifting complexities to the runtime/script side has its own issues, I'm happy with the C/C++ toolchain maturity, Visual C++, GCC, GDB etc, you have very comprehensive debugging and editor facilities available for C++, but on the script side you have far less tools, and debugging may be a hassle. > > Also for scripts that are scoped by whitespace/tabs and are not strictly typed, we found that scripts exceeding 1/2 pages in length tend to be less maintainable, and the chances of nuking a whitespace or overwriting a variable gets higher. > > Just my 2 cents > > On Wed, Jul 23, 2014 at 11:11 PM, Satyananda Kashyap wrote: > Hello, > > I am looking for your expert opinions here. I have a relatively large C++ project I am working on which uses ITK mainly (hence the question here) and to some extent VTK and OpenCV. I do think that my code is fairly well written. I was thinking of wrapping my code to python using either SWIG or boost.python. Here are my questions : > > > 1. I am led to believe that prototyping and code development is much faster in Python. Given that I have such a big cpp base code is it really worth the effort to wrap into python and then continue there. > > 2. From what I have read ITK uses SWIG wrappings for wrapping into Python while VTK uses the boost.python route. My initial attempts with both have been relatively unsuccessful. Any opinion on which one is more user friendly/better when I have to wrap my own custom classes which use a combination of both ITK and VTK in them. > > 3. Any suggestion on a road map as to how to proceed. I am not sure at what base class level I should wrap them and rewrite the dependencies in python. > > Thanks, > Regards, > Kashyap > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > > > > -- > Regards, > Vincent > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From vincent.ngai at gmail.com Fri Jul 25 03:39:10 2014 From: vincent.ngai at gmail.com (vincent ngai) Date: Fri, 25 Jul 2014 15:39:10 +0800 Subject: [ITK-users] Suggestions about Python wrapping of cpp project In-Reply-To: References: Message-ID: My project was designed as a C++ framework with functionality exposed to scripts, so it acts like an executable that runs a script that determines the program behaviour rather than a pure python program. It might be an important factor whether its a pure python app or an app that runs python. Honestly I can't tell if relegating some application logic to scripts is more productive, it works for sure, how productive it is ultimately depends on how many of our next projects rely on using the existing framework. :) Sorry I don't have a clear cut answer its a bit early to tell for my project. On Fri, Jul 25, 2014 at 12:22 PM, Satyananda Kashyap wrote: > Thanks for your perspective Vincent. > > One of my initial questions were about the productivity boost which you > get when using scripting languages. I am reasonably comfortable coding in > C++ toolchain. From your experience do you really see a spike in > productivity when you shift over. Is it worth the effort ? > > I think I will do some of the core development in C++ and expose them to > Python. I wanted to use the scripting side more for prototyping and testing > purposes. > > Regards, > Kashyap > > > On Thu, Jul 24, 2014 at 10:18 PM, vincent ngai > wrote: > >> I'm no expert, but previously when I worked on projects where we exposed >> almost all core functionalities via scripts, it seemed like a good >> initially, but what really happened is a shifting of complexities. Rather >> than have the complexity on the C++/Compiled codebase side shifted over to >> the scripts, in situation where you need to be able to change functionality >> without recompiling the source, or even have access to the source, scripts >> are the way to go. But shifting complexities to the runtime/script side has >> its own issues, I'm happy with the C/C++ toolchain maturity, Visual C++, >> GCC, GDB etc, you have very comprehensive debugging and editor facilities >> available for C++, but on the script side you have far less tools, and >> debugging may be a hassle. >> >> Also for scripts that are scoped by whitespace/tabs and are not strictly >> typed, we found that scripts exceeding 1/2 pages in length tend to be less >> maintainable, and the chances of nuking a whitespace or overwriting a >> variable gets higher. >> >> Just my 2 cents >> >> On Wed, Jul 23, 2014 at 11:11 PM, Satyananda Kashyap < >> ksatyananda at gmail.com> wrote: >> >>> Hello, >>> >>> I am looking for your expert opinions here. I have a relatively large >>> C++ project I am working on which uses ITK mainly (hence the question here) >>> and to some extent VTK and OpenCV. I do think that my code is fairly well >>> written. I was thinking of wrapping my code to python using either SWIG or >>> boost.python. Here are my questions : >>> >>> >>> 1. I am led to believe that prototyping and code development is much >>> faster in Python. Given that I have such a big cpp base code is it really >>> worth the effort to wrap into python and then continue there. >>> >>> 2. From what I have read ITK uses SWIG wrappings for wrapping into >>> Python while VTK uses the boost.python route. My initial attempts with both >>> have been relatively unsuccessful. Any opinion on which one is more user >>> friendly/better when I have to wrap my own custom classes which use a >>> combination of both ITK and VTK in them. >>> >>> 3. Any suggestion on a road map as to how to proceed. I am not sure at >>> what base class level I should wrap them and rewrite the dependencies in >>> python. >>> >>> Thanks, >>> Regards, >>> Kashyap >>> >>> _____________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://www.kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the ITK FAQ at: >>> http://www.itk.org/Wiki/ITK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/insight-users >>> >>> >> >> >> -- >> Regards, >> Vincent >> > > -- Regards, Vincent -------------- next part -------------- An HTML attachment was scrubbed... URL: From fdrakopo at gmail.com Fri Jul 25 15:32:25 2014 From: fdrakopo at gmail.com (Fotis Drakopoulos) Date: Fri, 25 Jul 2014 15:32:25 -0400 Subject: [ITK-users] Problems with the integration of LASPack package into ITK Message-ID: Hi ITK developers, I am working on the integration of the LASPack package ( http://www.netlib.org/linalg/) inside the ITK for solving for solving large sparse systems of linear equations with iterative methods. I created a new folder with name laspack under the directory : Modules/ThirdParty/VNL/src/vxl/v3p/netlib/ with the following CMakeList.txt : *PROJECT( laspack )* *# List sources for each library component.* *SET(V3P_NETLIB_laspack_SOURCES* * eigenval.c* * errhandl.c* * factor.c* * itersolv.c* * matrix.c* * mlsolv.c* * operats.c* * precond.c* * qmatrix.c* * rtc.c* * vector.c* * eigenval.h* * elcmp.h* * errhandl.h* * factor.h* * itersolv.h* * lastypes.h* * matrix.h* * mlsolv.h* * operats.h* * precond.h* * qmatrix.h* * rtc.h* * vector.h* * version.h* * copyrght.h* * xc/getopts.c* * xc/xstring.c* * xc/getopts.h* * xc/version.h* * xc/xstring.h* * xc/xtypes.h* * )* *# Create a library .* *ADD_LIBRARY(itkv3p_laspack ${V3P_NETLIB_laspack_SOURCES})* *IF(UNIX)* * TARGET_LINK_LIBRARIES( itkv3p_laspack m )* *ENDIF(UNIX)* *IF(ITK_LIBRARY_PROPERTIES)* * SET_TARGET_PROPERTIES(itkv3p_laspack PROPERTIES ${ITK_LIBRARY_PROPERTIES})* *ENDIF(ITK_LIBRARY_PROPERTIES)* *IF(NOT VXL_INSTALL_NO_LIBRARIES)* * INSTALL(TARGETS itkv3p_laspack* * EXPORT ${VXL_INSTALL_EXPORT_NAME}* * RUNTIME DESTINATION ${VXL_INSTALL_RUNTIME_DIR} COMPONENT RuntimeLibraries* * LIBRARY DESTINATION ${VXL_INSTALL_LIBRARY_DIR} COMPONENT RuntimeLibraries* * ARCHIVE DESTINATION ${VXL_INSTALL_ARCHIVE_DIR} COMPONENT Development)* *ENDIF(NOT VXL_INSTALL_NO_LIBRARIES)* *IF(NOT VXL_INSTALL_NO_DEVELOPMENT)* * INSTALL_NOBASE_HEADER_FILES(${VXL_INSTALL_INCLUDE_DIR} ${V3P_NETLIB_laspack_SOURCES})* *ENDIF(NOT VXL_INSTALL_NO_DEVELOPMENT)* Also in the CMakeLists.txt located in direcory : Modules/ThirdParty/VNL/src I added the new *itkv3p_laspack* library as follows: *add_subdirectory(vxl)* *foreach(lib itkvcl itkv3p_netlib itkv3p_lsqr itkv3p_laspack itktestlib itkvnl itkvnl_algo)* * itk_module_target(${lib} NO_INSTALL)* *endforeach()* When I build ITK I do not get any errors and the *libitkv3p_laspack. a* is normally created like all the other ITK libraries. However when I compile an external project which links to ITK with TARGET_LINK_LIBRARIES(PROJECT_NAME ${ITK_LIBRARIES}), I am getting the following link error: */home/fdrakopo/local/bin/ITKDev/release/lib/libitkvnl_algo-4.1.a(vnl_sparse_iterative_solver.cxx.o): In function `vnl_sparse_iterative_solver::vnl_sparse_iterative_solver(vnl_sparse_matrix const&)':* *vnl_sparse_iterative_solver.cxx:(.text+0x6a): undefined reference to `Q_SetName(QMatrixType*, char*)'* *collect2: error: ld returned 1 exit status* *make[2]: *** [PAPBNRR] Error 1* *make[1]: *** [CMakeFiles/PAPBNRR.dir/all] Error 2* *make: *** [all] Error 2* The vnl_sparse_iterative_solver is a new class I created under : Modules/ThirdParty/VNL/src/vxl/core/vnl/algo and encapsulates the implemented calls (functions, etc.) to the LASPack package (similarly to vnl_sparse_lu class that calls Kenneth's Kundert SPARSE package). Also the itkvnl_algo inks to itkv3p_laspack : *TARGET_LINK_LIBRARIES( itkvnl_algo ${NETLIB_LIBRARIES} itkvnl itkv3p_lsqr itkv3p_laspack ) * Any ideas how can I solve the above link error? Regards, Fotis Drakopoulos CRTC lab -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Fri Jul 25 15:44:51 2014 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Fri, 25 Jul 2014 15:44:51 -0400 Subject: [ITK-users] [ITK-dev] Problems with the integration of LASPack package into ITK In-Reply-To: References: Message-ID: Hello, I am not certain but I just was looking around at a few things and found some work related to ITKv4 Numerics Refactors[1] here on github that's a bit out dated: https://github.com/chuckatkins/ITK/commits/numlibs_refactor Looks like similar work and my first search reveals this may be of use: https://github.com/chuckatkins/ITK/commit/2c773edc695cbe7b907bebf356ee14e0af66b01a Brad [1] http://www.itk.org/Wiki/ITK_Release_4/Refactor_Numerical_Libraries On Jul 25, 2014, at 3:32 PM, Fotis Drakopoulos wrote: > Hi ITK developers, > > I am working on the integration of the LASPack package (http://www.netlib.org/linalg/) inside the ITK for solving for solving large sparse systems of linear equations with iterative methods. > I created a new folder with name laspack under the directory : Modules/ThirdParty/VNL/src/vxl/v3p/netlib/ with the following CMakeList.txt : > > PROJECT( laspack ) > > # List sources for each library component. > SET(V3P_NETLIB_laspack_SOURCES > eigenval.c > errhandl.c > factor.c > itersolv.c > matrix.c > mlsolv.c > operats.c > precond.c > qmatrix.c > rtc.c > vector.c > eigenval.h > elcmp.h > errhandl.h > factor.h > itersolv.h > lastypes.h > matrix.h > mlsolv.h > operats.h > precond.h > qmatrix.h > rtc.h > vector.h > version.h > copyrght.h > xc/getopts.c > xc/xstring.c > xc/getopts.h > xc/version.h > xc/xstring.h > xc/xtypes.h > ) > > # Create a library . > ADD_LIBRARY(itkv3p_laspack ${V3P_NETLIB_laspack_SOURCES}) > IF(UNIX) > TARGET_LINK_LIBRARIES( itkv3p_laspack m ) > ENDIF(UNIX) > IF(ITK_LIBRARY_PROPERTIES) > SET_TARGET_PROPERTIES(itkv3p_laspack PROPERTIES ${ITK_LIBRARY_PROPERTIES}) > ENDIF(ITK_LIBRARY_PROPERTIES) > > IF(NOT VXL_INSTALL_NO_LIBRARIES) > INSTALL(TARGETS itkv3p_laspack > EXPORT ${VXL_INSTALL_EXPORT_NAME} > RUNTIME DESTINATION ${VXL_INSTALL_RUNTIME_DIR} COMPONENT RuntimeLibraries > LIBRARY DESTINATION ${VXL_INSTALL_LIBRARY_DIR} COMPONENT RuntimeLibraries > ARCHIVE DESTINATION ${VXL_INSTALL_ARCHIVE_DIR} COMPONENT Development) > ENDIF(NOT VXL_INSTALL_NO_LIBRARIES) > IF(NOT VXL_INSTALL_NO_DEVELOPMENT) > INSTALL_NOBASE_HEADER_FILES(${VXL_INSTALL_INCLUDE_DIR} ${V3P_NETLIB_laspack_SOURCES}) > ENDIF(NOT VXL_INSTALL_NO_DEVELOPMENT) > > Also in the CMakeLists.txt located in direcory : Modules/ThirdParty/VNL/src I added the new itkv3p_laspack library as follows: > > add_subdirectory(vxl) > foreach(lib itkvcl itkv3p_netlib itkv3p_lsqr itkv3p_laspack itktestlib itkvnl itkvnl_algo) > itk_module_target(${lib} NO_INSTALL) > endforeach() > > When I build ITK I do not get any errors and the libitkv3p_laspack. a is normally created like all the other ITK libraries. > However when I compile an external project which links to ITK with TARGET_LINK_LIBRARIES(PROJECT_NAME ${ITK_LIBRARIES}), I am getting the following link error: > > /home/fdrakopo/local/bin/ITKDev/release/lib/libitkvnl_algo-4.1.a(vnl_sparse_iterative_solver.cxx.o): In function `vnl_sparse_iterative_solver::vnl_sparse_iterative_solver(vnl_sparse_matrix const&)': > vnl_sparse_iterative_solver.cxx:(.text+0x6a): undefined reference to `Q_SetName(QMatrixType*, char*)' > collect2: error: ld returned 1 exit status > make[2]: *** [PAPBNRR] Error 1 > make[1]: *** [CMakeFiles/PAPBNRR.dir/all] Error 2 > make: *** [all] Error 2 > > The vnl_sparse_iterative_solver is a new class I created under : Modules/ThirdParty/VNL/src/vxl/core/vnl/algo > and encapsulates the implemented calls (functions, etc.) to the LASPack package (similarly to vnl_sparse_lu class that calls Kenneth's Kundert SPARSE package). > Also the itkvnl_algo inks to itkv3p_laspack : > TARGET_LINK_LIBRARIES( itkvnl_algo ${NETLIB_LIBRARIES} itkvnl itkv3p_lsqr itkv3p_laspack ) > > Any ideas how can I solve the above link error? > > Regards, > Fotis Drakopoulos > CRTC lab > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-developers -------------- next part -------------- An HTML attachment was scrubbed... URL: From soccer_zhe at hotmail.com Sat Jul 26 00:29:44 2014 From: soccer_zhe at hotmail.com (zhe) Date: Sat, 26 Jul 2014 12:29:44 +0800 Subject: [ITK-users] Building ITK4.5.2 with Python wrapping: A tool returned an error code from "Generating ../vcInstall_stamp.c" Message-ID: Dear All I am trying to build ITK with Python wrapping on windows (python 2.7.7 32bit, VS 2008 32bit and Windows 7 64bit). But during the compiling, the VS 2008 reported a error as follow: 1>1>------ Build started: Project: vcInstallPatch, Configuration: Release Win32 ------ 1>1>Generating ../vcInstall_stamp.c 1>1>Executing D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vccat.exe D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vc9Include.patch | D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vcpatch.exe -p0 -t -d D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML-build\GCC_XML\Support\Vc9\Include 1>1>Error running patch. Output is [] 1>1>Executing D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vccat.exe D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vc9PlatformSDK.patch | D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vcpatch.exe -p0 -t -d D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML-build\GCC_XML\Support\Vc9\PlatformSDK 1>1>Error running patch. Output is [] 1>1>Executing D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vccat.exe D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vc10Include.patch | D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vcpatch.exe -p0 -t -d D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML-build\GCC_XML\Support\Vc10\Include 1>1>Error running patch. Output is [] 1>1>Executing D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vccat.exe D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vc10PlatformSDK.patch | D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vcpatch.exe -p0 -t -d D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML-build\GCC_XML\Support\Vc10\PlatformSDK 1>1>Error running patch. Output is [] 1>1>Project : error PRJ0019: A tool returned an error code from "Generating ../vcInstall_stamp.c" 1>1>Build log was saved at "file://d:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML-build\GCC_XML\VcInstall\vcInstallPatch.dir\Release\BuildLog.htm" 1>1>vcInstallPatch - 1 error(s), 0 warning(s) 1>========== Build: 0 succeeded, 1 failed, 36 up-to-date, 0 skipped ========== 1>Project : error PRJ0019: A tool returned an error code from "Performing build step for 'GCC_XML'" 1>Build log was saved at "file://d:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\GCC_XML.dir\Release\BuildLog.htm" 1>GCC_XML - 2 error(s), 0 warning(s) How can I solve this problem? Thank you very much. Best regards Zhe Luo -------------- next part -------------- An HTML attachment was scrubbed... URL: From michkapopoff at gmail.com Sat Jul 26 05:01:18 2014 From: michkapopoff at gmail.com (Michka Popoff) Date: Sat, 26 Jul 2014 11:01:18 +0200 Subject: [ITK-users] Building ITK4.5.2 with Python wrapping: A tool returned an error code from "Generating ../vcInstall_stamp.c" In-Reply-To: References: Message-ID: Hi I don?t know if it?s a solution, but last time I had trouble with the gccxml part, I had to disable my antivirus (Avast in my case). It blocks some files to be extracted or to run. You may start with a new build folder and try this. If it?s still not working, please report back, I will then try to compile it myself, but it should be OK as we have a machine running with this setup on our Dashboard. Michka On 26 juil. 2014, at 06:29, zhe wrote: > Dear All > > I am trying to build ITK with Python wrapping on windows (python 2.7.7 32bit, VS 2008 32bit and Windows 7 64bit). But during the compiling, the VS 2008 reported a error as follow: > > > 1>1>------ Build started: Project: vcInstallPatch, Configuration: Release Win32 ------ > 1>1>Generating ../vcInstall_stamp.c > 1>1>Executing D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vccat.exe D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vc9Include.patch | D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vcpatch.exe -p0 -t -d D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML-build\GCC_XML\Support\Vc9\Include > 1>1>Error running patch. Output is [] > 1>1>Executing D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vccat.exe D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vc9PlatformSDK.patch | D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vcpatch.exe -p0 -t -d D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML-build\GCC_XML\Support\Vc9\PlatformSDK > 1>1>Error running patch. Output is [] > 1>1>Executing D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vccat.exe D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vc10Include.patch | D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vcpatch.exe -p0 -t -d D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML-build\GCC_XML\Support\Vc10\Include > 1>1>Error running patch. Output is [] > 1>1>Executing D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vccat.exe D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vc10PlatformSDK.patch | D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vcpatch.exe -p0 -t -d D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML-build\GCC_XML\Support\Vc10\PlatformSDK > 1>1>Error running patch. Output is [] > 1>1>Project : error PRJ0019: A tool returned an error code from "Generating ../vcInstall_stamp.c" > 1>1>Build log was saved at "file://d:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML-build\GCC_XML\VcInstall\vcInstallPatch.dir\Release\BuildLog.htm" > 1>1>vcInstallPatch - 1 error(s), 0 warning(s) > 1>========== Build: 0 succeeded, 1 failed, 36 up-to-date, 0 skipped ========== > 1>Project : error PRJ0019: A tool returned an error code from "Performing build step for 'GCC_XML'" > 1>Build log was saved at "file://d:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\GCC_XML.dir\Release\BuildLog.htm" > 1>GCC_XML - 2 error(s), 0 warning(s) > > How can I solve this problem? > Thank you very much. > > Best regards > > Zhe Luo > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Sat Jul 26 08:46:34 2014 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Sat, 26 Jul 2014 08:46:34 -0400 Subject: [ITK-users] Building ITK4.5.2 with Python wrapping: A tool returned an error code from "Generating ../vcInstall_stamp.c" In-Reply-To: References: Message-ID: <31347E6A-DA8B-479A-8F9D-550CF33AC703@mail.nih.gov> Hello, Have you looked into SimpleITK[1]? It provides binary distributions for windows that are readily available, if you are having too much difficulty compiling with the native WrapITK. [1] http://www.itk.org/Wiki/SimpleITK On Jul 26, 2014, at 5:01 AM, Michka Popoff wrote: > Hi > > I don?t know if it?s a solution, but last time I had trouble with the gccxml part, I had to disable my antivirus (Avast in my case). > It blocks some files to be extracted or to run. You may start with a new build folder and try this. > > If it?s still not working, please report back, I will then try to compile it myself, but it should be OK as we have a machine running with this setup on our Dashboard. > > Michka > > On 26 juil. 2014, at 06:29, zhe wrote: > >> Dear All >> >> I am trying to build ITK with Python wrapping on windows (python 2.7.7 32bit, VS 2008 32bit and Windows 7 64bit). But during the compiling, the VS 2008 reported a error as follow: >> >> >> 1>1>------ Build started: Project: vcInstallPatch, Configuration: Release Win32 ------ >> 1>1>Generating ../vcInstall_stamp.c >> 1>1>Executing D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vccat.exe D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vc9Include.patch | D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vcpatch.exe -p0 -t -d D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML-build\GCC_XML\Support\Vc9\Include >> 1>1>Error running patch. Output is [] >> 1>1>Executing D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vccat.exe D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vc9PlatformSDK.patch | D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vcpatch.exe -p0 -t -d D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML-build\GCC_XML\Support\Vc9\PlatformSDK >> 1>1>Error running patch. Output is [] >> 1>1>Executing D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vccat.exe D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vc10Include.patch | D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vcpatch.exe -p0 -t -d D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML-build\GCC_XML\Support\Vc10\Include >> 1>1>Error running patch. Output is [] >> 1>1>Executing D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vccat.exe D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vc10PlatformSDK.patch | D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML\GCC_XML\VcInstall\vcpatch.exe -p0 -t -d D:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML-build\GCC_XML\Support\Vc10\PlatformSDK >> 1>1>Error running patch. Output is [] >> 1>1>Project : error PRJ0019: A tool returned an error code from "Generating ../vcInstall_stamp.c" >> 1>1>Build log was saved at "file://d:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\gccxml\src\GCC_XML-build\GCC_XML\VcInstall\vcInstallPatch.dir\Release\BuildLog.htm" >> 1>1>vcInstallPatch - 1 error(s), 0 warning(s) >> 1>========== Build: 0 succeeded, 1 failed, 36 up-to-date, 0 skipped ========== >> 1>Project : error PRJ0019: A tool returned an error code from "Performing build step for 'GCC_XML'" >> 1>Build log was saved at "file://d:\ITK4.5.2\ITK_Build\Wrapping\Generators\GccXML\GCC_XML.dir\Release\BuildLog.htm" >> 1>GCC_XML - 2 error(s), 0 warning(s) >> >> How can I solve this problem? >> Thank you very much. >> >> Best regards >> >> Zhe Luo >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From fdrakopo at gmail.com Sat Jul 26 13:15:02 2014 From: fdrakopo at gmail.com (Fotis Drakopoulos) Date: Sat, 26 Jul 2014 13:15:02 -0400 Subject: [ITK-users] [ITK-dev] Problems with the integration of LASPack package into ITK In-Reply-To: References: Message-ID: Hi Brad, I made the appropriate changes to all CMakeLists.txt files according to [1] but I still get the same error when I link the external project to ITK libraries. I also tried NOT to create a separate *libitkv3p_laspack *but to include laspack into the *itkv3p_netlib* (like the SPARSE package) and I still get the same link error. After spending several days on the LASPack integration I am not sure why I get this link error... [1] https://github.com/chuckatkins/ITK/commit/2c773edc695cbe7b907bebf356ee14e0af66b01a Best, Fotis On Fri, Jul 25, 2014 at 3:44 PM, Bradley Lowekamp wrote: > Hello, > > I am not certain but I just was looking around at a few things and found > some work related to ITKv4 Numerics Refactors[1] here on github that's a > bit out dated: > https://github.com/chuckatkins/ITK/commits/numlibs_refactor > > Looks like similar work and my first search reveals this may be of use: > > https://github.com/chuckatkins/ITK/commit/2c773edc695cbe7b907bebf356ee14e0af66b01a > > Brad > > [1] http://www.itk.org/Wiki/ITK_Release_4/Refactor_Numerical_Libraries > > On Jul 25, 2014, at 3:32 PM, Fotis Drakopoulos wrote: > > Hi ITK developers, > > I am working on the integration of the LASPack package ( > http://www.netlib.org/linalg/) inside the ITK for solving for solving > large sparse systems of linear equations with iterative methods. > I created a new folder with name laspack under the directory : > Modules/ThirdParty/VNL/src/vxl/v3p/netlib/ with the following CMakeList.txt > : > > *PROJECT( laspack )* > > *# List sources for each library component.* > *SET(V3P_NETLIB_laspack_SOURCES* > * eigenval.c* > * errhandl.c* > * factor.c* > * itersolv.c* > * matrix.c* > * mlsolv.c* > * operats.c* > * precond.c* > * qmatrix.c* > * rtc.c* > * vector.c* > * eigenval.h* > * elcmp.h* > * errhandl.h* > * factor.h* > * itersolv.h* > * lastypes.h* > * matrix.h* > * mlsolv.h* > * operats.h* > * precond.h* > * qmatrix.h* > * rtc.h* > * vector.h* > * version.h* > * copyrght.h* > * xc/getopts.c* > * xc/xstring.c* > * xc/getopts.h* > * xc/version.h* > * xc/xstring.h* > * xc/xtypes.h* > * )* > > *# Create a library .* > *ADD_LIBRARY(itkv3p_laspack ${V3P_NETLIB_laspack_SOURCES})* > *IF(UNIX)* > * TARGET_LINK_LIBRARIES( itkv3p_laspack m )* > *ENDIF(UNIX)* > *IF(ITK_LIBRARY_PROPERTIES)* > * SET_TARGET_PROPERTIES(itkv3p_laspack PROPERTIES > ${ITK_LIBRARY_PROPERTIES})* > *ENDIF(ITK_LIBRARY_PROPERTIES)* > > *IF(NOT VXL_INSTALL_NO_LIBRARIES)* > * INSTALL(TARGETS itkv3p_laspack* > * EXPORT ${VXL_INSTALL_EXPORT_NAME}* > * RUNTIME DESTINATION ${VXL_INSTALL_RUNTIME_DIR} COMPONENT > RuntimeLibraries* > * LIBRARY DESTINATION ${VXL_INSTALL_LIBRARY_DIR} COMPONENT > RuntimeLibraries* > * ARCHIVE DESTINATION ${VXL_INSTALL_ARCHIVE_DIR} COMPONENT Development)* > *ENDIF(NOT VXL_INSTALL_NO_LIBRARIES)* > *IF(NOT VXL_INSTALL_NO_DEVELOPMENT)* > * INSTALL_NOBASE_HEADER_FILES(${VXL_INSTALL_INCLUDE_DIR} > ${V3P_NETLIB_laspack_SOURCES})* > *ENDIF(NOT VXL_INSTALL_NO_DEVELOPMENT)* > > Also in the CMakeLists.txt located in direcory : > Modules/ThirdParty/VNL/src I added the new *itkv3p_laspack* library as > follows: > > *add_subdirectory(vxl)* > *foreach(lib itkvcl itkv3p_netlib itkv3p_lsqr itkv3p_laspack itktestlib > itkvnl itkvnl_algo)* > * itk_module_target(${lib} NO_INSTALL)* > *endforeach()* > > When I build ITK I do not get any errors and the *libitkv3p_laspack. a* > is normally created like all the other ITK libraries. > However when I compile an external project which links to ITK with > TARGET_LINK_LIBRARIES(PROJECT_NAME ${ITK_LIBRARIES}), I am getting the > following link error: > > */home/fdrakopo/local/bin/ITKDev/release/lib/libitkvnl_algo-4.1.a(vnl_sparse_iterative_solver.cxx.o): > In function > `vnl_sparse_iterative_solver::vnl_sparse_iterative_solver(vnl_sparse_matrix > const&)':* > *vnl_sparse_iterative_solver.cxx:(.text+0x6a): undefined reference to > `Q_SetName(QMatrixType*, char*)'* > *collect2: error: ld returned 1 exit status* > *make[2]: *** [PAPBNRR] Error 1* > *make[1]: *** [CMakeFiles/PAPBNRR.dir/all] Error 2* > *make: *** [all] Error 2* > > The vnl_sparse_iterative_solver is a new class I created under : > Modules/ThirdParty/VNL/src/vxl/core/vnl/algo > and encapsulates the implemented calls (functions, etc.) to the LASPack > package (similarly to vnl_sparse_lu class that calls Kenneth's Kundert > SPARSE package). > Also the itkvnl_algo inks to itkv3p_laspack : > *TARGET_LINK_LIBRARIES( itkvnl_algo ${NETLIB_LIBRARIES} itkvnl itkv3p_lsqr > itkv3p_laspack ) * > > Any ideas how can I solve the above link error? > > Regards, > Fotis Drakopoulos > CRTC lab > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-developers > > > ------------------------------ > > Spam > > Not spam > > Forget previous vote > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From grothausmann.roman at mh-hannover.de Mon Jul 28 10:23:20 2014 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Mon, 28 Jul 2014 16:23:20 +0200 Subject: [ITK-users] Extensions to the MetaImage (MHDs) IO-plugin to support compression and MHAs Message-ID: <53D65CD8.4080305@mh-hannover.de> Dear mailing list members, I've extended the MetaImage (used by e.g. ITK/VTK) IO-plugin from Kang Li (http://www.kangli.org/code/MetaImage_Reader_Writer.html) to also support compression and local data storage, i.e. MHAs. The MetaImage Reader/Writer from (http://ij-plugins.sourceforge.net/plugins/3d-io/) seems not to support this either. Reading and writing in Fiji was tested with MHDs and MHAs created/read by ITK-4.5.1. While the plugin handles files bigger than 4GB correctly, (for unknown reasons my) ITK seems to have problems with MHDs/MHAs bigger than 4GB (in general). The plugin does not check whether the size of the compressed data is correct, ITK however does. If the header lacks an entry of CompressedDataSize, ITK throws an error when reading/loading such a file. If the size specified with CompressedDataSize is too big, ITK just issues a warning. This was used as a workaround because I did not find an easy way in Java to put the correct value for CompressedDataSize without using extra temporary files (which might be quite big). Attached are the modified files (java-files, plugins.config and a repacked IO_-2.0.0-SNAPSHOT.jar). A modified HandleExtraFileTypes.java (based on: https://github.com/fiji/IO/blob/master/src/main/java/HandleExtraFileTypes.java) is also included. Togehter with the modified Plugin it allows opening MHDs and MHAs directly. The repacked IO_-2.0.0-SNAPSHOT.jar was generated with: javac -cp /opt/fiji/Fiji.app/jars/ij-1.48a.jar:. MetaImage_Reader.java javac -cp /opt/fiji/Fiji.app/jars/ij-1.48a.jar:. MetaImage_Writer.java javac -cp /opt/fiji/Fiji.app/jars/ij-1.48a.jar:. MetaImage_CWriter.java javac -cp /opt/fiji/Fiji.app/jars/ij-1.48a.jar:. HandleExtraFileTypes.java The compiled Class-files were moved to a subfolder named io/: ExtendedFileOpener.class MetaImage_CWriter.class MetaImage_Writer.class ExtendedFileSaver.class MetaImage_Reader.class ReplacingInputStream.class And then included/replaced with zip: zip -r IO_-2.0.0-SNAPSHOT.jar plugins.config HandleExtraFileTypes.class io/ Feel free to add these extensions to the Plugin-Page or the ImageJ/Fiji repository. Any suggestions concerning improvements are very welcome. Many thanks for ImageJ/Fiji and the initial Metaimage IO-plugin. Roman -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-9574 -------------- next part -------------- A non-text attachment was scrubbed... Name: HandleExtraFileTypes.java Type: text/x-java Size: 16846 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MetaImage_CWriter.java Type: text/x-java Size: 11063 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MetaImage_Reader.java Type: text/x-java Size: 17777 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MetaImage_Writer.java Type: text/x-java Size: 6219 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: MetaImageIO.patch Type: text/x-patch Size: 17205 bytes Desc: not available URL: -------------- next part -------------- # Author: Roman Grothausmann File>Save As, "MHD/MHA ...", io.MetaImage_Writer File>Save As, "MHD/MHA compressed ...", io.MetaImage_CWriter File>Import, "MHD/MHA...", io.MetaImage_Reader # Author: Stephan Saalfeld File>Save As, "DF3 ...", io.Save_DF3 File>Import, "DF3...", io.Open_DF3 # Author: Stephan Preibisch File>Import, "FIB-SEM ...", io.FIBSEM_Reader # by Albert Cardona: File>Import, "MRC Leginon ...", io.Open_MRC_Leginon File>Import, "PDF ...", io.PDF_Viewer File>Import, "Extract Images From PDF...", io.Extract_Images_From_PDF File>Import, "DAT EMMENU ...", io.Open_DAT_EMMENU # by Greg Jefferis File>Import, "DM3 Reader...", io.DM3_Reader File>Import, "TorstenRaw GZ Reader...", io.TorstenRaw_GZ_Reader File>Import, "Nrrd ...", io.Nrrd_Reader File>Save As, "Nrrd ... ", io.Nrrd_Writer # by Johannes Schindelin File>Import, "ICO...", io.ICO_Reader File>Save As, "ICO ...", io.ICO_Writer File>Import, "Icns...", io.Icns_Reader File>Save As, "Icns ...", io.Icns_Writer File>Import, "SVG...", io.SVG_Reader File>Save As, "XPM ...", io.XPM_Writer File>Import, "LSS16...", io.LSS16_Reader File>Save As, "LSS16 ...", io.LSS16_Writer # others: File>Import, "IPLab Reader...", io.IPLab_Reader File>Save As, "PDF ... ", io.PDF_Writer File>Import, "Animated Gif...", io.Animated_Gif_Reader File>Save As, "Animated Gif ... ", io.Gif_Stack_Writer File>Save As, "EPS ...", io.Export_EPS -------------- next part -------------- A non-text attachment was scrubbed... Name: IO_-2.0.0-SNAPSHOT.jar Type: application/x-java-archive Size: 149064 bytes Desc: not available URL: From norman-k-williams at uiowa.edu Mon Jul 28 13:34:50 2014 From: norman-k-williams at uiowa.edu (Williams, Norman K) Date: Mon, 28 Jul 2014 17:34:50 +0000 Subject: [ITK-users] Extensions to the MetaImage (MHDs) IO-plugin to support compression and MHAs In-Reply-To: <27272_1406557413_s6SENUxH012254_53D65CD8.4080305@mh-hannover.de> References: <27272_1406557413_s6SENUxH012254_53D65CD8.4080305@mh-hannover.de> Message-ID: This is a good thing to submit to ITK proper; it would require conversion to C++, though. On 7/28/14, 9:23 AM, "Dr. Roman Grothausmann" wrote: >Dear mailing list members, > > >I've extended the MetaImage (used by e.g. ITK/VTK) IO-plugin from Kang >Li >(http://www.kangli.org/code/MetaImage_Reader_Writer.html) to also support >compression and local data storage, i.e. MHAs. The MetaImage >Reader/Writer from >(http://ij-plugins.sourceforge.net/plugins/3d-io/) seems not to support >this >either. >Reading and writing in Fiji was tested with MHDs and MHAs created/read by >ITK-4.5.1. While the plugin handles files bigger than 4GB correctly, (for >unknown reasons my) ITK seems to have problems with MHDs/MHAs bigger than >4GB >(in general). >The plugin does not check whether the size of the compressed data is >correct, >ITK however does. If the header lacks an entry of CompressedDataSize, ITK >throws >an error when reading/loading such a file. If the size specified with >CompressedDataSize is too big, ITK just issues a warning. This was used >as a >workaround because I did not find an easy way in Java to put the correct >value >for CompressedDataSize without using extra temporary files (which might >be quite >big). > >Attached are the modified files (java-files, plugins.config and a >repacked >IO_-2.0.0-SNAPSHOT.jar). >A modified HandleExtraFileTypes.java (based on: >https://github.com/fiji/IO/blob/master/src/main/java/HandleExtraFileTypes. >java) >is also included. >Togehter with the modified Plugin it allows opening MHDs and MHAs >directly. > > >The repacked IO_-2.0.0-SNAPSHOT.jar was generated with: > >javac -cp /opt/fiji/Fiji.app/jars/ij-1.48a.jar:. MetaImage_Reader.java >javac -cp /opt/fiji/Fiji.app/jars/ij-1.48a.jar:. MetaImage_Writer.java >javac -cp /opt/fiji/Fiji.app/jars/ij-1.48a.jar:. MetaImage_CWriter.java > >javac -cp /opt/fiji/Fiji.app/jars/ij-1.48a.jar:. HandleExtraFileTypes.java > >The compiled Class-files were moved to a subfolder named io/: >ExtendedFileOpener.class MetaImage_CWriter.class MetaImage_Writer.class >ExtendedFileSaver.class MetaImage_Reader.class >ReplacingInputStream.class > >And then included/replaced with zip: >zip -r IO_-2.0.0-SNAPSHOT.jar plugins.config HandleExtraFileTypes.class >io/ > >Feel free to add these extensions to the Plugin-Page or the ImageJ/Fiji >repository. >Any suggestions concerning improvements are very welcome. > > >Many thanks for ImageJ/Fiji and the initial Metaimage IO-plugin. >Roman > > >-- >Dr. Roman Grothausmann > >Tomographie und Digitale Bildverarbeitung >Tomography and Digital Image Analysis > >Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 >Medizinische Hochschule Hannover >Carl-Neuberg-Str. 1 >D-30625 Hannover > >Tel. +49 511 532-9574 > > > >====================================================================== >A potentially unsafe attachment has been removed from this email >message. See http://its.uiowa.edu/support/article/100806 for further >information. > >Removed attachment name(s): >IO_-2.0.0-SNAPSHOT.jar >====================================================================== > ________________________________ Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you. ________________________________ From norman-k-williams at uiowa.edu Mon Jul 28 17:11:59 2014 From: norman-k-williams at uiowa.edu (Williams, Norman K) Date: Mon, 28 Jul 2014 21:11:59 +0000 Subject: [ITK-users] Suggestions about Python wrapping of cpp project In-Reply-To: References: Message-ID: The biggest plus in using Python with C++ back end for the compute/graphics intensive stuff is interactive development without a compile/link stage. There are great python debug tools. Debugging python in Emacs is easy enough using pdb. You can set breakpoint in the source code, examine variables, etc. Debugging python is no more difficult than debugging C++. There are python IDE that allow source debugging as well. PyCharm is well regarded. From: vincent ngai > Date: Friday, July 25, 2014 at 2:39 AM To: Satyananda Kashyap > Cc: Insight > Subject: Re: [ITK-users] Suggestions about Python wrapping of cpp project My project was designed as a C++ framework with functionality exposed to scripts, so it acts like an executable that runs a script that determines the program behaviour rather than a pure python program. It might be an important factor whether its a pure python app or an app that runs python. Honestly I can't tell if relegating some application logic to scripts is more productive, it works for sure, how productive it is ultimately depends on how many of our next projects rely on using the existing framework. :) Sorry I don't have a clear cut answer its a bit early to tell for my project. On Fri, Jul 25, 2014 at 12:22 PM, Satyananda Kashyap > wrote: Thanks for your perspective Vincent. One of my initial questions were about the productivity boost which you get when using scripting languages. I am reasonably comfortable coding in C++ toolchain. From your experience do you really see a spike in productivity when you shift over. Is it worth the effort ? I think I will do some of the core development in C++ and expose them to Python. I wanted to use the scripting side more for prototyping and testing purposes. Regards, Kashyap On Thu, Jul 24, 2014 at 10:18 PM, vincent ngai > wrote: I'm no expert, but previously when I worked on projects where we exposed almost all core functionalities via scripts, it seemed like a good initially, but what really happened is a shifting of complexities. Rather than have the complexity on the C++/Compiled codebase side shifted over to the scripts, in situation where you need to be able to change functionality without recompiling the source, or even have access to the source, scripts are the way to go. But shifting complexities to the runtime/script side has its own issues, I'm happy with the C/C++ toolchain maturity, Visual C++, GCC, GDB etc, you have very comprehensive debugging and editor facilities available for C++, but on the script side you have far less tools, and debugging may be a hassle. Also for scripts that are scoped by whitespace/tabs and are not strictly typed, we found that scripts exceeding 1/2 pages in length tend to be less maintainable, and the chances of nuking a whitespace or overwriting a variable gets higher. Just my 2 cents On Wed, Jul 23, 2014 at 11:11 PM, Satyananda Kashyap > wrote: Hello, I am looking for your expert opinions here. I have a relatively large C++ project I am working on which uses ITK mainly (hence the question here) and to some extent VTK and OpenCV. I do think that my code is fairly well written. I was thinking of wrapping my code to python using either SWIG or boost.python. Here are my questions : 1. I am led to believe that prototyping and code development is much faster in Python. Given that I have such a big cpp base code is it really worth the effort to wrap into python and then continue there. 2. From what I have read ITK uses SWIG wrappings for wrapping into Python while VTK uses the boost.python route. My initial attempts with both have been relatively unsuccessful. Any opinion on which one is more user friendly/better when I have to wrap my own custom classes which use a combination of both ITK and VTK in them. 3. Any suggestion on a road map as to how to proceed. I am not sure at what base class level I should wrap them and rewrite the dependencies in python. Thanks, Regards, Kashyap _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users -- Regards, Vincent -- Regards, Vincent ________________________________ Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you. ________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From ksatyananda at gmail.com Mon Jul 28 18:56:38 2014 From: ksatyananda at gmail.com (Satyananda Kashyap) Date: Mon, 28 Jul 2014 17:56:38 -0500 Subject: [ITK-users] Suggestions about Python wrapping of cpp project In-Reply-To: References: Message-ID: <9AD76AB1-2A22-4725-AB39-682D58C0F947@gmail.com> Regards, Kashyap > On Jul 28, 2014, at 4:11 PM, "Williams, Norman K" wrote: > > The biggest plus in using Python with C++ back end for the compute/graphics intensive stuff is interactive development without a compile/link stage. > > There are great python debug tools. Debugging python in Emacs is easy enough using pdb. You can set breakpoint in the source code, examine variables, etc. Debugging python is no more difficult than debugging C++. There are python IDE that allow source debugging as well. PyCharm is well regarded. > > From: vincent ngai > Date: Friday, July 25, 2014 at 2:39 AM > To: Satyananda Kashyap > Cc: Insight > Subject: Re: [ITK-users] Suggestions about Python wrapping of cpp project > > My project was designed as a C++ framework with functionality exposed to scripts, so it acts like an executable that runs a script that determines the program behaviour rather than a pure python program. It might be an important factor whether its a pure python app or an app that runs python. > > Honestly I can't tell if relegating some application logic to scripts is more productive, it works for sure, how productive it is ultimately depends on how many of our next projects rely on using the existing framework. :) > > Sorry I don't have a clear cut answer its a bit early to tell for my project. > > >> On Fri, Jul 25, 2014 at 12:22 PM, Satyananda Kashyap wrote: >> Thanks for your perspective Vincent. >> >> One of my initial questions were about the productivity boost which you get when using scripting languages. I am reasonably comfortable coding in C++ toolchain. From your experience do you really see a spike in productivity when you shift over. Is it worth the effort ? >> >> I think I will do some of the core development in C++ and expose them to Python. I wanted to use the scripting side more for prototyping and testing purposes. >> >> Regards, >> Kashyap >> >> >>> On Thu, Jul 24, 2014 at 10:18 PM, vincent ngai wrote: >>> I'm no expert, but previously when I worked on projects where we exposed almost all core functionalities via scripts, it seemed like a good initially, but what really happened is a shifting of complexities. Rather than have the complexity on the C++/Compiled codebase side shifted over to the scripts, in situation where you need to be able to change functionality without recompiling the source, or even have access to the source, scripts are the way to go. But shifting complexities to the runtime/script side has its own issues, I'm happy with the C/C++ toolchain maturity, Visual C++, GCC, GDB etc, you have very comprehensive debugging and editor facilities available for C++, but on the script side you have far less tools, and debugging may be a hassle. >>> >>> Also for scripts that are scoped by whitespace/tabs and are not strictly typed, we found that scripts exceeding 1/2 pages in length tend to be less maintainable, and the chances of nuking a whitespace or overwriting a variable gets higher. >>> >>> Just my 2 cents >>> >>> On Wed, Jul 23, 2014 at 11:11 PM, Satyananda Kashyap wrote: >>>> Hello, >>>> >>>> I am looking for your expert opinions here. I have a relatively large C++ project I am working on which uses ITK mainly (hence the question here) and to some extent VTK and OpenCV. I do think that my code is fairly well written. I was thinking of wrapping my code to python using either SWIG or boost.python. Here are my questions : >>>> >>>> >>>> 1. I am led to believe that prototyping and code development is much faster in Python. Given that I have such a big cpp base code is it really worth the effort to wrap into python and then continue there. >>>> >>>> 2. From what I have read ITK uses SWIG wrappings for wrapping into Python while VTK uses the boost.python route. My initial attempts with both have been relatively unsuccessful. Any opinion on which one is more user friendly/better when I have to wrap my own custom classes which use a combination of both ITK and VTK in them. >>>> >>>> 3. Any suggestion on a road map as to how to proceed. I am not sure at what base class level I should wrap them and rewrite the dependencies in python. >>>> >>>> Thanks, >>>> Regards, >>>> Kashyap >>>> >>>> _____________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Kitware offers ITK Training Courses, for more information visit: >>>> http://www.kitware.com/products/protraining.php >>>> >>>> Please keep messages on-topic and check the ITK FAQ at: >>>> http://www.itk.org/Wiki/ITK_FAQ >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/insight-users >>> >>> >>> >>> -- >>> Regards, >>> Vincent > > > > -- > Regards, > Vincent > > > Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Tue Jul 29 09:52:41 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 29 Jul 2014 09:52:41 -0400 Subject: [ITK-users] [ITK] Suggestions about Python wrapping of cpp project In-Reply-To: References: Message-ID: Hi, I'm a little late to the party on this thread, but I would recommend creating the .wrap files for ITK module code. For code that is not as highly templated, XDress [1] is another option to keep in mind. Matt [1] http://xdress.org/ On Wed, Jul 23, 2014 at 11:11 AM, Satyananda Kashyap wrote: > Hello, > > I am looking for your expert opinions here. I have a relatively large C++ > project I am working on which uses ITK mainly (hence the question here) and > to some extent VTK and OpenCV. I do think that my code is fairly well > written. I was thinking of wrapping my code to python using either SWIG or > boost.python. Here are my questions : > > > 1. I am led to believe that prototyping and code development is much faster > in Python. Given that I have such a big cpp base code is it really worth the > effort to wrap into python and then continue there. > > 2. From what I have read ITK uses SWIG wrappings for wrapping into Python > while VTK uses the boost.python route. My initial attempts with both have > been relatively unsuccessful. Any opinion on which one is more user > friendly/better when I have to wrap my own custom classes which use a > combination of both ITK and VTK in them. > > 3. Any suggestion on a road map as to how to proceed. I am not sure at what > base class level I should wrap them and rewrite the dependencies in python. > > Thanks, > Regards, > Kashyap > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > From norman-k-williams at uiowa.edu Tue Jul 29 12:38:55 2014 From: norman-k-williams at uiowa.edu (Williams, Norman K) Date: Tue, 29 Jul 2014 16:38:55 +0000 Subject: [ITK-users] ConstIterator In-Reply-To: References: Message-ID: The documentation for ITK classes is contained in the source code; the web documentation is generated from the source code periodically. Feel free to sign up to submit changes to ITK ? instructions are here: http://www.itk.org/Wiki/ITK/Git Documentation fixes and additions are always welcome. In this case, the meaning of ConstIterator vs Iterator was probably assumed to be obvious, because experienced C++ programmers would be familiar with std::iterator and std::const_iterator. From: med aweng > Date: Thursday, July 24, 2014 at 5:09 AM To: Marco Ulgelmo > Cc: Insight > Subject: Re: [ITK-users] ConstIterator Thanks Marco. Is that description in the itk documentation? I really couldn't find such clear explanation. Thanks. On Thu, Jul 24, 2014 at 12:07 PM, Marco Ulgelmo > wrote: A ConstIterator an iterator which is used to iterate over a constant container, which means that data in the container can't be modified (unless you use const_cast). You can find it in the ITK documentation. Marco 2014-07-24 11:47 GMT+02:00 med aweng >: Hello, What is the purpose of the "ConstIterator". Where can I find its description? Thanks. _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users ________________________________ Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you. ________________________________ -------------- next part -------------- An HTML attachment was scrubbed... URL: From norman-k-williams at uiowa.edu Tue Jul 29 12:52:15 2014 From: norman-k-williams at uiowa.edu (Williams, Norman K) Date: Tue, 29 Jul 2014 16:52:15 +0000 Subject: [ITK-users] Smartpointer as a default parameter for a function In-Reply-To: <74500304cea08473af6cfd3b37c686c6@mufradat.com> References: <74500304cea08473af6cfd3b37c686c6@mufradat.com> Message-ID: You do not need to explicitly initialize ::Pointer variables. They have a default constructor that initializes the raw pointer member m_Pointer to zero. I would tend to use references to SmartPointers as parameters, because if you pass a Pointer value, it creates a temporary Pointer on the stack, and then assigns it to the member variable. This isn?t a huge overhead but it does involve semaphore lock/unlock pairs protecting reference count increment/decrement. When you pass a Pointer by reference, it ends up doing this. 1. Construct anonymous temp Pointer. 2. assign .m_Pointer with .m_Pointer (I.e. the actual object pointed to by the smart pointer) 3. lock the object pointed to by .m_Pointer. 4. Increment the pointed-to object?s reference count. 5. unlock pointed-to object. 6. Inside the method, assign to local or member variable, repeat steps 2 through 5. 7. When the function exits, call destructor 8. lock the pointed-to object 9. decrement reference count 10. unlock pointed-to object If you pass the smart pointer by reference, you skip creating and destroying the temp, and only assign to a smart pointer once. On 7/22/14, 2:37 AM, "ahmed at mufradat.com" wrote: >Hello All, > >Suppose I have class like > >class A{ > public: > A(int a, ImageType::Pointer ptr){ > // whatever! > } >}; > >My question is, what's the default value for that ptr? I'd like to be >able to create an instance of that class using > >A myA(5); > >so for the definition of the constructor of A: > >A(int a, ImageType::Pointer ptr = WHAT?) > >Best regards, >Ahmed >_____________________________________ >Powered by www.kitware.com > >Visit other Kitware open-source projects at >http://www.kitware.com/opensource/opensource.html > >Kitware offers ITK Training Courses, for more information visit: >http://www.kitware.com/products/protraining.php > >Please keep messages on-topic and check the ITK FAQ at: >http://www.itk.org/Wiki/ITK_FAQ > >Follow this link to subscribe/unsubscribe: >http://public.kitware.com/mailman/listinfo/insight-users ________________________________ Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error, then delete it. Thank you. ________________________________ From fttfzzx227 at 126.com Tue Jul 29 22:56:51 2014 From: fttfzzx227 at 126.com (=?GBK?B?t+vmw+bD?=) Date: Wed, 30 Jul 2014 10:56:51 +0800 (CST) Subject: [ITK-users] how to write grey images into color image using itkScalarToRGBColormapImageFilter Message-ID: <3a761248.dcd8.1478532e5ca.Coremail.fttfzzx227@126.com> Hi, I want to write some jpg (gray level) images into color image to display different intensities, the range of the intensities in the input image is 0~255.And the code I wrote is as below: typedef itk::Image< OutputPixelType, 2 > OutputImageType; typedef itk::ScalarToRGBColormapImageFilter< jpgScalarImageType, OutputImageType > RGBFilterType; RGBFilterType::Pointer colormapImageFilter = RGBFilterType::New(); colormapImageFilter->SetColormap( RGBFilterType::Hot ); colormapImageFilter->SetInput( InputImage ); try { colormapImageFilter->Update(); } catch ( itk::ExceptionObject &err ) { std::cerr << err << std::endl; //return EXIT_FAILURE; } OutputImageType::Pointer outputImage = colormapImageFilter->GetOutput(); But after I write the outputImage ,it is all black.Did I miss something ,or is there any other solution to write a grey image into a color image?Thank you! Best regards! Tina -------------- next part -------------- An HTML attachment was scrubbed... URL: From mallikarjun49 at gmail.com Wed Jul 30 10:18:57 2014 From: mallikarjun49 at gmail.com (Mallikarjun K) Date: Wed, 30 Jul 2014 19:48:57 +0530 Subject: [ITK-users] itkSmoothingQuadEdgeMeshFilter Help!! Message-ID: Hi All, I am using itkSmoothingQuadEdgeMeshFilter for Surface Mesh smoothing.This filter is giving good results what I expected but taking more execution time.can any one suggest me to reduce the execution time( multi threading or any parameters to add/remove )? Below is the code snippet /////// typedef itk::QuadEdgeMeshTraits qetraits; typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; //typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3 > MeshType; itk::OnesMatrixCoefficients< MeshType > coeff0; typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > SmoothingQuadEdgeMeshFilter; SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = SmoothingQuadEdgeMeshFilter::New(); QEMeshSmoother->SetInput("abc.vtk"); QEMeshSmoother->SetNumberOfIterations(5 ); QEMeshSmoother->SetRelaxationFactor( 0.5 ); QEMeshSmoother->SetDelaunayConforming(true ); QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); QEMeshSmoother->Update(); //// -- *Regards:* Mallik -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Wed Jul 30 11:59:59 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Wed, 30 Jul 2014 11:59:59 -0400 Subject: [ITK-users] itkSmoothingQuadEdgeMeshFilter Help!! In-Reply-To: References: Message-ID: First, make sure you are building ITK and your app with Release. A Debug build can be 10-50 times slower. On Wed, Jul 30, 2014 at 10:18 AM, Mallikarjun K wrote: > Hi All, > I am using itkSmoothingQuadEdgeMeshFilter for Surface Mesh smoothing.This > filter is giving good results what I expected but taking more execution > time.can any one suggest me to reduce the execution time( multi threading > or any parameters to add/remove )? > > Below is the code snippet > /////// > typedef itk::QuadEdgeMeshTraits > qetraits; > typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; > > //typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3 > MeshType; > > itk::OnesMatrixCoefficients< MeshType > coeff0; > > typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > > SmoothingQuadEdgeMeshFilter; > > SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = > SmoothingQuadEdgeMeshFilter::New(); > > QEMeshSmoother->SetInput("abc.vtk"); > QEMeshSmoother->SetNumberOfIterations(5 ); > QEMeshSmoother->SetRelaxationFactor( 0.5 ); > QEMeshSmoother->SetDelaunayConforming(true ); > QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); > QEMeshSmoother->Update(); > //// > > -- > Regards: > Mallik > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > -- Unpaid intern in BillsBasement at noware dot com From blowekamp at mail.nih.gov Wed Jul 30 11:56:18 2014 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Wed, 30 Jul 2014 11:56:18 -0400 Subject: [ITK-users] [ITK] ITK: error: floating-point literal cannot appear in a constant-expression In-Reply-To: <49C3D5F2-E43F-4012-B0E6-51862C4CA841@gmail.com> References: <2A510655-60E7-466F-BC6B-8D8168BDACCF@gmail.com> <88659D55-CC33-4103-8020-FB172FD00270@mail.nih.gov> <49C3D5F2-E43F-4012-B0E6-51862C4CA841@gmail.com> Message-ID: <7CE9E66F-2870-4644-9905-F74CF84C551E@mail.nih.gov> Nick, I was a little too specific with the flag to look for in my prior e-mail The error message you are getting is coming from here[1]. Which used the VECL_STATIC_CONST_INIT_FLOAT_DECL macro defined here[2]. CMake does some try compile to see if this in class declaration of double is supported during your initial configuration when ITK is first built. If it's detected that the compiler supports, then when ever ITK is used this feature is enabled. Something changed with your compiler, like some addition or removal of flag, which changed the support of the feature. Hope that helps, Brad [1] https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/ThirdParty/VNL/src/vxl/core/vnl/vnl_numeric_traits.h#L387 [2] https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/ThirdParty/VNL/src/vxl/vcl/vcl_config_compiler.h.in#L138-L159 On Jul 30, 2014, at 11:47 AM, Nick Patterson wrote: > > Dear Brad, > > I?m afraid I made no further progress to report on the compilation of my application. It?s very curious. I even tried to roll back to ITK 4.5.2 (rather than the newer 4.6) but I am receiving similar errors. I have no issues with compiling this code on my Macbook? just on my linux box. > > Regards, Nick. > > > > On 29 Jul 2014, at 22:20, Bradley Lowekamp wrote: > >> Hello, >> >> Is any of your code monkeying around with the "-std=c++11" flags? Did you compile ITK or your application with it? >> >> Brad >> >> On Jul 29, 2014, at 10:59 AM, Nick Patterson wrote: >> >>> Hi, >>> Can I ask if anybody has the following error when compiling code which makes use of ITK? The complilation of ITK was fine, this is an error produced when compiling against ITK in my own application. >>> >>> The error that I am currently getting is:- (Building on Ubuntu Linux). >>> >>> >>> In file included from /usr/local/include/ITK-4.5/vnl/vnl_c_vector.h:26:0, >>> from /usr/local/include/ITK-4.5/vnl/vnl_vector.h:22, >>> from /usr/local/include/ITK-4.5/vnl/vnl_vector_ref.h:20, >>> from /usr/local/include/ITK-4.5/itkVector.h:23, >>> from /usr/local/include/ITK-4.5/itkPoint.h:23, >>> from /usr/local/include/ITK-4.5/itkContinuousIndex.h:21, >>> from /usr/local/include/ITK-4.5/itkImageRegion.h:34, >>> from /usr/local/include/ITK-4.5/itkImageIORegion.h:24, >>> from /usr/local/include/ITK-4.5/itkImageIOBase.h:26, >>> from /usr/local/include/ITK-4.5/itkImageFileReader.h:22, >>> from /usr/local/include/ITK-4.5/itkImageSeriesReader.h:26, >>> from /home/nppatt/Raydose2/RaydoseNew/src/Simulation/RaydoseNMImageData.cpp:2: >>> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:387:27: error: floating-point literal cannot appear in a constant-expression >>> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:387:27: warning: ISO C++ forbids initialization of member constant 'zero' of non-integral type 'const float' [-pedantic] >>> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:389:26: error: floating-point literal cannot appear in a constant-expression >>> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:389:26: warning: ISO C++ forbids initialization of member constant 'one' of non-integral type 'const float' [-pedantic] >>> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:391:29: error: floating-point literal cannot appear in a constant-expression >>> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:391:29: warning: ISO C++ forbids initialization of member constant 'maxval' of non-integral type 'const float' [-pedantic] >>> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:410:28: error: floating-point literal cannot appear in a constant-expression >>> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:410:28: warning: ISO C++ forbids initialization of member constant 'zero' of non-integral type 'const double' [-pedantic] >>> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:412:27: error: floating-point literal cannot appear in a constant-expression >>> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:412:27: warning: ISO C++ forbids initialization of member constant 'one' of non-integral type 'const double' [-pedantic] >>> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:414:30: error: floating-point literal cannot appear in a constant-expression >>> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:414:30: warning: ISO C++ forbids initialization of member constant 'maxval' of non-integral type 'const double' [-pedantic] >>> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:433:33: error: floating-point literal cannot appear in a constant-expression >>> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:433:33: warning: ISO C++ forbids initialization of member constant 'zero' of non-integral type 'const long double' [-pedantic] >>> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:435:32: error: floating-point literal cannot appear in a constant-expression >>> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:435:32: warning: ISO C++ forbids initialization of member constant 'one' of non-integral type 'const long double' [-pedantic] >>> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:437:35: error: floating-point literal cannot appear in a constant-expression >>> /usr/local/include/ITK-4.5/vnl/vnl_numeric_traits.h:437:35: warning: ISO C++ forbids initialization of member constant 'maxval' of non-integral type 'const long double' [-pedantic]R >>> >>> >>> Regards, Nick >>> _______________________________________________ >>> Community mailing list >>> Community at itk.org >>> http://public.kitware.com/mailman/listinfo/community >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Wed Jul 30 14:44:08 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Wed, 30 Jul 2014 14:44:08 -0400 Subject: [ITK-users] [ANNOUNCE] ITK 4.6.0 has been released! Message-ID: On behalf of the Insight Toolkit community, we are proud to announce that ITK 4.6.0 has been released! Links to the Sourceforge.net tarballs can be found on the download page: http://www.itk.org/ITK/resources/software.html Outline ---------- 1. Introduction 2. New Documentation 3 New Features 4. ITK Changelog 5. ITK Sphinx Examples Changelog 6. ITK Software Guide Changelog Introduction ------------------------- The 4.6 release is a major milestone that marks the hard work of many outstanding community members. Among the major contributions in this release are improved Remote Module support with a number of exciting new Remote Modules. The TransformToDisplacementField filter and a entire module of image noise generation classes were migrated into the default build. A number of new optimizers were added to the Registrationv4 framework, which also experienced a number of performance improvements. Performance improvements were a general theme as was improved code coverage. Python wrapping underwent a huge cleanup. Our documentation continues to improve with better examples, Doxygen documentation, and guidance material. The Software Guide was split in anticipation of the release of two new hard copy books. Thanks to everyone for their hard work! Enjoy ITK! New Documentation ------------------------- Our documentation continues to improve. Remote modules are now grouped in the Doxygen Module page [1]. A number of new examples were added to the Sphinx repository and the Wiki, which can now also be built as Remote modules. The Software Guide was split into two books and the ITK configure and build instructions were revised. [1] http://www.itk.org/Doxygen/html/modules.html New Features ------------------ * CMake improvements - Improved Remote Module support - Add ITK_FORBID_DOWNLOADS for package maintainers - ITK_USE_SYSTEM_EXPAT available * Filtering Improvements - Moved TransformToDisplacementField out of Review - An entire noise image generation module - http://hdl.handle.net/10380/3158 - Better pipeline support for ResampleImageFilter - Move MagnitudeAndPhaseToComplexImageFilter out of Review - Setters for LabelMap overlay filters - More consistent filter progress reporting * ImageIO improvements - Register the GE image formats by default - More IO modules are built as shared libraries - OpenFileForReading/Writing methods in ImageIO - Support for system tiff 4.0.0-4.0.2 (e.g. some Ubuntu versions) - Mangling to internal OpenJPEG - SCIFIO improvements * Infrastructure improvements - MetaDataObject print specialization for common types - Improvements to ResourceProbe and RealTimeClock - More Solve methods for VNLSparseLUSolverTraits - Output stream operator for LightObject exposed - FFTW bump to 3.3.3 * New Remote Modules - Skull stripper - http://hdl.handle.net/10380/3353 - Wiki examples - Sphinx examples - Variational registration - http://hdl.handle.net/10380/3460 - AnalyzeObjectMapIO - http://hdl.handle.net/1926/593 - FDFImageIO - SplitComponents - http://hdl.handle.net/10380/320 * Registrationv4 improvements - v4 regular step gradient descent optimizer - v4 amoeba optimizer - v4 exhaustive optimizer - v4 Powell optimizer - v4 one-plus-one-evolutionary optimizer - v4 LBFGS optimizer improvements - Use registration method classes as pipeline filters * Performance improvements - Registrationv4 - Histogram computation - Improved SmartPointer copy - CompositeTransform - Registration Jacobian re-use * Wrapping improvements - pygccxml 1.0.0 - .pth symlink usable in a virtualenv - Cleaner CMake configuration - SWIG and PCRE updated to 3.0.2, 8.34 - Latest GCCXML, which works with GCC 4.9 - Sweeping wrapping generation cleanup * Many style improvements -- ITK gets more stylish with every release! * Improved code coverage -- some measures put us over 85%! * *Lots* of important bug fixes * And more! See details in the log below. List of changes since v4.6rc03 -------------------------------------- Arnaud Gelas (1): DOC: ThresholdBetween does not exist, it should be ThresholdOutside Bradley Lowekamp (6): BUG: Remove division in inner loop for otsu threshold calculator COMP: Fix implicit conversion warnings BUG: Print the histogram calculator for auto threshold filter BUG: Use tolerant float compare when choosing better otsu threshold BUG: Fix out of bounds access for image region size BUG: Add export specification to DCMTKFileReader and utilities Luis Ibanez (1): BUG: Increased OtsuThreshold computation precision Matthew McCormick (13): COMP: Remove unused local typedef's. COMP: Make Doxygen Modules group definition consistent. STYLE: Improve readability and const correctness of ImageIORegion. BUG: GDCM does not apply rescale slope / intercept on write. COMP: Ignore itkIndex.h -Warray-bounds warnings on GCC 4.9. COMP: Remove unused typedefs in ITKReview module. COMP: Remove unused FFTW typedef's. COMP: Remove unused typedefs from the Examples. COMP: Remove unused typedefs in compatibility code. BUG: Fix GDCM buffer size when written pixel type is different. COMP: Disable array above bounds warnings in FixedArray for GCC 4.9. BUG: Increase itkVoronoiPartitioningImageFilterTest1 for 32-bit builds. BUG: Set output type to unsigned char when writing uchar in GDCMIO test. Michka Popoff (3): BUG: Fix GeodesicActiveContourImageFilterOutput7.png STYLE: Threshold Segmentation LevelSet Image Filter Figure ENH: Remove GeodesicActiveContourImageFilter.py example List of changes since v4.6rc02 --------------------------------------- Ali Ghayoor (1): ENH: Convert seven ImageRegistration examples to ITKv4 Bradley Lowekamp (2): BUG: Remove multiple per-pixel allocations in Mahalanobis Membership COMP: Fix unused-local-typedef warnings in the Registration and Numeric Hans Johnson (1): ENH: Prepare for ITKv4 registration Examples Matthew McCormick (5): BUG: Improve module Group membership detection. COMP: Fix unused-local-typedef warnings in Group Core. BUG: Update TransformReadWrite example. COMP: Fix unused-local-typedef warnings in the Filtering Group. COMP: Remove unused typedefs. Nick Tustison (1): ENH: Missed spec for generic computation type. List of changes since v4.6rc01 --------------------------------------- Bradley Lowekamp (3): BUG: Do not ENABLED_SHARED for GDCMIO DOC: Add break in brief description of Canny edge filter BUG: Add additional MetaDataObject explicit instantiation. Jean-Christophe Fillion-Robin (2): COMP: Fix "unused-local-typedefs" warnings COMP: Fix "unused-local-typedefs" warning in LandmarkBasedTransformInitializer Kent Williams (1): COMP: Fix typo in ReflectiveImageRegionConstIterator. Matthew McCormick (4): DOC: CMake warning BRANWEB -> BRAINWEB. BUG: Remove -Wno-unused-local-typedefs flag. COMP: Fix IOSTL Doxygen group and Windows shared build. BUG: Use Remote repository explicitly on git fetch. Michka Popoff (6): COMP: Move itkMatrixCoefficients wrapping to Filtering module COMP: Fix wrapping with Core only STYLE: Pep8 cleanup for generators COMP: Fix default wrapping with all modules ENH: Use open() instead of file() for python 3 compatibility ENH: Allow to use methods which pass std::string by reference from python Nick Tustison (1): ENH: Adding generic computation type. List of changes since v4.5.0 -------------------------------------- Alexander Schmidt-Richberg (1): ENH: Added *.remote.cmake for remote module VariationalRegistration Ali Ghayoor (22): ENH: Add a registration test for LBFGS-B optimizer ENH: Add versorTransformOptimizerv4 class to ITKv4 BUG: Fix Coverity defects for LBFGS-B tests BUG: avoid division by zero in versorOptimizerv4 ENH: Add RegularStep gradient optimizer to ITKv4 DOC: The use of VersorTransformOptimizerv4 is deprecated. ENH: [SG]et optimizable params ITKv4 registration ENH: remove VersorTransformOptimizerv4 from ITKv4 ENH: Add AmoebaOptimizerv4 to ITKv4 registration ENH: Add ExhaustiveOptimizerv4 to ITKv4 registration ENH: Add PowellOptimizerv4 to ITKv4 registration BUG: define the GetStopConditionDescription as a public member funciton ENH: Add OnePlusOneEvolutionaryOptimizerv4 to ITKv4 registration BUG: lbfgsb optimizer could not be used in unbounded mode ENH: Add GetCurrentIteration to ExhaustiveOptimizerv4 ENH: Add currentIteration to the AmoebaOptimizerv4 PERF: Move the currentIteration to optimizersv4 base class ENH: Move the NumberOfIterations to the Optimizersv4 base class PERF: Change the parent class of RegularStepGradDescentv4 optimizer ENH: Add currentIteration to LBFGSBOptimizerv4 BUG: Fix memory leak in LBFGSBOptimzierv4 ENH: Add distance vector to KdTree search API Bill Lorensen (32): BUG: Tiff compression was broken and untested ENH: Add SetJPEGQuality method COMP: Missing breaks in swithc COMP: Uninitialized scalar field COMP: Uninitialized scalar field COMP: Unused pointer value ENH: Add SkullStrip Remote Module BUG: Tiff compression was broken and untested COMP: Missing breaks in swithc ENH: Improved message for missing IO factories COMP: Remove vcl_time and vcl_clock ENH: Remove vcl_math calls COMP: std::abs integral overloads not always provided COMP: Array versus singleton access COMP: Failed to check dynamic_cast results STYLE: Empty lines exceed 3 COMP: Uninitialized member data BUG: Two tests try to write the same file ENH: Uninitialized scalar field COMP: Constructor initialize list improvement COMP: Type warnings in constructors BUG: Copy/paste error COMP: Arguments of wrong type BUG: Buffer not null terminated BUG: Dereference after null check BUG: Division or modulo by zero ENH: Uninitialized scalar field BUG: Uninitialized scalar field BUG: Not restoring ostream format ENH: Add an exception safe state restore class for streams BUG: Not restoring ostream format ENH: Add WikiExamples as a remote module Brad King (4): COMP: Remove extra calls to cmake_minimum_required COMP: Fix cmake_minimum_required call order COMP: Set CMake Policies CMP0025 and CMP0042 as necessary COMP: Add missing call to cmake_minimum_required Bradley Lowekamp (91): ENH: Removed non-work TCL Examples DOC: Add missing const in Doxygen GetConstReferenceMacro BUG: Correctly re-throw exception to restore AbortEvent, ProcessAborted BUG: Emit StartEvent before a ProgressEvent BUG: Do not throw exception in Probes with mis-matched Stop BUG: Correctly re-throw exception to restore AbortEvent, ProcessAborted BUG: Adding export specification to Exception objects COMP: fix unused variable warning in abort test BUG: Adding export specification to Exception objects COMP: fix failing voronoi segmentation tests COMP: Remove explicit typed exception specifications ENH: Print Object name for observers of objects ENH: Adding progress reporting to some filters BUG: fixing grind peak progress to reach 1.0 COMP: use std::transform with static_cast to avoid conversion warning BUG: disable ipa-cp-clone in GDCM COMP: fix unused variable warning in abort test BUG: Do not throw exception in Probes with mis-matched Stop BUG: Address Shared Library issues with SCIFIO COMP: fix failing voronoi segmentation tests COMP: export required in explicitly defined NumbericTraits consts DOC: Make comment the Doxygen brief BUG: Adding missing raw data file to MINC test BUG: Fix linkage for SmartPointerForwardReference for clang 4 BUG: Fixing missing char type and doc for Thresholding filters BUG: Add support for system libtiff 4.0.0-4.0.2 BUG: remove second wrapping of BinShrink for scalars BUG: Fix LabelStatistics and LabelOverlap to require same image size PERF: Remove IncreaseFrequencyOfMeasurement from inner loops STYLE: Save deference iterator mapped type to variable PERF: switch to scanline and linear iterators COMP: Fix checks for system libtiff PERF: add namespace swap to SmartPoitners PERF: Use stl iterator algorithm in Iterator Partitioner BUG: Add mutex lock to MersenneTwister GetInstance STYLE: MersenneTwister move methods to cxx, docs STYLE: renaming files to standard ITK conventions ENH: Improving Noise Simulation Filters COMP: Explicitly make constant an unsigned int BUG: Fix uninitialized ivar in NoiseBaseImageFilter ENH: Make NoiseBaseImageFilter an abstract base class COMP: remove extraneous cast to double BUG: Same test function in different file causes conflict ENH: Explicitly specify internal linkage for internal observer objects ENH: Enable observed events to modify observers BUG: Catch exception in DeleteEvent STYLE: dynamic_cast to pointer does not throw COMP: Fix GCC warning about unused typedef in ConceptChecking COMP: Adding itkMacro.h for ITK_NULLPTR definition ENH: Use DynamicCastInDebugMod for name input macros BUG: Add support for signed char output BUG: Use NewMacro for Clone with TimeVaryingVElocityFieldTransforms ENH: Improve DataObjectDecorator with Modifiable, Graft ReleaseData ENH: Improve Resample's use of pipeline inputs ENH: Adding output of line and file on test failure ENH: Add InitialTransform as pipelined input with inplace option ENH: Use Transform base class as default template parameter ENH: Use InitialTransform in deformation examples COMP: add missing stl algorithm header for std::max COMP: add missing stl algorithm header for std::max Revert "ENH: Add Remote module group description to Doxygen." COMP: Remove incorrect override declaration ENH: Encapsulate expat header ENH: Make IntialMoving and InitialFixed transforms decorated inputs ENH: Update SimpleRegistration test BUG: Don't create new Decorator in GenerateData BUG: Use referenceImage for output information ENH: Adding some ImageIO libraries as shared ENH: Use TransformParametersAdaporBase on Transform base class ENH: Removing const_casts from ImageRegistrationv4 tests BUG: Add AllocateOutputs method to other v4 RegistrationMethods ENH: Update v4 registration tests to set initial transform BUG: Explicitly instantiate common MetaDataObjects BUG: Disable explicit visibility with OSX gcc and llvm gcc 4.2 ENH: Register GE Image formats COMP: Fix warning for overloading AllocateElements COMP: Suppress warning for using extern template instantiation PERF: Use shallow swap over deep assignment ENH: Use LearingRate member variable for scaling gradient ENH: support learning rate estimation for regular step optimizer COMP: Add space between string literals ENH: remove catch as dynamic_cast of pointers is nothrow BUG: Use rounding in TestingStretchIntensity for portability BUG: Warn if unsupported ITK_BRAINWEB_DATA_ROOT is being used ENH: Use MultiResolutionIteration event for registration ENH: Use exception safe copy-and-swap for assignment BUG: Use DEPENDS for dependent files STYLE: Add itkPrintSelfObjectMacro to improve indenting BUG: Print missing member variables ENH: Make more IO modules shared. COMP: Add missing header for EXIT_FAILURE Brian Helba (66): ENH: Disable tip to enable Uncrustify from SetupForDevelopment STYLE: Rename TValueType template parameters to TValue COMP: Fix compiler warnings with ITK_USE_SYSTEM_VXL BUG: Make all specializations NumericTrails::SetLength re-zero contents ENH: 3048, 3224: Refactor *SampleFilters to fix multiple issues ENH: Re-enable the array-bounds warnings for GCC 4.7 DOC: Fix a bug with SquaredEdgeLengthDecimationQuadEdgeMeshFilter DOC: Clean up comments in NiftiImageIO, for better Doxygen compatibility STYLE: Remove unused typedefs from AlgorithmsPrintTests BUG: Fix improper usage of VoronoiSegmentationRGBImageFilter ENH: Move OpenFileForReading/Writing from StreamingImageIO to parent class ENH: Improve OpenFileForReading/Writing logic and documentation BUG: Prevent ObjectFactoryBase from possibly throwing an exception STYLE: Make internal-use CMake variables lowercase in KWStyle.cmake PERF: Prevent FindKWStyle.cmake from being called multiple times BUG: Fix FindKWStyle crash when kwstyle returns empty version info BUG: Fix Coverity issue 1081600: Use after free BUG: Update SmoothingRecursiveYvvGaussianFilter to fix CMake warnings ENH: Update ImageIO classes to use OpenFileForReading/Writing COMP: Fix array subscript build warning COMP: Except Git's status messages from CTest reporting COMP: Suppress Coverity defect when Examples create an ITK object BUG: Fix uninitialized variable in GradientRecursiveGaussianImageFilter DOC: Fix documentation in VoronoiDiagram2DGenerator BUG: Coverity 1081062: Fix big parameter passed by value BUG: Update IOSTL to include new bug fixes upstream DOC: Improve documentation for StatisticsAlgorithm functions BUG: Coverity 1130670: Buffer not null terminated in GE4ImageIO BUG: Coverity 1103200: Copy into fixed size buffer in GE5ImageIO STYLE: Coverity 1080839: Dead default in switch in QuadEdgeMeshEulerOperatorJoinVertexTest STYLE: Coverity 1080963: Dereference after null check in TreeIteratorBase BUG: Coverity 1081009: Missing break in switch in GiftiMeshIO BUG: Coverity 1081422: Uninitialized pointer field in QuadEdgeMeshFrontBaseIterator STYLE: Coverity 1081140: Dereference before null check BUG: Coverity 1081547: Uninitialized pointer field in ConnectedRegionsMeshFilter STYLE: Coverity 40ee44a9: Self assignment in VoronoiSegmentationImageFilterTest BUG: Coverity 1081129: Dereference before null check in itkIOCommonTest COMP: Update libminc from upstream, fixing a compiler warning on OSX BUG: Coverity 1081019: Improper use of negative value in StringTools COMP: Fix downcast warnings BUG: Coverity 1103189: Big parameter passed by value in FindSampleBound COMP: Fix implicit conversion warning COMP: Fix unused variable warning on Intel compilers BUG: Fix uninitialized variable in GradientRecursiveGaussianImageFilter BUG: Make all specializations NumericTrails::SetLength re-zero contents BUG: Update SmoothingRecursiveYvvGaussianFilter remote module BUG: Update SplitComponents remote module COMP: Fix implicit conversion warning BUG: Update SmoothingRecursiveYvvGaussianFilter remote module COMP: Update LesionSizingToolkit remote module from upstream STYLE: Coverity 1103618-1103620: Structurally dead code STYLE: Coverity 1081585: Structurally dead code STYLE: Coverity 1081584: Structurally dead code STYLE: Coverity 1081583: Structurally dead code STYLE: Coverity 1081580: Structurally dead code STYLE: Coverity 1081570-1081578: Structurally dead code STYLE: Coverity 1081566-1081568: Structurally dead code STYLE: Coverity 1081564: Structurally dead code STYLE: Coverity 1080826-1080827: Logically dead code STYLE: Coverity 1080862: Logically dead code STYLE: Coverity 1081598: Unused pointer value BUG: Coverity 1103595: Uninitialized pointer field BUG: Coverity 1081508: Uninitialized pointer field BUG: Fix uninitialized pointer fields BUG: Coverity 1081381: Uninitialized scalar field STYLE: Coverity 1103107-1103116: Logically dead code Constantine Zakkaroff (1): DOC: HelloWorld Comments Edit for ITKSoftwareGuide David Cole (2): COMP: Eliminate some level 4 warnings BUG: Add missing header files to enable try_run tests to run without crashing Dirk Padfield (2): DOC: Improved comments and reorganized code for IsolatedConnected DOC: Corrected documentation for threshold boundaries. Eric Greveson (1): ENH: Add setters for the overlay functor in labelmap overlay filters. Fotis Drakopoulos (1): ENH: Adding GetFEMFilter method to PhysicsBasedNonRidgidRegistrationMethod. GCC-XML Upstream (1): pygccxml 1.0.0 (reduced) Ga?tan Lehmann (1): ENH: Importing files from Noise Simulation Article Gib Bogle (1): BUG: Windows BigTIFF errors: stat failure and lack of COMPRESSION_DEFLATE Google double-conversion Maintainers (1): COMP: Google double-conversion (reduced) Guillaume Pasero (1): ENH: Add mangling to internal OpenJpeg Hans Johnson (40): PERF: 15% speed improvement for registration PERF: Simplify conditionals in loop COMP: Conditional assert check warning unused var. COMP: SimpleITK linkage failure BUG: Missing Modified() call COMP: SimpleITK linkage failure BUG: Element numbers 1053, 1052 not hex BUG: Remove valgrind reported leak BUG: Add missing transform types to factory BUG: Missing Modified() call PERF: Reviewing code for facilitating compiler optimizations COMP: Fix const constructor for const arrays ENH: Add LBFGOptimizerv4(for BSPline registration) COMP: Test failure from numerical precision BUG: Memory leak introduced. COMP: Remove deprecated 'register' keyword ENH: Ignore autocompletion clang helper files ENH: Move to latest remote module tag STYLE: Improve testing of member Get/Set functions COMP: Update AnalyzeObjectMapIO replacing deprecated DOC: Fixed documentation regarding multi-threading DOC: Improved Image Representation PERF: Minimize redundant function calls PERF: Pull loop termination constants out of loop ENH: Refactoring the CompositeTransform class STYLE: Explicitly declare virtual for derived class member functions STYLE: Explicitly recognize virtual functions STYLE: Add ITK_NULLPTR supporting c++11 checks BUG: Missing parentheses for logic comparison STYLE: Explicitly declare virtual (cont. of 1c8609) STYLE: Consistency of threadID and threadId BUG: FFTConvolutionImageFilter outputs incorrect STYLE: GetStopConditionDescription abstract method PERF: Re-use jacobian rather than instantiation ENH: Improve test in preparation for performance testing PERF: Code simplifications for performance testing BUG: Missed an API change for Allocate STYLE: Remove unnecessary comments. BUG: Expose unusable functions BUG: Incomplete refactoring of member variable name Jean-Christophe Fillion-Robin (1): COMP: Fix "unused-local-typedefs" warnings Jens Wetzl (2): BUG: Fix race conditions in itkInvertDisplacementFieldImageFilter STYLE: Incorporated reviewer suggestions Jon Haitz Legarreta (8): ENH: New test for itkSigmoidTransferFunction. COMP: Fix type casting build warning. ENH: New test for itkLogSigmoidTransferFunction ENH: Added call to Print() method STYLE: Changed LogSigmoidTransferFunction template argument names. ENH: Added StatisticsRelabelImageFilterTest to testing BUG: Fix issues with the BinaryStatisticsOpeningImageFilter test COMP: Test for itkCustomColormapFunction Kent Williams (13): ENH: Add remote module for AnalyzeObjectMapIO BUG: incorrect loop var increment COMP: Update the DoubleConversion library upstream update script. ENH: Turn off DCMTK Logger messages by default COMP: fixed license test command in UpdateDoubleConversionFromGoogle.sh ENH: Add FDFImageIO as a remote module. PERF: replace image allocate followed by fillbuffer with allocate(true) COMP: Add test to verify Slope/Intercept handling BUG: GDCM reporting wrong spacing for some Media Types ENH: Add test for itkTestingStretchIntensityImageFilter COMP: Fix misplaced closing brace ENH: Remove try/catch exception handling around dynamic_catch ENH: Disallow vector multiply by itself Liza Shrestha (1): COMP: Added new unit tests for increasing code coverage Luis Ibanez (11): ENH: Add STLMeshIO remote module. BUG: Fixed module name IOSTL. COMP: Fixing instantiation of templated functions. BUG: Fixed Affine test 32bits. Precision checks. PERF: Accelerate initialize via selective testing. COMP: ShapeUniqueLabelMapFilter test was missing. STYLE: Coverity 1103119: Logically dead code BUG: itkLoggerThreadWrapper test was disabled. BUG: No DiscreteHessianGaussianImageFunctionTest. BUG: DiffusionTensorReconstruction lacked Progress BUG: TestingExtractSliceImageFilter lacked test. Luke Bloy (4): BUG: Fixes itkBoxSpatialObject part of issue ITK-3153 BUG: Fixes itkImageMaskSpatialObject part of issue ITK-3153 BUG: Fixes itkBoxSpatialObject part of issue ITK-3153 BUG: Fixes itkImageMaskSpatialObject part of issue ITK-3153 Marius Staring (2): ENH: add reset function to resource probe ENH: adding handle to RealTimeClock Mark Hiner (1): ENH: bump to latest scifio-imageio Martin Stegh?fer (1): BUG: Match behavior of SimpleFastMutexLock on different platforms (#ITK-3248) Matthew McCormick (93): ENH: Bump CMakeLists.txt to version 4.6.0. BUG: Remove unused itkAffineTransformXX.txt content links. BUG: Avoid SimpleImageRegistration{Float,Double}Test output clobbering. BUG: Prevent MINC transform tests outputs from clobbering. BUG: Add random number generator seed for vnl_algo_test_sparse_lm. COMP: Update libminc to latest version. ENH: Only build tests for modules explicitly enabled. BUG: Remove unused forward declarations in RegistrationMethodsv4. COMP: Update libminc to latest version. ENH: Add REQUIRES_DISPLAY CTest label. ENH: Add SplitComponents Remote Module. DOC: Suggest MeshFileReader instead VTKPolyDataReader. DOC: Add itkSetGetDecoratedInputMacro definition for Doxygen. COMP: Bump DCMTK to fix warning. BUG: Wrap TransformFileReader, TransformFileWriter. BUG: Remove unused itkAffineTransformXX.txt content links. COMP: Wrap OptimizerParameterScalesEstimatorTemplate. COMP: CommandIterationUpdate has field whose type uses anonymous namespace. COMP: Do not use -fno-ipa-cp-clone with clang. ENH: Move TransformToDisplacementFieldSource out of Review. ENH: Bump ITK version to 4.5.1. COMP: ImageRegistrationHistogramPlotter Clone never referenced. ENH: Add the ITK_INSTALL_LIBRARY_DIR to WrapITK.pth. ENH: Bump SCIFIO to add wrapping. COMP: ImageRegistrationHistogramPlotter unchecked dynamic_cast. BUG: Fix Array memory leaks with non-const construction. BUG: Prevent ambiguous Array construction methods. COMP: HDF5 library version variables contain '@'. COMP: Remove add_custom_command(SOURCE... COMP: Wrap OptimizerParameterScalesEstimatorTemplate. BUG: Wrap TransformFileReader, TransformFileWriter. COMP: Add missing itkVerson.h header. COMP: LBFGSOptimizerBasev4 explicit Doxygen link request. ENH: Bump FFTW to 3.3.3. COMP: Duplicated VectorContainer wrapping for real types. BUG: Increase tolerance for itkFEMC0TriangularElement-NodalLoads-BCs STYLE: Add missing "Test" to GDCM test names and filenames. DOC: No ReferenceImage members in TransformToDisplacementFieldSource. COMP: Bump LesionSizingToolkit for Doxygen warnings. BUG: GDCM Series does not write z-spacing. COMP: Remove unreachable return statements. ENH: Add ITK_FORBID_DOWNLOADS option. ITK-3239 COMP: Bump SplitComponents Remote for Doxygen warnings. COMP: return will never be executed after exception thrown. BUG: Invalid read during ImageIOBase SetDirection. COMP: Fix failed itkTIFFImageIOCompressionTest merge. ENH: Bump version to 4.5.2. COMP: return will never be executed after exception thrown. COMP: SigmoidTransferFunction conversion from double. BUG: BoxImageFilter GenerateInputRequestRegion public -> protected. DOC: KernelImageFilter does not reimplement GenerateInputRequestedRegion. STYLE: Remove SigmoidTransferFunction .hxx doxy comments. BUG: Clean up Python module2module test. BUG: TestingExtractSliceImageFilterTest v3 direction strategy. STYLE: Remove duplicated TestingExtractSliceImageFilter doxygen. COMP: Use latex formula for HoughTransform doxygen. COMP: SigmoidTransferFunction members Alpha, Beta real type. STYLE: Fix SigmoidTransformFunction template argument names. COMP: BuildHeaderTest.py print_function import. BUG: Fix print function errors in pygccxml. BUG: Fix print functions in igenerator.py. ENH: Add Remote module group description to Doxygen. STYLE: Clean up MetaDataObjectBase. STYLE: Clean up MetaDataObject. ENH: Add unit test for MetaDataObject. ENH: Add MetaDataObject Print specialization for common types. STYLE: Fix template statements in SigmoidTransformFunction. BUG: Remove public MetaDataObject constructors. BUG: Add missing private copy constructors to MetaDataObject. BUG: Remove FEMRegistrationFilter debug code. DOC: Improve documentation and types for SplitRequestedRegion. Revert "Revert "ENH: Add Remote module group description to Doxygen."" DOC: Remove errant "+" in Remote_documentation. ENH: For shared libraries when wrapping. ENH: Collect all wrapping configuration checks in one place. ENH: Better CMake defaults with wrapping. ENH: Replace CSWIG preprocessor definition with ITK_WRAPPING. BUG: Remove old itkSampleBuildTest.cmake.in file. ENH: Move MagnitudeAndPhaseToComplexImageFilter out of Review. COMP: Fix Doxygen warnings in itkMetaDataObject.h. BUG: Exclude Remote Modules the default ON Group values. COMP: Documentation CMake target must come before add_custom_command. BUG: Assign Remote modules to groups more robustly. BUG: Remove MagnitudeAndPhaseWriteComplexImageFilter test from Review Module. BUG: Remove old tests from Review for classes that have been removed. DOC: Fix Software Guide LaTeX syntax errors in the examples. COMP: Define ITKCommon_EXPORT_EXPLICIT for Doxygen. COMP: Remove itkImageReadComplexWriteMagnitudeAndPhaseTest.cxx from list. BUG: Move MagnitudeAndPhaseToComplexImageFilter to the ImageIntensity module. COMP: StdStreamStateSave Doxygen include. ENH: Add Sphinx examples as a Remote Module. BUG: Remove ITK_INSTALL_NO_LIBRARIES and ITK_INSTALL_NO_DEVELOPMENT. ENH: Make ITK_WRAPPING INTERNAL. Matthew Woehlke (1): COMP: Fix egregious -Wcast-qual warnings Michka Popoff (53): BUG: Fix for the WrapITK.pth destination path COMP: Fixes the Python wrapping under OS 10.8.5 STYLE: Removed itkExtras folder BUG: Fix for the WrapITK.pth destination path COMP: Fixed itkQuasiNewtonOptimizerv4 wrapping warnings STYLE: 4 space indentation for python files COMP: Fixed itkGradientDescentOptimizerv4 wrapping warnings STYLE: Removed deprecated itk functions STYLE: Removed unused and misplaced python tests STYLE: Removed legacy python importing STYLE: Pep8 cleanup for the python files STYLE: Remove deprecated python strel function COMP: Fixed itkQuasiNewtonOptimizerv4 wrapping warnings COMP: Fixed itkGradientDescentOptimizerv4 wrapping warnings ENH: Use python warnings module for template warnings COMP: Duplicated wrapping for double in Array2D COMP: Update SWIG to 2.0.12 COMP: Require at least Python 2.6 for Python wrapping ENH: Remove python dl dependency ENH: Remove psyco import COMP: Update PCRE to 8.34 ENH: Update Swig to 3.0.0 STYLE: Remove WrapITK versions COMP: Remove cmp0011 in wrapping COMP: Remove unused code in ConfigureWrapping.cmake COMP: Remove clrLine in itkExtras COMP: Fix the python import and progress callbacks STYLE: Remove reference to CableSwig STYLE: Clean up BinaryThresholdImageFilter (python) COMP: Fix the Python ResampleImageFilter test ENH: Bump SCIFIO for OS X installation ENH: Bump SCIFIO for OS X installation COMP: Update PCRE to 8.35 STYLE: Remove unused compile all code for Python Wrapping ENH: Replace python print with print() function STYLE: Remove deprecated Python wrapping macros COMP: Fix failing header test COMP: Fix the writing of .idx files COMP: Fix python print import for .pth file creation COMP: Fix print import statement in itkExtras.py STYLE: Refactor swig call and code cleanup COMP: Fix for wrapping warnings (RealTimeClock and SimpleFastMutexLock) STYLE: Remove old Python examples COMP: Update gccxml ENH: Use pygccxml snapshot. ENH: Update to swig 3.0.2 DOC: Update commit instructions for JIRA bugtracker ENH: Update GCCXML BUG: Fix wrapping with dimension 2 only COMP: Temporarily hide pygccxml warnings BUG: Do not wrap BinaryMask3DMeshSource when building with 2D only COMP: Move itkMatrixCoefficients wrapping to Filtering module COMP: Fix wrapping with Core only Miguel Algaba (1): ENH: Added further Solve methods to VNLSparseLUSolverTraits Nick Tustison (2): BUG: Ignored the case for exceeding iteration limit. ENH: Preparing point set metrics for use with registration. Rashad M (1): STYLE: Allow system installed expat library with ITK_USE_SYSTEM_EXPAT=ON Sean McBride (6): BUG: initialize m_SmallBlock ivar in ctor; fixes garbage read BUG: changed some variables involved in shifting to unsigned COMP: Updated libminc to a78661bb592359ab86f417cc0c298299e593d808 BUG: initialize m_SmallBlock ivar in ctor; fixes garbage read PERF: Mark ImageRegistration8Test with RUNS_LONG COMP: workaround clang -Windent warnings by fixing indentation Sebastian P?lsterl (1): BUG: Return null pointer if class label does not exist (#3235) Taylor Braun-Jones (1): ENH: Expose the output stream operator for LightObject Vladimir Chalupecky (1): DOC: Fix description of SpatialObject::GetBoundingBox() Vladimir S. FONOV (3): COMP: Fixed libminc to build on Windows COMP: Updated libminc, hopefully reducing number of warnings COMP: Improved MINCIOTransform tests Wei Liu (1): BUG: Fixed a bug in ExpectationMaximiationMixtureModelEstimator. Yves Frederix (1): ENH: GeodesicActiveContourShapePrior deals with DerivativeSigma equal to zero ITK Sphinx Examples Changelog ----------------------------------------- Arnaud Gelas (25): remove annonying messages about include folders not used with Clang ENH: Add one example for LabelMapMakImageFilter upgrade breathe to 1.2.0 add documentation for ITKLabelMap ENH: Add one example to convert a triangular mesh to binary image ENH: Add example for itk::AccumulateImageFilter read an unknown image type add example to generate mesh from binary image ENH: Add one example for ExpNegativeImageFilter add one example for ThresholdImageFilter Add one example to translate one itk::Mesh add Iterative hole filling example wrong directory name fix link to c++ code link to the wrong folder for canny edge detection example Resample scalar image (with identity transform) fix command line for cloning in README COMP: Fix for failing ApplyAccumulateImageFilter baseline comparison test add one example to translate one itk::Image add PasteImageFilter example fix path in ArchiveBinaryData.py.in BUG: error when TEST_IMAGE_PREFIX was used fix broken links as detected by linkcheck add example for PermuteAxesImageFilter Add one example to apply an affine transform given homogeneous matrix Brian Helba (3): ENH: Support ExternalData_OBJECT_STORES being set with a Superbuild ENH: Allow ExternalData path to be set by environment on dashboards BUG: Set correct URL scheme in dashboard common script Matt McCormick (21): ENH: DilateABinaryImage uses FlatStructuringElement. ENH: Add DilateABinaryImage.py. ENH: ErodeABinaryImage uses FlatStructuringElement. ENH: Add ErodeABinaryImage.py. ENH: Use Git email as default when uploading binary data. BUG: ITKIOImageBase module directory not included. BUG: MaskOneImageGivenLabelMap test name for baseline comparison. ENH: Add Register IO Factories example. ENH: Add documentation upload to common CDash script. ENH: Add ApplyExpNegativeImageFilter.py. BUG: Remove non-existent Sphinx example entry. DOC: Give an example call to UploadBinaryData.py. COMP: Fix Doxygen link to LevelSets visualization classes. ENH: Rename module to follow Remote Module convention. COMP: QUIET initial find_package( ITK ). ENH: Bump ITK Superbuild tag to 4.6.0. BUG: Fix ConvertAnITKGrayScaleImageToCVMat compare_to_baseline. COMP: Remove breathe link to ConstantPadImageFilter. BUG: Fix figure path for Iterative Hole Filling. BUG: Evolution.gif needs to be ..only:: html COMP: Content not permitted in image:: directive. Michka Popoff (29): ENH: Add examples for grayscale image dilation/erosion ENH: Add BinaryThresholdImageFilter example COMP: Fix for cmake 3.0 compatibility ENH: Clean up ThresholdAnImageUsingOtsu ENH: Add missing python documentation call for binarythreshold example STYLE: Fix Python subtitles ENH: Add CannyEdgeDetectionImageFilter example COMP: Add cmake_minimum_required back STYLE: Cleanup include( ${ITK_USE_FILE} ) and minor alignements COMP: Fix for Canny Edge example ENH: Add CastImageFilter.py and code cleanup ENH: Add ComputeCurvatureAnisotropicDiffusion example ENH: Add GradientAnisotropicDiffusionImageFilter example ENH: Add ComputeGradientMagnitudeRecursiveGaussian python example ENH: Add CurvatureFlowImageFilter example STYLE: Clean up pipeline and uniformize error catching ENH: Add mean and median filters ENH: Add Laplacian filter example ENH: Add an example of image resampling COMP: Fix two documentation warnings STYLE: Update sys.argv len() checks ENH: Add example for Sigmoid computation STYLE: Rename python examples to Code.py ENH: Fix the git URL ENH: Add python code for ThresholdAnImage ENH: Add example for SmoothWithRecursiveGaussianImageFilter COMP: Fix failing setup of SegmentBloodVessels example STYLE: Update title for Apply Affine Transform example ENH: Add GeodesicActiveContourLevelSetImageFilter example ITK Software Guide Changelog --------------------------------------- Brad King (3): SoftwareGuideCover: Port to VTK >= 5 SoftwareGuideCover: Re-order code to simplify non-interactive run SoftwareGuideCover: Adjust colors and camera position for new cover Bradley Lowekamp (1): Fix spelling of Lowekamp Constantine Zakkaroff (1): ENH: Revise Configure and Build Instructions Hans Johnson (4): ENH: Reorder IO and filtering chapters. STYLE: Remove end of line spaces. COMP: File name change needed DOC: Added Direction to the figure Matt McCormick (39): ENH: Improve Hello World directions. BUG: Remove extra configuration of SoftwareGuideConfiguration.tex. ENH: Update the printed SoftwareGuide authors. BUG: Updates to PrintedPreamble. BUG: Update the cover sources location. STYLE: Update CMake style in SoftwareGuide/Latex/CMakeLists.txt ENH: Split into two books. BUG: Build resolving citations. BUG: Update build process description in SoftwareGuide/README.txt. BUG: Remove SoftwareGuide/Latex/00-SoftwareGuide.tex. DOC: Move build instructions to top level README. ENH: Update funding acknowledgement. DOC: Remove minipage about VTK/CMake books. STYLE: Improve spacing after preamble year. BUG: Update Cover VWSegmentation CMakeLists.txt. COMP: Fix compilation of ModerBasedSegmentation.cxx. STYLE: Strip trailing whitespace from SoftwareGuide sources. COMP: Add -dUseCIEColor when building Printer quality. BUG: o -> % in comment. ENH: Update the Kitware logo. ENH: Update copyright notice. STYLE: Place the appendix before \backmatter. BUG: Remove commentted content. ENH: Matt -> Matthew. ENH: Add Ali Ghayoor to contributors. ENH: Add contributors for covers. BUG: Update participants URL. BUG: Move build configuration to PrintedPreamble-Common. ENH: Add description for book cover 2. BUG: Update index generation. BUG: Remove wrapping Tcl entry. BUG: Remove old comments. ENH: Bump ITK to v4.6.0. ENH: Pass PDF_QUALITY_LEVEL in superbuild. BUG: Remove unused RunExamples.py imports. ENH: Reduce verbosity of RunExamples.py. BUG: Do not include RegistrationITKv4 example sources in the build. BUG: Fix caption on Confidence Connectened on BrainWeb figures. BUG: Bump the ITK superbuild for LaTeX fixes. From mercikd at thomas.edu Wed Jul 30 15:25:41 2014 From: mercikd at thomas.edu (Dan Mercik) Date: Wed, 30 Jul 2014 19:25:41 +0000 Subject: [ITK-users] Adjacent Deblurring Wavelenght fusion? Message-ID: Hey, I'm using ITK and wanted to know if there a way I can do Adjacent Deblurring Wavelenght fusion for a stack of images? Daniel Mercik Computer Science Major Thomas College From oscar.lazzarino at gmail.com Wed Jul 30 16:23:57 2014 From: oscar.lazzarino at gmail.com (Oscar Lazzarino) Date: Wed, 30 Jul 2014 22:23:57 +0200 Subject: [ITK-users] Starting with GPU development Message-ID: Hi, I'd like to experiment a bit with GPU/OpenCL computing, but I'm having some troubles finding examples and documentation. The ITK Software Guide mentions "GPU" exactly ZERO times. I could not find any complete example on the wiki. The reference documentation is there, but I can't even understand where to start from. Let's say I want to put the output on a reader into a GPUImage. I can't just say MyGPUImageType::Pointer image = reader->getOutput() because the output of a reader is NOT a GPU image. How am I supposed to do that? Am I missing something? Any info (or any pointer to any good info) is REALLY welcome :) Thanks Oscar Lazzarino -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Wed Jul 30 16:33:47 2014 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Wed, 30 Jul 2014 16:33:47 -0400 Subject: [ITK-users] Starting with GPU development In-Reply-To: References: Message-ID: The test may be a good starting point for some examples: $ find . -name "*GPU*Test.cxx" ./Modules/Core/GPUCommon/test/itkGPUImageTest.cxx ./Modules/Core/GPUCommon/test/itkGPUReductionTest.cxx ./Modules/Registration/GPUPDEDeformable/test/itkGPUDemonsRegistrationFilterTest.cxx ./Modules/Filtering/GPUThresholding/test/itkGPUBinaryThresholdImageFilterTest.cxx ./Modules/Filtering/GPUThresholding/test/itkGPUImageFilterTest.cxx ./Modules/Filtering/GPUImageFilterBase/test/itkGPUNeighborhoodOperatorImageFilterTest.cxx ./Modules/Filtering/GPUAnisotropicSmoothing/test/itkGPUGradientAnisotropicDiffusionImageFilterTest.cxx ./Modules/Filtering/GPUSmoothing/test/itkGPUMeanImageFilterTest.cxx ./Modules/Filtering/GPUSmoothing/test/itkGPUDiscreteGaussianImageFilterTest.cx Brad On Jul 30, 2014, at 4:23 PM, Oscar Lazzarino wrote: > Hi, > > I'd like to experiment a bit with GPU/OpenCL computing, but I'm having some troubles finding examples and documentation. > > The ITK Software Guide mentions "GPU" exactly ZERO times. > > I could not find any complete example on the wiki. > > The reference documentation is there, but I can't even understand where to start from. > > Let's say I want to put the output on a reader into a GPUImage. > > I can't just say MyGPUImageType::Pointer image = reader->getOutput() because the output of a reader is NOT a GPU image. > > How am I supposed to do that? Am I missing something? > > Any info (or any pointer to any good info) is REALLY welcome :) > > Thanks > > Oscar Lazzarino > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users From mallikarjun49 at gmail.com Thu Jul 31 01:35:32 2014 From: mallikarjun49 at gmail.com (Mallikarjun K) Date: Thu, 31 Jul 2014 11:05:32 +0530 Subject: [ITK-users] itkSmoothingQuadEdgeMeshFilter Help!! In-Reply-To: References: Message-ID: Hi Bill, Thanks for the replay. Yes,I built both ITK and my app with Release ,I forgot to mention it in the previous post.Actually the data set is the output of vtkDiscreteMarchingCubes algorithm(around 5MB) and need to smooth .I saved this marching cube's output as .vtk file and read it using itkVTKPolyDataReader and then I am giving this reader's output to itkSmoothingQuadEdgeMeshFilter's input. I checked the execution time of each step in the pipeline ,after SmothingQEMeshFilter has got it's input ,it is taking time to process the data. Thank you On Wed, Jul 30, 2014 at 9:29 PM, Bill Lorensen wrote: > First, make sure you are building ITK and your app with Release. A > Debug build can be 10-50 times slower. > > > On Wed, Jul 30, 2014 at 10:18 AM, Mallikarjun K > wrote: > > Hi All, > > I am using itkSmoothingQuadEdgeMeshFilter for Surface Mesh smoothing.This > > filter is giving good results what I expected but taking more execution > > time.can any one suggest me to reduce the execution time( multi threading > > or any parameters to add/remove )? > > > > Below is the code snippet > > /////// > > typedef itk::QuadEdgeMeshTraits > > qetraits; > > typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; > > > > //typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3 > MeshType; > > > > itk::OnesMatrixCoefficients< MeshType > coeff0; > > > > typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > > > SmoothingQuadEdgeMeshFilter; > > > > SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = > > SmoothingQuadEdgeMeshFilter::New(); > > > > QEMeshSmoother->SetInput("abc.vtk"); > > QEMeshSmoother->SetNumberOfIterations(5 ); > > QEMeshSmoother->SetRelaxationFactor( 0.5 ); > > QEMeshSmoother->SetDelaunayConforming(true ); > > QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); > > QEMeshSmoother->Update(); > > //// > > > > -- > > Regards: > > Mallik > > > > > > _____________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Kitware offers ITK Training Courses, for more information visit: > > http://www.kitware.com/products/protraining.php > > > > Please keep messages on-topic and check the ITK FAQ at: > > http://www.itk.org/Wiki/ITK_FAQ > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/insight-users > > > > > > -- > Unpaid intern in BillsBasement at noware dot com > -- *Regards:* Mallik -------------- next part -------------- An HTML attachment was scrubbed... URL: From irina.vidal-migallon at inria.fr Thu Jul 31 04:29:54 2014 From: irina.vidal-migallon at inria.fr (Irina Vidal Migallon) Date: Thu, 31 Jul 2014 10:29:54 +0200 Subject: [ITK-users] Starting with GPU development In-Reply-To: References: Message-ID: <53D9FE82.1050404@inria.fr> Hi Oscar, > Let's say I want to put the output on a reader into a GPUImage. > > I can't just say MyGPUImageType::Pointer image = reader->getOutput() > because the output of a reader is NOT a GPU image. If you've defined your reader as a GPUImage reader, as in: typedef itk::ImageFileReader< itk::GPUImage > GPUReaderType; you can do just that, as you would with any other type of image. > Any info (or any pointer to any good info) is REALLY welcome :) > I found examples and tests in Modules/Filtering/GPU* and/or Modules/Core/GPUCommon rather helpful, they will probably get you started. I. From bill.lorensen at gmail.com Thu Jul 31 07:44:39 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Thu, 31 Jul 2014 07:44:39 -0400 Subject: [ITK-users] itkSmoothingQuadEdgeMeshFilter Help!! In-Reply-To: References: Message-ID: If you have it in vtk, I suggest using the vtk pipeline to smooth the data. On Thu, Jul 31, 2014 at 1:35 AM, Mallikarjun K wrote: > Hi Bill, > Thanks for the replay. > > Yes,I built both ITK and my app with Release ,I forgot to mention it in the > previous post.Actually the data set is the output of > vtkDiscreteMarchingCubes algorithm(around 5MB) and need to smooth .I saved > this marching cube's output as .vtk file and read it using > itkVTKPolyDataReader and then I am giving this reader's output to > itkSmoothingQuadEdgeMeshFilter's input. > > I checked the execution time of each step in the pipeline ,after > SmothingQEMeshFilter has got it's input ,it is taking time to process the > data. > > Thank you > > > > On Wed, Jul 30, 2014 at 9:29 PM, Bill Lorensen > wrote: >> >> First, make sure you are building ITK and your app with Release. A >> Debug build can be 10-50 times slower. >> >> >> On Wed, Jul 30, 2014 at 10:18 AM, Mallikarjun K >> wrote: >> > Hi All, >> > I am using itkSmoothingQuadEdgeMeshFilter for Surface Mesh >> > smoothing.This >> > filter is giving good results what I expected but taking more execution >> > time.can any one suggest me to reduce the execution time( multi >> > threading >> > or any parameters to add/remove )? >> > >> > Below is the code snippet >> > /////// >> > typedef itk::QuadEdgeMeshTraits> > > >> > qetraits; >> > typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; >> > >> > //typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3 > MeshType; >> > >> > itk::OnesMatrixCoefficients< MeshType > coeff0; >> > >> > typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > >> > SmoothingQuadEdgeMeshFilter; >> > >> > SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = >> > SmoothingQuadEdgeMeshFilter::New(); >> > >> > QEMeshSmoother->SetInput("abc.vtk"); >> > QEMeshSmoother->SetNumberOfIterations(5 ); >> > QEMeshSmoother->SetRelaxationFactor( 0.5 ); >> > QEMeshSmoother->SetDelaunayConforming(true ); >> > QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); >> > QEMeshSmoother->Update(); >> > //// >> > >> > -- >> > Regards: >> > Mallik >> > >> > >> > _____________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Kitware offers ITK Training Courses, for more information visit: >> > http://www.kitware.com/products/protraining.php >> > >> > Please keep messages on-topic and check the ITK FAQ at: >> > http://www.itk.org/Wiki/ITK_FAQ >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/insight-users >> > >> >> >> >> -- >> Unpaid intern in BillsBasement at noware dot com > > > > > -- > Regards: > Mallik > -- Unpaid intern in BillsBasement at noware dot com From elena.bresciani87 at gmail.com Thu Jul 31 11:22:54 2014 From: elena.bresciani87 at gmail.com (elena bresciani) Date: Thu, 31 Jul 2014 17:22:54 +0200 Subject: [ITK-users] ERROR: MeanSquaresImageToImageMetric: Too many samples map outside moving image buffer In-Reply-To: References: Message-ID: Any hint on how I can resolve my issue? I'd really appreciate any suggestion? I should change the metric? I tried adding a Centered Transform Initializer but whitout success, even after setting smaller step lenghts I have the same problem. Cheers Elena 2014-07-23 14:52 GMT+02:00 elena bresciani : > I get the error immediately after running the script, so I think the > problem is in the transform initialization. > Should I try with itkCenteredTransformInitializer.h > > ? > > > 2014-07-23 14:48 GMT+02:00 Bradley Lowekamp : > > Is this at the first iteration of after a few? Are iterations converging, >> diverging or erratic? >> >> If it's the first it's an indication that initial transform is poor and >> they don't overlap much. There for the results of the transform initializer >> should be evaluated. >> >> If it's after a few iterations, then is the iteration of the metric and >> optimizer needs to be examine. Is the value of the metric correct and >> correlated with the correct solution? Is the step size too big? Would >> smoothing the fixed and moving images smooth optimization? etc? >> >> These registration examples are not designed to be turn key solution, >> they are a stepping stone to learn about the registration framework, and >> begin analyzing the behavior of the components so that a solution to your >> problem can be constructed. >> >> Brad >> >> On Jul 23, 2014, at 8:30 AM, elena bresciani >> wrote: >> >> ExceptionObject caught ! >> >> itk::ExceptionObject (0x3043350) >> Location: "void itk::MeanSquaresImageToImageMetric> TMovingImage>::GetValueAndDerivative(const ParametersType&, >> itk::MeanSquaresImageToImageMetric> TMovingImage>::MeasureType&, >> itk::MeanSquaresImageToImageMetric> TMovingImage>::DerivativeType&) const [with TFixedImage = >> itk::Image; TMovingImage = itk::Image> 2u>; itk::MeanSquaresImageToImageMetric> TMovingImage>::ParametersType = itk::OptimizerParameters; >> itk::MeanSquaresImageToImageMetric::MeasureType >> = double; itk::MeanSquaresImageToImageMetric> TMovingImage>::DerivativeType = itk::Array]" >> File: /usr/local/include/ITK-4.5/itkMeanSquaresImageToImageMetric.hxx >> Line: 257 >> Description: itk::ERROR: MeanSquaresImageToImageMetric(0x30384c0): Too >> many samples map outside moving image buffer: 4042 / 568832 >> >> >> 2014-07-23 13:47 GMT+02:00 Bradley Lowekamp : >> >>> What is the error you are getting? >>> >>> Brad >>> On Jul 23, 2014, at 6:20 AM, elena bresciani < >>> elena.bresciani87 at gmail.com> wrote: >>> >>> > Hello folks, >>> > >>> > I have a registration problem for you. I'm using the code in the >>> example ImageRegistration5.cxx in order to align image of drugs blisters to >>> assess if they are the same or not. >>> > >>> > The code works well even though for certain images couples I get the >>> error in this message object. >>> > I thought the problem could be the relative difference in images size >>> and tried to pad the smallest one to have the same size as the biggest: >>> same error. >>> > After reading comments on the same topic I tried to add to the code >>> the line >>> > >>> > registration -> SetFixedImageRegion (fixedImage -> >>> GetBufferedRegion()); >>> > >>> > again not solving my problem. >>> > Attached you can find example images: while I can register image "1" >>> on image "0", if I try to register "2" on "1" I get the ERROR. >>> > >>> > Any guess? >>> > >>> > Cheers, >>> > Elena >>> > >>> > >>> > >>> > <0.jpg><1.jpg><2.jpg> >>> > >>> > _____________________________________ >>> > Powered by www.kitware.com >>> > >>> > Visit other Kitware open-source projects at >>> > http://www.kitware.com/opensource/opensource.html >>> > >>> > Kitware offers ITK Training Courses, for more information visit: >>> > http://www.kitware.com/products/protraining.php >>> > >>> > Please keep messages on-topic and check the ITK FAQ at: >>> > http://www.itk.org/Wiki/ITK_FAQ >>> > >>> > Follow this link to subscribe/unsubscribe: >>> > http://public.kitware.com/mailman/listinfo/insight-users >>> >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From oscar.lazzarino at gmail.com Thu Jul 31 13:58:56 2014 From: oscar.lazzarino at gmail.com (Oscar Lazzarino) Date: Thu, 31 Jul 2014 19:58:56 +0200 Subject: [ITK-users] Starting with GPU development In-Reply-To: <53D9FE82.1050404@inria.fr> References: <53D9FE82.1050404@inria.fr> Message-ID: Thank you both, that's a start. O. On Thu, Jul 31, 2014 at 10:29 AM, Irina Vidal Migallon < irina.vidal-migallon at inria.fr> wrote: > Hi Oscar, > > > Let's say I want to put the output on a reader into a GPUImage. >> >> I can't just say MyGPUImageType::Pointer image = reader->getOutput() >> because the output of a reader is NOT a GPU image. >> > > > If you've defined your reader as a GPUImage reader, as in: > > typedef itk::ImageFileReader< itk::GPUImage > GPUReaderType; > > you can do just that, as you would with any other type of image. > > > > Any info (or any pointer to any good info) is REALLY welcome :) >> >> > I found examples and tests in Modules/Filtering/GPU* and/or > Modules/Core/GPUCommon rather helpful, they will probably get you started. > > > > > I. > > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From donelron at web.de Thu Jul 31 14:58:30 2014 From: donelron at web.de (donelron) Date: Thu, 31 Jul 2014 11:58:30 -0700 (PDT) Subject: [ITK-users] Inconsistent results for same histogram on same image when PixelType of image is different Message-ID: <1406833109934-34366.post@n7.nabble.com> Dear ITK users, I have the following function that generates two scalar images with a constant intensity value, then combines them to a vector image and then calculates a histogram of the vector image: template void TestHistogram() { //Create an "empty" image in which all pixels will be 13 TinputImage::Pointer pImage13pixels=TinputImage::New(); CreateImage(pImage13pixels, 50, 50, 13); //Create an "empty" image in which all pixels will be 42 TinputImage::Pointer pImage42pixels=TinputImage::New(); CreateImage(pImage42pixels, 50, 50, 42); typedef itk::JoinImageFilter JoinImageFilterType; JoinImageFilterType::Pointer joinFilter = JoinImageFilterType::New(); joinFilter->SetInput1(pImage13pixels); joinFilter->SetInput2(pImage42pixels); joinFilter->Update(); //Calculation of histogram const unsigned int MeasurementVectorSize = 2; // 2 channels, as image is combination of two images (see above) const unsigned int binsPerDimension = 200; typedef itk::VectorImage Vector2DImageType; //vector image has the same pixel type as the input image //When using the join filter, determine the OutputImageType like this: JoinImageFilterType::OutputImageType typedef itk::Statistics::ImageToHistogramFilter< JoinImageFilterType::OutputImageType > ImageToHistogramFilterType; ImageToHistogramFilterType::HistogramType::MeasurementVectorType lowerBound(binsPerDimension); lowerBound.Fill(0); ImageToHistogramFilterType::HistogramType::MeasurementVectorType upperBound(binsPerDimension); upperBound.Fill(binsPerDimension-1); ImageToHistogramFilterType::HistogramType::SizeType size(MeasurementVectorSize); size.Fill(binsPerDimension); ImageToHistogramFilterType::Pointer imageToHistogramFilter = ImageToHistogramFilterType::New(); imageToHistogramFilter->SetInput( joinFilter->GetOutput() ); imageToHistogramFilter->SetHistogramBinMinimum( lowerBound ); imageToHistogramFilter->SetHistogramBinMaximum( upperBound ); imageToHistogramFilter->SetHistogramSize( size ); try { imageToHistogramFilter->Update(); } catch( itk::ExceptionObject & error ) { std::cerr << "Error: " << error << std::endl; system("pause"); } ImageToHistogramFilterType::HistogramType* histogram = imageToHistogramFilter->GetOutput(); // Walking through all of the histogram bins and getting the corresponding frequencies typedef ImageToHistogramFilterType::HistogramType HistogramType; HistogramType::ConstIterator itr = histogram->Begin(); HistogramType::ConstIterator end = histogram->End(); typedef HistogramType::AbsoluteFrequencyType AbsoluteFrequencyType; TinputImage::PixelType indexElement; HistogramType::IndexType index; //this is an itk::Array of signed long elements in the current ITK version while( itr != end ) { const AbsoluteFrequencyType frequency = itr.GetFrequency(); if (frequency>0) { index = histogram->GetIndex(itr.GetInstanceIdentifier()); std::cout << "index= " << index << ", Frequency:" << frequency << std::endl; } ++itr; } } -------------------------------------------------------------- void CreateImage is defined as: template void CreateImage(TImage* const image, int width, int height, int intensity) { typename TImage::IndexType corner = {{0,0}}; unsigned int NumRows = height; unsigned int NumCols = width; typename TImage::SizeType size = {{NumRows, NumCols}}; typename TImage::RegionType region(corner, size); image->SetRegions(region); image->Allocate(); image->FillBuffer(intensity); } ---------------------------------------------------------- Then I do some typdefs and call the function twice like:: typedef itk::Image UintImageType; typedef itk::Image UcharImageType; TestHistogram(); TestHistogram(); The resulting output is then: index= [13, 42], Frequency:2500 index= [199, 199], Frequency:2500 However, if I change the number of histogram bins like this: const unsigned int binsPerDimension = 300; then the resulting output is: index= [13, 42], Frequency:2500 index= [299, 299], Frequency:2500 So, it works only for the unsigned char image, but not for the unsigned int, which is the one, that I actually need! It seems that for the unsigned int image that whatever the intensity values in the image are, they are always rounded up to the upper bound as defined for the histogram. i also tried to use the itk::ComposeImageFilter instead of the itk::JoinImageFilter, but that did not help in any way. What am I doing wrong? And what do I need to change to calculate a histogram for an image with unsigned int PixelType??? Thanks in advance! -- View this message in context: http://itk-users.7.n7.nabble.com/Inconsistent-results-for-same-histogram-on-same-image-when-PixelType-of-image-is-different-tp34366.html Sent from the ITK - Users mailing list archive at Nabble.com.