From maudette at odu.edu Mon Mar 2 14:45:23 2015 From: maudette at odu.edu (Audette, Michel A.) Date: Mon, 2 Mar 2015 19:45:23 +0000 Subject: [ITK-users] possible to get a closest-point map from a distance map in ITK? Message-ID: <22EC75E8215562428ACADFA35877A25A26187E3F@JANEWAY.ts.odu.edu> Dear ITK users, a student of mine would like to use the ITK implementation of distance maps in a way where the point label of the closest initial boundary is propagated throughout, i.e. a closest boundary point map. Is there something like this implemented already in ITK? I would like to use something like this to produce a spatially varying distance threshold. Thanks for your kind support. Michel Michel Audette, Ph.D. Assistant Professor, Department of Modeling, Simulation and Visualization Engineering, Old Dominion University, Norfolk, VA. -------------- next part -------------- An HTML attachment was scrubbed... URL: From richard.beare at gmail.com Mon Mar 2 15:37:06 2015 From: richard.beare at gmail.com (Richard Beare) Date: Tue, 3 Mar 2015 07:37:06 +1100 Subject: [ITK-users] possible to get a closest-point map from a distance map in ITK? In-Reply-To: <22EC75E8215562428ACADFA35877A25A26187E3F@JANEWAY.ts.odu.edu> References: <22EC75E8215562428ACADFA35877A25A26187E3F@JANEWAY.ts.odu.edu> Message-ID: I've written a set of label erosion and dilation filters that might do what you're after. I've also got some spatially varying morphology filters, but have't put them on the insight journal. The label erode dilate filters aren't outputing the distance map, so they aren't exactly what you want, but they use the same kind of computation internally. Thus you could use them in conjunction with the parabolic distance transforms to get labels and distances. https://github.com/richardbeare/LabelErodeDilate.git https://github.com/richardbeare/parabolicMorphology.git The insight journal article. http://hdl.handle.net/10380/3399 I can provide more details about the spatially variant stuff if it is of interest. Note that it only works with binary images, and simply weights the input image. On Tue, Mar 3, 2015 at 6:45 AM, Audette, Michel A. wrote: > Dear ITK users, > > > > a student of mine would like to use the ITK implementation of distance > maps in a way where the point label of the closest initial boundary is > propagated throughout, i.e. a closest boundary point map. Is there > something like this implemented already in ITK? I would like to use > something like this to produce a spatially varying distance threshold. > > > > Thanks for your kind support. > > > > Michel > > > Michel Audette, Ph.D. > Assistant Professor, > Department of Modeling, Simulation and Visualization Engineering, > Old Dominion University, > Norfolk, VA. > > _____________________________________ > 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 88.vikram at gmail.com Tue Mar 3 02:19:40 2015 From: 88.vikram at gmail.com (Vikram Venkatraghavan) Date: Tue, 3 Mar 2015 12:49:40 +0530 Subject: [ITK-users] Reading a very large image Message-ID: Hello, I am relatively new to ITK. I am trying to read a very large TIFF image using the IO streaming functionality in ITK. I am reading a very small portion of the image and I still end up getting memory allocation error. I get the feeling, the code is trying to read the entire image at once, even after specifying the region to read. Can someone please tell what is wrong the following code snippet ? typedef itk::RGBPixel< unsigned char > RGBPixelType; typedef itk::Image< RGBPixelType, 2 > RGB2DImageType; typedef itk::ImageFileReader RGBReaderType; itk::TIFFImageIO::Pointer tiffIO = itk::TIFFImageIO::New(); tiffIO->SetPixelType(itk::ImageIOBase::RGBA); RGB2DImageType::SizeType sz; RGB2DImageType::IndexType idx; sz[0]=128; sz[1]=128; idx[0]=0; idx[1]=0; itk::ImageIORegion region(2); region.SetSize(0,sz[0]); region.SetSize(1,sz[1]); region.SetIndex(0,idx[0]); region.SetIndex(1,idx[1]); tiffIO->SetIORegion(region); RGBReaderType::Pointer reader = RGBReaderType::New(); reader->SetFileName("V:\\TiFF_Image.tiff"); reader->SetImageIO(tiffIO); reader->SetUseStreaming(1); reader->Update(); Thanks in advance. Regards, Vikram -------------- next part -------------- An HTML attachment was scrubbed... URL: From lluna.nova at gmail.com Tue Mar 3 04:35:14 2015 From: lluna.nova at gmail.com (=?UTF-8?B?UG9sIE1vbnPDsyBQdXJ0w60=?=) Date: Tue, 3 Mar 2015 10:35:14 +0100 Subject: [ITK-users] Reading a very large image In-Reply-To: References: Message-ID: Hello Vikram, I followed the same road a few months ago, read the kind and insightful answer of Bradley here: http://public.kitware.com/pipermail/community/2014-November/007678.html tl; dr @Bradley is working on streaming the tiff reader, but it isn't ready yet (right? I apologize for not having had the time to test it). So indeed, your reader is reading the whole image. Try using mha instead if possible. 2015-03-03 8:19 GMT+01:00 Vikram Venkatraghavan <88.vikram at gmail.com>: > Hello, > > I am relatively new to ITK. I am trying to read a very large TIFF image > using the IO streaming functionality in ITK. I am reading a very small > portion of the image and I still end up getting memory allocation error. I > get the feeling, the code is trying to read the entire image at once, even > after specifying the region to read. Can someone please tell what is wrong > the following code snippet ? > > typedef itk::RGBPixel< unsigned char > RGBPixelType; > typedef itk::Image< RGBPixelType, 2 > RGB2DImageType; > typedef itk::ImageFileReader RGBReaderType; > > itk::TIFFImageIO::Pointer tiffIO = itk::TIFFImageIO::New(); > tiffIO->SetPixelType(itk::ImageIOBase::RGBA); > > RGB2DImageType::SizeType sz; > RGB2DImageType::IndexType idx; > sz[0]=128; sz[1]=128; > idx[0]=0; idx[1]=0; > > itk::ImageIORegion region(2); > region.SetSize(0,sz[0]); > region.SetSize(1,sz[1]); > region.SetIndex(0,idx[0]); > region.SetIndex(1,idx[1]); > tiffIO->SetIORegion(region); > > RGBReaderType::Pointer reader = RGBReaderType::New(); > reader->SetFileName("V:\\TiFF_Image.tiff"); > reader->SetImageIO(tiffIO); > reader->SetUseStreaming(1); > reader->Update(); > > Thanks in advance. > > Regards, > Vikram > > _____________________________________ > 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 Mar 3 09:27:11 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Tue, 3 Mar 2015 09:27:11 -0500 Subject: [ITK-users] Reading a very large image In-Reply-To: References: Message-ID: Hello Vikram, Unfortunately TIFFImageIO doesn't support streaming. So your code will try to load the whole things. Perhaps you can find a machine with a large amount of memory and convert the TIFF to a mha file to perform ITK streaming processing on? However, even if TIFFImageIO supported streaming your code would still try to read the largest possible region. The ImageIORegion::SetIORegion is not a method that really should be used for IO streaming. For reading images the ITK pipeline architecture will take care of it automatically, by only reading the requested region. For writing the SetNumberOfStreamingDivisions methods can be set to sequentially write a region, and the ImageFileWriter::SetIORegion, can be use to only update a sub-region in the output. I would strongly urge to read Section 8.3 of the new ITK Software guide[1][2], a couple of times. You need to be comfortable processing images with the LargestPossibleRegion being different than the buffered region. As well as know that just calling Update, is the same thing as calling UpdateLargestPossibleRegion Consider the following changes: 1) Remove the manual setup of the ImageIO, just let the factory take care of it. 2) Replace the Update call with: SetRequestedRegion(region) followed by PropagateRequestedRegion(). ( This will not cause memory allocation or reading. It'll just determine what the ImageIO can read). 3) Print the output, of the image reader. Noting the LargestPossibleRegion, BufferedRegion and the RequestedRegion. Hope that gets you started, Brad [1] http://www.itk.org/ITK/resources/software.html [2] http://www.amazon.com/ITK-Software-Guide-Book-Introduction/dp/1930934270/ref=sr_1_1?ie=UTF8&qid=1425392002&sr=8-1&keywords=ITK+Software Pol, Yes, I did a bit of work on the TIFFImageIO for the 4.7 ITK release, to improve performance (~3-5X) and add support for the TIFF tags in the meta-data dictionary. This took a good bit of time, and just improving the read performance was sufficient for my project, and I didn't need streaming. It would certainly be nice to add streaming, but I haven't gotten around to it. Letting me know it's important to people certainly helps prioritize :) Brad On Mar 3, 2015, at 4:35 AM, Pol Mons? Purt? wrote: > Hello Vikram, > > > I followed the same road a few months ago, read the kind and insightful answer of Bradley here: http://public.kitware.com/pipermail/community/2014-November/007678.html > > tl; dr > @Bradley is working on streaming the tiff reader, but it isn't ready yet (right? I apologize for not having had the time to test it). So indeed, your reader is reading the whole image. Try using mha instead if possible. > > > 2015-03-03 8:19 GMT+01:00 Vikram Venkatraghavan <88.vikram at gmail.com>: > Hello, > > I am relatively new to ITK. I am trying to read a very large TIFF image using the IO streaming functionality in ITK. I am reading a very small portion of the image and I still end up getting memory allocation error. I get the feeling, the code is trying to read the entire image at once, even after specifying the region to read. Can someone please tell what is wrong the following code snippet ? > > typedef itk::RGBPixel< unsigned char > RGBPixelType; > typedef itk::Image< RGBPixelType, 2 > RGB2DImageType; > typedef itk::ImageFileReader RGBReaderType; > > itk::TIFFImageIO::Pointer tiffIO = itk::TIFFImageIO::New(); > tiffIO->SetPixelType(itk::ImageIOBase::RGBA); > > RGB2DImageType::SizeType sz; > RGB2DImageType::IndexType idx; > sz[0]=128; sz[1]=128; > idx[0]=0; idx[1]=0; > > itk::ImageIORegion region(2); > region.SetSize(0,sz[0]); > region.SetSize(1,sz[1]); > region.SetIndex(0,idx[0]); > region.SetIndex(1,idx[1]); > tiffIO->SetIORegion(region); > > RGBReaderType::Pointer reader = RGBReaderType::New(); > reader->SetFileName("V:\\TiFF_Image.tiff"); > reader->SetImageIO(tiffIO); > reader->SetUseStreaming(1); > reader->Update(); > > Thanks in advance. > > Regards, > Vikram > > _____________________________________ > 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 majcjc at gmail.com Tue Mar 3 11:23:29 2015 From: majcjc at gmail.com (Lin M) Date: Tue, 3 Mar 2015 11:23:29 -0500 Subject: [ITK-users] find_package(ITK) and find_package(VTK) problems in CMake Message-ID: Hi guys, I met a strange problem when I try to use ITK and VTK in my projects. If I only use find_package( VTK required ) cmake will find all the right .h and .lib files and add them to the project, but if I use both find_package(ITK) and find_package(VTK), then some of the .h and .lib of VTK just disappeared in my VS projects. Does anyone have some suggestions for that? Thank you very much! My CMakeLists.txt is written as below: ... ... # QT FILES FIND_PACKAGE( Qt5Widgets ) FIND_PACKAGE( Qt5Xml ) FIND_PACKAGE( Qt5Core ) # ITK FILES FIND_PACKAGE( ITK REQUIRED ) INCLUDE( ${ITK_USE_FILE} ) # VTK FILES FIND_PACKAGE( VTK REQUIRED ) NCLUDE( ${VTK_USE_FILE} ) ... ... TARGET_LINK_LIBRARIES( ${PROJECT_NAME} ${Qt5Widgets_LIBRARIES} ${Qt5Xml_LIBRARIES} ${Qt5Core_LIBRARIES} ${VTK_LIBRARIES} ${ITK_LIBRARIES} ) Best, Lin -------------- next part -------------- An HTML attachment was scrubbed... URL: From jlg145 at pitt.edu Tue Mar 3 17:00:36 2015 From: jlg145 at pitt.edu (Grimm, Jonathan Louis) Date: Tue, 3 Mar 2015 22:00:36 +0000 Subject: [ITK-users] Position on Image Registration and Analysis Message-ID: <1425420037101.94853@pitt.edu> The Laboratory of Ocular Biomechanics at the University of Pittsburgh is seeking candidates for a position on image analysis and soft tissue biomechanics. Although our preference is for a post-doctoral fellow, strong candidates without a PhD will be considered.? More information provided in the link. http://ocularbiomechanics.org/pdfs/PostDocAd-ITK_WithImages_27Feb.pdf -------------- next part -------------- An HTML attachment was scrubbed... URL: From zeinsalah at gmail.com Wed Mar 4 05:25:52 2015 From: zeinsalah at gmail.com (Zein Salah) Date: Wed, 4 Mar 2015 11:25:52 +0100 Subject: [ITK-users] Filling the region inside a closed contour Message-ID: Hi, I want to fill the region surrounded by a closed contour in a 2d itk image. I have been doing this using a reverse flood-filling procedure. I am wondering is itk has a more efficient/robust mechanism for doing this. BTW, 2d-coordinates of the point on the contour are also stored in a vector if this helps. thanks, Zeno From blowekamp at mail.nih.gov Wed Mar 4 09:30:39 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Wed, 4 Mar 2015 09:30:39 -0500 Subject: [ITK-users] possible to get a closest-point map from a distance map in ITK? In-Reply-To: References: <22EC75E8215562428ACADFA35877A25A26187E3F@JANEWAY.ts.odu.edu> Message-ID: <564311ED-2E71-4B12-919B-C36B78084AF8@mail.nih.gov> Richard, You have some nice additional morphological filters in those repositories. I have been meaning to give them a try. Given that you have Insight Journal articles for them, have you considered making them more readily available to the community by adding and converting them into Remote modules for ITK? Brad On Mar 2, 2015, at 3:37 PM, Richard Beare wrote: > I've written a set of label erosion and dilation filters that might do what you're after. I've also got some spatially varying morphology filters, but have't put them on the insight journal. The label erode dilate filters aren't outputing the distance map, so they aren't exactly what you want, but they use the same kind of computation internally. Thus you could use them in conjunction with the parabolic distance transforms to get labels and distances. > > https://github.com/richardbeare/LabelErodeDilate.git > https://github.com/richardbeare/parabolicMorphology.git > > The insight journal article. > > http://hdl.handle.net/10380/3399 > > > I can provide more details about the spatially variant stuff if it is of interest. Note that it only works with binary images, and simply weights the input image. > > On Tue, Mar 3, 2015 at 6:45 AM, Audette, Michel A. wrote: > Dear ITK users, > > > a student of mine would like to use the ITK implementation of distance maps in a way where the point label of the closest initial boundary is propagated throughout, i.e. a closest boundary point map. Is there something like this implemented already in ITK? I would like to use something like this to produce a spatially varying distance threshold. > > > Thanks for your kind support. > > > Michel > > > Michel Audette, Ph.D. > Assistant Professor, > Department of Modeling, Simulation and Visualization Engineering, > Old Dominion University, > Norfolk, VA. > > _____________________________________ > 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 blowekamp at mail.nih.gov Wed Mar 4 09:28:44 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Wed, 4 Mar 2015 09:28:44 -0500 Subject: [ITK-users] Filling the region inside a closed contour In-Reply-To: References: Message-ID: Hello, The turn-key solution would the to use the BinaryFillholeImageFilter[1]. There may be a solution which uses connected components and the LabelMap framework to determine the regions separated by the contour. Then there are a variety of conditional flood fill conditional iterators that could be used [2]. Lastly if I could make the assumption that the contour didn't touch the boarder, I'd write a threaded filter which uses a scan-line iterator which would alternate between an inside and outside state based on encountering the input contour and wrote the output image accordingly. You have options. The "best" or most "efficient" or most "robust" method can only be determine with experimentation and quantification for your problem. Brad [1] http://www.itk.org/Doxygen/html/classitk_1_1BinaryFillholeImageFilter.html [2] http://www.itk.org/Doxygen/html/classitk_1_1ShapedFloodFilledFunctionConditionalConstIterator.html On Mar 4, 2015, at 5:25 AM, Zein Salah wrote: > Hi, > > I want to fill the region surrounded by a closed contour in a 2d > itk image. I have been doing this using a reverse flood-filling procedure. > I am wondering is itk has a more efficient/robust mechanism for > doing this. > > BTW, 2d-coordinates of the point on the contour are also stored in a > vector if this helps. > > thanks, > Zeno > _____________________________________ > 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 lchauvin at bwh.harvard.edu Wed Mar 4 14:11:15 2015 From: lchauvin at bwh.harvard.edu (Laurent Chauvin) Date: Wed, 4 Mar 2015 14:11:15 -0500 Subject: [ITK-users] 1 DOF Optimizer Message-ID: Hello, I'm trying to develop a registration algorithm, and in order to do that, I need an optimizer but I couldn't find this kind in ITK. I need to specificy a plane, and rotate this plane around one given axis, on 360 degrees (with a step of 1 degree for example), and calculate some energy function for each step and find the minimum. 360 degrees avoid to find local minima only. Do you know if such optimizer already exists ? Thank you very much. -Laurent -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Wed Mar 4 14:21:12 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Wed, 4 Mar 2015 14:21:12 -0500 Subject: [ITK-users] 1 DOF Optimizer In-Reply-To: References: Message-ID: <210B4188-70F4-4E95-97D1-527CC3162EC8@mail.nih.gov> Hello Laurent, You can configure the ExhaustiveOptimizer to do that [1], [2]. Brad [1] http://www.itk.org/Doxygen46/html/classitk_1_1ExhaustiveOptimizer.html [2] http://www.itk.org/Doxygen46/html/classitk_1_1ExhaustiveOptimizerv4.html On Mar 4, 2015, at 2:11 PM, Laurent Chauvin wrote: > Hello, > > I'm trying to develop a registration algorithm, and in order to do that, I need an optimizer but I couldn't find this kind in ITK. > I need to specificy a plane, and rotate this plane around one given axis, on 360 degrees (with a step of 1 degree for example), and calculate some energy function for each step and find the minimum. > 360 degrees avoid to find local minima only. > > Do you know if such optimizer already exists ? > > Thank you very much. > -Laurent > _____________________________________ > 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 lchauvin at bwh.harvard.edu Wed Mar 4 14:24:45 2015 From: lchauvin at bwh.harvard.edu (Laurent Chauvin) Date: Wed, 4 Mar 2015 14:24:45 -0500 Subject: [ITK-users] 1 DOF Optimizer In-Reply-To: <210B4188-70F4-4E95-97D1-527CC3162EC8@mail.nih.gov> References: <210B4188-70F4-4E95-97D1-527CC3162EC8@mail.nih.gov> Message-ID: Thank you Bradley, I will have a look at it. -Laurent On Wed, Mar 4, 2015 at 2:21 PM, Bradley Lowekamp wrote: > Hello Laurent, > > You can configure the ExhaustiveOptimizer to do that [1], [2]. > > Brad > > [1] http://www.itk.org/Doxygen46/html/classitk_1_1ExhaustiveOptimizer.html > [2] > http://www.itk.org/Doxygen46/html/classitk_1_1ExhaustiveOptimizerv4.html > > On Mar 4, 2015, at 2:11 PM, Laurent Chauvin > wrote: > > > Hello, > > > > I'm trying to develop a registration algorithm, and in order to do that, > I need an optimizer but I couldn't find this kind in ITK. > > I need to specificy a plane, and rotate this plane around one given > axis, on 360 degrees (with a step of 1 degree for example), and calculate > some energy function for each step and find the minimum. > > 360 degrees avoid to find local minima only. > > > > Do you know if such optimizer already exists ? > > > > Thank you very much. > > -Laurent > > _____________________________________ > > 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 > > > > The information in this e-mail is intended only for the person to whom it > is > addressed. If you believe this e-mail was sent to you in error and the > e-mail > contains patient information, please contact the Partners Compliance > HelpLine at > http://www.partners.org/complianceline . If the e-mail was sent to you in > error > but does not contain patient information, please contact the sender and > properly > dispose of the e-mail. > > -- Laurent Chauvin, MS Surgical Navigation and Robotics Laboratory, Radiology Department Brigham And Women's Hospital, Harvard Medical School http://wiki.ncigt.org/index.php/User:Lchauvin -------------- next part -------------- An HTML attachment was scrubbed... URL: From tejasm at gmail.com Wed Mar 4 14:40:33 2015 From: tejasm at gmail.com (tejas9090) Date: Wed, 4 Mar 2015 12:40:33 -0700 (MST) Subject: [ITK-users] ITK Ver 4.5 memory leak in HDF5 library Message-ID: <1425498033934-7586961.post@n2.nabble.com> Hi, Apologies if this topic has been posted before but I could not find an answer for this. I am using Visual Leak Detector with my VC++/VS2012 code which uses ITK 4.5. The output shows some memory leaks at program exit in the HDF5 library. Sample memory leak output from VLD shown below. Does anyone know if this is a genuine leak and if there is way to fix this? Thank you in advance, TJ Visual Visual Leak Detector Version 2.4RC2 installed. Outputting the report to the debugger and to C:\MyProject\Algorithm\AlgorithmBuild\Driver\memory_leak_report.txt WARNING: Visual Leak Detector detected memory leaks! ---------- Block 1035319 at 0x0069C2C0: 8 bytes ---------- Leak Hash: 0x83CD32EA, Count: 1, Total 8 bytes Call Stack (TID 296): f:\dd\vctools\crt_bld\self_x86\crt\src\dbgmalloc.c (55): MSVCR110D.dll!malloc C:\MyProject\tp\itk4_5\modules\thirdparty\hdf5\src\itkhdf5\src\h5fl.c (241): (Module name unavailable)!H5FL_reg_init + 0xA bytes C:\MyProject\tp\itk4_5\modules\thirdparty\hdf5\src\itkhdf5\src\h5fl.c (382): (Module name unavailable)!H5FL_reg_malloc + 0x9 bytes C:\MyProject\tp\itk4_5\modules\thirdparty\hdf5\src\itkhdf5\src\h5fl.c (458): (Module name unavailable)!H5FL_reg_calloc + 0x9 bytes C:\MyProject\tp\itk4_5\modules\thirdparty\hdf5\src\itkhdf5\src\h5e.c (464): (Module name unavailable)!H5E_register_class + 0xA bytes C:\MyProject\tp\itk4_5\modules\thirdparty\hdf5\src\itkhdf5\src\h5e.c (238): (Module name unavailable)!H5E_init_interface + 0x16 bytes C:\MyProject\tp\itk4_5\modules\thirdparty\hdf5\src\itkhdf5\src\h5e.c (147): (Module name unavailable)!H5E_init + 0x1F bytes C:\MyProject\tp\itk4_5\modules\thirdparty\hdf5\src\itkhdf5\src\h5.c (170): (Module name unavailable)!H5_init_library + 0x5 bytes C:\MyProject\tp\itk4_5\modules\thirdparty\hdf5\src\itkhdf5\src\h5i.c (1131): (Module name unavailable)!H5Iget_type + 0x1F bytes C:\MyProject\tp\itk4_5\modules\thirdparty\hdf5\src\itkhdf5\c++\src\h5idcomponent.cpp (317): (Module name unavailable)!H5::IdComponent::p_valid_id + 0x9 bytes C:\MyProject\tp\itk4_5\modules\thirdparty\hdf5\src\itkhdf5\c++\src\h5dataspace.cpp (608): (Module name unavailable)!H5::DataSpace::close + 0xC bytes C:\MyProject\tp\itk4_5\modules\thirdparty\hdf5\src\itkhdf5\c++\src\h5dataspace.cpp (633): (Module name unavailable)!H5::DataSpace::~DataSpace + 0x8 bytes 0x108DE98D (File and line number not available): (Module name unavailable)!`dynamic atexit destructor for 'H5::DataSpace::ALL'' + 0xD bytes f:\dd\vctools\crt_bld\self_x86\crt\src\crtdll.c (416): (Module name unavailable)!_CRT_INIT f:\dd\vctools\crt_bld\self_x86\crt\src\crtdll.c (522): (Module name unavailable)!__DllMainCRTStartup + 0x11 bytes f:\dd\vctools\crt_bld\self_x86\crt\src\crtdll.c (472): (Module name unavailable)!_DllMainCRTStartup + 0x11 bytes 0x772999A0 (File and line number not available): ntdll.dll!RtlQueryEnvironmentVariable + 0x241 bytes 0x772BAD1E (File and line number not available): ntdll.dll!LdrRemoveLoadAsDataTable + 0x5D5 bytes 0x772A12D1 (File and line number not available): ntdll.dll!LdrUnloadDll + 0x4A bytes 0x76CF2D2C (File and line number not available): KERNELBASE.dll!FreeLibrary + 0x15 bytes C:\MyProject\Algorithm\driver\loadccmdll_w.cpp (112): Driver.exe!ATMAlgo_W::FreeDll + 0x12 bytes C:\MyProject\Algorithm\driver\loadruncc_w.cpp (28): Driver.exe!Clean C:\MyProject\Algorithm\driver\main.cpp (207): Driver.exe!main f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (536): Driver.exe!__tmainCRTStartup + 0x19 bytes f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (377): Driver.exe!mainCRTStartup 0x764A338A (File and line number not available): kernel32.dll!BaseThreadInitThunk + 0x12 bytes 0x77299F72 (File and line number not available): ntdll.dll!RtlInitializeExceptionChain + 0x63 bytes 0x77299F45 (File and line number not available): ntdll.dll!RtlInitializeExceptionChain + 0x36 bytes Data: C0 CA BF 10 00 00 00 00 -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-Ver-4-5-memory-leak-in-HDF5-library-tp7586961.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From blowekamp at mail.nih.gov Wed Mar 4 14:53:18 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Wed, 4 Mar 2015 14:53:18 -0500 Subject: [ITK-users] ITK Ver 4.5 memory leak in HDF5 library In-Reply-To: <1425498033934-7586961.post@n2.nabble.com> References: <1425498033934-7586961.post@n2.nabble.com> Message-ID: Hello, Thanks for reporting this! We don't have any HDF5 suppressions for the valgrind memory defect checking we run each night. Is there a minimal program which exhibits this behavior on Windows? Brad On Mar 4, 2015, at 2:40 PM, tejas9090 wrote: > Hi, > > Apologies if this topic has been posted before but I could not find an > answer for this. > > I am using Visual Leak Detector with my VC++/VS2012 code which uses ITK 4.5. > The output shows some memory leaks at program exit in the HDF5 library. > Sample memory leak output from VLD shown below. > > Does anyone know if this is a genuine leak and if there is way to fix this? > > Thank you in advance, > TJ > > > Visual Visual Leak Detector Version 2.4RC2 installed. > Outputting the report to the debugger and to > C:\MyProject\Algorithm\AlgorithmBuild\Driver\memory_leak_report.txt > WARNING: Visual Leak Detector detected memory leaks! > ---------- Block 1035319 at 0x0069C2C0: 8 bytes ---------- > Leak Hash: 0x83CD32EA, Count: 1, Total 8 bytes > Call Stack (TID 296): > f:\dd\vctools\crt_bld\self_x86\crt\src\dbgmalloc.c (55): > MSVCR110D.dll!malloc > C:\MyProject\tp\itk4_5\modules\thirdparty\hdf5\src\itkhdf5\src\h5fl.c > (241): (Module name unavailable)!H5FL_reg_init + 0xA bytes > C:\MyProject\tp\itk4_5\modules\thirdparty\hdf5\src\itkhdf5\src\h5fl.c > (382): (Module name unavailable)!H5FL_reg_malloc + 0x9 bytes > C:\MyProject\tp\itk4_5\modules\thirdparty\hdf5\src\itkhdf5\src\h5fl.c > (458): (Module name unavailable)!H5FL_reg_calloc + 0x9 bytes > C:\MyProject\tp\itk4_5\modules\thirdparty\hdf5\src\itkhdf5\src\h5e.c > (464): (Module name unavailable)!H5E_register_class + 0xA bytes > C:\MyProject\tp\itk4_5\modules\thirdparty\hdf5\src\itkhdf5\src\h5e.c > (238): (Module name unavailable)!H5E_init_interface + 0x16 bytes > C:\MyProject\tp\itk4_5\modules\thirdparty\hdf5\src\itkhdf5\src\h5e.c > (147): (Module name unavailable)!H5E_init + 0x1F bytes > C:\MyProject\tp\itk4_5\modules\thirdparty\hdf5\src\itkhdf5\src\h5.c > (170): (Module name unavailable)!H5_init_library + 0x5 bytes > C:\MyProject\tp\itk4_5\modules\thirdparty\hdf5\src\itkhdf5\src\h5i.c > (1131): (Module name unavailable)!H5Iget_type + 0x1F bytes > > C:\MyProject\tp\itk4_5\modules\thirdparty\hdf5\src\itkhdf5\c++\src\h5idcomponent.cpp > (317): (Module name unavailable)!H5::IdComponent::p_valid_id + 0x9 bytes > > C:\MyProject\tp\itk4_5\modules\thirdparty\hdf5\src\itkhdf5\c++\src\h5dataspace.cpp > (608): (Module name unavailable)!H5::DataSpace::close + 0xC bytes > > C:\MyProject\tp\itk4_5\modules\thirdparty\hdf5\src\itkhdf5\c++\src\h5dataspace.cpp > (633): (Module name unavailable)!H5::DataSpace::~DataSpace + 0x8 bytes > 0x108DE98D (File and line number not available): (Module name > unavailable)!`dynamic atexit destructor for 'H5::DataSpace::ALL'' + 0xD > bytes > f:\dd\vctools\crt_bld\self_x86\crt\src\crtdll.c (416): (Module name > unavailable)!_CRT_INIT > f:\dd\vctools\crt_bld\self_x86\crt\src\crtdll.c (522): (Module name > unavailable)!__DllMainCRTStartup + 0x11 bytes > f:\dd\vctools\crt_bld\self_x86\crt\src\crtdll.c (472): (Module name > unavailable)!_DllMainCRTStartup + 0x11 bytes > 0x772999A0 (File and line number not available): > ntdll.dll!RtlQueryEnvironmentVariable + 0x241 bytes > 0x772BAD1E (File and line number not available): > ntdll.dll!LdrRemoveLoadAsDataTable + 0x5D5 bytes > 0x772A12D1 (File and line number not available): ntdll.dll!LdrUnloadDll > + 0x4A bytes > 0x76CF2D2C (File and line number not available): > KERNELBASE.dll!FreeLibrary + 0x15 bytes > C:\MyProject\Algorithm\driver\loadccmdll_w.cpp (112): > Driver.exe!ATMAlgo_W::FreeDll + 0x12 bytes > C:\MyProject\Algorithm\driver\loadruncc_w.cpp (28): Driver.exe!Clean > C:\MyProject\Algorithm\driver\main.cpp (207): Driver.exe!main > f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (536): > Driver.exe!__tmainCRTStartup + 0x19 bytes > f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (377): > Driver.exe!mainCRTStartup > 0x764A338A (File and line number not available): > kernel32.dll!BaseThreadInitThunk + 0x12 bytes > 0x77299F72 (File and line number not available): > ntdll.dll!RtlInitializeExceptionChain + 0x63 bytes > 0x77299F45 (File and line number not available): > ntdll.dll!RtlInitializeExceptionChain + 0x36 bytes > Data: > C0 CA BF 10 00 00 00 00 > > > > > -- > View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-Ver-4-5-memory-leak-in-HDF5-library-tp7586961.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 tejasm at gmail.com Wed Mar 4 15:01:55 2015 From: tejasm at gmail.com (tejas9090) Date: Wed, 4 Mar 2015 13:01:55 -0700 (MST) Subject: [ITK-users] ITK Ver 4.5 memory leak in HDF5 library In-Reply-To: References: <1425498033934-7586961.post@n2.nabble.com> Message-ID: <1425499315444-7586963.post@n2.nabble.com> Hello Brad, Thank you for the quick response. Unfortunately I don't have a minimal program to reproduce this leak. To be honest I am new to ITK and am using some inherited code (which tends to be quite large). When I ran this program through Visual Leak Detector, I came across a whole bunch of these leaks in the same part of the ITK code. Was hoping somebody else would have come across the same and possibly new why this might be happening. Thank you, TJ -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-Ver-4-5-memory-leak-in-HDF5-library-tp7586961p7586963.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From matt.mccormick at kitware.com Wed Mar 4 15:07:20 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Wed, 4 Mar 2015 15:07:20 -0500 Subject: [ITK-users] [ITK] ITK Ver 4.5 memory leak in HDF5 library In-Reply-To: <1425499315444-7586963.post@n2.nabble.com> References: <1425498033934-7586961.post@n2.nabble.com> <1425499315444-7586963.post@n2.nabble.com> Message-ID: Hi TJ, I have experienced some reported memory leaks and memory errors from the valgrind tool using ITK's HDF5 library. However, this was with some custom code outside of the ITK image IO context. As far as I could tell, though, they were false positives. HTH, Matt On Wed, Mar 4, 2015 at 3:01 PM, tejas9090 wrote: > Hello Brad, > > Thank you for the quick response. Unfortunately I don't have a minimal > program to reproduce this leak. > To be honest I am new to ITK and am using some inherited code (which tends > to be quite large). When I ran this program through Visual Leak Detector, I > came across a whole bunch of these leaks in the same part of the ITK code. > Was hoping somebody else would have come across the same and possibly new > why this might be happening. > > Thank you, > TJ > > > > > > -- > View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-Ver-4-5-memory-leak-in-HDF5-library-tp7586961p7586963.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 tejasm at gmail.com Wed Mar 4 16:02:48 2015 From: tejasm at gmail.com (tejas9090) Date: Wed, 4 Mar 2015 14:02:48 -0700 (MST) Subject: [ITK-users] [ITK] ITK Ver 4.5 memory leak in HDF5 library In-Reply-To: References: <1425498033934-7586961.post@n2.nabble.com> <1425499315444-7586963.post@n2.nabble.com> Message-ID: <1425502968082-7586965.post@n2.nabble.com> Matt, thanks! -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-Ver-4-5-memory-leak-in-HDF5-library-tp7586961p7586965.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From matt.mccormick at kitware.com Wed Mar 4 22:44:28 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Wed, 4 Mar 2015 22:44:28 -0500 Subject: [ITK-users] Opportunities to share, discuss, design, and learn with other ITK community members Message-ID: There are a couple of upcoming opportunities to share, discuss, design, and learn with your fellow ITK community members. On Thursday (tomorrow), 1:00 PM Eastern USA time, there will be a Google+ Hangout where we will be doing code reviews: https://plus.google.com/events/covpn37cs306pbu11gl42gdlo5c On Friday, 11:00 AM Eastern USA time, an ITK development conference, https://plus.google.com/events/cnbf68nke70rp5ttt6plcp232n0 For those that cannot join via Hangout, telephone call-in is also possible. Dial: 585-632-6296 Enter pin: 31423 To get regular invites to these events, join the ITK Bar Camp G+ Community: https://plus.google.com/u/0/communities/111375098792764998322 All are welcome. Hope to talk to you then! From matt.mccormick at kitware.com Wed Mar 4 23:31:10 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Wed, 4 Mar 2015 23:31:10 -0500 Subject: [ITK-users] find_package(ITK) and find_package(VTK) problems in CMake In-Reply-To: References: Message-ID: Hi Lin, Please try using VTK 6.2rc1 or newer. Thanks, Matt On Tue, Mar 3, 2015 at 11:23 AM, Lin M wrote: > Hi guys, > > I met a strange problem when I try to use ITK and VTK in my projects. If I > only use find_package( VTK required ) cmake will find all the right .h and > .lib files and add them to the project, but if I use both find_package(ITK) > and find_package(VTK), then some of the .h and .lib of VTK just disappeared > in my VS projects. Does anyone have some suggestions for that? Thank you > very much! > > My CMakeLists.txt is written as below: > > ... > ... > # QT FILES > FIND_PACKAGE( Qt5Widgets ) > FIND_PACKAGE( Qt5Xml ) > FIND_PACKAGE( Qt5Core ) > > # ITK FILES > FIND_PACKAGE( ITK REQUIRED ) > INCLUDE( ${ITK_USE_FILE} ) > > # VTK FILES > FIND_PACKAGE( VTK REQUIRED ) > NCLUDE( ${VTK_USE_FILE} ) > > ... > ... > TARGET_LINK_LIBRARIES( ${PROJECT_NAME} > ${Qt5Widgets_LIBRARIES} > ${Qt5Xml_LIBRARIES} > ${Qt5Core_LIBRARIES} > ${VTK_LIBRARIES} > ${ITK_LIBRARIES} > ) > > > Best, > Lin > > _____________________________________ > 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 lassi.paavolainen at jyu.fi Mon Mar 9 06:11:55 2015 From: lassi.paavolainen at jyu.fi (Paavolainen, Lassi) Date: Mon, 9 Mar 2015 10:11:55 +0000 Subject: [ITK-users] Memory leak in Python wrapped Image GetPixel method? Message-ID: Hi, I noticed that GetPixel method in itk.Image object eats memory in Python wrapped code. I think I've seen some Python wrapping memory issues years ago but nothing as simple as this. Here is a simple test script: import sys import itk reader = itk.ImageFileReader.IUC2.New() reader.SetFileName(sys.argv[1]) reader.Update() img = reader.GetOutput() size = img.GetLargestPossibleRegion().GetSize() for i in range(100): for x in range(size[0]): for y in range(size[1]): value = img.GetPixel((x,y)) print "Done with iteration %d"%(i+1) When I run it with 1 MB image, it end up taking 1.5 GB of memory. After spending lots of time on debugging a bigger bunch of code I realized that the GetPixel method was to blame. Can anyone reproduce it? I'm using ITK 4.6.1 Cheers, Lassi From matt.mccormick at kitware.com Mon Mar 9 14:22:24 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 9 Mar 2015 14:22:24 -0400 Subject: [ITK-users] Memory leak in Python wrapped Image GetPixel method? In-Reply-To: References: Message-ID: Hi Lassi, Thanks for investigating and reporting the issue! I have created an issue in the Issue Tracker to keep track of it: https://issues.itk.org/jira/browse/ITK-3352 Matt On Mon, Mar 9, 2015 at 6:11 AM, Paavolainen, Lassi wrote: > Hi, > > I noticed that GetPixel method in itk.Image object eats memory in Python wrapped code. I think I've seen some Python wrapping memory issues years ago but nothing as simple as this. Here is a simple test script: > import sys > import itk > reader = itk.ImageFileReader.IUC2.New() > reader.SetFileName(sys.argv[1]) > reader.Update() > img = reader.GetOutput() > size = img.GetLargestPossibleRegion().GetSize() > for i in range(100): > for x in range(size[0]): > for y in range(size[1]): > value = img.GetPixel((x,y)) > print "Done with iteration %d"%(i+1) > > When I run it with 1 MB image, it end up taking 1.5 GB of memory. After spending lots of time on debugging a bigger bunch of code I realized that the GetPixel method was to blame. Can anyone reproduce it? I'm using ITK 4.6.1 > > Cheers, > Lassi > _____________________________________ > 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 lassi.paavolainen at jyu.fi Mon Mar 9 15:59:26 2015 From: lassi.paavolainen at jyu.fi (Paavolainen, Lassi) Date: Mon, 9 Mar 2015 19:59:26 +0000 Subject: [ITK-users] Memory leak in Python wrapped Image GetPixel method? In-Reply-To: References: , Message-ID: Hi Matt, Seems its an issue with local environment. Here is also for the list what I replied to Gaetan: "This is interesting. I'm using ITK 4.6.1 with swig that comes with it. I now tested with 3.20 that has been built long time ago with swig 1.9 (if I remember correctly). The same thing. So the conclusion is that it must be something local as I'm sure I've done something similar over the years many times. Next is to try to find out what on my environment causes this." To add to that, I ran 30 iterations using valgrind. Here is the report: ==8603== HEAP SUMMARY: ==8603== in use at exit: 478,066,856 bytes in 483,719 blocks ==8603== total heap usage: 657,312 allocs, 173,593 frees, 787,087,705 bytes allocated ==8603== ==8603== LEAK SUMMARY: ==8603== definitely lost: 0 bytes in 0 blocks ==8603== indirectly lost: 0 bytes in 0 blocks ==8603== possibly lost: 20,224 bytes in 34 blocks ==8603== still reachable: 478,046,632 bytes in 483,685 blocks ==8603== suppressed: 0 bytes in 0 blocks So almost 500 MB is in heap but still reachable when the program exits. Lassi ________________________________________ From: Matt McCormick [matt.mccormick at kitware.com] Sent: Monday, March 09, 2015 20:22 To: Paavolainen, Lassi Cc: insight-users at itk.org; Ga?tan Lehmann; Michka Popoff Subject: Re: [ITK-users] Memory leak in Python wrapped Image GetPixel method? Hi Lassi, Thanks for investigating and reporting the issue! I have created an issue in the Issue Tracker to keep track of it: https://issues.itk.org/jira/browse/ITK-3352 Matt On Mon, Mar 9, 2015 at 6:11 AM, Paavolainen, Lassi wrote: > Hi, > > I noticed that GetPixel method in itk.Image object eats memory in Python wrapped code. I think I've seen some Python wrapping memory issues years ago but nothing as simple as this. Here is a simple test script: > import sys > import itk > reader = itk.ImageFileReader.IUC2.New() > reader.SetFileName(sys.argv[1]) > reader.Update() > img = reader.GetOutput() > size = img.GetLargestPossibleRegion().GetSize() > for i in range(100): > for x in range(size[0]): > for y in range(size[1]): > value = img.GetPixel((x,y)) > print "Done with iteration %d"%(i+1) > > When I run it with 1 MB image, it end up taking 1.5 GB of memory. After spending lots of time on debugging a bigger bunch of code I realized that the GetPixel method was to blame. Can anyone reproduce it? I'm using ITK 4.6.1 > > Cheers, > Lassi > _____________________________________ > 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 gabrielgimenez85 at gmail.com Mon Mar 9 19:40:48 2015 From: gabrielgimenez85 at gmail.com (=?UTF-8?Q?Gabriel_A=2E_Gim=C3=A9nez?=) Date: Mon, 9 Mar 2015 16:40:48 -0700 (MST) Subject: [ITK-users] Mattes Mutual Information Speed with 3D Images Message-ID: <1425944448336-7586972.post@n2.nabble.com> Hello everyone... I'm working on a genetic optimizer for Rigid 3D Registration. The fitness of each individual is calculated using Mattes Mutual Information, the execution time of the metric is high ... (30 seconds on average). This makes the registration too slow. Any recommendations? could improve the performance metrics?other most appropriate metric? Regards! -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Mattes-Mutual-Information-Speed-with-3D-Images-tp7586972.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From gabrielgimenez85 at gmail.com Mon Mar 9 19:02:21 2015 From: gabrielgimenez85 at gmail.com (=?UTF-8?Q?Gabriel_A=2E_Gim=C3=A9nez?=) Date: Mon, 9 Mar 2015 16:02:21 -0700 (MST) Subject: [ITK-users] Mattes Mutual Information Speed with 3D Images Message-ID: <1425942141529-7586971.post@n2.nabble.com> Hello everyone... I'm working on a genetic optimizer for Rigid 3D Registration. The fitness of each individual is calculated using Mattes Mutual Information, the execution time of the metric is high ... (30 seconds on average). This makes the registration too slow. Any recommendations? could improve the performance metrics? otherwise most appropriate metric? Regards! -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Mattes-Mutual-Information-Speed-with-3D-Images-tp7586971.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From arnaudgelas at gmail.com Tue Mar 10 05:30:01 2015 From: arnaudgelas at gmail.com (Arnaud Gelas) Date: Tue, 10 Mar 2015 10:30:01 +0100 Subject: [ITK-users] apply color map to a label map with overlapping label objects? Message-ID: Hi all, I would like to colorize one label map with overlapping label objects. I know there is itk::LabelMapOverlayImageFilter but would it work on such a case? (could be wrong, but based on the code it does not seem so) Thanks Arnaud From blowekamp at mail.nih.gov Tue Mar 10 08:59:24 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Tue, 10 Mar 2015 08:59:24 -0400 Subject: [ITK-users] [ITK] Mattes Mutual Information Speed with 3D Images In-Reply-To: <1425942141529-7586971.post@n2.nabble.com> References: <1425942141529-7586971.post@n2.nabble.com> Message-ID: <6DB0A858-9B7D-4A6A-832A-2E86661C7611@mail.nih.gov> Hello, Unfortunately, I can help much because of lack of information. I can tell you I just wrote SimpleITK registration code which uses Mattes Mutual Information, Versor Rigid Transform, with a Regular Step Gradient Descent optimizer . The sampling percentage for the metric is 0.2, and the volumes are about 60^3 each. This is able to do the registration in about 8 iterations in 0.3 seconds. Brad On Mar 9, 2015, at 7:02 PM, Gabriel A. Gim?nez wrote: > Hello everyone... > > I'm working on a genetic optimizer for Rigid 3D Registration. > > The fitness of each individual is calculated using Mattes Mutual > Information, the execution time of the metric is high ... (30 seconds on > average). This makes the registration too slow. > > Any recommendations? could improve the performance metrics? otherwise most > appropriate metric? > > Regards! > > > > -- > View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Mattes-Mutual-Information-Speed-with-3D-Images-tp7586971.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 gabrielgimenez85 at gmail.com Tue Mar 10 09:03:41 2015 From: gabrielgimenez85 at gmail.com (=?UTF-8?Q?Gabriel_A=2E_Gim=C3=A9nez?=) Date: Tue, 10 Mar 2015 10:03:41 -0300 Subject: [ITK-users] [ITK] Mattes Mutual Information Speed with 3D Images In-Reply-To: <6DB0A858-9B7D-4A6A-832A-2E86661C7611@mail.nih.gov> References: <1425942141529-7586971.post@n2.nabble.com> <6DB0A858-9B7D-4A6A-832A-2E86661C7611@mail.nih.gov> Message-ID: Hi! thanks for your answer... I use images of RIRE BD (http://www.insight-journal.org/rire/), my initial tests I make with package training_001 (CT - MR_PD). Following recommendation here is my configuration: metric->SetNumberOfHistogramBins( 50 ); double samplingPercentage = 0.002; registration->SetMetricSamplingPercentage( samplingPercentage ); RegistrationType::MetricSamplingStrategyType samplingStrategy = RegistrationType::REGULAR; Unfortunately, the results were not good ... the average execution time remains the same (25 ~ 30 seconds). With a population size equal to 50, the execution time of an iteration is in the order of 25 minutes, very slow for me ... These are the image data: Fixed Image: ObjectType = Image NDims = 3 BinaryDataByteOrderMSB = True AnatomicalOrientation = LPH ElementSpacing = 0.653595 0.653595 4.000000 *DimSize = 512 512 29* ElementType = MET_SHORT ElementDataFile = image.bin Moving Image: ObjectType = Image NDims = 3 BinaryDataByteOrderMSB = True AnatomicalOrientation = LPH ElementSpacing = 1.250000 1.250000 4.000000 *DimSize = 256 256 26* ElementType = MET_SHORT ElementDataFile = image.bin Thanks and regards! 2015-03-10 9:59 GMT-03:00 Bradley Lowekamp : > Hello, > > Unfortunately, I can help much because of lack of information. > > I can tell you I just wrote SimpleITK registration code which uses Mattes > Mutual Information, Versor Rigid Transform, with a Regular Step Gradient > Descent optimizer . The sampling percentage for the metric is 0.2, and the > volumes are about 60^3 each. This is able to do the registration in about 8 > iterations in 0.3 seconds. > > Brad > > On Mar 9, 2015, at 7:02 PM, Gabriel A. Gim?nez > wrote: > > > Hello everyone... > > > > I'm working on a genetic optimizer for Rigid 3D Registration. > > > > The fitness of each individual is calculated using Mattes Mutual > > Information, the execution time of the metric is high ... (30 seconds on > > average). This makes the registration too slow. > > > > Any recommendations? could improve the performance metrics? otherwise > most > > appropriate metric? > > > > Regards! > > > > > > > > -- > > View this message in context: > http://itk-insight-users.2283740.n2.nabble.com/Mattes-Mutual-Information-Speed-with-3D-Images-tp7586971.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 > > -- *Gabriel Alberto Gim?nez.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Tue Mar 10 09:09:54 2015 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 10 Mar 2015 09:09:54 -0400 Subject: [ITK-users] [ITK] Mattes Mutual Information Speed with 3D Images In-Reply-To: References: <1425942141529-7586971.post@n2.nabble.com> <6DB0A858-9B7D-4A6A-832A-2E86661C7611@mail.nih.gov> Message-ID: Are ITK and your app built Release? On Tue, Mar 10, 2015 at 9:03 AM, Gabriel A. Gim?nez wrote: > Hi! thanks for your answer... > > I use images of RIRE BD (http://www.insight-journal.org/rire/), my initial > tests I make with package training_001 (CT - MR_PD). Following > recommendation here is my configuration: > > > metric->SetNumberOfHistogramBins( 50 ); > double samplingPercentage = 0.002; > registration->SetMetricSamplingPercentage( samplingPercentage ); > RegistrationType::MetricSamplingStrategyType samplingStrategy = > > RegistrationType::REGULAR; > > Unfortunately, the results were not good ... the average execution time > remains the same (25 ~ 30 seconds). With a population size equal to 50, the > execution time of an iteration is in the order of 25 minutes, very slow for > me ... > > These are the image data: > > Fixed Image: > > ObjectType = Image > > NDims = 3 > > BinaryDataByteOrderMSB = True > > AnatomicalOrientation = LPH > > ElementSpacing = 0.653595 0.653595 4.000000 > > DimSize = 512 512 29 > > ElementType = MET_SHORT > > ElementDataFile = image.bin > > > Moving Image: > > ObjectType = Image > > NDims = 3 > > BinaryDataByteOrderMSB = True > > AnatomicalOrientation = LPH > > ElementSpacing = 1.250000 1.250000 4.000000 > > DimSize = 256 256 26 > > ElementType = MET_SHORT > > ElementDataFile = image.bin > > > > Thanks and regards! > > > 2015-03-10 9:59 GMT-03:00 Bradley Lowekamp : > >> Hello, >> >> Unfortunately, I can help much because of lack of information. >> >> I can tell you I just wrote SimpleITK registration code which uses Mattes >> Mutual Information, Versor Rigid Transform, with a Regular Step Gradient >> Descent optimizer . The sampling percentage for the metric is 0.2, and the >> volumes are about 60^3 each. This is able to do the registration in about 8 >> iterations in 0.3 seconds. >> >> Brad >> >> On Mar 9, 2015, at 7:02 PM, Gabriel A. Gim?nez >> wrote: >> >> > Hello everyone... >> > >> > I'm working on a genetic optimizer for Rigid 3D Registration. >> > >> > The fitness of each individual is calculated using Mattes Mutual >> > Information, the execution time of the metric is high ... (30 seconds on >> > average). This makes the registration too slow. >> > >> > Any recommendations? could improve the performance metrics? otherwise >> > most >> > appropriate metric? >> > >> > Regards! >> > >> > >> > >> > -- >> > View this message in context: >> > http://itk-insight-users.2283740.n2.nabble.com/Mattes-Mutual-Information-Speed-with-3D-Images-tp7586971.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 >> > > > > -- > Gabriel Alberto Gim?nez. > > _____________________________________ > 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 chiara.magliaro at googlemail.com Tue Mar 10 09:26:53 2015 From: chiara.magliaro at googlemail.com (Chiara Magliaro) Date: Tue, 10 Mar 2015 14:26:53 +0100 Subject: [ITK-users] read an image stack .tif Message-ID: Hi all, i'd like to read a tiff file, stocking an image stack and see the different images composing the stack. Is there any irk class to do this? Thanks in advance Best regards Chiara -- Chiara Magliaro PhD Student Research Center "E. Piaggio" - University of Pisa Largo Lucio Lazzarino 1, 56122 Pisa, Italy Tel. 0039 0502217061 - Fax. 0039 0502217051 -------------- next part -------------- An HTML attachment was scrubbed... URL: From grothausmann.roman at mh-hannover.de Tue Mar 10 10:14:58 2015 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Tue, 10 Mar 2015 15:14:58 +0100 Subject: [ITK-users] Help needed to implement 64-bit "label" image in ITK-Snap for global watershed segmentation mode In-Reply-To: <547C5A89.9090905@mh-hannover.de> References: <547C5A89.9090905@mh-hannover.de> Message-ID: <54FEFC62.7000105@mh-hannover.de> Dear mailing list members, To ease further development and possible help, my extensions to ITK-Snap (Click'n'Join and a global dynamic watershed segmentation mode) are now available on github: https://github.com/romangrothausmann/itksnap.git The branch rel_3.0+gdWS contains the changes needed for ITK-Snap v3.0, rel_3.2+gdWS for ITK-Snap v3.2 and master+gdWS for the newest development. For this branch there is also a PR (https://github.com/pyushkevich/itksnap/pull/1) with a short description and two screen shots, a documentation (article in the MIDAS journal) is on the way. One point on the ToDo list I would need help on is the realization of the join-srouce-image being 64-bit (itk::IdentifierType) and possibly coloured with itk::ScalarToRGBPixelFunctor. Other things I tried are those reported before/below. So if someone has any idea how to realize this or would like to take part in further development, please let me know. Thanks for any help or hints. Roman On 01/12/14 13:09, Dr. Roman Grothausmann wrote: > Dear mailing list members, > > > How can I modify the ColorLabelTableDisplayMappingPolicy to accept also images > containing labels of long unsigned int, i.e. the output of the > itkWatershedImageFilter? > It seems that this image type only causes problems for: > m_RGBAFilter[i]->SetInput(wrapper->GetSlice(i)); > i.e. m_RGBAFilter can only handle short but the slice from the output of a > itkWatershedImageFilter is of type long. > I tried to incorporate a CastImageFilter (see below, as the loss of precision > does not matter for the colouring), but that cannot be updated because the input > region size is [0,0] at that position of the pipeline: > > > typedef itk::Image JsrcImageType; > typedef itk::Image LabelInputSliceType; > typedef itk::CastImageFilter CIFType; > typename CIFType::Pointer cif; > cif = CIFType::New(); > wrapper->GetSlice(i)->Print(std::cerr); > cif->SetInput(dynamic_cast(wrapper->GetSlice(i))); > //cif->InPlaceOff(); > cif->Print(std::cerr); > std::cerr << "cif->Update" << std::endl; > //cif->UpdateLargestPossibleRegion(); > cif->Update(); ////crashes as input region size is [0,0] > cif->GetOutput()->Print(std::cerr); > m_RGBAFilter[i]->SetInput(cif->GetOutput()); > > > I wonder if there is a better place to do the casting but e.g. > Logic/Slicing/IRISSlicer.txx didn't seem more promising to me. > > Or how could I create a new ColorLabelTableDisplayMappingPolicy2 that would > handle long? > It seems that the typedef itk::Image InputSliceType; in > DisplayMappingPolicy.h is not used, i.e. changing it to use long for labels has > no effect. > > Setting the Label type globally to long in SNAPCommon.h: > typedef itk::IdentifierType LabelType; > confuses Qt. > > Any help or hints how I can handle this type mismatch are very welcome > Thanks, > 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 lluna.nova at gmail.com Tue Mar 10 12:02:24 2015 From: lluna.nova at gmail.com (=?UTF-8?B?UG9sIE1vbnPDsyBQdXJ0w60=?=) Date: Tue, 10 Mar 2015 17:02:24 +0100 Subject: [ITK-users] read an image stack .tif In-Reply-To: References: Message-ID: Yes, there is. How are the images stacked? Are we talking about a volume? If so, read it normally with a reader with a dimension of 3. Check the reader example: http://itk.org/Wiki/ITK/Examples/IO/ImageFileReader You'll have to change the Dimension to 3 and remove the visualization part. If you only want to visualize, you could use Fiji for this. Pol 2015-03-10 14:26 GMT+01:00 Chiara Magliaro : > Hi all, > > i'd like to read a tiff file, stocking an image stack and see the > different images composing the stack. Is there any irk class to do this? > Thanks in advance > > Best regards > Chiara > > -- > Chiara Magliaro > PhD Student > Research Center "E. Piaggio" - University of Pisa > Largo Lucio Lazzarino 1, 56122 Pisa, Italy > Tel. 0039 0502217061 - Fax. 0039 0502217051 > > _____________________________________ > 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 janschepers1 at gmail.com Tue Mar 10 12:14:24 2015 From: janschepers1 at gmail.com (Jan Schepers) Date: Tue, 10 Mar 2015 17:14:24 +0100 Subject: [ITK-users] Question about itkCenteredVersorTransformInitializer Message-ID: Hello, in the method InitializeTransform the rotation matrix is computed as follows: MovingMatrixType rotationMatrix = movingPrincipalAxis * fixedPrincipalAxis.GetInverse(); This doesn't work for me. If I change it to MovingMatrixType rotationMatrix = movingPrincipalAxis.GetInverse() * fixedPrincipalAxis; then I get the results that I expected. Strangely, both rotation matrices are not even each other's inverse. Did anyone experience the same problem? Best regards, Jan -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Tue Mar 10 12:56:32 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Tue, 10 Mar 2015 12:56:32 -0400 Subject: [ITK-users] Question about itkCenteredVersorTransformInitializer In-Reply-To: References: Message-ID: <9D59DDE4-7748-4804-95BD-D2244A2E9EC6@mail.nih.gov> Hello Jan, Please remember that the ITK registration framework ( and initializers ) produce a transform which maps points from the fixed image to the moving image. My first guess is that you are applying the transform in the wrong direction. Brad On Mar 10, 2015, at 12:14 PM, Jan Schepers wrote: > Hello, > > in the method InitializeTransform the rotation matrix is computed as follows: > MovingMatrixType rotationMatrix = movingPrincipalAxis * fixedPrincipalAxis.GetInverse(); > > This doesn't work for me. If I change it to > MovingMatrixType rotationMatrix = movingPrincipalAxis.GetInverse() * fixedPrincipalAxis; > then I get the results that I expected. Strangely, both rotation matrices are not even each other's inverse. > > Did anyone experience the same problem? > > Best regards, > Jan > _____________________________________ > 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 amghanem at gmail.com Tue Mar 10 16:18:25 2015 From: amghanem at gmail.com (amghanem) Date: Tue, 10 Mar 2015 13:18:25 -0700 (MST) Subject: [ITK-users] error exception occurred during SingleMethodExecute Message-ID: <1426018705093-35316.post@n7.nabble.com> Hi, I am working on Osirix plugin and when the following code run, ITK generate the following runtime error itk::ERROR: MultiThreader(0x79f1400): Exception occurred during SingleMethodExecute ITK180/Modules/Core/Common/include/itkImageSource.hxx:300: itk::ERROR: ImageToImageFilter(0x126df1a0): Subclass should override this method!!! The signature of ThreadedGenerateData() has been changed in ITK v4 to use the new ThreadIdType. ImageToImageFilter::ThreadedGenerateData() might need to be updated to used it. the version of ITK that used by osirix is 4.1 thanks, const unsigned int Dimension = 3; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; typedef itk::SymmetricSecondRankTensor< double, Dimension > HessianPixelType; typedef itk::Image< HessianPixelType, Dimension > HessianImageType; typedef itk::HessianToObjectnessMeasureImageFilter< HessianImageType, ImageType > ObjectnessFilterType; ObjectnessFilterType::Pointer objectnessFilter = ObjectnessFilterType::New(); //objectnessFilter->SetBrightObject( false ); objectnessFilter->SetBrightObject( true ); objectnessFilter->SetScaleObjectnessMeasure( false ); objectnessFilter->SetAlpha( 0.5 ); objectnessFilter->SetBeta( 1.0 ); objectnessFilter->SetGamma( 5.0 ); objectnessFilter->SetObjectDimension(1); //vessels typedef itk::MultiScaleHessianBasedMeasureImageFilter< ImageType, HessianImageType, ImageType > MultiScaleEnhancementFilterType; MultiScaleEnhancementFilterType::Pointer multiScaleEnhancementFilter = MultiScaleEnhancementFilterType::New(); multiScaleEnhancementFilter->SetInput( importFilter->GetOutput() ); multiScaleEnhancementFilter->SetHessianToMeasureFilter( objectnessFilter ); multiScaleEnhancementFilter->SetSigmaStepMethodToEquispaced(); multiScaleEnhancementFilter->SetSigmaMinimum( 0.2 ); multiScaleEnhancementFilter->SetSigmaMaximum( 2 ); multiScaleEnhancementFilter->SetNumberOfSigmaSteps( 2); multiScaleEnhancementFilter->SetGenerateHessianOutput(true); multiScaleEnhancementFilter->SetGenerateScalesOutput(false); try { multiScaleEnhancementFilter->Update(); } catch( itk::ExceptionObject & excep ) { NSString * erro = [[ NSString alloc] initWithCString:excep.GetDescription()]; NSLog(erro); return 1; } float* enhanceOutput=multiScaleEnhancementFilter->GetOutput()->GetBufferPointer(); -- View this message in context: http://itk-users.7.n7.nabble.com/error-exception-occurred-during-SingleMethodExecute-tp35316.html Sent from the ITK - Users mailing list archive at Nabble.com. From blowekamp at mail.nih.gov Wed Mar 11 08:56:07 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Wed, 11 Mar 2015 08:56:07 -0400 Subject: [ITK-users] [ITK] error exception occurred during SingleMethodExecute In-Reply-To: <1426018705093-35316.post@n7.nabble.com> References: <1426018705093-35316.post@n7.nabble.com> Message-ID: <656320A1-1E8F-45B6-8C3D-1EE5168C0941@mail.nih.gov> Hello, I think you have a build and include path problem and are mixing up using different versions of ITK headers. Or perhaps some how using an old version of the these filters. Brad On Mar 10, 2015, at 4:18 PM, amghanem wrote: > Hi, > > I am working on Osirix plugin and when the following code run, ITK generate > the following runtime error > > > itk::ERROR: MultiThreader(0x79f1400): Exception occurred during > SingleMethodExecute > ITK180/Modules/Core/Common/include/itkImageSource.hxx:300: > itk::ERROR: ImageToImageFilter(0x126df1a0): Subclass should override this > method!!! > The signature of ThreadedGenerateData() has been changed in ITK v4 to use > the new ThreadIdType. > ImageToImageFilter::ThreadedGenerateData() might need to be updated to used > it. > > the version of ITK that used by osirix is 4.1 > > > > > thanks, > > > > const unsigned int Dimension = 3; > > > typedef float PixelType; > typedef itk::Image< PixelType, Dimension > ImageType; > > > typedef itk::SymmetricSecondRankTensor< double, Dimension > > HessianPixelType; > typedef itk::Image< HessianPixelType, Dimension > > HessianImageType; > typedef itk::HessianToObjectnessMeasureImageFilter< HessianImageType, > ImageType > ObjectnessFilterType; > ObjectnessFilterType::Pointer objectnessFilter = > ObjectnessFilterType::New(); > //objectnessFilter->SetBrightObject( false ); > objectnessFilter->SetBrightObject( true ); > objectnessFilter->SetScaleObjectnessMeasure( false ); > objectnessFilter->SetAlpha( 0.5 ); > objectnessFilter->SetBeta( 1.0 ); > objectnessFilter->SetGamma( 5.0 ); > objectnessFilter->SetObjectDimension(1); //vessels > > typedef itk::MultiScaleHessianBasedMeasureImageFilter< ImageType, > HessianImageType, ImageType > MultiScaleEnhancementFilterType; > MultiScaleEnhancementFilterType::Pointer multiScaleEnhancementFilter = > MultiScaleEnhancementFilterType::New(); > multiScaleEnhancementFilter->SetInput( importFilter->GetOutput() ); > multiScaleEnhancementFilter->SetHessianToMeasureFilter( objectnessFilter > ); > multiScaleEnhancementFilter->SetSigmaStepMethodToEquispaced(); > multiScaleEnhancementFilter->SetSigmaMinimum( 0.2 ); > multiScaleEnhancementFilter->SetSigmaMaximum( 2 ); > multiScaleEnhancementFilter->SetNumberOfSigmaSteps( 2); > multiScaleEnhancementFilter->SetGenerateHessianOutput(true); > multiScaleEnhancementFilter->SetGenerateScalesOutput(false); > > > > try > { > multiScaleEnhancementFilter->Update(); > } > catch( itk::ExceptionObject & excep ) > { > NSString * erro = [[ NSString alloc] > initWithCString:excep.GetDescription()]; > > NSLog(erro); > return 1; > } > > float* > enhanceOutput=multiScaleEnhancementFilter->GetOutput()->GetBufferPointer(); > > > > -- > View this message in context: http://itk-users.7.n7.nabble.com/error-exception-occurred-during-SingleMethodExecute-tp35316.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 amghanem at gmail.com Wed Mar 11 10:25:57 2015 From: amghanem at gmail.com (amghanem) Date: Wed, 11 Mar 2015 07:25:57 -0700 (MST) Subject: [ITK-users] [ITK] error exception occurred during SingleMethodExecute In-Reply-To: <656320A1-1E8F-45B6-8C3D-1EE5168C0941@mail.nih.gov> References: <1426018705093-35316.post@n7.nabble.com> <656320A1-1E8F-45B6-8C3D-1EE5168C0941@mail.nih.gov> Message-ID: <1426083957973-35318.post@n7.nabble.com> Thanks Brad, I used the ITK library which integrated with Osirix so I think, There is no headers library version conflict. -- View this message in context: http://itk-users.7.n7.nabble.com/error-exception-occurred-during-SingleMethodExecute-tp35316p35318.html Sent from the ITK - Users mailing list archive at Nabble.com. From matt.mccormick at kitware.com Wed Mar 11 13:21:21 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Wed, 11 Mar 2015 13:21:21 -0400 Subject: [ITK-users] [ITK] error exception occurred during SingleMethodExecute In-Reply-To: <1426083957973-35318.post@n7.nabble.com> References: <1426018705093-35316.post@n7.nabble.com> <656320A1-1E8F-45B6-8C3D-1EE5168C0941@mail.nih.gov> <1426083957973-35318.post@n7.nabble.com> Message-ID: Hi, You will need to run the code in a debugger to see which class is causing the issue. It is likely related to the use of "ThreadIdType" in the ThreadedGenerateData method signature. HTH, Matt On Wed, Mar 11, 2015 at 10:25 AM, amghanem wrote: > Thanks Brad, > I used the ITK library which integrated with Osirix so I think, There is no > headers library version conflict. > > > > > > -- > View this message in context: http://itk-users.7.n7.nabble.com/error-exception-occurred-during-SingleMethodExecute-tp35316p35318.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 matimontg at gmail.com Wed Mar 11 18:32:17 2015 From: matimontg at gmail.com (Matias Montroull) Date: Wed, 11 Mar 2015 19:32:17 -0300 Subject: [ITK-users] Registration in SimpleITK Message-ID: Hi, is it possible to do registration in SimpleITK? I mean, something like in this example: http://public.kitware.com/cgi-bin/viewcvs.cgi/Insight/Examples/Registration/ImageRegistration2.cxx?view=markup Thanks, Matias, -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Wed Mar 11 18:46:07 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Wed, 11 Mar 2015 18:46:07 -0400 Subject: [ITK-users] [ITK] Registration in SimpleITK In-Reply-To: References: Message-ID: Hello Matias, Currently there is SimpleITK 0.9b01 [1] out with the registration framework. With it you can do things like this: http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/56_VH_Registration1.html or http://www.itk.org/SimpleITKDoxygen/html/ImageRegistrationMethod2_8py-example.html Please give it a try and let us know how it work for you. Enjoy, Brad [1] http://www.itk.org/Wiki/SimpleITK/ReleaseNotes#SimpleITK_-_Version_0.9.0_Release On Mar 11, 2015, at 6:32 PM, Matias Montroull wrote: > Hi, > > is it possible to do registration in SimpleITK? I mean, something like in this example: > http://public.kitware.com/cgi-bin/viewcvs.cgi/Insight/Examples/Registration/ImageRegistration2.cxx?view=markup > > Thanks, > > Matias, > _____________________________________ > 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 matimontg at gmail.com Wed Mar 11 18:54:41 2015 From: matimontg at gmail.com (Matias Montroull) Date: Wed, 11 Mar 2015 19:54:41 -0300 Subject: [ITK-users] [ITK] Registration in SimpleITK In-Reply-To: References: Message-ID: Thanks Bradley, I'll give it a try. I downloaded version 0.8.1 but wasn't aware of this new Beta release Thanks, Matias. On Wed, Mar 11, 2015 at 7:46 PM, Bradley Lowekamp wrote: > Hello Matias, > > Currently there is SimpleITK 0.9b01 [1] out with the registration > framework. > > With it you can do things like this: > > http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/56_VH_Registration1.html > or > > http://www.itk.org/SimpleITKDoxygen/html/ImageRegistrationMethod2_8py-example.html > > Please give it a try and let us know how it work for you. > > Enjoy, > Brad > > [1] > http://www.itk.org/Wiki/SimpleITK/ReleaseNotes#SimpleITK_-_Version_0.9.0_Release > > On Mar 11, 2015, at 6:32 PM, Matias Montroull wrote: > > Hi, > > is it possible to do registration in SimpleITK? I mean, something like in > this example: > > http://public.kitware.com/cgi-bin/viewcvs.cgi/Insight/Examples/Registration/ImageRegistration2.cxx?view=markup > > Thanks, > > Matias, > _____________________________________ > 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 matimontg at gmail.com Wed Mar 11 19:31:48 2015 From: matimontg at gmail.com (Matias Montroull) Date: Wed, 11 Mar 2015 20:31:48 -0300 Subject: [ITK-users] [ITK] Registration in SimpleITK In-Reply-To: References: Message-ID: My project is using 64 bits and some DLL I use as well, I've ran into issues when using the beta version because is 32 bits. I guess I'll wait until the final release is done. Thanks, Matias. On Wed, Mar 11, 2015 at 7:54 PM, Matias Montroull wrote: > Thanks Bradley, I'll give it a try. I downloaded version 0.8.1 but wasn't > aware of this new Beta release > Thanks, > Matias. > > On Wed, Mar 11, 2015 at 7:46 PM, Bradley Lowekamp > wrote: > >> Hello Matias, >> >> Currently there is SimpleITK 0.9b01 [1] out with the registration >> framework. >> >> With it you can do things like this: >> >> http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/56_VH_Registration1.html >> or >> >> http://www.itk.org/SimpleITKDoxygen/html/ImageRegistrationMethod2_8py-example.html >> >> Please give it a try and let us know how it work for you. >> >> Enjoy, >> Brad >> >> [1] >> http://www.itk.org/Wiki/SimpleITK/ReleaseNotes#SimpleITK_-_Version_0.9.0_Release >> >> On Mar 11, 2015, at 6:32 PM, Matias Montroull >> wrote: >> >> Hi, >> >> is it possible to do registration in SimpleITK? I mean, something like in >> this example: >> >> http://public.kitware.com/cgi-bin/viewcvs.cgi/Insight/Examples/Registration/ImageRegistration2.cxx?view=markup >> >> Thanks, >> >> Matias, >> _____________________________________ >> 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 Mar 11 19:56:56 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Wed, 11 Mar 2015 19:56:56 -0400 Subject: [ITK-users] [ITK] Registration in SimpleITK In-Reply-To: References: Message-ID: Hello, If you are willing to compile it yourself you can get it to work with just a little bit of effort. Compile the SimpleITK superbuild with shared libraries enabled. Do the usual installation of SimpleITK from the super build [1], this will install the SimpleITK python library into your site-packages. However, this libraries also depends on all the SimpleITK an ITK dlls (not installed or packaged), these should be in the superbuild's bin directory. These need to be in your run-time path when importing SimpleITK. This can be done either by modifying you PATH environment variable you copying them to the appropriate place ( which may depend on the python environment, and there are likely several alternatives). Brad [1] http://www.itk.org/Wiki/SimpleITK/GettingStarted#Python_installation On Mar 11, 2015, at 7:31 PM, Matias Montroull wrote: > > My project is using 64 bits and some DLL I use as well, I've ran into issues when using the beta version because is 32 bits. I guess I'll wait until the final release is done. > Thanks, > Matias. > > On Wed, Mar 11, 2015 at 7:54 PM, Matias Montroull wrote: > Thanks Bradley, I'll give it a try. I downloaded version 0.8.1 but wasn't aware of this new Beta release > Thanks, > Matias. > > On Wed, Mar 11, 2015 at 7:46 PM, Bradley Lowekamp wrote: > Hello Matias, > > Currently there is SimpleITK 0.9b01 [1] out with the registration framework. > > With it you can do things like this: > http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/56_VH_Registration1.html > or > http://www.itk.org/SimpleITKDoxygen/html/ImageRegistrationMethod2_8py-example.html > > Please give it a try and let us know how it work for you. > > Enjoy, > Brad > > [1] http://www.itk.org/Wiki/SimpleITK/ReleaseNotes#SimpleITK_-_Version_0.9.0_Release > > On Mar 11, 2015, at 6:32 PM, Matias Montroull wrote: > >> Hi, >> >> is it possible to do registration in SimpleITK? I mean, something like in this example: >> http://public.kitware.com/cgi-bin/viewcvs.cgi/Insight/Examples/Registration/ImageRegistration2.cxx?view=markup >> >> Thanks, >> >> Matias, >> _____________________________________ >> 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 camargo at lncc.br Thu Mar 12 14:56:53 2015 From: camargo at lncc.br (Eduardo - LNCC) Date: Thu, 12 Mar 2015 15:56:53 -0300 Subject: [ITK-users] abs function ambigous in Mac OS X 10.9 Message-ID: Hi, I am trying compile ITK 3.20 in the Mac OS X 10.9.5 I received the erro below and I don't figure out what have happened. Someboy can help me? [ 1%] Built target itksys [ 6%] Built target itkjpeg8 [ 11%] Built target itkjpeg12 [ 16%] Built target itkjpeg16 [ 17%] Built target itkzlib [ 18%] Built target itkpng [ 18%] Built target itkmkg3states [ 21%] Built target itktiff [ 23%] Built target itkopenjpeg [ 25%] Built target ITKMetaIO [ 28%] Built target ITKNrrdIO [ 28%] Built target ITKEXPAT [ 28%] Built target ITKznz [ 28%] Built target ITKniftiio [ 29%] Built target ITKDICOMParser [ 30%] Built target itkvcl [ 51%] Built target itkv3p_netlib [ 51%] Built target itktestlib [ 69%] Built target itkvnl [ 74%] Built target itkvnl_algo [ 76%] Built target itkNetlibSlatec [ 80%] Built target itkgdcm [ 82%] Built target itkvnl_inst [ 88%] Built target ITKCommon [ 91%] Built target ITKNumerics [ 91%] Built target ITKBasicFilters [ 91%] Built target ITKStatistics [ 91%] Built target ITKAlgorithms [ 91%] Built target ITKSpatialObject [ 96%] Built target ITKIO [ 96%] Building CXX object Code/IO/CMakeFiles/itkTestDriver.dir/itkTestDriver.o In file included from /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/IO/itkTestDriver.cxx:33: In file included from /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkNumericTraits.h:20: In file included from /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkMacro.h:42: /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:86:36: warning: in-class initializer for static data member of type 'const double' is a GNU extension [-Wgnu-static-float-init] static VNL_DLL_DATA const double e VCL_STATIC_CONST_INIT_FLOAT_DECL(2.7182818284590452354); ^ ~~~~~~~~~~~~~~~~~~~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:87:36: warning: in-class initializer for static data member of type 'const double' is a GNU extension [-Wgnu-static-float-init] static VNL_DLL_DATA const double log2e VCL_STATIC_CONST_INIT_FLOAT_DECL(1.4426950408889634074); ^ ~~~~~~~~~~~~~~~~~~~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:88:36: warning: in-class initializer for static data member of type 'const double' is a GNU extension [-Wgnu-static-float-init] static VNL_DLL_DATA const double log10e VCL_STATIC_CONST_INIT_FLOAT_DECL(0.43429448190325182765); ^ ~~~~~~~~~~~~~~~~~~~~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:89:36: warning: in-class initializer for static data member of type 'const double' is a GNU extension [-Wgnu-static-float-init] static VNL_DLL_DATA const double ln2 VCL_STATIC_CONST_INIT_FLOAT_DECL(0.69314718055994530942); ^ ~~~~~~~~~~~~~~~~~~~~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:90:36: warning: in-class initializer for static data member of type 'const double' is a GNU extension [-Wgnu-static-float-init] static VNL_DLL_DATA const double ln10 VCL_STATIC_CONST_INIT_FLOAT_DECL(2.30258509299404568402); ^ ~~~~~~~~~~~~~~~~~~~~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:91:36: warning: in-class initializer for static data member of type 'const double' is a GNU extension [-Wgnu-static-float-init] static VNL_DLL_DATA const double pi VCL_STATIC_CONST_INIT_FLOAT_DECL(3.14159265358979323846); ^ ~~~~~~~~~~~~~~~~~~~~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:92:36: warning: in-class initializer for static data member of type 'const double' is a GNU extension [-Wgnu-static-float-init] static VNL_DLL_DATA const double pi_over_2 VCL_STATIC_CONST_INIT_FLOAT_DECL(1.57079632679489661923); ^ ~~~~~~~~~~~~~~~~~~~~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:93:36: warning: in-class initializer for static data member of type 'const double' is a GNU extension [-Wgnu-static-float-init] static VNL_DLL_DATA const double pi_over_4 VCL_STATIC_CONST_INIT_FLOAT_DECL(0.78539816339744830962); ^ ~~~~~~~~~~~~~~~~~~~~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:94:36: warning: in-class initializer for static data member of type 'const double' is a GNU extension [-Wgnu-static-float-init] static VNL_DLL_DATA const double one_over_pi VCL_STATIC_CONST_INIT_FLOAT_DECL(0.31830988618379067154); ^ ~~~~~~~~~~~~~~~~~~~~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:95:36: warning: in-class initializer for static data member of type 'const double' is a GNU extension [-Wgnu-static-float-init] static VNL_DLL_DATA const double two_over_pi VCL_STATIC_CONST_INIT_FLOAT_DECL(0.63661977236758134308); ^ ~~~~~~~~~~~~~~~~~~~~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:96:36: warning: in-class initializer for static data member of type 'const double' is a GNU extension [-Wgnu-static-float-init] static VNL_DLL_DATA const double two_over_sqrtpi VCL_STATIC_CONST_INIT_FLOAT_DECL(1.12837916709551257390); ^ ~~~~~~~~~~~~~~~~~~~~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:97:36: warning: in-class initializer for static data member of type 'const double' is a GNU extension [-Wgnu-static-float-init] static VNL_DLL_DATA const double one_over_sqrt2pi VCL_STATIC_CONST_INIT_FLOAT_DECL(0.39894228040143267794); ^ ~~~~~~~~~~~~~~~~~~~~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:98:36: warning: in-class initializer for static data member of type 'const double' is a GNU extension [-Wgnu-static-float-init] static VNL_DLL_DATA const double sqrt2 VCL_STATIC_CONST_INIT_FLOAT_DECL(1.41421356237309504880); ^ ~~~~~~~~~~~~~~~~~~~~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:99:36: warning: in-class initializer for static data member of type 'const double' is a GNU extension [-Wgnu-static-float-init] static VNL_DLL_DATA const double sqrt1_2 VCL_STATIC_CONST_INIT_FLOAT_DECL(0.70710678118654752440); ^ ~~~~~~~~~~~~~~~~~~~~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:102:36: warning: in-class initializer for static data member of type 'const double' is a GNU extension [-Wgnu-static-float-init] static VNL_DLL_DATA const double eps VCL_STATIC_CONST_INIT_FLOAT_DECL(2.2204460492503131e-16); ^ ~~~~~~~~~~~~~~~~~~~~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:103:36: warning: in-class initializer for static data member of type 'const double' is a GNU extension [-Wgnu-static-float-init] static VNL_DLL_DATA const double sqrteps VCL_STATIC_CONST_INIT_FLOAT_DECL(1.490116119384766e-08); ^ ~~~~~~~~~~~~~~~~~~~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:105:35: warning: in-class initializer for static data member of type 'const float' is a GNU extension [-Wgnu-static-float-init] static VNL_DLL_DATA const float float_eps VCL_STATIC_CONST_INIT_FLOAT_DECL(1.192092896e-07f); ^ ~~~~~~~~~~~~~~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:106:35: warning: in-class initializer for static data member of type 'const float' is a GNU extension [-Wgnu-static-float-init] static VNL_DLL_DATA const float float_sqrteps VCL_STATIC_CONST_INIT_FLOAT_DECL(3.4526698307e-4f); ^ ~~~~~~~~~~~~~~~~ In file included from /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/IO/itkTestDriver.cxx:35: In file included from /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkImage.h:20: In file included from /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkImageBase.h:25: In file included from /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkImageRegion.h:27: In file included from /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkContinuousIndex.h:20: In file included from /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkPoint.h:23: In file included from /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkVector.h:23: In file included from /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_vector_ref.h:20: In file included from /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_vector.h:20: In file included from /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_c_vector.h:25: /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_numeric_traits.h:340:22: warning: in-class initializer for static data member of type 'const float' is a GNU extension [-Wgnu-static-float-init] static const float zero VCL_STATIC_CONST_INIT_FLOAT_DECL(0.0F); ^ ~~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_numeric_traits.h:342:22: warning: in-class initializer for static data member of type 'const float' is a GNU extension [-Wgnu-static-float-init] static const float one VCL_STATIC_CONST_INIT_FLOAT_DECL(1.0F); ^ ~~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_numeric_traits.h:344:22: warning: in-class initializer for static data member of type 'const float' is a GNU extension [-Wgnu-static-float-init] static const float maxval VCL_STATIC_CONST_INIT_FLOAT_DECL(3.40282346638528860e+38F); ^ ~~~~~~~~~~~~~~~~~~~~~~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_numeric_traits.h:363:23: warning: in-class initializer for static data member of type 'const double' is a GNU extension [-Wgnu-static-float-init] static const double zero VCL_STATIC_CONST_INIT_FLOAT_DECL(0.0); ^ ~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_numeric_traits.h:365:23: warning: in-class initializer for static data member of type 'const double' is a GNU extension [-Wgnu-static-float-init] static const double one VCL_STATIC_CONST_INIT_FLOAT_DECL(1.0); ^ ~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_numeric_traits.h:367:23: warning: in-class initializer for static data member of type 'const double' is a GNU extension [-Wgnu-static-float-init] static const double maxval VCL_STATIC_CONST_INIT_FLOAT_DECL(1.7976931348623157E+308); ^ ~~~~~~~~~~~~~~~~~~~~~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_numeric_traits.h:386:28: warning: in-class initializer for static data member of type 'const long double' is a GNU extension [-Wgnu-static-float-init] static const long double zero VCL_STATIC_CONST_INIT_FLOAT_DECL(0.0); ^ ~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_numeric_traits.h:388:28: warning: in-class initializer for static data member of type 'const long double' is a GNU extension [-Wgnu-static-float-init] static const long double one VCL_STATIC_CONST_INIT_FLOAT_DECL(1.0); ^ ~~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_numeric_traits.h:390:28: warning: in-class initializer for static data member of type 'const long double' is a GNU extension [-Wgnu-static-float-init] static const long double maxval VCL_STATIC_CONST_INIT_FLOAT_DECL(1.7976931348623157E+308); ^ ~~~~~~~~~~~~~~~~~~~~~~~ In file included from /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/IO/itkTestDriver.cxx:33: In file included from /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkNumericTraits.h:32: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/complex:939:16: error: call to 'abs' is ambiguous return abs(__c.real()); ^~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/IO/itkDefaultConvertPixelTraits.h:294:1: note: in instantiation of function template specialization 'std::__1::norm' requested here ITK_DEFAULTCONVERTTRAITS_COMPLEX_TYPE(unsigned int); ^ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/IO/itkDefaultConvertPixelTraits.h:287:17: note: expanded from macro 'ITK_DEFAULTCONVERTTRAITS_COMPLEX_TYPE' return std::norm(pixel); \ ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/stdlib.h:129:6: note: candidate function int abs(int) __pure2; ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib:159:44: note: candidate function inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);} ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib:161:44: note: candidate function inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);} ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:660:1: note: candidate function abs(float __x) _NOEXCEPT {return fabsf(__x);} ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:664:1: note: candidate function abs(double __x) _NOEXCEPT {return fabs(__x);} ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:668:1: note: candidate function abs(long double __x) _NOEXCEPT {return fabsl(__x);} ^ In file included from /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/IO/itkTestDriver.cxx:33: In file included from /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkNumericTraits.h:32: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/complex:941:16: error: call to 'abs' is ambiguous return abs(__c.imag()); ^~~ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/stdlib.h:129:6: note: candidate function int abs(int) __pure2; ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib:159:44: note: candidate function inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);} ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib:161:44: note: candidate function inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);} ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:660:1: note: candidate function abs(float __x) _NOEXCEPT {return fabsf(__x);} ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:664:1: note: candidate function abs(double __x) _NOEXCEPT {return fabs(__x);} ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:668:1: note: candidate function abs(long double __x) _NOEXCEPT {return fabsl(__x);} ^ In file included from /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/IO/itkTestDriver.cxx:33: In file included from /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkNumericTraits.h:32: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/complex:939:16: error: call to 'abs' is ambiguous return abs(__c.real()); ^~~ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/IO/itkDefaultConvertPixelTraits.h:298:1: note: in instantiation of function template specialization 'std::__1::norm' requested here ITK_DEFAULTCONVERTTRAITS_COMPLEX_TYPE(unsigned long); ^ /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/IO/itkDefaultConvertPixelTraits.h:287:17: note: expanded from macro 'ITK_DEFAULTCONVERTTRAITS_COMPLEX_TYPE' return std::norm(pixel); \ ^ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/stdlib.h:129:6: note: candidate function int abs(int) __pure2; ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib:159:44: note: candidate function inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);} ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib:161:44: note: candidate function inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);} ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:660:1: note: candidate function abs(float __x) _NOEXCEPT {return fabsf(__x);} ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:664:1: note: candidate function abs(double __x) _NOEXCEPT {return fabs(__x);} ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:668:1: note: candidate function abs(long double __x) _NOEXCEPT {return fabsl(__x);} ^ In file included from /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/IO/itkTestDriver.cxx:33: In file included from /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkNumericTraits.h:32: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/complex:941:16: error: call to 'abs' is ambiguous return abs(__c.imag()); ^~~ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/stdlib.h:129:6: note: candidate function int abs(int) __pure2; ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib:159:44: note: candidate function inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);} ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib:161:44: note: candidate function inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);} ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:660:1: note: candidate function abs(float __x) _NOEXCEPT {return fabsf(__x);} ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:664:1: note: candidate function abs(double __x) _NOEXCEPT {return fabs(__x);} ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:668:1: note: candidate function abs(long double __x) _NOEXCEPT {return fabsl(__x);} ^ 27 warnings and 4 errors generated. make[2]: *** [Code/IO/CMakeFiles/itkTestDriver.dir/itkTestDriver.o] Error 1 make[1]: *** [Code/IO/CMakeFiles/itkTestDriver.dir/all] Error 2 make: *** [all] Error 2 Atenciosamente, Eduardo Camargo, M.Sc. Analista de Sistemas Instituto Nacional de Ci?ncia e Tecnologia em Medicina Assistida por Computa??o Cient?fica INCT-MACC http://macc.lncc.br Laborat?rio Nacional de Computa??o Cient?fica LNCC - http://www.lncc.br -------------- next part -------------- An HTML attachment was scrubbed... URL: From gabrielgimenez85 at gmail.com Thu Mar 12 15:24:05 2015 From: gabrielgimenez85 at gmail.com (=?UTF-8?Q?Gabriel_A=2E_Gim=C3=A9nez?=) Date: Thu, 12 Mar 2015 16:24:05 -0300 Subject: [ITK-users] [ITK] Mattes Mutual Information Speed with 3D Images In-Reply-To: References: <1425942141529-7586971.post@n2.nabble.com> <069517FAB08E5D4C80ABEB86CB55A1AB4CEF83A8@BHMF314A.SIRONA.ORG> <069517FAB08E5D4C80ABEB86CB55A1AB4CEFB491@BHMF314A.SIRONA.ORG> <069517FAB08E5D4C80ABEB86CB55A1AB4CEFB4C3@BHMF314A.SIRONA.ORG> Message-ID: Hi! I debug the code of the MMI implementation and the bottleneck is in in this part: *itkImageToImageMetricv4GetValueAndDerivativeThreader.hxx:* template< typename TImageToImageMetricv4 > void ImageToImageMetricv4GetValueAndDerivativeThreader< ThreadedIndexedContainerPartitioner, TImageToImageMetricv4 > ::*ThreadedExecution* ( const DomainType & indexSubRange, const ThreadIdType threadId ) { //Initialize per thread buffers and variables. this->m_Associate->InitializeThread( threadId ); typename TImageToImageMetricv4::VirtualPointSetType::ConstPointer virtualSampledPointSet = this->m_Associate->GetVirtualSampledPointSet(); typedef typename TImageToImageMetricv4::VirtualPointSetType::MeshTraits::PointIdentifier ElementIdentifierType; const ElementIdentifierType begin = indexSubRange[0]; const ElementIdentifierType end = indexSubRange[1]; VirtualIndexType virtualIndex; typename VirtualImageType::ConstPointer virtualImage = this->m_Associate->GetVirtualImage(); * for( ElementIdentifierType i = begin; i <= end; ++i )* * {* * const VirtualPointType & virtualPoint = virtualSampledPointSet->GetPoint( i );* * virtualImage->TransformPhysicalPointToIndex( virtualPoint, virtualIndex );* * this->ProcessVirtualPoint( virtualIndex, virtualPoint, threadId );* * }* //Finalize per thread actions this->m_Associate->FinalizeThread( threadId ); } The "for" statement takes a long time to finish running... and I think the default multithreaded is 2...I tried to raise this value through seter "SetMaximumNumberOfThreads()" but did not notice substantial improvements in performance .. However, when set build-type to "release" instead "debug" the performance is much better (2 ~ 3 sec.) but without reaching to the order of milliseconds....would I like it to be. I could not do the test with the ITK 3D Slicer (my OS is of 32-bits only). What do you think? can further improve performance? Thanks and regards! 2015-03-11 9:37 GMT-03:00 Gabriel A. Gim?nez : > Ok...I understand...,I'll try...and I commented the results.... > > Thanks in advance! > > 2015-03-11 9:26 GMT-03:00 Braun Tim : > > Yes, exactly. If you compile ITK e.g. with Visual Studio, you can set >> the compile profile either to ?debug?, which is slow but allows the >> debugger to stop at breakpoints etc, and ?release?, which is much faster >> due to enabled optimizations but cannot be debugged easily.. If you have >> trouble compiling ITK, there are some good youtube tutorials around >> covering this topic. >> >> >> >> *Von:* Gabriel A. Gim?nez [mailto:gabrielgimenez85 at gmail.com] >> *Gesendet:* Mittwoch, 11. M?rz 2015 13:21 >> >> *An:* Braun Tim >> *Betreff:* Re: [ITK] [ITK-users] Mattes Mutual Information Speed with 3D >> Images >> >> >> >> Hi! thank you very much for your answer! >> >> I'll try the alternatives do you recommend me...,I do not understand the >> execution mode "Release" ? it is a compile option? >> >> >> >> Regards! >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> 2015-03-11 6:18 GMT-03:00 Braun Tim : >> >> Hi Gabriel, >> >> >> >> this is several orders of magnitude slower than it should be, so I assume >> there is something weird going on. Applying the metric should take a couple >> of milliseconds, not longer. Did you compile ITK from source yourself? Then >> you should be able to use the ?DEBUG? configuration to trace into the >> metric evaluation and find out what the performance bottleneck is ? that?s >> probably faster than empirical testing.. Running the algorithm must be done >> in release mode, of course. Another option would be to try the ITK Slicer >> program, which contains the Brainsfit algorithm which uses MMI for >> registration ? here, you can try different parameters and check the >> runtime.. >> >> >> >> cheers, Tim >> >> >> >> >> >> *Von:* Gabriel A. Gim?nez [mailto:gabrielgimenez85 at gmail.com] >> *Gesendet:* Dienstag, 10. M?rz 2015 13:33 >> *An:* Braun Tim >> *Betreff:* Re: [ITK] [ITK-users] Mattes Mutual Information Speed with 3D >> Images >> >> >> >> Hi Braun, thanks for your answer... >> >> >> >> I use images of RIRE BD (http://www.insight-journal.org/rire/), my >> initial tests I make with package training_001 (CT - MR_PD). Following your >> recommendation here is my configuration: >> >> >> >> >> >> metric->SetNumberOfHistogramBins( 50 ); >> >> double samplingPercentage = 0.002; >> >> registration->SetMetricSamplingPercentage( samplingPercentage ); >> >> RegistrationType::MetricSamplingStrategyType samplingStrategy = >> >> >> RegistrationType::REGULAR; >> >> >> >> Unfortunately, the results were not good ... the average execution time >> remains the same (25 ~ 30 seconds). With a population size equal to 50, the >> execution time of an iteration is in the order of 25 minutes, very slow for >> me ... >> >> >> >> These are the image data: >> >> >> >> Fixed Image: >> >> ObjectType = Image >> >> NDims = 3 >> >> BinaryDataByteOrderMSB = True >> >> AnatomicalOrientation = LPH >> >> ElementSpacing = 0.653595 0.653595 4.000000 >> >> *DimSize = 512 512 29* >> >> ElementType = MET_SHORT >> >> ElementDataFile = image.bin >> >> >> >> Moving Image: >> >> ObjectType = Image >> >> NDims = 3 >> >> BinaryDataByteOrderMSB = True >> >> AnatomicalOrientation = LPH >> >> ElementSpacing = 1.250000 1.250000 4.000000 >> >> *DimSize = 256 256 26* >> >> ElementType = MET_SHORT >> >> ElementDataFile = image.bin >> >> >> >> >> >> Thanks and regards! >> >> >> >> >> >> >> >> >> >> 2015-03-10 5:51 GMT-03:00 Braun Tim : >> >> Hi Gabriel, >> >> the easiest way to speed up the metric calculation I can think of >> (without having more detailed information about your setup) is to reduce >> the numbers of samples used to build the MMI histogram estimates. For 256^3 >> Voxel Volumes, we typically use a value of 0.002. You can set the sampling >> percentage in the registration method that manages the metric and the >> optimizer: >> >> >> registrationMethod->SetMetricSamplingStrategy(ImageRegistrationMethodTypev4::REGULAR); >> registrationMethod->SetMetricSamplingPercentage(0.002); >> >> Another way to speed up calculation would be to reduce the resolution of >> the registered volumes - which is somewhat similar to reducing the sampling >> percentage, but has memory benefits and might reduce aliasing.. >> >> >> Hope that helps! >> >> Cheers, >> Tim >> >> -----Urspr?ngliche Nachricht----- >> Von: Community [mailto:community-bounces at itk.org] Im Auftrag von Gabriel >> A. Gim?nez >> Gesendet: Dienstag, 10. M?rz 2015 00:02 >> An: insight-users at itk.org >> Betreff: [ITK] [ITK-users] Mattes Mutual Information Speed with 3D Images >> >> >> Hello everyone... >> >> I'm working on a genetic optimizer for Rigid 3D Registration. >> >> The fitness of each individual is calculated using Mattes Mutual >> Information, the execution time of the metric is high ... (30 seconds on >> average). This makes the registration too slow. >> >> Any recommendations? could improve the performance metrics? otherwise >> most appropriate metric? >> >> Regards! >> >> >> >> -- >> View this message in context: >> http://itk-insight-users.2283740.n2.nabble.com/Mattes-Mutual-Information-Speed-with-3D-Images-tp7586971.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 >> >> >> >> ----------------------------------------------------------------------------------------------------------- >> Sirona Dental Systems GmbH * HRB 24948 * >> Vorsitzender des Aufsichtsrats: Dr. Erich Blum * >> Sirona Dental Services GmbH * HRB 25817 * >> Geschaeftsfuehrung: Rainer Berthan * Michael Geil * >> Sitz der Gesellschaften: Bensheim * Registergericht: AG Darmstadt * >> >> ------------------------------------------------------------------------------------------------------------ >> Diese E-Mail ist ausschliesslich fuer den angesprochenen Adressaten >> bestimmt und kann vertrauliche Informationen beinhalten. >> -- >> This e-mail is intended only for the designated recipient(s). It may >> contain confidential or proprietary information. >> >> ------------------------------------------------------------------------------------------------------------ >> >> >> >> >> >> -- >> >> *Gabriel Alberto Gim?nez.* >> >> >> >> >> ----------------------------------------------------------------------------------------------------------- >> Sirona Dental Systems GmbH ? HRB 24948 ? >> >> Vorsitzender des Aufsichtsrats: Dr. Erich Blum ? >> Sirona Dental Services GmbH ? HRB 25817 ? >> Gesch?ftsf?hrung: Rainer Berthan ? Michael Geil ? >> Sitz der Gesellschaften: Bensheim ? Registergericht: AG Darmstadt ? >> >> ------------------------------------------------------------------------------------------------------------ >> Diese E-Mail ist ausschliesslich fuer den angesprochenen Adressaten >> bestimmt und kann vertrauliche Informationen beinhalten. >> -- >> This e-mail is intended only for the designated recipient(s). It may >> contain confidential or proprietary information. >> >> ------------------------------------------------------------------------------------------------------------ >> >> >> >> >> >> -- >> >> *Gabriel Alberto Gim?nez.* >> > > > > -- > *Gabriel Alberto Gim?nez.* > -- *Gabriel Alberto Gim?nez.* -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Thu Mar 12 16:11:12 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 12 Mar 2015 16:11:12 -0400 Subject: [ITK-users] abs function ambigous in Mac OS X 10.9 In-Reply-To: References: Message-ID: Hello, This issue has been addressed in ITKv4. Please use ITKv4 or backport a patch to the "release-3.20" Git branch and share it it with the list. Thanks, Matt On Thu, Mar 12, 2015 at 2:56 PM, Eduardo - LNCC wrote: > Hi, > > I am trying compile ITK 3.20 in the Mac OS X 10.9.5 I received the erro > below and I don't figure out what have happened. Someboy can help me? > > > [ 1%] Built target itksys > [ 6%] Built target itkjpeg8 > [ 11%] Built target itkjpeg12 > [ 16%] Built target itkjpeg16 > [ 17%] Built target itkzlib > [ 18%] Built target itkpng > [ 18%] Built target itkmkg3states > [ 21%] Built target itktiff > [ 23%] Built target itkopenjpeg > [ 25%] Built target ITKMetaIO > [ 28%] Built target ITKNrrdIO > [ 28%] Built target ITKEXPAT > [ 28%] Built target ITKznz > [ 28%] Built target ITKniftiio > [ 29%] Built target ITKDICOMParser > [ 30%] Built target itkvcl > [ 51%] Built target itkv3p_netlib > [ 51%] Built target itktestlib > [ 69%] Built target itkvnl > [ 74%] Built target itkvnl_algo > [ 76%] Built target itkNetlibSlatec > [ 80%] Built target itkgdcm > [ 82%] Built target itkvnl_inst > [ 88%] Built target ITKCommon > [ 91%] Built target ITKNumerics > [ 91%] Built target ITKBasicFilters > [ 91%] Built target ITKStatistics > [ 91%] Built target ITKAlgorithms > [ 91%] Built target ITKSpatialObject > [ 96%] Built target ITKIO > [ 96%] Building CXX object > Code/IO/CMakeFiles/itkTestDriver.dir/itkTestDriver.o > In file included from > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/IO/itkTestDriver.cxx:33: > In file included from > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkNumericTraits.h:20: > In file included from > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkMacro.h:42: > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:86:36: > warning: in-class initializer for static data member of type 'const double' > is a GNU extension [-Wgnu-static-float-init] > static VNL_DLL_DATA const double e > VCL_STATIC_CONST_INIT_FLOAT_DECL(2.7182818284590452354); > ^ > ~~~~~~~~~~~~~~~~~~~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:87:36: > warning: in-class initializer for static data member of type 'const double' > is a GNU extension [-Wgnu-static-float-init] > static VNL_DLL_DATA const double log2e > VCL_STATIC_CONST_INIT_FLOAT_DECL(1.4426950408889634074); > ^ > ~~~~~~~~~~~~~~~~~~~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:88:36: > warning: in-class initializer for static data member of type 'const double' > is a GNU extension [-Wgnu-static-float-init] > static VNL_DLL_DATA const double log10e > VCL_STATIC_CONST_INIT_FLOAT_DECL(0.43429448190325182765); > ^ > ~~~~~~~~~~~~~~~~~~~~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:89:36: > warning: in-class initializer for static data member of type 'const double' > is a GNU extension [-Wgnu-static-float-init] > static VNL_DLL_DATA const double ln2 > VCL_STATIC_CONST_INIT_FLOAT_DECL(0.69314718055994530942); > ^ > ~~~~~~~~~~~~~~~~~~~~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:90:36: > warning: in-class initializer for static data member of type 'const double' > is a GNU extension [-Wgnu-static-float-init] > static VNL_DLL_DATA const double ln10 > VCL_STATIC_CONST_INIT_FLOAT_DECL(2.30258509299404568402); > ^ > ~~~~~~~~~~~~~~~~~~~~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:91:36: > warning: in-class initializer for static data member of type 'const double' > is a GNU extension [-Wgnu-static-float-init] > static VNL_DLL_DATA const double pi > VCL_STATIC_CONST_INIT_FLOAT_DECL(3.14159265358979323846); > ^ > ~~~~~~~~~~~~~~~~~~~~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:92:36: > warning: in-class initializer for static data member of type 'const double' > is a GNU extension [-Wgnu-static-float-init] > static VNL_DLL_DATA const double pi_over_2 > VCL_STATIC_CONST_INIT_FLOAT_DECL(1.57079632679489661923); > ^ > ~~~~~~~~~~~~~~~~~~~~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:93:36: > warning: in-class initializer for static data member of type 'const double' > is a GNU extension [-Wgnu-static-float-init] > static VNL_DLL_DATA const double pi_over_4 > VCL_STATIC_CONST_INIT_FLOAT_DECL(0.78539816339744830962); > ^ > ~~~~~~~~~~~~~~~~~~~~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:94:36: > warning: in-class initializer for static data member of type 'const double' > is a GNU extension [-Wgnu-static-float-init] > static VNL_DLL_DATA const double one_over_pi > VCL_STATIC_CONST_INIT_FLOAT_DECL(0.31830988618379067154); > ^ > ~~~~~~~~~~~~~~~~~~~~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:95:36: > warning: in-class initializer for static data member of type 'const double' > is a GNU extension [-Wgnu-static-float-init] > static VNL_DLL_DATA const double two_over_pi > VCL_STATIC_CONST_INIT_FLOAT_DECL(0.63661977236758134308); > ^ > ~~~~~~~~~~~~~~~~~~~~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:96:36: > warning: in-class initializer for static data member of type 'const double' > is a GNU extension [-Wgnu-static-float-init] > static VNL_DLL_DATA const double two_over_sqrtpi > VCL_STATIC_CONST_INIT_FLOAT_DECL(1.12837916709551257390); > ^ > ~~~~~~~~~~~~~~~~~~~~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:97:36: > warning: in-class initializer for static data member of type 'const double' > is a GNU extension [-Wgnu-static-float-init] > static VNL_DLL_DATA const double one_over_sqrt2pi > VCL_STATIC_CONST_INIT_FLOAT_DECL(0.39894228040143267794); > ^ > ~~~~~~~~~~~~~~~~~~~~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:98:36: > warning: in-class initializer for static data member of type 'const double' > is a GNU extension [-Wgnu-static-float-init] > static VNL_DLL_DATA const double sqrt2 > VCL_STATIC_CONST_INIT_FLOAT_DECL(1.41421356237309504880); > ^ > ~~~~~~~~~~~~~~~~~~~~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:99:36: > warning: in-class initializer for static data member of type 'const double' > is a GNU extension [-Wgnu-static-float-init] > static VNL_DLL_DATA const double sqrt1_2 > VCL_STATIC_CONST_INIT_FLOAT_DECL(0.70710678118654752440); > ^ > ~~~~~~~~~~~~~~~~~~~~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:102:36: > warning: in-class initializer for static data member of type 'const double' > is a GNU extension [-Wgnu-static-float-init] > static VNL_DLL_DATA const double eps > VCL_STATIC_CONST_INIT_FLOAT_DECL(2.2204460492503131e-16); > ^ > ~~~~~~~~~~~~~~~~~~~~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:103:36: > warning: in-class initializer for static data member of type 'const double' > is a GNU extension [-Wgnu-static-float-init] > static VNL_DLL_DATA const double sqrteps > VCL_STATIC_CONST_INIT_FLOAT_DECL(1.490116119384766e-08); > ^ > ~~~~~~~~~~~~~~~~~~~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:105:35: > warning: in-class initializer for static data member of type 'const float' > is a GNU extension [-Wgnu-static-float-init] > static VNL_DLL_DATA const float float_eps > VCL_STATIC_CONST_INIT_FLOAT_DECL(1.192092896e-07f); > ^ > ~~~~~~~~~~~~~~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_math.h:106:35: > warning: in-class initializer for static data member of type 'const float' > is a GNU extension [-Wgnu-static-float-init] > static VNL_DLL_DATA const float float_sqrteps > VCL_STATIC_CONST_INIT_FLOAT_DECL(3.4526698307e-4f); > ^ > ~~~~~~~~~~~~~~~~ > In file included from > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/IO/itkTestDriver.cxx:35: > In file included from > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkImage.h:20: > In file included from > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkImageBase.h:25: > In file included from > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkImageRegion.h:27: > In file included from > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkContinuousIndex.h:20: > In file included from > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkPoint.h:23: > In file included from > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkVector.h:23: > In file included from > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_vector_ref.h:20: > In file included from > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_vector.h:20: > In file included from > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_c_vector.h:25: > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_numeric_traits.h:340:22: > warning: in-class initializer for static data member of type 'const float' > is a GNU extension [-Wgnu-static-float-init] > static const float zero VCL_STATIC_CONST_INIT_FLOAT_DECL(0.0F); > ^ ~~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_numeric_traits.h:342:22: > warning: in-class initializer for static data member of type 'const float' > is a GNU extension [-Wgnu-static-float-init] > static const float one VCL_STATIC_CONST_INIT_FLOAT_DECL(1.0F); > ^ ~~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_numeric_traits.h:344:22: > warning: in-class initializer for static data member of type 'const float' > is a GNU extension [-Wgnu-static-float-init] > static const float maxval > VCL_STATIC_CONST_INIT_FLOAT_DECL(3.40282346638528860e+38F); > ^ > ~~~~~~~~~~~~~~~~~~~~~~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_numeric_traits.h:363:23: > warning: in-class initializer for static data member of type 'const double' > is a GNU extension [-Wgnu-static-float-init] > static const double zero VCL_STATIC_CONST_INIT_FLOAT_DECL(0.0); > ^ ~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_numeric_traits.h:365:23: > warning: in-class initializer for static data member of type 'const double' > is a GNU extension [-Wgnu-static-float-init] > static const double one VCL_STATIC_CONST_INIT_FLOAT_DECL(1.0); > ^ ~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_numeric_traits.h:367:23: > warning: in-class initializer for static data member of type 'const double' > is a GNU extension [-Wgnu-static-float-init] > static const double maxval > VCL_STATIC_CONST_INIT_FLOAT_DECL(1.7976931348623157E+308); > ^ > ~~~~~~~~~~~~~~~~~~~~~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_numeric_traits.h:386:28: > warning: in-class initializer for static data member of type 'const long > double' is a GNU extension [-Wgnu-static-float-init] > static const long double zero VCL_STATIC_CONST_INIT_FLOAT_DECL(0.0); > ^ ~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_numeric_traits.h:388:28: > warning: in-class initializer for static data member of type 'const long > double' is a GNU extension [-Wgnu-static-float-init] > static const long double one VCL_STATIC_CONST_INIT_FLOAT_DECL(1.0); > ^ ~~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Utilities/vxl/core/vnl/vnl_numeric_traits.h:390:28: > warning: in-class initializer for static data member of type 'const long > double' is a GNU extension [-Wgnu-static-float-init] > static const long double maxval > VCL_STATIC_CONST_INIT_FLOAT_DECL(1.7976931348623157E+308); > ^ > ~~~~~~~~~~~~~~~~~~~~~~~ > In file included from > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/IO/itkTestDriver.cxx:33: > In file included from > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkNumericTraits.h:32: > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/complex:939:16: > error: call to 'abs' is ambiguous > return abs(__c.real()); > ^~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/IO/itkDefaultConvertPixelTraits.h:294:1: > note: in instantiation of function template specialization > 'std::__1::norm' requested here > ITK_DEFAULTCONVERTTRAITS_COMPLEX_TYPE(unsigned int); > ^ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/IO/itkDefaultConvertPixelTraits.h:287:17: > note: expanded from macro 'ITK_DEFAULTCONVERTTRAITS_COMPLEX_TYPE' > return std::norm(pixel); \ > ^ > /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/stdlib.h:129:6: > note: candidate function > int abs(int) __pure2; > ^ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib:159:44: > note: candidate function > inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT > {return labs(__x);} > ^ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib:161:44: > note: candidate function > inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT > {return llabs(__x);} > ^ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:660:1: > note: candidate function > abs(float __x) _NOEXCEPT {return fabsf(__x);} > ^ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:664:1: > note: candidate function > abs(double __x) _NOEXCEPT {return fabs(__x);} > ^ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:668:1: > note: candidate function > abs(long double __x) _NOEXCEPT {return fabsl(__x);} > ^ > In file included from > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/IO/itkTestDriver.cxx:33: > In file included from > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkNumericTraits.h:32: > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/complex:941:16: > error: call to 'abs' is ambiguous > return abs(__c.imag()); > ^~~ > /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/stdlib.h:129:6: > note: candidate function > int abs(int) __pure2; > ^ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib:159:44: > note: candidate function > inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT > {return labs(__x);} > ^ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib:161:44: > note: candidate function > inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT > {return llabs(__x);} > ^ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:660:1: > note: candidate function > abs(float __x) _NOEXCEPT {return fabsf(__x);} > ^ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:664:1: > note: candidate function > abs(double __x) _NOEXCEPT {return fabs(__x);} > ^ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:668:1: > note: candidate function > abs(long double __x) _NOEXCEPT {return fabsl(__x);} > ^ > In file included from > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/IO/itkTestDriver.cxx:33: > In file included from > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkNumericTraits.h:32: > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/complex:939:16: > error: call to 'abs' is ambiguous > return abs(__c.real()); > ^~~ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/IO/itkDefaultConvertPixelTraits.h:298:1: > note: in instantiation of function template specialization > 'std::__1::norm' requested here > ITK_DEFAULTCONVERTTRAITS_COMPLEX_TYPE(unsigned long); > ^ > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/IO/itkDefaultConvertPixelTraits.h:287:17: > note: expanded from macro 'ITK_DEFAULTCONVERTTRAITS_COMPLEX_TYPE' > return std::norm(pixel); \ > ^ > /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/stdlib.h:129:6: > note: candidate function > int abs(int) __pure2; > ^ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib:159:44: > note: candidate function > inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT > {return labs(__x);} > ^ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib:161:44: > note: candidate function > inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT > {return llabs(__x);} > ^ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:660:1: > note: candidate function > abs(float __x) _NOEXCEPT {return fabsf(__x);} > ^ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:664:1: > note: candidate function > abs(double __x) _NOEXCEPT {return fabs(__x);} > ^ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:668:1: > note: candidate function > abs(long double __x) _NOEXCEPT {return fabsl(__x);} > ^ > In file included from > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/IO/itkTestDriver.cxx:33: > In file included from > /Users/hemolab/Documents/workspace/libs/InsightToolkit-3.16.0/Code/Common/itkNumericTraits.h:32: > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/complex:941:16: > error: call to 'abs' is ambiguous > return abs(__c.imag()); > ^~~ > /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/stdlib.h:129:6: > note: candidate function > int abs(int) __pure2; > ^ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib:159:44: > note: candidate function > inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT > {return labs(__x);} > ^ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib:161:44: > note: candidate function > inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT > {return llabs(__x);} > ^ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:660:1: > note: candidate function > abs(float __x) _NOEXCEPT {return fabsf(__x);} > ^ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:664:1: > note: candidate function > abs(double __x) _NOEXCEPT {return fabs(__x);} > ^ > /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:668:1: > note: candidate function > abs(long double __x) _NOEXCEPT {return fabsl(__x);} > ^ > 27 warnings and 4 errors generated. > make[2]: *** [Code/IO/CMakeFiles/itkTestDriver.dir/itkTestDriver.o] Error 1 > make[1]: *** [Code/IO/CMakeFiles/itkTestDriver.dir/all] Error 2 > make: *** [all] Error 2 > > Atenciosamente, > > > Eduardo Camargo, M.Sc. > > Analista de Sistemas > Instituto Nacional de Ci?ncia e Tecnologia em > Medicina Assistida por Computa??o Cient?fica > INCT-MACC http://macc.lncc.br > Laborat?rio Nacional de Computa??o Cient?fica > LNCC - http://www.lncc.br > > _____________________________________ > 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 gaetan.lehmann at gmail.com Thu Mar 12 17:49:05 2015 From: gaetan.lehmann at gmail.com (Gaetan Lehmann) Date: Thu, 12 Mar 2015 22:49:05 +0100 Subject: [ITK-users] apply color map to a label map with overlapping label objects? In-Reply-To: References: Message-ID: Hi Arnaud, Converting a label map with overlapping objects to an image usually works quite badly, and itk::LabelMapOverlayImageFilter is no exception. The overlapping zones must be removed first, for example with itk::UniqueLableMapFilter. This may not be what you want though. What would you expect as output for the overlapping objects? Regards, Ga?tan 2015-03-10 10:30 GMT+01:00 Arnaud Gelas : > Hi all, > > I would like to colorize one label map with overlapping label objects. I > know there is itk::LabelMapOverlayImageFilter but would it work on such a > case? (could be wrong, but based on the code it does not seem so) > > Thanks > Arnaud -------------- next part -------------- An HTML attachment was scrubbed... URL: From matimontg at gmail.com Thu Mar 12 19:26:47 2015 From: matimontg at gmail.com (Matias Montroull) Date: Thu, 12 Mar 2015 20:26:47 -0300 Subject: [ITK-users] [ITK] Registration in SimpleITK In-Reply-To: References: Message-ID: Hi Brad, thanks for the explanation. I'm using C#, would that be the same process? On Wed, Mar 11, 2015 at 8:56 PM, Bradley Lowekamp wrote: > Hello, > > If you are willing to compile it yourself you can get it to work with just > a little bit of effort. > > Compile the SimpleITK superbuild with shared libraries enabled. Do the > usual installation of SimpleITK from the super build [1], this will install > the SimpleITK python library into your site-packages. However, this > libraries also depends on all the SimpleITK an ITK dlls (not installed or > packaged), these should be in the superbuild's bin directory. These need to > be in your run-time path when importing SimpleITK. This can be done either > by modifying you PATH environment variable you copying them to the > appropriate place ( which may depend on the python environment, and there > are likely several alternatives). > > Brad > > [1] http://www.itk.org/Wiki/SimpleITK/GettingStarted#Python_installation > > On Mar 11, 2015, at 7:31 PM, Matias Montroull wrote: > > > My project is using 64 bits and some DLL I use as well, I've ran into > issues when using the beta version because is 32 bits. I guess I'll wait > until the final release is done. > Thanks, > Matias. > > On Wed, Mar 11, 2015 at 7:54 PM, Matias Montroull > wrote: > >> Thanks Bradley, I'll give it a try. I downloaded version 0.8.1 but wasn't >> aware of this new Beta release >> Thanks, >> Matias. >> >> On Wed, Mar 11, 2015 at 7:46 PM, Bradley Lowekamp > > wrote: >> >>> Hello Matias, >>> >>> Currently there is SimpleITK 0.9b01 [1] out with the registration >>> framework. >>> >>> With it you can do things like this: >>> >>> http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/56_VH_Registration1.html >>> or >>> >>> http://www.itk.org/SimpleITKDoxygen/html/ImageRegistrationMethod2_8py-example.html >>> >>> Please give it a try and let us know how it work for you. >>> >>> Enjoy, >>> Brad >>> >>> [1] >>> http://www.itk.org/Wiki/SimpleITK/ReleaseNotes#SimpleITK_-_Version_0.9.0_Release >>> >>> On Mar 11, 2015, at 6:32 PM, Matias Montroull >>> wrote: >>> >>> Hi, >>> >>> is it possible to do registration in SimpleITK? I mean, something like >>> in this example: >>> >>> http://public.kitware.com/cgi-bin/viewcvs.cgi/Insight/Examples/Registration/ImageRegistration2.cxx?view=markup >>> >>> Thanks, >>> >>> Matias, >>> _____________________________________ >>> 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 Thu Mar 12 20:50:30 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Thu, 12 Mar 2015 20:50:30 -0400 Subject: [ITK-users] [ITK] Registration in SimpleITK In-Reply-To: References: Message-ID: Hello, Yes, it is more or less the same process. Grab all the ITK and SimpleITK dlls from the bin directories and place them in your path. The SimpleITK Superbuild INSTALL target will actually install ITK and SimpleITK's core libraries correctly in to the CMake specified path. The installation target for the superbuild project just doesn't install the target languages ( every language has at least one own way of doing things that CMake does not know about ). You could use this to install all the needed dlls into a defined path. Then just grab the CSharp dll for your project and that should work too. Also I worked on the explicit instantiation in SimpleITK today. I was able to reduce the size of the .o files on Linux by 30% by explicitly instantiating about 20 classes with their used templates. This is expected to resolve the linking and packaging issues on windows. So a solution is forth coming. Brad On Mar 12, 2015, at 7:26 PM, Matias Montroull wrote: > Hi Brad, thanks for the explanation. I'm using C#, would that be the same process? > > On Wed, Mar 11, 2015 at 8:56 PM, Bradley Lowekamp wrote: > Hello, > > If you are willing to compile it yourself you can get it to work with just a little bit of effort. > > Compile the SimpleITK superbuild with shared libraries enabled. Do the usual installation of SimpleITK from the super build [1], this will install the SimpleITK python library into your site-packages. However, this libraries also depends on all the SimpleITK an ITK dlls (not installed or packaged), these should be in the superbuild's bin directory. These need to be in your run-time path when importing SimpleITK. This can be done either by modifying you PATH environment variable you copying them to the appropriate place ( which may depend on the python environment, and there are likely several alternatives). > > Brad > > [1] http://www.itk.org/Wiki/SimpleITK/GettingStarted#Python_installation > > On Mar 11, 2015, at 7:31 PM, Matias Montroull wrote: > >> >> My project is using 64 bits and some DLL I use as well, I've ran into issues when using the beta version because is 32 bits. I guess I'll wait until the final release is done. >> Thanks, >> Matias. >> >> On Wed, Mar 11, 2015 at 7:54 PM, Matias Montroull wrote: >> Thanks Bradley, I'll give it a try. I downloaded version 0.8.1 but wasn't aware of this new Beta release >> Thanks, >> Matias. >> >> On Wed, Mar 11, 2015 at 7:46 PM, Bradley Lowekamp wrote: >> Hello Matias, >> >> Currently there is SimpleITK 0.9b01 [1] out with the registration framework. >> >> With it you can do things like this: >> http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/56_VH_Registration1.html >> or >> http://www.itk.org/SimpleITKDoxygen/html/ImageRegistrationMethod2_8py-example.html >> >> Please give it a try and let us know how it work for you. >> >> Enjoy, >> Brad >> >> [1] http://www.itk.org/Wiki/SimpleITK/ReleaseNotes#SimpleITK_-_Version_0.9.0_Release >> >> On Mar 11, 2015, at 6:32 PM, Matias Montroull wrote: >> >>> Hi, >>> >>> is it possible to do registration in SimpleITK? I mean, something like in this example: >>> http://public.kitware.com/cgi-bin/viewcvs.cgi/Insight/Examples/Registration/ImageRegistration2.cxx?view=markup >>> >>> Thanks, >>> >>> Matias, >>> _____________________________________ >>> 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 lassi.paavolainen at jyu.fi Fri Mar 13 07:42:54 2015 From: lassi.paavolainen at jyu.fi (Paavolainen, Lassi) Date: Fri, 13 Mar 2015 11:42:54 +0000 Subject: [ITK-users] Memory leak in Python wrapped Image GetPixel method? In-Reply-To: References: , , Message-ID: In case it makes any difference, I can see the same issue with freshly installed another computer. Though both have pretty much the same environment (updated Ubuntu 14.04, Python 2.7.6). The freshly installed machine is using ITK 4.7.1, but as said I can see the same problem with ITK 4.6 and 3.20. Would be nice to hear if anyone with similar setup is able to reproduce the issue. Lassi ________________________________________ From: Insight-users [insight-users-bounces at itk.org] on behalf of Paavolainen, Lassi [lassi.paavolainen at jyu.fi] Sent: Monday, March 09, 2015 21:59 To: Matt McCormick Cc: insight-users at itk.org Subject: Re: [ITK-users] Memory leak in Python wrapped Image GetPixel method? Hi Matt, Seems its an issue with local environment. Here is also for the list what I replied to Gaetan: "This is interesting. I'm using ITK 4.6.1 with swig that comes with it. I now tested with 3.20 that has been built long time ago with swig 1.9 (if I remember correctly). The same thing. So the conclusion is that it must be something local as I'm sure I've done something similar over the years many times. Next is to try to find out what on my environment causes this." To add to that, I ran 30 iterations using valgrind. Here is the report: ==8603== HEAP SUMMARY: ==8603== in use at exit: 478,066,856 bytes in 483,719 blocks ==8603== total heap usage: 657,312 allocs, 173,593 frees, 787,087,705 bytes allocated ==8603== ==8603== LEAK SUMMARY: ==8603== definitely lost: 0 bytes in 0 blocks ==8603== indirectly lost: 0 bytes in 0 blocks ==8603== possibly lost: 20,224 bytes in 34 blocks ==8603== still reachable: 478,046,632 bytes in 483,685 blocks ==8603== suppressed: 0 bytes in 0 blocks So almost 500 MB is in heap but still reachable when the program exits. Lassi ________________________________________ From: Matt McCormick [matt.mccormick at kitware.com] Sent: Monday, March 09, 2015 20:22 To: Paavolainen, Lassi Cc: insight-users at itk.org; Ga?tan Lehmann; Michka Popoff Subject: Re: [ITK-users] Memory leak in Python wrapped Image GetPixel method? Hi Lassi, Thanks for investigating and reporting the issue! I have created an issue in the Issue Tracker to keep track of it: https://issues.itk.org/jira/browse/ITK-3352 Matt On Mon, Mar 9, 2015 at 6:11 AM, Paavolainen, Lassi wrote: > Hi, > > I noticed that GetPixel method in itk.Image object eats memory in Python wrapped code. I think I've seen some Python wrapping memory issues years ago but nothing as simple as this. Here is a simple test script: > import sys > import itk > reader = itk.ImageFileReader.IUC2.New() > reader.SetFileName(sys.argv[1]) > reader.Update() > img = reader.GetOutput() > size = img.GetLargestPossibleRegion().GetSize() > for i in range(100): > for x in range(size[0]): > for y in range(size[1]): > value = img.GetPixel((x,y)) > print "Done with iteration %d"%(i+1) > > When I run it with 1 MB image, it end up taking 1.5 GB of memory. After spending lots of time on debugging a bigger bunch of code I realized that the GetPixel method was to blame. Can anyone reproduce it? I'm using ITK 4.6.1 > > Cheers, > Lassi > _____________________________________ > 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 From lluna.nova at gmail.com Mon Mar 16 07:37:23 2015 From: lluna.nova at gmail.com (=?UTF-8?B?UG9sIE1vbnPDsyBQdXJ0w60=?=) Date: Mon, 16 Mar 2015 12:37:23 +0100 Subject: [ITK-users] Splitting and repasting a volume with overlap Message-ID: Hello everyone, We need to split a volume into pieces, overlaped by a certain amount, do some computation and then repaste them. The computation requires the pieces' region indexes to be set to zero. The original volume might not have index at zero, but be a subregion itself. What is the best way to achieve this? I've thought of the following pipeline: 1. imageRegionSplitterSlowDimension 2. Store the index and size of each region 3. manually increase the size of each region (and modify index) 4. crop with the largestPossibleRegion of the original volume (to prevent requesting more than available) iterate over regions: 5. extractImageFilter 6. disconnect pipeline for each region 7. reset indexes 8. perform computation 9. crop with the regions in step 1 to remove the added overlap 10. restore indexes 11. pasteImageFilter I'll have to think of a smart way to deal with the index restore/cropping of steps 9 and 10. I somehow feel somebody will have already dealt with this... And there's certainly a better way to do it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ds_prakash at rediffmail.com Mon Mar 16 08:48:44 2015 From: ds_prakash at rediffmail.com (Surya Prakash) Date: 16 Mar 2015 12:48:44 -0000 Subject: [ITK-users] =?utf-8?q?big_image?= Message-ID: <20150316124844.23818.qmail@f4mail-235-154.rediffmail.com> hello, I have very large, 50k x 50k images assume. How I can read part of an image. Thanks & regards Prakash -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Mon Mar 16 09:00:00 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Mon, 16 Mar 2015 09:00:00 -0400 Subject: [ITK-users] Splitting and repasting a volume with overlap In-Reply-To: References: Message-ID: <0B31CB6B-D4D0-48B1-A019-775E1E09E686@mail.nih.gov> Hello, The RegionOfInterestImageFilter[1] is very similar to the ExtractImageFilter, but returns an image whose starting index is always zeros. The process you described is remarkable close to what occur in each filter for the multi-threading process. Also what occurs in the StreamingImageFilter is very similar, but just copies the region. As you didn't mention you motivation for chunking the data this way be it for threading or memory requirements, I can't fully advise. Brad [1 ]http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html [2] https://github.com/InsightSoftwareConsortium/ITK/blob/b184194869ac6407fcbb4e309710894cfc84466f/Modules/Core/Common/include/itkStreamingImageFilter.hxx#L194-L213 On Mar 16, 2015, at 7:37 AM, Pol Mons? Purt? wrote: > Hello everyone, > > We need to split a volume into pieces, overlaped by a certain amount, do some computation and then repaste them. > > The computation requires the pieces' region indexes to be set to zero. The original volume might not have index at zero, but be a subregion itself. > > What is the best way to achieve this? > > I've thought of the following pipeline: > > 1. imageRegionSplitterSlowDimension > 2. Store the index and size of each region > 3. manually increase the size of each region (and modify index) > 4. crop with the largestPossibleRegion of the original volume (to prevent requesting more than available) > iterate over regions: > 5. extractImageFilter > 6. disconnect pipeline for each region > 7. reset indexes > 8. perform computation > 9. crop with the regions in step 1 to remove the added overlap > 10. restore indexes > 11. pasteImageFilter > > I'll have to think of a smart way to deal with the index restore/cropping of steps 9 and 10. > > I somehow feel somebody will have already dealt with this... And there's certainly a better way to do it. > _____________________________________ > 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 Mon Mar 16 09:05:02 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Mon, 16 Mar 2015 09:05:02 -0400 Subject: [ITK-users] big image In-Reply-To: <20150316124844.23818.qmail@f4mail-235-154.rediffmail.com> References: <20150316124844.23818.qmail@f4mail-235-154.rediffmail.com> Message-ID: <26A3491B-B64F-43E8-9708-A366E27549D8@mail.nih.gov> Hello Surya, What file format do you have? You may find this article helpful: http://www.kitware.com/media/html/IOStreamingInITK.htm The currently support formats for streaming io input include HDF5, JPEG2000, MRC, SCIFIO, VTK, NIFTI and MetaIO. I myself have personally extensively used MetaImageIO, and MRC, and a little VTK. Brad On Mar 16, 2015, at 8:48 AM, Surya Prakash wrote: > hello, > I have very large, 50k x 50k images assume. How I can read part of an image. > > Thanks & regards > Prakash > > Get your own FREE website, FREE domain & FREE mobile app with Company email. > Know More > > _____________________________________ > 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 lluna.nova at gmail.com Mon Mar 16 09:25:49 2015 From: lluna.nova at gmail.com (=?UTF-8?B?UG9sIE1vbnPDsyBQdXJ0w60=?=) Date: Mon, 16 Mar 2015 14:25:49 +0100 Subject: [ITK-users] Splitting and repasting a volume with overlap In-Reply-To: <0B31CB6B-D4D0-48B1-A019-775E1E09E686@mail.nih.gov> References: <0B31CB6B-D4D0-48B1-A019-775E1E09E686@mail.nih.gov> Message-ID: Hello Bradley, Thank you for your answer and suggestion. Answering your question: It's not for multi-threading purposes, I have to split the image due to memory limitations. I would use extractImage directly and do streaming, but the client and the low-level libraries might not work correctly if I do that. I have to provide itk images disconnected from the pipeline and with proper indexes and sizes. The RegionOfInterestImageFilter would have the same memory footprint, and it would still be tricky to compute the regions of interest, due to the overlapping. 2015-03-16 14:00 GMT+01:00 Bradley Lowekamp : > Hello, > > The RegionOfInterestImageFilter[1] is very similar to the > ExtractImageFilter, but returns an image whose starting index is always > zeros. > > The process you described is remarkable close to what occur in each filter > for the multi-threading process. Also what occurs in the > StreamingImageFilter is very similar, but just copies the region. > > As you didn't mention you motivation for chunking the data this way be it > for threading or memory requirements, I can't fully advise. > > Brad > > > [1 ] > http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html > [2] > https://github.com/InsightSoftwareConsortium/ITK/blob/b184194869ac6407fcbb4e309710894cfc84466f/Modules/Core/Common/include/itkStreamingImageFilter.hxx#L194-L213 > > > On Mar 16, 2015, at 7:37 AM, Pol Mons? Purt? wrote: > > > Hello everyone, > > > > We need to split a volume into pieces, overlaped by a certain amount, do > some computation and then repaste them. > > > > The computation requires the pieces' region indexes to be set to zero. > The original volume might not have index at zero, but be a subregion itself. > > > > What is the best way to achieve this? > > > > I've thought of the following pipeline: > > > > 1. imageRegionSplitterSlowDimension > > 2. Store the index and size of each region > > 3. manually increase the size of each region (and modify index) > > 4. crop with the largestPossibleRegion of the original volume (to > prevent requesting more than available) > > iterate over regions: > > 5. extractImageFilter > > 6. disconnect pipeline for each region > > 7. reset indexes > > 8. perform computation > > 9. crop with the regions in step 1 to remove the added overlap > > 10. restore indexes > > 11. pasteImageFilter > > > > I'll have to think of a smart way to deal with the index > restore/cropping of steps 9 and 10. > > > > I somehow feel somebody will have already dealt with this... And there's > certainly a better way to do it. > > _____________________________________ > > 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 > > 2015-03-16 14:00 GMT+01:00 Bradley Lowekamp : > Hello, > > The RegionOfInterestImageFilter[1] is very similar to the > ExtractImageFilter, but returns an image whose starting index is always > zeros. > > The process you described is remarkable close to what occur in each filter > for the multi-threading process. Also what occurs in the > StreamingImageFilter is very similar, but just copies the region. > > As you didn't mention you motivation for chunking the data this way be it > for threading or memory requirements, I can't fully advise. > > Brad > > > [1 ] > http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html > [2] > https://github.com/InsightSoftwareConsortium/ITK/blob/b184194869ac6407fcbb4e309710894cfc84466f/Modules/Core/Common/include/itkStreamingImageFilter.hxx#L194-L213 > > > On Mar 16, 2015, at 7:37 AM, Pol Mons? Purt? wrote: > > > Hello everyone, > > > > We need to split a volume into pieces, overlaped by a certain amount, do > some computation and then repaste them. > > > > The computation requires the pieces' region indexes to be set to zero. > The original volume might not have index at zero, but be a subregion itself. > > > > What is the best way to achieve this? > > > > I've thought of the following pipeline: > > > > 1. imageRegionSplitterSlowDimension > > 2. Store the index and size of each region > > 3. manually increase the size of each region (and modify index) > > 4. crop with the largestPossibleRegion of the original volume (to > prevent requesting more than available) > > iterate over regions: > > 5. extractImageFilter > > 6. disconnect pipeline for each region > > 7. reset indexes > > 8. perform computation > > 9. crop with the regions in step 1 to remove the added overlap > > 10. restore indexes > > 11. pasteImageFilter > > > > I'll have to think of a smart way to deal with the index > restore/cropping of steps 9 and 10. > > > > I somehow feel somebody will have already dealt with this... And there's > certainly a better way to do it. > > _____________________________________ > > 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 Gordian.Kabelitz at medma.uni-heidelberg.de Mon Mar 16 08:59:23 2015 From: Gordian.Kabelitz at medma.uni-heidelberg.de (Kabelitz, Gordian) Date: Mon, 16 Mar 2015 13:59:23 +0100 Subject: [ITK-users] Examples for ITK-based 2D/3D registration Message-ID: <5E843F0B86B47846B72559B57A54F96217BE836658@MBX02.ad.uni-heidelberg.de> Hello, I am interested in 2D/3D medical image registration using ITK. Currently I am looking for some good examples for a 2D/3D registration based on CT and conventional x-ray images. Is there a recommended tutorial or framework in addition to ITK? I am familiar with the registration examples from [1]. IMHO these are not useful for my topic. I am interested in all the possibilities for optimizing the registration process the ITK can provide. I would appreciate it if someone can give me a hint. I already checked the documentation center for ITK [3]. Bonus question: Is the extended ITK-based Framework for Intensity-based 2D/3D-Registration [2] from 2009 included in the ITK? Thanks in advance. Regards, Gordian Kabelitz [1]: http://www.itk.org/Doxygen47/html/examples.html [2]: https://ibia.umit.at/ResearchGroup/Phil/web/Simple2D3DRegistrationFramework.html [3]: www.itk.org/Wiki/ITK/Documentation -------------- next part -------------- An HTML attachment was scrubbed... URL: From ds_prakash at rediffmail.com Mon Mar 16 08:38:14 2015 From: ds_prakash at rediffmail.com (Surya Prakash) Date: 16 Mar 2015 12:38:14 -0000 Subject: [ITK-users] =?utf-8?q?connected_threshold?= Message-ID: <20150316123814.27479.qmail@f4mail-235-189.rediffmail.com> Hello, I am making an interactive region growing application using connectedThreshold. Seed point etc I want to collect interactively. After collecting the inputs, I will execute something like this. smoothing->SetInput( reader->GetOutput() ); connectedThreshold->SetInput( smoothing->GetOutput() ); As it is not possible to read big images, I will read portion of the data and give it to 'smoothing', by passing the 'Reader'. Please help me with some sample. I am using the 'ConnectedThresholdImageFilter sample. Thanks & regards Prakash -------------- next part -------------- An HTML attachment was scrubbed... URL: From ds_prakash at rediffmail.com Mon Mar 16 15:23:45 2015 From: ds_prakash at rediffmail.com (ds_prakash) Date: 16 Mar 2015 19:23:45 -0000 Subject: [ITK-users] =?utf-8?q?multiple_seeds?= Message-ID: <20150316192345.1345.qmail@f4mail-235-145.rediffmail.com> hello ALL, Is it possible to give multiple seed pixels to ConnectedThresholdImageFilter? I also want the output of regions grown corresponding to all seeds in a single output file. Thanks Prakash -------------- next part -------------- An HTML attachment was scrubbed... URL: From scapegoat.sarthak at gmail.com Mon Mar 16 10:15:03 2015 From: scapegoat.sarthak at gmail.com (Scapegoat Sarthak) Date: Mon, 16 Mar 2015 10:15:03 -0400 Subject: [ITK-users] Error while reading Unknown Image Information Message-ID: Hi All, I am trying to read information from different images using the Unknown Image Type Example (http://itk.org/Wiki/ITK/Examples/IO/ReadUnknownImageType) but I am getting an Access violation error. The three main lines of code (which compile without issues) I am using are: itk::ImageIOBase::Pointer imageIO = itk::ImageIOFactory::CreateImageIO(argv[3], itk::ImageIOFactory::ReadMode ); imageIO->SetFileName(std::string(argv[3])); imageIO->ReadImageInformation(); I am getting the error in the second line. I am using CMake to generate project files as described in the example so the include directories and libraries are all taken care of. I tried to read different files (.nii, .dcm, .png, .jpg) but all of them give the same error. Any suggestions regarding what I am doing wrong? Thanks in advance, Sarthak -------------- next part -------------- An HTML attachment was scrubbed... URL: From lluna.nova at gmail.com Mon Mar 16 10:16:05 2015 From: lluna.nova at gmail.com (=?UTF-8?B?UG9sIE1vbnPDsyBQdXJ0w60=?=) Date: Mon, 16 Mar 2015 15:16:05 +0100 Subject: [ITK-users] Splitting and repasting a volume with overlap In-Reply-To: References: <0B31CB6B-D4D0-48B1-A019-775E1E09E686@mail.nih.gov> Message-ID: Mmh, I believe I misread the RegionOfInterestImageFilter documentation, confusing dimension with size. That should work. I still have the computation of the splitting regions problem to handle, but maybe with this filter is easier than with the ExtractImageFilter. Or maybe it just removes step 7? Is there a way to ease the repasting back to the original region with it? How should I use the physical space index? 2015-03-16 14:25 GMT+01:00 Pol Mons? Purt? : > Hello Bradley, > > Thank you for your answer and suggestion. > > Answering your question: It's not for multi-threading purposes, I have to > split the image due to memory limitations. > > I would use extractImage directly and do streaming, but the client and the > low-level libraries might not work correctly if I do that. I have to > provide itk images disconnected from the pipeline and with proper indexes > and sizes. > > The RegionOfInterestImageFilter would have the same memory footprint, and > it would still be tricky to compute the regions of interest, due to the > overlapping. > > > > 2015-03-16 14:00 GMT+01:00 Bradley Lowekamp : > >> Hello, >> >> The RegionOfInterestImageFilter[1] is very similar to the >> ExtractImageFilter, but returns an image whose starting index is always >> zeros. >> >> The process you described is remarkable close to what occur in each >> filter for the multi-threading process. Also what occurs in the >> StreamingImageFilter is very similar, but just copies the region. >> >> As you didn't mention you motivation for chunking the data this way be it >> for threading or memory requirements, I can't fully advise. >> >> Brad >> >> >> [1 ] >> http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html >> [2] >> https://github.com/InsightSoftwareConsortium/ITK/blob/b184194869ac6407fcbb4e309710894cfc84466f/Modules/Core/Common/include/itkStreamingImageFilter.hxx#L194-L213 >> >> >> On Mar 16, 2015, at 7:37 AM, Pol Mons? Purt? >> wrote: >> >> > Hello everyone, >> > >> > We need to split a volume into pieces, overlaped by a certain amount, >> do some computation and then repaste them. >> > >> > The computation requires the pieces' region indexes to be set to zero. >> The original volume might not have index at zero, but be a subregion itself. >> > >> > What is the best way to achieve this? >> > >> > I've thought of the following pipeline: >> > >> > 1. imageRegionSplitterSlowDimension >> > 2. Store the index and size of each region >> > 3. manually increase the size of each region (and modify index) >> > 4. crop with the largestPossibleRegion of the original volume (to >> prevent requesting more than available) >> > iterate over regions: >> > 5. extractImageFilter >> > 6. disconnect pipeline for each region >> > 7. reset indexes >> > 8. perform computation >> > 9. crop with the regions in step 1 to remove the added overlap >> > 10. restore indexes >> > 11. pasteImageFilter >> > >> > I'll have to think of a smart way to deal with the index >> restore/cropping of steps 9 and 10. >> > >> > I somehow feel somebody will have already dealt with this... And >> there's certainly a better way to do it. >> > _____________________________________ >> > 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 >> >> > > 2015-03-16 14:00 GMT+01:00 Bradley Lowekamp : > >> Hello, >> >> The RegionOfInterestImageFilter[1] is very similar to the >> ExtractImageFilter, but returns an image whose starting index is always >> zeros. >> >> The process you described is remarkable close to what occur in each >> filter for the multi-threading process. Also what occurs in the >> StreamingImageFilter is very similar, but just copies the region. >> >> As you didn't mention you motivation for chunking the data this way be it >> for threading or memory requirements, I can't fully advise. >> >> Brad >> >> >> [1 ] >> http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html >> [2] >> https://github.com/InsightSoftwareConsortium/ITK/blob/b184194869ac6407fcbb4e309710894cfc84466f/Modules/Core/Common/include/itkStreamingImageFilter.hxx#L194-L213 >> >> >> On Mar 16, 2015, at 7:37 AM, Pol Mons? Purt? >> wrote: >> >> > Hello everyone, >> > >> > We need to split a volume into pieces, overlaped by a certain amount, >> do some computation and then repaste them. >> > >> > The computation requires the pieces' region indexes to be set to zero. >> The original volume might not have index at zero, but be a subregion itself. >> > >> > What is the best way to achieve this? >> > >> > I've thought of the following pipeline: >> > >> > 1. imageRegionSplitterSlowDimension >> > 2. Store the index and size of each region >> > 3. manually increase the size of each region (and modify index) >> > 4. crop with the largestPossibleRegion of the original volume (to >> prevent requesting more than available) >> > iterate over regions: >> > 5. extractImageFilter >> > 6. disconnect pipeline for each region >> > 7. reset indexes >> > 8. perform computation >> > 9. crop with the regions in step 1 to remove the added overlap >> > 10. restore indexes >> > 11. pasteImageFilter >> > >> > I'll have to think of a smart way to deal with the index >> restore/cropping of steps 9 and 10. >> > >> > I somehow feel somebody will have already dealt with this... And >> there's certainly a better way to do it. >> > _____________________________________ >> > 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 Mon Mar 16 10:20:24 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Mon, 16 Mar 2015 10:20:24 -0400 Subject: [ITK-users] Splitting and repasting a volume with overlap In-Reply-To: References: <0B31CB6B-D4D0-48B1-A019-775E1E09E686@mail.nih.gov> Message-ID: You may find this method useful: http://www.itk.org/Doxygen/html/structitk_1_1ImageAlgorithm.html#a5ec5bcac992cb3b1302840636530ba20 Brad On Mar 16, 2015, at 10:16 AM, Pol Mons? Purt? wrote: > Mmh, I believe I misread the RegionOfInterestImageFilter documentation, confusing dimension with size. That should work. > > I still have the computation of the splitting regions problem to handle, but maybe with this filter is easier than with the ExtractImageFilter. Or maybe it just removes step 7? > > Is there a way to ease the repasting back to the original region with it? How should I use the physical space index? > > 2015-03-16 14:25 GMT+01:00 Pol Mons? Purt? : > Hello Bradley, > > Thank you for your answer and suggestion. > > Answering your question: It's not for multi-threading purposes, I have to split the image due to memory limitations. > > I would use extractImage directly and do streaming, but the client and the low-level libraries might not work correctly if I do that. I have to provide itk images disconnected from the pipeline and with proper indexes and sizes. > > The RegionOfInterestImageFilter would have the same memory footprint, and it would still be tricky to compute the regions of interest, due to the overlapping. > > > > 2015-03-16 14:00 GMT+01:00 Bradley Lowekamp : > Hello, > > The RegionOfInterestImageFilter[1] is very similar to the ExtractImageFilter, but returns an image whose starting index is always zeros. > > The process you described is remarkable close to what occur in each filter for the multi-threading process. Also what occurs in the StreamingImageFilter is very similar, but just copies the region. > > As you didn't mention you motivation for chunking the data this way be it for threading or memory requirements, I can't fully advise. > > Brad > > > [1 ]http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html > [2] https://github.com/InsightSoftwareConsortium/ITK/blob/b184194869ac6407fcbb4e309710894cfc84466f/Modules/Core/Common/include/itkStreamingImageFilter.hxx#L194-L213 > > > On Mar 16, 2015, at 7:37 AM, Pol Mons? Purt? wrote: > > > Hello everyone, > > > > We need to split a volume into pieces, overlaped by a certain amount, do some computation and then repaste them. > > > > The computation requires the pieces' region indexes to be set to zero. The original volume might not have index at zero, but be a subregion itself. > > > > What is the best way to achieve this? > > > > I've thought of the following pipeline: > > > > 1. imageRegionSplitterSlowDimension > > 2. Store the index and size of each region > > 3. manually increase the size of each region (and modify index) > > 4. crop with the largestPossibleRegion of the original volume (to prevent requesting more than available) > > iterate over regions: > > 5. extractImageFilter > > 6. disconnect pipeline for each region > > 7. reset indexes > > 8. perform computation > > 9. crop with the regions in step 1 to remove the added overlap > > 10. restore indexes > > 11. pasteImageFilter > > > > I'll have to think of a smart way to deal with the index restore/cropping of steps 9 and 10. > > > > I somehow feel somebody will have already dealt with this... And there's certainly a better way to do it. > > _____________________________________ > > 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 > > > > 2015-03-16 14:00 GMT+01:00 Bradley Lowekamp : > Hello, > > The RegionOfInterestImageFilter[1] is very similar to the ExtractImageFilter, but returns an image whose starting index is always zeros. > > The process you described is remarkable close to what occur in each filter for the multi-threading process. Also what occurs in the StreamingImageFilter is very similar, but just copies the region. > > As you didn't mention you motivation for chunking the data this way be it for threading or memory requirements, I can't fully advise. > > Brad > > > [1 ]http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html > [2] https://github.com/InsightSoftwareConsortium/ITK/blob/b184194869ac6407fcbb4e309710894cfc84466f/Modules/Core/Common/include/itkStreamingImageFilter.hxx#L194-L213 > > > On Mar 16, 2015, at 7:37 AM, Pol Mons? Purt? wrote: > > > Hello everyone, > > > > We need to split a volume into pieces, overlaped by a certain amount, do some computation and then repaste them. > > > > The computation requires the pieces' region indexes to be set to zero. The original volume might not have index at zero, but be a subregion itself. > > > > What is the best way to achieve this? > > > > I've thought of the following pipeline: > > > > 1. imageRegionSplitterSlowDimension > > 2. Store the index and size of each region > > 3. manually increase the size of each region (and modify index) > > 4. crop with the largestPossibleRegion of the original volume (to prevent requesting more than available) > > iterate over regions: > > 5. extractImageFilter > > 6. disconnect pipeline for each region > > 7. reset indexes > > 8. perform computation > > 9. crop with the regions in step 1 to remove the added overlap > > 10. restore indexes > > 11. pasteImageFilter > > > > I'll have to think of a smart way to deal with the index restore/cropping of steps 9 and 10. > > > > I somehow feel somebody will have already dealt with this... And there's certainly a better way to do it. > > _____________________________________ > > 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 matt.mccormick at kitware.com Mon Mar 16 10:46:00 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 16 Mar 2015 10:46:00 -0400 Subject: [ITK-users] Examples for ITK-based 2D/3D registration In-Reply-To: <5E843F0B86B47846B72559B57A54F96217BE836658@MBX02.ad.uni-heidelberg.de> References: <5E843F0B86B47846B72559B57A54F96217BE836658@MBX02.ad.uni-heidelberg.de> Message-ID: Hi Gordian, Hopefully you came across this example that uses the RayCastInterpolateImageFunction [1]. Regarding the reference from 2009, to the best of my knowledge it has not been integrated into the toolkit. To help that process along, first find its associated article in the Insight Journal [2]. Next, organize the code into an ITKv4 External module. Finally, submit it as a Remote Module [4]. Of course, adding documentation along the way will help others in your situation. Thanks, Matt [1] http://www.itk.org/Doxygen/html/Examples_2Filtering_2DigitallyReconstructedRadiograph1_8cxx-example.html [2] http://insight-journal.org [3] http://www.kitware.com/blog/home/post/557 [4] http://www.itk.org/Wiki/ITK/Policy_and_Procedures_for_Adding_Remote_Modules On Mon, Mar 16, 2015 at 8:59 AM, Kabelitz, Gordian wrote: > Hello, > > I am interested in 2D/3D medical image registration using ITK. Currently I > am looking for some good examples for a 2D/3D registration based on CT and > conventional x-ray images. > Is there a recommended tutorial or framework in addition to ITK? I am > familiar with the registration examples from [1]. IMHO these are not useful > for my topic. I am interested in all the possibilities for optimizing the > registration process the ITK can provide. > I would appreciate it if someone can give me a hint. I already checked the > documentation center for ITK [3]. > > Bonus question: > Is the extended ITK-based Framework for Intensity-based 2D/3D-Registration > [2] from 2009 included in the ITK? > > Thanks in advance. > > Regards, > Gordian Kabelitz > > [1]: http://www.itk.org/Doxygen47/html/examples.html > [2]: > https://ibia.umit.at/ResearchGroup/Phil/web/Simple2D3DRegistrationFramework.html > [3]: www.itk.org/Wiki/ITK/Documentation > > > > > > _____________________________________ > 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 Mar 16 10:50:09 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 16 Mar 2015 10:50:09 -0400 Subject: [ITK-users] Error while reading Unknown Image Information In-Reply-To: References: Message-ID: Hi Sarthak, You may also find this example [1] informative. To investigate the access violation error, use try{}catch{} statements as found in the examples (use it around your imageIO->ReadImageInformation; statement). Also, run the code in a debugger. Hope this helps, Matt [1] http://itk.org/ITKExamples/src/IO/ImageBase/ReadUnknownImageType/Documentation.html?highlight=read On Mon, Mar 16, 2015 at 10:15 AM, Scapegoat Sarthak wrote: > Hi All, > > I am trying to read information from different images using the Unknown > Image Type Example > (http://itk.org/Wiki/ITK/Examples/IO/ReadUnknownImageType) but I am getting > an Access violation error. The three main lines of code (which compile > without issues) I am using are: > > itk::ImageIOBase::Pointer imageIO = > itk::ImageIOFactory::CreateImageIO(argv[3], itk::ImageIOFactory::ReadMode ); > imageIO->SetFileName(std::string(argv[3])); > imageIO->ReadImageInformation(); > > I am getting the error in the second line. I am using CMake to generate > project files as described in the example so the include directories and > libraries are all taken care of. I tried to read different files (.nii, > .dcm, .png, .jpg) but all of them give the same error. > > Any suggestions regarding what I am doing wrong? > > Thanks in advance, > Sarthak > > _____________________________________ > 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 Mar 16 11:05:30 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 16 Mar 2015 11:05:30 -0400 Subject: [ITK-users] Splitting and repasting a volume with overlap In-Reply-To: References: <0B31CB6B-D4D0-48B1-A019-775E1E09E686@mail.nih.gov> Message-ID: Hi Pol, As a side note, limitation of memory usage is built into the streaming pipeline design of ITK. All computation of appropriate regions should occur if the filters are implemented correctly. To take advantage of streaming, place the StreamingImageFilter [1] at the end of your pipeline. To use less memory, set the ReleaseDataFlagOn() [2] on the component filters. HTH, Matt [1] http://www.itk.org/Doxygen/html/classitk_1_1StreamingImageFilter.html [2] http://www.itk.org/Doxygen/html/classitk_1_1ProcessObject.html#ae732e9163879ae559ccd0b5957141f97 On Mon, Mar 16, 2015 at 10:20 AM, Bradley Lowekamp wrote: > You may find this method useful: > > http://www.itk.org/Doxygen/html/structitk_1_1ImageAlgorithm.html#a5ec5bcac992cb3b1302840636530ba20 > > Brad > > On Mar 16, 2015, at 10:16 AM, Pol Mons? Purt? wrote: > > Mmh, I believe I misread the RegionOfInterestImageFilter documentation, > confusing dimension with size. That should work. > > I still have the computation of the splitting regions problem to handle, but > maybe with this filter is easier than with the ExtractImageFilter. Or maybe > it just removes step 7? > > Is there a way to ease the repasting back to the original region with it? > How should I use the physical space index? > > 2015-03-16 14:25 GMT+01:00 Pol Mons? Purt? : >> >> Hello Bradley, >> >> Thank you for your answer and suggestion. >> >> Answering your question: It's not for multi-threading purposes, I have to >> split the image due to memory limitations. >> >> I would use extractImage directly and do streaming, but the client and the >> low-level libraries might not work correctly if I do that. I have to provide >> itk images disconnected from the pipeline and with proper indexes and sizes. >> >> The RegionOfInterestImageFilter would have the same memory footprint, and >> it would still be tricky to compute the regions of interest, due to the >> overlapping. >> >> >> >> 2015-03-16 14:00 GMT+01:00 Bradley Lowekamp : >>> >>> Hello, >>> >>> The RegionOfInterestImageFilter[1] is very similar to the >>> ExtractImageFilter, but returns an image whose starting index is always >>> zeros. >>> >>> The process you described is remarkable close to what occur in each >>> filter for the multi-threading process. Also what occurs in the >>> StreamingImageFilter is very similar, but just copies the region. >>> >>> As you didn't mention you motivation for chunking the data this way be it >>> for threading or memory requirements, I can't fully advise. >>> >>> Brad >>> >>> >>> [1 >>> ]http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html >>> [2] >>> https://github.com/InsightSoftwareConsortium/ITK/blob/b184194869ac6407fcbb4e309710894cfc84466f/Modules/Core/Common/include/itkStreamingImageFilter.hxx#L194-L213 >>> >>> >>> On Mar 16, 2015, at 7:37 AM, Pol Mons? Purt? >>> wrote: >>> >>> > Hello everyone, >>> > >>> > We need to split a volume into pieces, overlaped by a certain amount, >>> > do some computation and then repaste them. >>> > >>> > The computation requires the pieces' region indexes to be set to zero. >>> > The original volume might not have index at zero, but be a subregion itself. >>> > >>> > What is the best way to achieve this? >>> > >>> > I've thought of the following pipeline: >>> > >>> > 1. imageRegionSplitterSlowDimension >>> > 2. Store the index and size of each region >>> > 3. manually increase the size of each region (and modify index) >>> > 4. crop with the largestPossibleRegion of the original volume (to >>> > prevent requesting more than available) >>> > iterate over regions: >>> > 5. extractImageFilter >>> > 6. disconnect pipeline for each region >>> > 7. reset indexes >>> > 8. perform computation >>> > 9. crop with the regions in step 1 to remove the added overlap >>> > 10. restore indexes >>> > 11. pasteImageFilter >>> > >>> > I'll have to think of a smart way to deal with the index >>> > restore/cropping of steps 9 and 10. >>> > >>> > I somehow feel somebody will have already dealt with this... And >>> > there's certainly a better way to do it. >>> > _____________________________________ >>> > 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 >>> >> >> >> 2015-03-16 14:00 GMT+01:00 Bradley Lowekamp : >>> >>> Hello, >>> >>> The RegionOfInterestImageFilter[1] is very similar to the >>> ExtractImageFilter, but returns an image whose starting index is always >>> zeros. >>> >>> The process you described is remarkable close to what occur in each >>> filter for the multi-threading process. Also what occurs in the >>> StreamingImageFilter is very similar, but just copies the region. >>> >>> As you didn't mention you motivation for chunking the data this way be it >>> for threading or memory requirements, I can't fully advise. >>> >>> Brad >>> >>> >>> [1 >>> ]http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html >>> [2] >>> https://github.com/InsightSoftwareConsortium/ITK/blob/b184194869ac6407fcbb4e309710894cfc84466f/Modules/Core/Common/include/itkStreamingImageFilter.hxx#L194-L213 >>> >>> >>> On Mar 16, 2015, at 7:37 AM, Pol Mons? Purt? >>> wrote: >>> >>> > Hello everyone, >>> > >>> > We need to split a volume into pieces, overlaped by a certain amount, >>> > do some computation and then repaste them. >>> > >>> > The computation requires the pieces' region indexes to be set to zero. >>> > The original volume might not have index at zero, but be a subregion itself. >>> > >>> > What is the best way to achieve this? >>> > >>> > I've thought of the following pipeline: >>> > >>> > 1. imageRegionSplitterSlowDimension >>> > 2. Store the index and size of each region >>> > 3. manually increase the size of each region (and modify index) >>> > 4. crop with the largestPossibleRegion of the original volume (to >>> > prevent requesting more than available) >>> > iterate over regions: >>> > 5. extractImageFilter >>> > 6. disconnect pipeline for each region >>> > 7. reset indexes >>> > 8. perform computation >>> > 9. crop with the regions in step 1 to remove the added overlap >>> > 10. restore indexes >>> > 11. pasteImageFilter >>> > >>> > I'll have to think of a smart way to deal with the index >>> > restore/cropping of steps 9 and 10. >>> > >>> > I somehow feel somebody will have already dealt with this... And >>> > there's certainly a better way to do it. >>> > _____________________________________ >>> > 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 > From scapegoat.sarthak at gmail.com Mon Mar 16 11:18:06 2015 From: scapegoat.sarthak at gmail.com (scap3y) Date: Mon, 16 Mar 2015 08:18:06 -0700 (MST) Subject: [ITK-users] Error while reading Unknown Image Information In-Reply-To: References: Message-ID: <1426519086520-7587013.post@n2.nabble.com> Hi Matt, Thanks for your reply. I have been using VS 2012. The thing is, the first statement works, so try{}catch{} isn't able to find anything. As soon as the program hits imageIO->SetFileName() statement, everything breaks. In the debugger mode, it throws the Access violation error and the imageIO is basically an uninitialized pointer (see image). I have also tried with a raw image but I am getting the same error. Thanks, Sarthak Matt McCormick-2 wrote > Hi Sarthak, > > You may also find this example [1] informative. > > To investigate the access violation error, use try{}catch{} statements > as found in the examples (use it around your > imageIO->ReadImageInformation; statement). Also, run the code in a > debugger. > > Hope this helps, > Matt > > > [1] > http://itk.org/ITKExamples/src/IO/ImageBase/ReadUnknownImageType/Documentation.html?highlight=read > > On Mon, Mar 16, 2015 at 10:15 AM, Scapegoat Sarthak > < > scapegoat.sarthak@ > > wrote: >> Hi All, > [snip!] >> > _____________________________________ > 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-Error-while-reading-Unknown-Image-Information-tp7587007p7587013.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From sebastian.ordas at gmail.com Mon Mar 16 15:03:31 2015 From: sebastian.ordas at gmail.com (Sebastian Ordas) Date: Mon, 16 Mar 2015 16:03:31 -0300 Subject: [ITK-users] [ITK] multiple seeds In-Reply-To: <20150316192345.1345.qmail@f4mail-235-145.rediffmail.com> References: <20150316192345.1345.qmail@f4mail-235-145.rediffmail.com> Message-ID: <55072903.90108@gmail.com> Hi Prakash, sure, you can: use the method: AddSeed (const IndexType & seed); The output will correspond to the combined effect of all input seeds. hope that helps, sebastian On 16/03/2015 04:23 p.m., ds_prakash wrote: > hello ALL, > Is it possible to give multiple seed pixels to > ConnectedThresholdImageFilter? I also want the output of regions grown > corresponding to all seeds in a single output file. > > Thanks > Prakash > > > > Get your own *FREE* website, *FREE* domain & *FREE* mobile app with > Company email. > *Know More >* > > > > > > _____________________________________ > 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 Mon Mar 16 16:33:00 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 16 Mar 2015 16:33:00 -0400 Subject: [ITK-users] Error while reading Unknown Image Information In-Reply-To: <1426519086520-7587013.post@n2.nabble.com> References: <1426519086520-7587013.post@n2.nabble.com> Message-ID: Hi Sarthak, You will need to check that CreateImageIO does not generate a null pointer. If none of the registered ImageIO classes can read the given file path, it will return a null pointer [1]. HTH, Matt [1] http://itk.org/gitweb?p=ITK.git;a=blob;f=Modules/IO/ImageBase/src/itkImageIOFactory.cxx;h=638775873847ad8c4017a85f0992de9f4dee7161;hb=HEAD#l63 On Mon, Mar 16, 2015 at 11:18 AM, scap3y wrote: > Hi Matt, > > Thanks for your reply. > > I have been using VS 2012. The thing is, the first statement works, so > try{}catch{} isn't able to find anything. As soon as the program hits > imageIO->SetFileName() statement, everything breaks. In the debugger mode, > it throws the Access violation error and the imageIO is basically an > uninitialized pointer (see image). > > > > I have also tried with a raw image but I am getting the same error. > > Thanks, > Sarthak > > > Matt McCormick-2 wrote >> Hi Sarthak, >> >> You may also find this example [1] informative. >> >> To investigate the access violation error, use try{}catch{} statements >> as found in the examples (use it around your >> imageIO->ReadImageInformation; statement). Also, run the code in a >> debugger. >> >> Hope this helps, >> Matt >> >> >> [1] >> http://itk.org/ITKExamples/src/IO/ImageBase/ReadUnknownImageType/Documentation.html?highlight=read >> >> On Mon, Mar 16, 2015 at 10:15 AM, Scapegoat Sarthak >> < > >> scapegoat.sarthak@ > >> > wrote: >>> Hi All, >> [snip!] >>> >> _____________________________________ >> 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-Error-while-reading-Unknown-Image-Information-tp7587007p7587013.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 ds_prakash at rediffmail.com Tue Mar 17 06:54:22 2015 From: ds_prakash at rediffmail.com (Surya Prakash) Date: 17 Mar 2015 10:54:22 -0000 Subject: [ITK-users] =?utf-8?q?providing_data?= Message-ID: <20150317105422.15641.qmail@f4mail-235-154.rediffmail.com> Hello, I am developing an application using ITK. I have data in an Arry pointed to by a 'float *'. I am aware of data sizes. How I can provide this array to 'ConnectedThresholdImageFilter' or for that matter to any filter. Thanks Prakash -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Tue Mar 17 07:01:50 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 17 Mar 2015 07:01:50 -0400 Subject: [ITK-users] providing data In-Reply-To: <20150317105422.15641.qmail@f4mail-235-154.rediffmail.com> References: <20150317105422.15641.qmail@f4mail-235-154.rediffmail.com> Message-ID: Hi Prakash, The ImportImageFilter [1] can be used to import a pixel buffer into an itk::Image data structure. HTH, Matt [1] http://www.itk.org/Doxygen/html/classitk_1_1ImportImageFilter.html On Tue, Mar 17, 2015 at 6:54 AM, Surya Prakash wrote: > Hello, > I am developing an application using ITK. I have data in an Arry pointed > to by a 'float *'. I am aware of data sizes. How I can provide this array > to 'ConnectedThresholdImageFilter' or for that matter to any filter. > > Thanks > Prakash > > > Get your own *FREE* website, *FREE* domain & *FREE* mobile app with > Company email. > *Know More >* > -------------- next part -------------- An HTML attachment was scrubbed... URL: From scapegoat.sarthak at gmail.com Tue Mar 17 09:14:34 2015 From: scapegoat.sarthak at gmail.com (scap3y) Date: Tue, 17 Mar 2015 06:14:34 -0700 (MST) Subject: [ITK-users] Error while reading Unknown Image Information In-Reply-To: References: <1426519086520-7587013.post@n2.nabble.com> Message-ID: <1426598074586-7587018.post@n2.nabble.com> Hi Matt, Thanks for your reply. I am checking for a null pointer like this: *if ( imageIO ) { imageIO->SetFileName(argv[3]); imageIO->ReadImageInformation(); } else { std::cout <<"Could not read the input image information from '" << argv[3] << "'\n"; } * And it is going into the "else" loop after the CreateImageIO step. What I am not able to understand is that why is this the case. Does CreateImageIO have restrictions? If so, what are they? I have tried reading 2D images in JPG, PNG, DCM, NII formats and 3D images in DCM and NII formats. It fails in all of them. Best, Sarthak Matt McCormick-2 wrote > Hi Sarthak, > > You will need to check that CreateImageIO does not generate a null > pointer. If none of the registered ImageIO classes can read the given > file path, it will return a null pointer [1]. > > HTH, > Matt > > [1] > http://itk.org/gitweb?p=ITK.git;a=blob;f=Modules/IO/ImageBase/src/itkImageIOFactory.cxx;h=638775873847ad8c4017a85f0992de9f4dee7161;hb=HEAD#l63 > > On Mon, Mar 16, 2015 at 11:18 AM, scap3y < > scapegoat.sarthak@ > > wrote: >> Hi Matt, >> >> Thanks for your reply. > [snip!] >> 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-Error-while-reading-Unknown-Image-Information-tp7587007p7587018.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From matt.mccormick at kitware.com Tue Mar 17 09:27:02 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 17 Mar 2015 09:27:02 -0400 Subject: [ITK-users] Error while reading Unknown Image Information In-Reply-To: <1426598074586-7587018.post@n2.nabble.com> References: <1426519086520-7587013.post@n2.nabble.com> <1426598074586-7587018.post@n2.nabble.com> Message-ID: Hi Sarthak, It looks like a good improvement. The ImageIO's classes for the different file formats must be registered to the factory. When using CMake to configure your project, this is done automatically. When not using CMake, it must be done manually. Are you using CMake to configure your project? HTH, Matt On Tue, Mar 17, 2015 at 9:14 AM, scap3y wrote: > Hi Matt, > > Thanks for your reply. > > I am checking for a null pointer like this: > > *if ( imageIO ) > { > imageIO->SetFileName(argv[3]); > imageIO->ReadImageInformation(); > } > else > { > std::cout <<"Could not read the input image information from '" << argv[3] > << "'\n"; > } * > > And it is going into the "else" loop after the CreateImageIO step. What I am > not able to understand is that why is this the case. Does CreateImageIO have > restrictions? If so, what are they? I have tried reading 2D images in JPG, > PNG, DCM, NII formats and 3D images in DCM and NII formats. It fails in all > of them. > > Best, > Sarthak > > > Matt McCormick-2 wrote >> Hi Sarthak, >> >> You will need to check that CreateImageIO does not generate a null >> pointer. If none of the registered ImageIO classes can read the given >> file path, it will return a null pointer [1]. >> >> HTH, >> Matt >> >> [1] >> http://itk.org/gitweb?p=ITK.git;a=blob;f=Modules/IO/ImageBase/src/itkImageIOFactory.cxx;h=638775873847ad8c4017a85f0992de9f4dee7161;hb=HEAD#l63 >> >> On Mon, Mar 16, 2015 at 11:18 AM, scap3y < > >> scapegoat.sarthak@ > >> > wrote: >>> Hi Matt, >>> >>> Thanks for your reply. >> [snip!] >>> 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-Error-while-reading-Unknown-Image-Information-tp7587007p7587018.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 sebastian.ordas at gmail.com Tue Mar 17 09:28:46 2015 From: sebastian.ordas at gmail.com (Sebastian Ordas) Date: Tue, 17 Mar 2015 10:28:46 -0300 Subject: [ITK-users] providing data In-Reply-To: <20150317105422.15641.qmail@f4mail-235-154.rediffmail.com> References: <20150317105422.15641.qmail@f4mail-235-154.rediffmail.com> Message-ID: <55082C0E.7000508@gmail.com> you can interate over your array and set seeds to ConnectedThresholdImageFilter one by one On 17/03/2015 07:54 a.m., Surya Prakash wrote: > Hello, > I am developing an application using ITK. I have data in an Arry > pointed to by a 'float *'. I am aware of data sizes. How I can provide > this array to 'ConnectedThresholdImageFilter' or for that matter to > any filter. > > Thanks > Prakash > > > > Get your own *FREE* website, *FREE* domain & *FREE* mobile app with > Company email. > *Know More >* > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sebastian.ordas at gmail.com Tue Mar 17 09:32:20 2015 From: sebastian.ordas at gmail.com (Sebastian Ordas) Date: Tue, 17 Mar 2015 10:32:20 -0300 Subject: [ITK-users] providing data In-Reply-To: <55082C0E.7000508@gmail.com> References: <20150317105422.15641.qmail@f4mail-235-154.rediffmail.com> <55082C0E.7000508@gmail.com> Message-ID: <55082CE4.8070202@gmail.com> sorry Prakash , I misunderstood your problem. do as Matt suggested using the ImportImageFilter On 17/03/2015 10:28 a.m., Sebastian Ordas wrote: > you can interate over your array and set seeds to > ConnectedThresholdImageFilter one by one > > On 17/03/2015 07:54 a.m., Surya Prakash wrote: >> Hello, >> I am developing an application using ITK. I have data in an Arry >> pointed to by a 'float *'. I am aware of data sizes. How I can >> provide this array to 'ConnectedThresholdImageFilter' or for that >> matter to any filter. >> >> Thanks >> Prakash >> >> >> >> Get your own *FREE* website, *FREE* domain & *FREE* mobile app with >> Company email. >> *Know More >* >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From scapegoat.sarthak at gmail.com Tue Mar 17 09:53:28 2015 From: scapegoat.sarthak at gmail.com (scap3y) Date: Tue, 17 Mar 2015 06:53:28 -0700 (MST) Subject: [ITK-users] Error while reading Unknown Image Information In-Reply-To: References: <1426519086520-7587013.post@n2.nabble.com> <1426598074586-7587018.post@n2.nabble.com> Message-ID: <1426600408388-7587022.post@n2.nabble.com> Hi Matt, Thanks for your reply. I am indeed using CMake for configuring my project (I don't think I have used anything else since the past 3-odd years; I am a huge CMake fan). Could you give me the details on how to do the registration for the different file formats? Much appreciated, Sarthak Matt McCormick-2 wrote > Hi Sarthak, > > It looks like a good improvement. > > The ImageIO's classes for the different file formats must be > registered to the factory. When using CMake to configure your > project, this is done automatically. When not using CMake, it must be > done manually. Are you using CMake to configure your project? > > HTH, > Matt > > On Tue, Mar 17, 2015 at 9:14 AM, scap3y < > scapegoat.sarthak@ > > wrote: >> Hi Matt, > [snip!] > _____________________________________ > 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-Error-while-reading-Unknown-Image-Information-tp7587007p7587022.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From matt.mccormick at kitware.com Tue Mar 17 10:49:21 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 17 Mar 2015 10:49:21 -0400 Subject: [ITK-users] Error while reading Unknown Image Information In-Reply-To: <1426600408388-7587022.post@n2.nabble.com> References: <1426519086520-7587013.post@n2.nabble.com> <1426598074586-7587018.post@n2.nabble.com> <1426600408388-7587022.post@n2.nabble.com> Message-ID: Hi Sarthak, To perform manual registration call the static RegisterOneFactory() method on the ImageIO class. See, e.g., http://www.itk.org/Doxygen/html/classitk_1_1VTKImageIOFactory.html#abd26950373ca63c737794504f09bb18a HTH, Matt On Tue, Mar 17, 2015 at 9:53 AM, scap3y wrote: > Hi Matt, > > Thanks for your reply. > > I am indeed using CMake for configuring my project (I don't think I have > used anything else since the past 3-odd years; I am a huge CMake fan). Could > you give me the details on how to do the registration for the different file > formats? > > Much appreciated, > Sarthak > > > Matt McCormick-2 wrote >> Hi Sarthak, >> >> It looks like a good improvement. >> >> The ImageIO's classes for the different file formats must be >> registered to the factory. When using CMake to configure your >> project, this is done automatically. When not using CMake, it must be >> done manually. Are you using CMake to configure your project? >> >> HTH, >> Matt >> >> On Tue, Mar 17, 2015 at 9:14 AM, scap3y < > >> scapegoat.sarthak@ > >> > wrote: >>> Hi Matt, >> [snip!] >> _____________________________________ >> 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-Error-while-reading-Unknown-Image-Information-tp7587007p7587022.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 scapegoat.sarthak at gmail.com Tue Mar 17 11:10:36 2015 From: scapegoat.sarthak at gmail.com (scap3y) Date: Tue, 17 Mar 2015 08:10:36 -0700 (MST) Subject: [ITK-users] Error while reading Unknown Image Information In-Reply-To: References: <1426519086520-7587013.post@n2.nabble.com> <1426598074586-7587018.post@n2.nabble.com> <1426600408388-7587022.post@n2.nabble.com> Message-ID: <1426605036611-7587024.post@n2.nabble.com> Hi Matt, Thanks for your reply. I am hesitant to do this since I just want to read image properties automatically. Doing a manual registration seems like an overkill and to be honest seems to mitigate the main idea behind problem in the first place. In any case, this shouldn't be required if I am using CMake to configure the project, correct? I am using a pretty standard CMakeLists file for attaching ITK includes and libraries to my project (taken from the previously mentioned example). Since the ImageIOFactory should be automatically registered, I am confused regarding what I am doing wrong. Best, Sarthak Matt McCormick-2 wrote > Hi Sarthak, > > To perform manual registration call the static RegisterOneFactory() > method on the ImageIO class. See, e.g., > > > http://www.itk.org/Doxygen/html/classitk_1_1VTKImageIOFactory.html#abd26950373ca63c737794504f09bb18a > > HTH, > Matt > > On Tue, Mar 17, 2015 at 9:53 AM, scap3y < > scapegoat.sarthak@ > > wrote: > [snip!] > _____________________________________ > 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-Error-while-reading-Unknown-Image-Information-tp7587007p7587024.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From scapegoat.sarthak at gmail.com Tue Mar 17 11:26:11 2015 From: scapegoat.sarthak at gmail.com (scap3y) Date: Tue, 17 Mar 2015 08:26:11 -0700 (MST) Subject: [ITK-users] Error while reading Unknown Image Information In-Reply-To: <1426605036611-7587024.post@n2.nabble.com> References: <1426519086520-7587013.post@n2.nabble.com> <1426598074586-7587018.post@n2.nabble.com> <1426600408388-7587022.post@n2.nabble.com> <1426605036611-7587024.post@n2.nabble.com> Message-ID: <1426605971241-7587025.post@n2.nabble.com> Hi Matt, This is probably the stupidest thing. I solved the issue by removing "itkImageIOBase.h" and "itkImageIOFactory.h". No idea why this is the reason. Thanks for all the help, Sarthak -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-users-Error-while-reading-Unknown-Image-Information-tp7587007p7587025.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From lluna.nova at gmail.com Tue Mar 17 12:33:29 2015 From: lluna.nova at gmail.com (=?UTF-8?B?UG9sIE1vbnPDsyBQdXJ0w60=?=) Date: Tue, 17 Mar 2015 17:33:29 +0100 Subject: [ITK-users] Splitting and repasting a volume with overlap In-Reply-To: References: <0B31CB6B-D4D0-48B1-A019-775E1E09E686@mail.nih.gov> Message-ID: Indeed, that simplifies the pasting. Good suggestion! 2015-03-16 15:20 GMT+01:00 Bradley Lowekamp : > You may find this method useful: > > > http://www.itk.org/Doxygen/html/structitk_1_1ImageAlgorithm.html#a5ec5bcac992cb3b1302840636530ba20 > > Brad > > On Mar 16, 2015, at 10:16 AM, Pol Mons? Purt? > wrote: > > Mmh, I believe I misread the RegionOfInterestImageFilter documentation, > confusing dimension with size. That should work. > > I still have the computation of the splitting regions problem to handle, > but maybe with this filter is easier than with the ExtractImageFilter. Or > maybe it just removes step 7? > > Is there a way to ease the repasting back to the original region with it? > How should I use the physical space index? > > 2015-03-16 14:25 GMT+01:00 Pol Mons? Purt? : > >> Hello Bradley, >> >> Thank you for your answer and suggestion. >> >> Answering your question: It's not for multi-threading purposes, I have to >> split the image due to memory limitations. >> >> I would use extractImage directly and do streaming, but the client and >> the low-level libraries might not work correctly if I do that. I have to >> provide itk images disconnected from the pipeline and with proper indexes >> and sizes. >> >> The RegionOfInterestImageFilter would have the same memory footprint, and >> it would still be tricky to compute the regions of interest, due to the >> overlapping. >> >> >> >> 2015-03-16 14:00 GMT+01:00 Bradley Lowekamp : >> >>> Hello, >>> >>> The RegionOfInterestImageFilter[1] is very similar to the >>> ExtractImageFilter, but returns an image whose starting index is always >>> zeros. >>> >>> The process you described is remarkable close to what occur in each >>> filter for the multi-threading process. Also what occurs in the >>> StreamingImageFilter is very similar, but just copies the region. >>> >>> As you didn't mention you motivation for chunking the data this way be >>> it for threading or memory requirements, I can't fully advise. >>> >>> Brad >>> >>> >>> [1 ] >>> http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html >>> [2] >>> https://github.com/InsightSoftwareConsortium/ITK/blob/b184194869ac6407fcbb4e309710894cfc84466f/Modules/Core/Common/include/itkStreamingImageFilter.hxx#L194-L213 >>> >>> >>> On Mar 16, 2015, at 7:37 AM, Pol Mons? Purt? >>> wrote: >>> >>> > Hello everyone, >>> > >>> > We need to split a volume into pieces, overlaped by a certain amount, >>> do some computation and then repaste them. >>> > >>> > The computation requires the pieces' region indexes to be set to zero. >>> The original volume might not have index at zero, but be a subregion itself. >>> > >>> > What is the best way to achieve this? >>> > >>> > I've thought of the following pipeline: >>> > >>> > 1. imageRegionSplitterSlowDimension >>> > 2. Store the index and size of each region >>> > 3. manually increase the size of each region (and modify index) >>> > 4. crop with the largestPossibleRegion of the original volume (to >>> prevent requesting more than available) >>> > iterate over regions: >>> > 5. extractImageFilter >>> > 6. disconnect pipeline for each region >>> > 7. reset indexes >>> > 8. perform computation >>> > 9. crop with the regions in step 1 to remove the added overlap >>> > 10. restore indexes >>> > 11. pasteImageFilter >>> > >>> > I'll have to think of a smart way to deal with the index >>> restore/cropping of steps 9 and 10. >>> > >>> > I somehow feel somebody will have already dealt with this... And >>> there's certainly a better way to do it. >>> > _____________________________________ >>> > 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 >>> >>> >> >> 2015-03-16 14:00 GMT+01:00 Bradley Lowekamp : >> >>> Hello, >>> >>> The RegionOfInterestImageFilter[1] is very similar to the >>> ExtractImageFilter, but returns an image whose starting index is always >>> zeros. >>> >>> The process you described is remarkable close to what occur in each >>> filter for the multi-threading process. Also what occurs in the >>> StreamingImageFilter is very similar, but just copies the region. >>> >>> As you didn't mention you motivation for chunking the data this way be >>> it for threading or memory requirements, I can't fully advise. >>> >>> Brad >>> >>> >>> [1 ] >>> http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html >>> [2] >>> https://github.com/InsightSoftwareConsortium/ITK/blob/b184194869ac6407fcbb4e309710894cfc84466f/Modules/Core/Common/include/itkStreamingImageFilter.hxx#L194-L213 >>> >>> >>> On Mar 16, 2015, at 7:37 AM, Pol Mons? Purt? >>> wrote: >>> >>> > Hello everyone, >>> > >>> > We need to split a volume into pieces, overlaped by a certain amount, >>> do some computation and then repaste them. >>> > >>> > The computation requires the pieces' region indexes to be set to zero. >>> The original volume might not have index at zero, but be a subregion itself. >>> > >>> > What is the best way to achieve this? >>> > >>> > I've thought of the following pipeline: >>> > >>> > 1. imageRegionSplitterSlowDimension >>> > 2. Store the index and size of each region >>> > 3. manually increase the size of each region (and modify index) >>> > 4. crop with the largestPossibleRegion of the original volume (to >>> prevent requesting more than available) >>> > iterate over regions: >>> > 5. extractImageFilter >>> > 6. disconnect pipeline for each region >>> > 7. reset indexes >>> > 8. perform computation >>> > 9. crop with the regions in step 1 to remove the added overlap >>> > 10. restore indexes >>> > 11. pasteImageFilter >>> > >>> > I'll have to think of a smart way to deal with the index >>> restore/cropping of steps 9 and 10. >>> > >>> > I somehow feel somebody will have already dealt with this... And >>> there's certainly a better way to do it. >>> > _____________________________________ >>> > 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 lluna.nova at gmail.com Tue Mar 17 13:13:02 2015 From: lluna.nova at gmail.com (=?UTF-8?B?UG9sIE1vbnPDsyBQdXJ0w60=?=) Date: Tue, 17 Mar 2015 18:13:02 +0100 Subject: [ITK-users] Splitting and repasting a volume with overlap In-Reply-To: References: <0B31CB6B-D4D0-48B1-A019-775E1E09E686@mail.nih.gov> Message-ID: Hello Matt, As I've told Bradley, I can't use streaming as-is because I need overlap between chunks and because the low-level library would need a proper itk image with correct size, region, etc. which I guess it wouldn't be provided by streaming. But most definetely, right now I use 'streaming' by using the ExtractFilter at the end. I believe that streams too. I was actually more interested in having a filter/object that computes the splits for me. I've implemented it, but it's far from perfect. For example, it broke when the input image had a non-zero index. (It's fixed now, but still, I'm sure the itk's Splitter filter does a better job, if only could I have overlap ;)) I guess the way to go would be to take the splitter (probably ImageRegionSplitterMultidimensional now that I look at it) and extend it to support overlap. If I do it, I'll let you know in case it is of interest to anyone. For now I'll stick to my class. Cheers, Pol 2015-03-16 16:05 GMT+01:00 Matt McCormick : > Hi Pol, > > As a side note, limitation of memory usage is built into the streaming > pipeline design of ITK. All computation of appropriate regions should > occur if the filters are implemented correctly. To take advantage of > streaming, place the StreamingImageFilter [1] at the end of your > pipeline. To use less memory, set the ReleaseDataFlagOn() [2] on the > component filters. > > HTH, > Matt > > [1] http://www.itk.org/Doxygen/html/classitk_1_1StreamingImageFilter.html > > [2] > http://www.itk.org/Doxygen/html/classitk_1_1ProcessObject.html#ae732e9163879ae559ccd0b5957141f97 > > On Mon, Mar 16, 2015 at 10:20 AM, Bradley Lowekamp > wrote: > > You may find this method useful: > > > > > http://www.itk.org/Doxygen/html/structitk_1_1ImageAlgorithm.html#a5ec5bcac992cb3b1302840636530ba20 > > > > Brad > > > > On Mar 16, 2015, at 10:16 AM, Pol Mons? Purt? > wrote: > > > > Mmh, I believe I misread the RegionOfInterestImageFilter documentation, > > confusing dimension with size. That should work. > > > > I still have the computation of the splitting regions problem to handle, > but > > maybe with this filter is easier than with the ExtractImageFilter. Or > maybe > > it just removes step 7? > > > > Is there a way to ease the repasting back to the original region with it? > > How should I use the physical space index? > > > > 2015-03-16 14:25 GMT+01:00 Pol Mons? Purt? : > >> > >> Hello Bradley, > >> > >> Thank you for your answer and suggestion. > >> > >> Answering your question: It's not for multi-threading purposes, I have > to > >> split the image due to memory limitations. > >> > >> I would use extractImage directly and do streaming, but the client and > the > >> low-level libraries might not work correctly if I do that. I have to > provide > >> itk images disconnected from the pipeline and with proper indexes and > sizes. > >> > >> The RegionOfInterestImageFilter would have the same memory footprint, > and > >> it would still be tricky to compute the regions of interest, due to the > >> overlapping. > >> > >> > >> > >> 2015-03-16 14:00 GMT+01:00 Bradley Lowekamp : > >>> > >>> Hello, > >>> > >>> The RegionOfInterestImageFilter[1] is very similar to the > >>> ExtractImageFilter, but returns an image whose starting index is always > >>> zeros. > >>> > >>> The process you described is remarkable close to what occur in each > >>> filter for the multi-threading process. Also what occurs in the > >>> StreamingImageFilter is very similar, but just copies the region. > >>> > >>> As you didn't mention you motivation for chunking the data this way be > it > >>> for threading or memory requirements, I can't fully advise. > >>> > >>> Brad > >>> > >>> > >>> [1 > >>> ] > http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html > >>> [2] > >>> > https://github.com/InsightSoftwareConsortium/ITK/blob/b184194869ac6407fcbb4e309710894cfc84466f/Modules/Core/Common/include/itkStreamingImageFilter.hxx#L194-L213 > >>> > >>> > >>> On Mar 16, 2015, at 7:37 AM, Pol Mons? Purt? > >>> wrote: > >>> > >>> > Hello everyone, > >>> > > >>> > We need to split a volume into pieces, overlaped by a certain amount, > >>> > do some computation and then repaste them. > >>> > > >>> > The computation requires the pieces' region indexes to be set to > zero. > >>> > The original volume might not have index at zero, but be a subregion > itself. > >>> > > >>> > What is the best way to achieve this? > >>> > > >>> > I've thought of the following pipeline: > >>> > > >>> > 1. imageRegionSplitterSlowDimension > >>> > 2. Store the index and size of each region > >>> > 3. manually increase the size of each region (and modify index) > >>> > 4. crop with the largestPossibleRegion of the original volume (to > >>> > prevent requesting more than available) > >>> > iterate over regions: > >>> > 5. extractImageFilter > >>> > 6. disconnect pipeline for each region > >>> > 7. reset indexes > >>> > 8. perform computation > >>> > 9. crop with the regions in step 1 to remove the added overlap > >>> > 10. restore indexes > >>> > 11. pasteImageFilter > >>> > > >>> > I'll have to think of a smart way to deal with the index > >>> > restore/cropping of steps 9 and 10. > >>> > > >>> > I somehow feel somebody will have already dealt with this... And > >>> > there's certainly a better way to do it. > >>> > _____________________________________ > >>> > 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 > >>> > >> > >> > >> 2015-03-16 14:00 GMT+01:00 Bradley Lowekamp : > >>> > >>> Hello, > >>> > >>> The RegionOfInterestImageFilter[1] is very similar to the > >>> ExtractImageFilter, but returns an image whose starting index is always > >>> zeros. > >>> > >>> The process you described is remarkable close to what occur in each > >>> filter for the multi-threading process. Also what occurs in the > >>> StreamingImageFilter is very similar, but just copies the region. > >>> > >>> As you didn't mention you motivation for chunking the data this way be > it > >>> for threading or memory requirements, I can't fully advise. > >>> > >>> Brad > >>> > >>> > >>> [1 > >>> ] > http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html > >>> [2] > >>> > https://github.com/InsightSoftwareConsortium/ITK/blob/b184194869ac6407fcbb4e309710894cfc84466f/Modules/Core/Common/include/itkStreamingImageFilter.hxx#L194-L213 > >>> > >>> > >>> On Mar 16, 2015, at 7:37 AM, Pol Mons? Purt? > >>> wrote: > >>> > >>> > Hello everyone, > >>> > > >>> > We need to split a volume into pieces, overlaped by a certain amount, > >>> > do some computation and then repaste them. > >>> > > >>> > The computation requires the pieces' region indexes to be set to > zero. > >>> > The original volume might not have index at zero, but be a subregion > itself. > >>> > > >>> > What is the best way to achieve this? > >>> > > >>> > I've thought of the following pipeline: > >>> > > >>> > 1. imageRegionSplitterSlowDimension > >>> > 2. Store the index and size of each region > >>> > 3. manually increase the size of each region (and modify index) > >>> > 4. crop with the largestPossibleRegion of the original volume (to > >>> > prevent requesting more than available) > >>> > iterate over regions: > >>> > 5. extractImageFilter > >>> > 6. disconnect pipeline for each region > >>> > 7. reset indexes > >>> > 8. perform computation > >>> > 9. crop with the regions in step 1 to remove the added overlap > >>> > 10. restore indexes > >>> > 11. pasteImageFilter > >>> > > >>> > I'll have to think of a smart way to deal with the index > >>> > restore/cropping of steps 9 and 10. > >>> > > >>> > I somehow feel somebody will have already dealt with this... And > >>> > there's certainly a better way to do it. > >>> > _____________________________________ > >>> > 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 matt.mccormick at kitware.com Tue Mar 17 15:22:17 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 17 Mar 2015 15:22:17 -0400 Subject: [ITK-users] Splitting and repasting a volume with overlap In-Reply-To: References: <0B31CB6B-D4D0-48B1-A019-775E1E09E686@mail.nih.gov> Message-ID: Hi Pol, You may already be aware of this, but the chunks will overlap if you implement a GenerateInputRequestedRegion() method on your filter that pads the output RequestedRegion. HTH, Matt On Tue, Mar 17, 2015 at 1:13 PM, Pol Mons? Purt? wrote: > Hello Matt, > > As I've told Bradley, I can't use streaming as-is because I need overlap > between chunks and because the low-level library would need a proper itk > image with correct size, region, etc. > which I guess it wouldn't be provided by streaming. > > But most definetely, right now I use 'streaming' by using the ExtractFilter > at the end. I believe that streams too. I was actually more interested in > having a filter/object that computes the splits for me. I've implemented it, > but it's far from perfect. For example, it broke when the input image had a > non-zero index. (It's fixed now, but still, I'm sure the itk's Splitter > filter does a better job, if only could I have overlap ;)) > > I guess the way to go would be to take the splitter (probably > ImageRegionSplitterMultidimensional now that I look at it) and extend it to > support overlap. If I do it, I'll let you know in case it is of interest to > anyone. For now I'll stick to my class. > > Cheers, > > Pol > > 2015-03-16 16:05 GMT+01:00 Matt McCormick : >> >> Hi Pol, >> >> As a side note, limitation of memory usage is built into the streaming >> pipeline design of ITK. All computation of appropriate regions should >> occur if the filters are implemented correctly. To take advantage of >> streaming, place the StreamingImageFilter [1] at the end of your >> pipeline. To use less memory, set the ReleaseDataFlagOn() [2] on the >> component filters. >> >> HTH, >> Matt >> >> [1] http://www.itk.org/Doxygen/html/classitk_1_1StreamingImageFilter.html >> >> [2] >> http://www.itk.org/Doxygen/html/classitk_1_1ProcessObject.html#ae732e9163879ae559ccd0b5957141f97 >> >> On Mon, Mar 16, 2015 at 10:20 AM, Bradley Lowekamp >> wrote: >> > You may find this method useful: >> > >> > >> > http://www.itk.org/Doxygen/html/structitk_1_1ImageAlgorithm.html#a5ec5bcac992cb3b1302840636530ba20 >> > >> > Brad >> > >> > On Mar 16, 2015, at 10:16 AM, Pol Mons? Purt? >> > wrote: >> > >> > Mmh, I believe I misread the RegionOfInterestImageFilter documentation, >> > confusing dimension with size. That should work. >> > >> > I still have the computation of the splitting regions problem to handle, >> > but >> > maybe with this filter is easier than with the ExtractImageFilter. Or >> > maybe >> > it just removes step 7? >> > >> > Is there a way to ease the repasting back to the original region with >> > it? >> > How should I use the physical space index? >> > >> > 2015-03-16 14:25 GMT+01:00 Pol Mons? Purt? : >> >> >> >> Hello Bradley, >> >> >> >> Thank you for your answer and suggestion. >> >> >> >> Answering your question: It's not for multi-threading purposes, I have >> >> to >> >> split the image due to memory limitations. >> >> >> >> I would use extractImage directly and do streaming, but the client and >> >> the >> >> low-level libraries might not work correctly if I do that. I have to >> >> provide >> >> itk images disconnected from the pipeline and with proper indexes and >> >> sizes. >> >> >> >> The RegionOfInterestImageFilter would have the same memory footprint, >> >> and >> >> it would still be tricky to compute the regions of interest, due to the >> >> overlapping. >> >> >> >> >> >> >> >> 2015-03-16 14:00 GMT+01:00 Bradley Lowekamp : >> >>> >> >>> Hello, >> >>> >> >>> The RegionOfInterestImageFilter[1] is very similar to the >> >>> ExtractImageFilter, but returns an image whose starting index is >> >>> always >> >>> zeros. >> >>> >> >>> The process you described is remarkable close to what occur in each >> >>> filter for the multi-threading process. Also what occurs in the >> >>> StreamingImageFilter is very similar, but just copies the region. >> >>> >> >>> As you didn't mention you motivation for chunking the data this way be >> >>> it >> >>> for threading or memory requirements, I can't fully advise. >> >>> >> >>> Brad >> >>> >> >>> >> >>> [1 >> >>> >> >>> ]http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html >> >>> [2] >> >>> >> >>> https://github.com/InsightSoftwareConsortium/ITK/blob/b184194869ac6407fcbb4e309710894cfc84466f/Modules/Core/Common/include/itkStreamingImageFilter.hxx#L194-L213 >> >>> >> >>> >> >>> On Mar 16, 2015, at 7:37 AM, Pol Mons? Purt? >> >>> wrote: >> >>> >> >>> > Hello everyone, >> >>> > >> >>> > We need to split a volume into pieces, overlaped by a certain >> >>> > amount, >> >>> > do some computation and then repaste them. >> >>> > >> >>> > The computation requires the pieces' region indexes to be set to >> >>> > zero. >> >>> > The original volume might not have index at zero, but be a subregion >> >>> > itself. >> >>> > >> >>> > What is the best way to achieve this? >> >>> > >> >>> > I've thought of the following pipeline: >> >>> > >> >>> > 1. imageRegionSplitterSlowDimension >> >>> > 2. Store the index and size of each region >> >>> > 3. manually increase the size of each region (and modify index) >> >>> > 4. crop with the largestPossibleRegion of the original volume (to >> >>> > prevent requesting more than available) >> >>> > iterate over regions: >> >>> > 5. extractImageFilter >> >>> > 6. disconnect pipeline for each region >> >>> > 7. reset indexes >> >>> > 8. perform computation >> >>> > 9. crop with the regions in step 1 to remove the added overlap >> >>> > 10. restore indexes >> >>> > 11. pasteImageFilter >> >>> > >> >>> > I'll have to think of a smart way to deal with the index >> >>> > restore/cropping of steps 9 and 10. >> >>> > >> >>> > I somehow feel somebody will have already dealt with this... And >> >>> > there's certainly a better way to do it. >> >>> > _____________________________________ >> >>> > 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 >> >>> >> >> >> >> >> >> 2015-03-16 14:00 GMT+01:00 Bradley Lowekamp : >> >>> >> >>> Hello, >> >>> >> >>> The RegionOfInterestImageFilter[1] is very similar to the >> >>> ExtractImageFilter, but returns an image whose starting index is >> >>> always >> >>> zeros. >> >>> >> >>> The process you described is remarkable close to what occur in each >> >>> filter for the multi-threading process. Also what occurs in the >> >>> StreamingImageFilter is very similar, but just copies the region. >> >>> >> >>> As you didn't mention you motivation for chunking the data this way be >> >>> it >> >>> for threading or memory requirements, I can't fully advise. >> >>> >> >>> Brad >> >>> >> >>> >> >>> [1 >> >>> >> >>> ]http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html >> >>> [2] >> >>> >> >>> https://github.com/InsightSoftwareConsortium/ITK/blob/b184194869ac6407fcbb4e309710894cfc84466f/Modules/Core/Common/include/itkStreamingImageFilter.hxx#L194-L213 >> >>> >> >>> >> >>> On Mar 16, 2015, at 7:37 AM, Pol Mons? Purt? >> >>> wrote: >> >>> >> >>> > Hello everyone, >> >>> > >> >>> > We need to split a volume into pieces, overlaped by a certain >> >>> > amount, >> >>> > do some computation and then repaste them. >> >>> > >> >>> > The computation requires the pieces' region indexes to be set to >> >>> > zero. >> >>> > The original volume might not have index at zero, but be a subregion >> >>> > itself. >> >>> > >> >>> > What is the best way to achieve this? >> >>> > >> >>> > I've thought of the following pipeline: >> >>> > >> >>> > 1. imageRegionSplitterSlowDimension >> >>> > 2. Store the index and size of each region >> >>> > 3. manually increase the size of each region (and modify index) >> >>> > 4. crop with the largestPossibleRegion of the original volume (to >> >>> > prevent requesting more than available) >> >>> > iterate over regions: >> >>> > 5. extractImageFilter >> >>> > 6. disconnect pipeline for each region >> >>> > 7. reset indexes >> >>> > 8. perform computation >> >>> > 9. crop with the regions in step 1 to remove the added overlap >> >>> > 10. restore indexes >> >>> > 11. pasteImageFilter >> >>> > >> >>> > I'll have to think of a smart way to deal with the index >> >>> > restore/cropping of steps 9 and 10. >> >>> > >> >>> > I somehow feel somebody will have already dealt with this... And >> >>> > there's certainly a better way to do it. >> >>> > _____________________________________ >> >>> > 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 >> > > > From aamundarain at ceit.es Wed Mar 18 07:43:49 2015 From: aamundarain at ceit.es (Amundarain, Aiert) Date: Wed, 18 Mar 2015 11:43:49 +0000 Subject: [ITK-users] ITK dicom reader wrong spacing Message-ID: I have a DICOM Image serie that itk does not read properly. The x,y,z spacing are incorrect and the return value is the default one (1,1,1). If I read this DICOM Image serie using vtk (vtkDICOMImageReader), the reading is correct. Both softwares are developed by kitware but the results are different. Is is possible to read the dicom files using ITK without using the gdcm library? Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lluna.nova at gmail.com Wed Mar 18 08:58:06 2015 From: lluna.nova at gmail.com (=?UTF-8?B?UG9sIE1vbnPDsyBQdXJ0w60=?=) Date: Wed, 18 Mar 2015 13:58:06 +0100 Subject: [ITK-users] Splitting and repasting a volume with overlap In-Reply-To: References: <0B31CB6B-D4D0-48B1-A019-775E1E09E686@mail.nih.gov> Message-ID: Hello matt, I wasn't aware of that possibility, thanks for the heads up!It doesn't apply to our case becaues I haven't created a filter but rather a class that takes a region and gives me the splitted regions that later on I feed to an extract filter (or the copy algorithm Bradley pointed out to repaste the results back). Creating a filter doesn't really fit well, the 'low-level' is based on machine learning so it trains and then predicts, and it requires several minutes depending on the size of the image etc. I didn't judge appropriate to create a Filter out of it. Could you elaborate a little bit on what you were proposing? Let's say I have a set of preprocessing filters, my processing and a set of postprocessing filters. The output would be a set of connected components. The volume doesn't necessarily fit in memory (specially the processing) so we have to stream. Because the chunks need to overlap, are you saying that I could place, in the pipeline, a Filter that is derived from the StreamingImageFilter that re-implements GeneratInputRequestedRegion() to have an overlap of 30 voxels, and that would should do it? where should I place such a filter and how does interact with the pre/post-processing? I will re-read the article on streaming, but maybe it would help me if you pinpoint the particularities of the approach you suggested. Cheers, Pol 2015-03-17 20:22 GMT+01:00 Matt McCormick : > Hi Pol, > > You may already be aware of this, but the chunks will overlap if you > implement a GenerateInputRequestedRegion() method on your filter that > pads the output RequestedRegion. > > HTH, > Matt > > On Tue, Mar 17, 2015 at 1:13 PM, Pol Mons? Purt? > wrote: > > Hello Matt, > > > > As I've told Bradley, I can't use streaming as-is because I need overlap > > between chunks and because the low-level library would need a proper itk > > image with correct size, region, etc. > > which I guess it wouldn't be provided by streaming. > > > > But most definetely, right now I use 'streaming' by using the > ExtractFilter > > at the end. I believe that streams too. I was actually more interested in > > having a filter/object that computes the splits for me. I've implemented > it, > > but it's far from perfect. For example, it broke when the input image > had a > > non-zero index. (It's fixed now, but still, I'm sure the itk's Splitter > > filter does a better job, if only could I have overlap ;)) > > > > I guess the way to go would be to take the splitter (probably > > ImageRegionSplitterMultidimensional now that I look at it) and extend it > to > > support overlap. If I do it, I'll let you know in case it is of interest > to > > anyone. For now I'll stick to my class. > > > > Cheers, > > > > Pol > > > > 2015-03-16 16:05 GMT+01:00 Matt McCormick : > >> > >> Hi Pol, > >> > >> As a side note, limitation of memory usage is built into the streaming > >> pipeline design of ITK. All computation of appropriate regions should > >> occur if the filters are implemented correctly. To take advantage of > >> streaming, place the StreamingImageFilter [1] at the end of your > >> pipeline. To use less memory, set the ReleaseDataFlagOn() [2] on the > >> component filters. > >> > >> HTH, > >> Matt > >> > >> [1] > http://www.itk.org/Doxygen/html/classitk_1_1StreamingImageFilter.html > >> > >> [2] > >> > http://www.itk.org/Doxygen/html/classitk_1_1ProcessObject.html#ae732e9163879ae559ccd0b5957141f97 > >> > >> On Mon, Mar 16, 2015 at 10:20 AM, Bradley Lowekamp > >> wrote: > >> > You may find this method useful: > >> > > >> > > >> > > http://www.itk.org/Doxygen/html/structitk_1_1ImageAlgorithm.html#a5ec5bcac992cb3b1302840636530ba20 > >> > > >> > Brad > >> > > >> > On Mar 16, 2015, at 10:16 AM, Pol Mons? Purt? > >> > wrote: > >> > > >> > Mmh, I believe I misread the RegionOfInterestImageFilter > documentation, > >> > confusing dimension with size. That should work. > >> > > >> > I still have the computation of the splitting regions problem to > handle, > >> > but > >> > maybe with this filter is easier than with the ExtractImageFilter. Or > >> > maybe > >> > it just removes step 7? > >> > > >> > Is there a way to ease the repasting back to the original region with > >> > it? > >> > How should I use the physical space index? > >> > > >> > 2015-03-16 14:25 GMT+01:00 Pol Mons? Purt? : > >> >> > >> >> Hello Bradley, > >> >> > >> >> Thank you for your answer and suggestion. > >> >> > >> >> Answering your question: It's not for multi-threading purposes, I > have > >> >> to > >> >> split the image due to memory limitations. > >> >> > >> >> I would use extractImage directly and do streaming, but the client > and > >> >> the > >> >> low-level libraries might not work correctly if I do that. I have to > >> >> provide > >> >> itk images disconnected from the pipeline and with proper indexes and > >> >> sizes. > >> >> > >> >> The RegionOfInterestImageFilter would have the same memory footprint, > >> >> and > >> >> it would still be tricky to compute the regions of interest, due to > the > >> >> overlapping. > >> >> > >> >> > >> >> > >> >> 2015-03-16 14:00 GMT+01:00 Bradley Lowekamp >: > >> >>> > >> >>> Hello, > >> >>> > >> >>> The RegionOfInterestImageFilter[1] is very similar to the > >> >>> ExtractImageFilter, but returns an image whose starting index is > >> >>> always > >> >>> zeros. > >> >>> > >> >>> The process you described is remarkable close to what occur in each > >> >>> filter for the multi-threading process. Also what occurs in the > >> >>> StreamingImageFilter is very similar, but just copies the region. > >> >>> > >> >>> As you didn't mention you motivation for chunking the data this way > be > >> >>> it > >> >>> for threading or memory requirements, I can't fully advise. > >> >>> > >> >>> Brad > >> >>> > >> >>> > >> >>> [1 > >> >>> > >> >>> ] > http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html > >> >>> [2] > >> >>> > >> >>> > https://github.com/InsightSoftwareConsortium/ITK/blob/b184194869ac6407fcbb4e309710894cfc84466f/Modules/Core/Common/include/itkStreamingImageFilter.hxx#L194-L213 > >> >>> > >> >>> > >> >>> On Mar 16, 2015, at 7:37 AM, Pol Mons? Purt? > >> >>> wrote: > >> >>> > >> >>> > Hello everyone, > >> >>> > > >> >>> > We need to split a volume into pieces, overlaped by a certain > >> >>> > amount, > >> >>> > do some computation and then repaste them. > >> >>> > > >> >>> > The computation requires the pieces' region indexes to be set to > >> >>> > zero. > >> >>> > The original volume might not have index at zero, but be a > subregion > >> >>> > itself. > >> >>> > > >> >>> > What is the best way to achieve this? > >> >>> > > >> >>> > I've thought of the following pipeline: > >> >>> > > >> >>> > 1. imageRegionSplitterSlowDimension > >> >>> > 2. Store the index and size of each region > >> >>> > 3. manually increase the size of each region (and modify index) > >> >>> > 4. crop with the largestPossibleRegion of the original volume (to > >> >>> > prevent requesting more than available) > >> >>> > iterate over regions: > >> >>> > 5. extractImageFilter > >> >>> > 6. disconnect pipeline for each region > >> >>> > 7. reset indexes > >> >>> > 8. perform computation > >> >>> > 9. crop with the regions in step 1 to remove the added > overlap > >> >>> > 10. restore indexes > >> >>> > 11. pasteImageFilter > >> >>> > > >> >>> > I'll have to think of a smart way to deal with the index > >> >>> > restore/cropping of steps 9 and 10. > >> >>> > > >> >>> > I somehow feel somebody will have already dealt with this... And > >> >>> > there's certainly a better way to do it. > >> >>> > _____________________________________ > >> >>> > 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 > >> >>> > >> >> > >> >> > >> >> 2015-03-16 14:00 GMT+01:00 Bradley Lowekamp >: > >> >>> > >> >>> Hello, > >> >>> > >> >>> The RegionOfInterestImageFilter[1] is very similar to the > >> >>> ExtractImageFilter, but returns an image whose starting index is > >> >>> always > >> >>> zeros. > >> >>> > >> >>> The process you described is remarkable close to what occur in each > >> >>> filter for the multi-threading process. Also what occurs in the > >> >>> StreamingImageFilter is very similar, but just copies the region. > >> >>> > >> >>> As you didn't mention you motivation for chunking the data this way > be > >> >>> it > >> >>> for threading or memory requirements, I can't fully advise. > >> >>> > >> >>> Brad > >> >>> > >> >>> > >> >>> [1 > >> >>> > >> >>> ] > http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html > >> >>> [2] > >> >>> > >> >>> > https://github.com/InsightSoftwareConsortium/ITK/blob/b184194869ac6407fcbb4e309710894cfc84466f/Modules/Core/Common/include/itkStreamingImageFilter.hxx#L194-L213 > >> >>> > >> >>> > >> >>> On Mar 16, 2015, at 7:37 AM, Pol Mons? Purt? > >> >>> wrote: > >> >>> > >> >>> > Hello everyone, > >> >>> > > >> >>> > We need to split a volume into pieces, overlaped by a certain > >> >>> > amount, > >> >>> > do some computation and then repaste them. > >> >>> > > >> >>> > The computation requires the pieces' region indexes to be set to > >> >>> > zero. > >> >>> > The original volume might not have index at zero, but be a > subregion > >> >>> > itself. > >> >>> > > >> >>> > What is the best way to achieve this? > >> >>> > > >> >>> > I've thought of the following pipeline: > >> >>> > > >> >>> > 1. imageRegionSplitterSlowDimension > >> >>> > 2. Store the index and size of each region > >> >>> > 3. manually increase the size of each region (and modify index) > >> >>> > 4. crop with the largestPossibleRegion of the original volume (to > >> >>> > prevent requesting more than available) > >> >>> > iterate over regions: > >> >>> > 5. extractImageFilter > >> >>> > 6. disconnect pipeline for each region > >> >>> > 7. reset indexes > >> >>> > 8. perform computation > >> >>> > 9. crop with the regions in step 1 to remove the added > overlap > >> >>> > 10. restore indexes > >> >>> > 11. pasteImageFilter > >> >>> > > >> >>> > I'll have to think of a smart way to deal with the index > >> >>> > restore/cropping of steps 9 and 10. > >> >>> > > >> >>> > I somehow feel somebody will have already dealt with this... And > >> >>> > there's certainly a better way to do it. > >> >>> > _____________________________________ > >> >>> > 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 blowekamp at mail.nih.gov Wed Mar 18 09:14:53 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Wed, 18 Mar 2015 09:14:53 -0400 Subject: [ITK-users] Splitting and repasting a volume with overlap In-Reply-To: References: <0B31CB6B-D4D0-48B1-A019-775E1E09E686@mail.nih.gov> Message-ID: <01DFDABC-9640-47CF-A2EA-4019A1C8A5F4@mail.nih.gov> Hello Pol, I believe I have already suggested reading the latest ITK Software Guide, and the section "How To Write a Filter" which details how the pipeline works. This will cover the GenerateInputRequestedRegion method and how it interacts with the Pipeline and it critical for understanding the pipeline. Your case really does sound like the ITK pipeline, and would benefit as being a filter. You described your output as "connected components", I am not sure if that is a image or another reduced structure. Does the output represent the whole thing in a compact fashion or does it represent a small part which can also be streamed? The may add more complications to your situation but it may be the right fit. I have written a external module "itkStreamingSinc"[1], which provides a base class for algorithms which are both streamed and threaded. I have used it for things like computing bounding boxes and image statistics on images which are hundreds of gigabytes in an out of core fashion. I have also wanted to write one which produces a an itk RLE LabelObject. It works good for algorithms that can consume a chunk and produce a reduced structure. Hope that helps, Brad [1] https://github.com/blowekamp/itkStreamingSinc On Mar 18, 2015, at 8:58 AM, Pol Mons? Purt? wrote: > Hello matt, > > I wasn't aware of that possibility, thanks for the heads up!It doesn't apply to our case becaues I haven't created a filter but rather a class that takes a region and gives me the splitted regions that later on I feed to an extract filter (or the copy algorithm Bradley pointed out to repaste the results back). Creating a filter doesn't really fit well, the 'low-level' is based on machine learning so it trains and then predicts, and it requires several minutes depending on the size of the image etc. I didn't judge appropriate to create a Filter out of it. > > Could you elaborate a little bit on what you were proposing? Let's say I have a set of preprocessing filters, my processing and a set of postprocessing filters. The output would be a set of connected components. The volume doesn't necessarily fit in memory (specially the processing) so we have to stream. Because the chunks need to overlap, are you saying that I could place, in the pipeline, a Filter that is derived from the StreamingImageFilter that re-implements GeneratInputRequestedRegion() to have an overlap of 30 voxels, and that would should do it? where should I place such a filter and how does interact with the pre/post-processing? > > I will re-read the article on streaming, but maybe it would help me if you pinpoint the particularities of the approach you suggested. > > Cheers, > > Pol > > > > > 2015-03-17 20:22 GMT+01:00 Matt McCormick : > Hi Pol, > > You may already be aware of this, but the chunks will overlap if you > implement a GenerateInputRequestedRegion() method on your filter that > pads the output RequestedRegion. > > HTH, > Matt > > On Tue, Mar 17, 2015 at 1:13 PM, Pol Mons? Purt? wrote: > > Hello Matt, > > > > As I've told Bradley, I can't use streaming as-is because I need overlap > > between chunks and because the low-level library would need a proper itk > > image with correct size, region, etc. > > which I guess it wouldn't be provided by streaming. > > > > But most definetely, right now I use 'streaming' by using the ExtractFilter > > at the end. I believe that streams too. I was actually more interested in > > having a filter/object that computes the splits for me. I've implemented it, > > but it's far from perfect. For example, it broke when the input image had a > > non-zero index. (It's fixed now, but still, I'm sure the itk's Splitter > > filter does a better job, if only could I have overlap ;)) > > > > I guess the way to go would be to take the splitter (probably > > ImageRegionSplitterMultidimensional now that I look at it) and extend it to > > support overlap. If I do it, I'll let you know in case it is of interest to > > anyone. For now I'll stick to my class. > > > > Cheers, > > > > Pol > > > > 2015-03-16 16:05 GMT+01:00 Matt McCormick : > >> > >> Hi Pol, > >> > >> As a side note, limitation of memory usage is built into the streaming > >> pipeline design of ITK. All computation of appropriate regions should > >> occur if the filters are implemented correctly. To take advantage of > >> streaming, place the StreamingImageFilter [1] at the end of your > >> pipeline. To use less memory, set the ReleaseDataFlagOn() [2] on the > >> component filters. > >> > >> HTH, > >> Matt > >> > >> [1] http://www.itk.org/Doxygen/html/classitk_1_1StreamingImageFilter.html > >> > >> [2] > >> http://www.itk.org/Doxygen/html/classitk_1_1ProcessObject.html#ae732e9163879ae559ccd0b5957141f97 > >> > >> On Mon, Mar 16, 2015 at 10:20 AM, Bradley Lowekamp > >> wrote: > >> > You may find this method useful: > >> > > >> > > >> > http://www.itk.org/Doxygen/html/structitk_1_1ImageAlgorithm.html#a5ec5bcac992cb3b1302840636530ba20 > >> > > >> > Brad > >> > > >> > On Mar 16, 2015, at 10:16 AM, Pol Mons? Purt? > >> > wrote: > >> > > >> > Mmh, I believe I misread the RegionOfInterestImageFilter documentation, > >> > confusing dimension with size. That should work. > >> > > >> > I still have the computation of the splitting regions problem to handle, > >> > but > >> > maybe with this filter is easier than with the ExtractImageFilter. Or > >> > maybe > >> > it just removes step 7? > >> > > >> > Is there a way to ease the repasting back to the original region with > >> > it? > >> > How should I use the physical space index? > >> > > >> > 2015-03-16 14:25 GMT+01:00 Pol Mons? Purt? : > >> >> > >> >> Hello Bradley, > >> >> > >> >> Thank you for your answer and suggestion. > >> >> > >> >> Answering your question: It's not for multi-threading purposes, I have > >> >> to > >> >> split the image due to memory limitations. > >> >> > >> >> I would use extractImage directly and do streaming, but the client and > >> >> the > >> >> low-level libraries might not work correctly if I do that. I have to > >> >> provide > >> >> itk images disconnected from the pipeline and with proper indexes and > >> >> sizes. > >> >> > >> >> The RegionOfInterestImageFilter would have the same memory footprint, > >> >> and > >> >> it would still be tricky to compute the regions of interest, due to the > >> >> overlapping. > >> >> > >> >> > >> >> > >> >> 2015-03-16 14:00 GMT+01:00 Bradley Lowekamp : > >> >>> > >> >>> Hello, > >> >>> > >> >>> The RegionOfInterestImageFilter[1] is very similar to the > >> >>> ExtractImageFilter, but returns an image whose starting index is > >> >>> always > >> >>> zeros. > >> >>> > >> >>> The process you described is remarkable close to what occur in each > >> >>> filter for the multi-threading process. Also what occurs in the > >> >>> StreamingImageFilter is very similar, but just copies the region. > >> >>> > >> >>> As you didn't mention you motivation for chunking the data this way be > >> >>> it > >> >>> for threading or memory requirements, I can't fully advise. > >> >>> > >> >>> Brad > >> >>> > >> >>> > >> >>> [1 > >> >>> > >> >>> ]http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html > >> >>> [2] > >> >>> > >> >>> https://github.com/InsightSoftwareConsortium/ITK/blob/b184194869ac6407fcbb4e309710894cfc84466f/Modules/Core/Common/include/itkStreamingImageFilter.hxx#L194-L213 > >> >>> > >> >>> > >> >>> On Mar 16, 2015, at 7:37 AM, Pol Mons? Purt? > >> >>> wrote: > >> >>> > >> >>> > Hello everyone, > >> >>> > > >> >>> > We need to split a volume into pieces, overlaped by a certain > >> >>> > amount, > >> >>> > do some computation and then repaste them. > >> >>> > > >> >>> > The computation requires the pieces' region indexes to be set to > >> >>> > zero. > >> >>> > The original volume might not have index at zero, but be a subregion > >> >>> > itself. > >> >>> > > >> >>> > What is the best way to achieve this? > >> >>> > > >> >>> > I've thought of the following pipeline: > >> >>> > > >> >>> > 1. imageRegionSplitterSlowDimension > >> >>> > 2. Store the index and size of each region > >> >>> > 3. manually increase the size of each region (and modify index) > >> >>> > 4. crop with the largestPossibleRegion of the original volume (to > >> >>> > prevent requesting more than available) > >> >>> > iterate over regions: > >> >>> > 5. extractImageFilter > >> >>> > 6. disconnect pipeline for each region > >> >>> > 7. reset indexes > >> >>> > 8. perform computation > >> >>> > 9. crop with the regions in step 1 to remove the added overlap > >> >>> > 10. restore indexes > >> >>> > 11. pasteImageFilter > >> >>> > > >> >>> > I'll have to think of a smart way to deal with the index > >> >>> > restore/cropping of steps 9 and 10. > >> >>> > > >> >>> > I somehow feel somebody will have already dealt with this... And > >> >>> > there's certainly a better way to do it. > >> >>> > _____________________________________ > >> >>> > 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 > >> >>> > >> >> > >> >> > >> >> 2015-03-16 14:00 GMT+01:00 Bradley Lowekamp : > >> >>> > >> >>> Hello, > >> >>> > >> >>> The RegionOfInterestImageFilter[1] is very similar to the > >> >>> ExtractImageFilter, but returns an image whose starting index is > >> >>> always > >> >>> zeros. > >> >>> > >> >>> The process you described is remarkable close to what occur in each > >> >>> filter for the multi-threading process. Also what occurs in the > >> >>> StreamingImageFilter is very similar, but just copies the region. > >> >>> > >> >>> As you didn't mention you motivation for chunking the data this way be > >> >>> it > >> >>> for threading or memory requirements, I can't fully advise. > >> >>> > >> >>> Brad > >> >>> > >> >>> > >> >>> [1 > >> >>> > >> >>> ]http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html > >> >>> [2] > >> >>> > >> >>> https://github.com/InsightSoftwareConsortium/ITK/blob/b184194869ac6407fcbb4e309710894cfc84466f/Modules/Core/Common/include/itkStreamingImageFilter.hxx#L194-L213 > >> >>> > >> >>> > >> >>> On Mar 16, 2015, at 7:37 AM, Pol Mons? Purt? > >> >>> wrote: > >> >>> > >> >>> > Hello everyone, > >> >>> > > >> >>> > We need to split a volume into pieces, overlaped by a certain > >> >>> > amount, > >> >>> > do some computation and then repaste them. > >> >>> > > >> >>> > The computation requires the pieces' region indexes to be set to > >> >>> > zero. > >> >>> > The original volume might not have index at zero, but be a subregion > >> >>> > itself. > >> >>> > > >> >>> > What is the best way to achieve this? > >> >>> > > >> >>> > I've thought of the following pipeline: > >> >>> > > >> >>> > 1. imageRegionSplitterSlowDimension > >> >>> > 2. Store the index and size of each region > >> >>> > 3. manually increase the size of each region (and modify index) > >> >>> > 4. crop with the largestPossibleRegion of the original volume (to > >> >>> > prevent requesting more than available) > >> >>> > iterate over regions: > >> >>> > 5. extractImageFilter > >> >>> > 6. disconnect pipeline for each region > >> >>> > 7. reset indexes > >> >>> > 8. perform computation > >> >>> > 9. crop with the regions in step 1 to remove the added overlap > >> >>> > 10. restore indexes > >> >>> > 11. pasteImageFilter > >> >>> > > >> >>> > I'll have to think of a smart way to deal with the index > >> >>> > restore/cropping of steps 9 and 10. > >> >>> > > >> >>> > I somehow feel somebody will have already dealt with this... And > >> >>> > there's certainly a better way to do it. > >> >>> > _____________________________________ > >> >>> > 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 blowekamp at mail.nih.gov Thu Mar 19 09:17:44 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Thu, 19 Mar 2015 09:17:44 -0400 Subject: [ITK-users] [ITK] Registration in SimpleITK In-Reply-To: References: Message-ID: Hello, Binaries for the current master are on the dashboard and now include the CSharp for windows 64. You can find more information about downloading nightly binaries here: http://www.itk.org/Wiki/SimpleITK/GettingStarted#Nightly_binaries Brad On Mar 12, 2015, at 8:50 PM, Bradley Lowekamp wrote: > Hello, > > Yes, it is more or less the same process. Grab all the ITK and SimpleITK dlls from the bin directories and place them in your path. > > The SimpleITK Superbuild INSTALL target will actually install ITK and SimpleITK's core libraries correctly in to the CMake specified path. The installation target for the superbuild project just doesn't install the target languages ( every language has at least one own way of doing things that CMake does not know about ). You could use this to install all the needed dlls into a defined path. Then just grab the CSharp dll for your project and that should work too. > > Also I worked on the explicit instantiation in SimpleITK today. I was able to reduce the size of the .o files on Linux by 30% by explicitly instantiating about 20 classes with their used templates. This is expected to resolve the linking and packaging issues on windows. So a solution is forth coming. > > Brad > > On Mar 12, 2015, at 7:26 PM, Matias Montroull wrote: > >> Hi Brad, thanks for the explanation. I'm using C#, would that be the same process? >> >> On Wed, Mar 11, 2015 at 8:56 PM, Bradley Lowekamp wrote: >> Hello, >> >> If you are willing to compile it yourself you can get it to work with just a little bit of effort. >> >> Compile the SimpleITK superbuild with shared libraries enabled. Do the usual installation of SimpleITK from the super build [1], this will install the SimpleITK python library into your site-packages. However, this libraries also depends on all the SimpleITK an ITK dlls (not installed or packaged), these should be in the superbuild's bin directory. These need to be in your run-time path when importing SimpleITK. This can be done either by modifying you PATH environment variable you copying them to the appropriate place ( which may depend on the python environment, and there are likely several alternatives). >> >> Brad >> >> [1] http://www.itk.org/Wiki/SimpleITK/GettingStarted#Python_installation >> >> On Mar 11, 2015, at 7:31 PM, Matias Montroull wrote: >> >>> >>> My project is using 64 bits and some DLL I use as well, I've ran into issues when using the beta version because is 32 bits. I guess I'll wait until the final release is done. >>> Thanks, >>> Matias. >>> >>> On Wed, Mar 11, 2015 at 7:54 PM, Matias Montroull wrote: >>> Thanks Bradley, I'll give it a try. I downloaded version 0.8.1 but wasn't aware of this new Beta release >>> Thanks, >>> Matias. >>> >>> On Wed, Mar 11, 2015 at 7:46 PM, Bradley Lowekamp wrote: >>> Hello Matias, >>> >>> Currently there is SimpleITK 0.9b01 [1] out with the registration framework. >>> >>> With it you can do things like this: >>> http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/56_VH_Registration1.html >>> or >>> http://www.itk.org/SimpleITKDoxygen/html/ImageRegistrationMethod2_8py-example.html >>> >>> Please give it a try and let us know how it work for you. >>> >>> Enjoy, >>> Brad >>> >>> [1] http://www.itk.org/Wiki/SimpleITK/ReleaseNotes#SimpleITK_-_Version_0.9.0_Release >>> >>> On Mar 11, 2015, at 6:32 PM, Matias Montroull wrote: >>> >>>> Hi, >>>> >>>> is it possible to do registration in SimpleITK? I mean, something like in this example: >>>> http://public.kitware.com/cgi-bin/viewcvs.cgi/Insight/Examples/Registration/ImageRegistration2.cxx?view=markup >>>> >>>> Thanks, >>>> >>>> Matias, >>>> _____________________________________ >>>> 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 matt.mccormick at kitware.com Thu Mar 19 16:20:06 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 19 Mar 2015 16:20:06 -0400 Subject: [ITK-users] ITK dicom reader wrong spacing In-Reply-To: References: Message-ID: Hi Aiert, It is possible to use DCMTK instead of GDCM. Turn on Module_ITKIODCMTK in your CMake configuration. See the itkDCMTKSeriesReadImageWriter.cxx test for example usage. HTH, Matt On Wed, Mar 18, 2015 at 7:43 AM, Amundarain, Aiert wrote: > I have a DICOM Image serie that itk does not read properly. The x,y,z > spacing are incorrect and the return value is the default one (1,1,1). > > If I read this DICOM Image serie using vtk (vtkDICOMImageReader), the > reading is correct. > > Both softwares are developed by kitware but the results are different. > > > > Is is possible to read the dicom files using ITK without using the gdcm > library? > > > > 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://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 audrey.istace at imavie.fr Mon Mar 23 11:11:13 2015 From: audrey.istace at imavie.fr (AI) Date: Mon, 23 Mar 2015 08:11:13 -0700 (MST) Subject: [ITK-users] itk - Writing dicom files from single 3D file Message-ID: <1427123473731-7587034.post@n2.nabble.com> Hello, I would like to write Dicom files from a nifti image files using DCMTKImageIO. In the code below, I read a nifti file using itkImageFileReader, and then try to write dicom files using itkImageSeriesWriter. I was not able to do it, probably because of the SetMetaDataDictionaryArray method, that I don?t know how to use since I don?t read dicom series as input. Can you help me with that ? Thank you very much, Audrey #include "itkDCMTKImageIO.h" #include "itkNumericSeriesFileNames.h" #include "itkImageFileReader.h" #include "itkImageSeriesWriter.h" int main(int argc, char *argv[]) { typedef signed short PixelType; const unsigned int Dimension = 3; typedef itk::Image< PixelType, Dimension > ImageType; typedef itk::Image< PixelType, 2 > OutputImageType; typedef itk::ImageFileReader< ImageType > ReaderType; typedef itk::DCMTKImageIO ImageIOType; typedef itk::NumericSeriesFileNames NamesGeneratorType; typedef itk::ImageSeriesWriter< ImageType, OutputImageType > WriterType; ImageIOType::Pointer dcmtkIO = ImageIOType::New(); NamesGeneratorType::Pointer namesGenerator = NamesGeneratorType::New(); ReaderType::Pointer reader = ReaderType::New(); WriterType::Pointer writer = WriterType::New(); reader->SetFileName( "../../out.nii" ); reader->Update(); itksys::SystemTools::MakeDirectory( "../../OutputDicom/" ); std::string seriesFormat = "../../OutputDicom/IM%d.dcm"; namesGenerator->SetSeriesFormat (seriesFormat.c_str()); namesGenerator->SetStartIndex (1); namesGenerator->SetEndIndex (166); writer->SetInput( reader->GetOutput() ); writer->SetImageIO( dcmtkIO ); writer->SetFileNames( namesGenerator->GetFileNames() ); // writer->SetMetaDataDictionaryArray( reader->GetMetaDataDictionaryArray() ); writer->Update(); } -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/itk-Writing-dicom-files-from-single-3D-file-tp7587034.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From majcjc at gmail.com Mon Mar 23 12:10:43 2015 From: majcjc at gmail.com (Lin M) Date: Mon, 23 Mar 2015 12:10:43 -0400 Subject: [ITK-users] Computational time of fast marching Message-ID: Hi guys. I'm using fast marching to compute the distance map, but the time of computation is much slower than I expected. Is it normal to cost about 250secs for a 512*512*365 image? I'm using the released mode. My process is like this: 1. initialize a binary image (alive image) where segmented target is set to 1, the rest is set to 0 2. initialize the trial image where the neighbourhood of alive image is set to 1, the rest is set to 0 3. give the two images to the adaptor and set the alive value and the trial value both to 1 4. run fast marching Do you have any ideas about that or some suggestions to improve the performance. Thank you very much! Best, Lin -------------- next part -------------- An HTML attachment was scrubbed... URL: From majcjc at gmail.com Mon Mar 23 12:18:44 2015 From: majcjc at gmail.com (Lin M) Date: Mon, 23 Mar 2015 12:18:44 -0400 Subject: [ITK-users] Computational time of fast marching In-Reply-To: References: Message-ID: I'm using a i7-4650U 8G machine. On Mon, Mar 23, 2015 at 12:10 PM, Lin M wrote: > Hi guys. > > I'm using fast marching to compute the distance map, but the time of > computation is much slower than I expected. Is it normal to cost about > 250secs for a 512*512*365 image? I'm using the released mode. > > My process is like this: > 1. initialize a binary image (alive image) where segmented target is set > to 1, the rest is set to 0 > 2. initialize the trial image where the neighbourhood of alive image is > set to 1, the rest is set to 0 > 3. give the two images to the adaptor and set the alive value and the > trial value both to 1 > 4. run fast marching > > Do you have any ideas about that or some suggestions to improve the > performance. Thank you very much! > > Best, > Lin > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matimontg at gmail.com Tue Mar 24 11:10:32 2015 From: matimontg at gmail.com (Matias Montroull) Date: Tue, 24 Mar 2015 12:10:32 -0300 Subject: [ITK-users] itk - Writing dicom files from single 3D file In-Reply-To: <1427123473731-7587034.post@n2.nabble.com> References: <1427123473731-7587034.post@n2.nabble.com> Message-ID: I'm able to write individual slices from a mha or mhd file, is that the same as nifti file? if so, I can send you the code, I think it's a copy/paste from one of the examples out there. On Mon, Mar 23, 2015 at 12:11 PM, AI wrote: > Hello, > > I would like to write Dicom files from a nifti image files using > DCMTKImageIO. In the code below, I read a nifti file using > itkImageFileReader, and then try to write dicom files using > itkImageSeriesWriter. I was not able to do it, probably because of the > SetMetaDataDictionaryArray method, that I don?t know how to use since I > don?t read dicom series as input. Can you help me with that ? > > Thank you very much, > > Audrey > > #include "itkDCMTKImageIO.h" > #include "itkNumericSeriesFileNames.h" > #include "itkImageFileReader.h" > #include "itkImageSeriesWriter.h" > > int main(int argc, char *argv[]) > { > typedef signed short > PixelType; > const unsigned int > Dimension = 3; > typedef itk::Image< PixelType, Dimension > > ImageType; > typedef itk::Image< PixelType, 2 > > OutputImageType; > typedef itk::ImageFileReader< ImageType > > ReaderType; > typedef itk::DCMTKImageIO > ImageIOType; > typedef itk::NumericSeriesFileNames > NamesGeneratorType; > typedef itk::ImageSeriesWriter< ImageType, OutputImageType > > WriterType; > > ImageIOType::Pointer dcmtkIO = ImageIOType::New(); > NamesGeneratorType::Pointer namesGenerator = > NamesGeneratorType::New(); > ReaderType::Pointer reader = ReaderType::New(); > WriterType::Pointer writer = WriterType::New(); > > reader->SetFileName( "../../out.nii" ); > reader->Update(); > > > > itksys::SystemTools::MakeDirectory( "../../OutputDicom/" ); > > std::string seriesFormat = "../../OutputDicom/IM%d.dcm"; > namesGenerator->SetSeriesFormat (seriesFormat.c_str()); > namesGenerator->SetStartIndex (1); > namesGenerator->SetEndIndex (166); > > > writer->SetInput( reader->GetOutput() ); > writer->SetImageIO( dcmtkIO ); > writer->SetFileNames( namesGenerator->GetFileNames() ); > // writer->SetMetaDataDictionaryArray( > reader->GetMetaDataDictionaryArray() ); > writer->Update(); > } > > > > > -- > View this message in context: > http://itk-insight-users.2283740.n2.nabble.com/itk-Writing-dicom-files-from-single-3D-file-tp7587034.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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matimontg at gmail.com Tue Mar 24 11:17:43 2015 From: matimontg at gmail.com (Matias Montroull) Date: Tue, 24 Mar 2015 12:17:43 -0300 Subject: [ITK-users] [ITK] Registration in SimpleITK In-Reply-To: References: Message-ID: Hi Bradley, so if I would like to download the Csharp DLL files, I need to go to the link you posted? for example, I can download: VS9-Win32-pkg-py2.7-csharp-java-master [image: Files] [image: info] ? Thanks, I'm new to the dashboard. Matias. On Thu, Mar 19, 2015 at 10:17 AM, Bradley Lowekamp wrote: > Hello, > > Binaries for the current master are on the dashboard and now include the > CSharp for windows 64. You can find more information about downloading > nightly binaries here: > http://www.itk.org/Wiki/SimpleITK/GettingStarted#Nightly_binaries > > Brad > > On Mar 12, 2015, at 8:50 PM, Bradley Lowekamp > wrote: > > Hello, > > Yes, it is more or less the same process. Grab all the ITK and SimpleITK > dlls from the bin directories and place them in your path. > > The SimpleITK Superbuild INSTALL target will actually install ITK and > SimpleITK's core libraries correctly in to the CMake specified path. The > installation target for the superbuild project just doesn't install the > target languages ( every language has at least one own way of doing things > that CMake does not know about ). You could use this to install all the > needed dlls into a defined path. Then just grab the CSharp dll for your > project and that should work too. > > Also I worked on the explicit instantiation in SimpleITK today. I was able > to reduce the size of the .o files on Linux by 30% by explicitly > instantiating about 20 classes with their used templates. This is expected > to resolve the linking and packaging issues on windows. So a solution is > forth coming. > > Brad > > On Mar 12, 2015, at 7:26 PM, Matias Montroull wrote: > > Hi Brad, thanks for the explanation. I'm using C#, would that be the same > process? > > On Wed, Mar 11, 2015 at 8:56 PM, Bradley Lowekamp > wrote: > >> Hello, >> >> If you are willing to compile it yourself you can get it to work with >> just a little bit of effort. >> >> Compile the SimpleITK superbuild with shared libraries enabled. Do the >> usual installation of SimpleITK from the super build [1], this will install >> the SimpleITK python library into your site-packages. However, this >> libraries also depends on all the SimpleITK an ITK dlls (not installed or >> packaged), these should be in the superbuild's bin directory. These need to >> be in your run-time path when importing SimpleITK. This can be done either >> by modifying you PATH environment variable you copying them to the >> appropriate place ( which may depend on the python environment, and there >> are likely several alternatives). >> >> Brad >> >> [1] http://www.itk.org/Wiki/SimpleITK/GettingStarted#Python_installation >> >> On Mar 11, 2015, at 7:31 PM, Matias Montroull >> wrote: >> >> >> My project is using 64 bits and some DLL I use as well, I've ran into >> issues when using the beta version because is 32 bits. I guess I'll wait >> until the final release is done. >> Thanks, >> Matias. >> >> On Wed, Mar 11, 2015 at 7:54 PM, Matias Montroull >> wrote: >> >>> Thanks Bradley, I'll give it a try. I downloaded version 0.8.1 but >>> wasn't aware of this new Beta release >>> Thanks, >>> Matias. >>> >>> On Wed, Mar 11, 2015 at 7:46 PM, Bradley Lowekamp < >>> blowekamp at mail.nih.gov> wrote: >>> >>>> Hello Matias, >>>> >>>> Currently there is SimpleITK 0.9b01 [1] out with the registration >>>> framework. >>>> >>>> With it you can do things like this: >>>> >>>> http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/56_VH_Registration1.html >>>> or >>>> >>>> http://www.itk.org/SimpleITKDoxygen/html/ImageRegistrationMethod2_8py-example.html >>>> >>>> Please give it a try and let us know how it work for you. >>>> >>>> Enjoy, >>>> Brad >>>> >>>> [1] >>>> http://www.itk.org/Wiki/SimpleITK/ReleaseNotes#SimpleITK_-_Version_0.9.0_Release >>>> >>>> On Mar 11, 2015, at 6:32 PM, Matias Montroull >>>> wrote: >>>> >>>> Hi, >>>> >>>> is it possible to do registration in SimpleITK? I mean, something like >>>> in this example: >>>> >>>> http://public.kitware.com/cgi-bin/viewcvs.cgi/Insight/Examples/Registration/ImageRegistration2.cxx?view=markup >>>> >>>> Thanks, >>>> >>>> Matias, >>>> _____________________________________ >>>> 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 blowekamp at mail.nih.gov Tue Mar 24 11:22:06 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Tue, 24 Mar 2015 11:22:06 -0400 Subject: [ITK-users] [ITK] Registration in SimpleITK In-Reply-To: References: Message-ID: <1AB9A9D9-03DC-4478-9EC1-B6682B5581B5@mail.nih.gov> The link you provided is for windows 32. You said you wanted windows 64, its here: https://open.cdash.org/viewFiles.php?buildid=3741847 Brad On Mar 24, 2015, at 11:17 AM, Matias Montroull wrote: > Hi Bradley, so if I would like to download the Csharp DLL files, I need to go to the link you posted? for example, I can download: > VS9-Win32-pkg-py2.7-csharp-java-master > ? > Thanks, I'm new to the dashboard. > Matias. > > On Thu, Mar 19, 2015 at 10:17 AM, Bradley Lowekamp wrote: > Hello, > > Binaries for the current master are on the dashboard and now include the CSharp for windows 64. You can find more information about downloading nightly binaries here: > http://www.itk.org/Wiki/SimpleITK/GettingStarted#Nightly_binaries > > Brad > > On Mar 12, 2015, at 8:50 PM, Bradley Lowekamp wrote: > >> Hello, >> >> Yes, it is more or less the same process. Grab all the ITK and SimpleITK dlls from the bin directories and place them in your path. >> >> The SimpleITK Superbuild INSTALL target will actually install ITK and SimpleITK's core libraries correctly in to the CMake specified path. The installation target for the superbuild project just doesn't install the target languages ( every language has at least one own way of doing things that CMake does not know about ). You could use this to install all the needed dlls into a defined path. Then just grab the CSharp dll for your project and that should work too. >> >> Also I worked on the explicit instantiation in SimpleITK today. I was able to reduce the size of the .o files on Linux by 30% by explicitly instantiating about 20 classes with their used templates. This is expected to resolve the linking and packaging issues on windows. So a solution is forth coming. >> >> Brad >> >> On Mar 12, 2015, at 7:26 PM, Matias Montroull wrote: >> >>> Hi Brad, thanks for the explanation. I'm using C#, would that be the same process? >>> >>> On Wed, Mar 11, 2015 at 8:56 PM, Bradley Lowekamp wrote: >>> Hello, >>> >>> If you are willing to compile it yourself you can get it to work with just a little bit of effort. >>> >>> Compile the SimpleITK superbuild with shared libraries enabled. Do the usual installation of SimpleITK from the super build [1], this will install the SimpleITK python library into your site-packages. However, this libraries also depends on all the SimpleITK an ITK dlls (not installed or packaged), these should be in the superbuild's bin directory. These need to be in your run-time path when importing SimpleITK. This can be done either by modifying you PATH environment variable you copying them to the appropriate place ( which may depend on the python environment, and there are likely several alternatives). >>> >>> Brad >>> >>> [1] http://www.itk.org/Wiki/SimpleITK/GettingStarted#Python_installation >>> >>> On Mar 11, 2015, at 7:31 PM, Matias Montroull wrote: >>> >>>> >>>> My project is using 64 bits and some DLL I use as well, I've ran into issues when using the beta version because is 32 bits. I guess I'll wait until the final release is done. >>>> Thanks, >>>> Matias. >>>> >>>> On Wed, Mar 11, 2015 at 7:54 PM, Matias Montroull wrote: >>>> Thanks Bradley, I'll give it a try. I downloaded version 0.8.1 but wasn't aware of this new Beta release >>>> Thanks, >>>> Matias. >>>> >>>> On Wed, Mar 11, 2015 at 7:46 PM, Bradley Lowekamp wrote: >>>> Hello Matias, >>>> >>>> Currently there is SimpleITK 0.9b01 [1] out with the registration framework. >>>> >>>> With it you can do things like this: >>>> http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/56_VH_Registration1.html >>>> or >>>> http://www.itk.org/SimpleITKDoxygen/html/ImageRegistrationMethod2_8py-example.html >>>> >>>> Please give it a try and let us know how it work for you. >>>> >>>> Enjoy, >>>> Brad >>>> >>>> [1] http://www.itk.org/Wiki/SimpleITK/ReleaseNotes#SimpleITK_-_Version_0.9.0_Release >>>> >>>> On Mar 11, 2015, at 6:32 PM, Matias Montroull wrote: >>>> >>>>> Hi, >>>>> >>>>> is it possible to do registration in SimpleITK? I mean, something like in this example: >>>>> http://public.kitware.com/cgi-bin/viewcvs.cgi/Insight/Examples/Registration/ImageRegistration2.cxx?view=markup >>>>> >>>>> Thanks, >>>>> >>>>> Matias, >>>>> _____________________________________ >>>>> 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 audrey.istace at imavie.fr Tue Mar 24 11:57:35 2015 From: audrey.istace at imavie.fr (AI) Date: Tue, 24 Mar 2015 08:57:35 -0700 (MST) Subject: [ITK-users] itk - Writing dicom files from single 3D file In-Reply-To: References: <1427123473731-7587034.post@n2.nabble.com> Message-ID: Hi Matias, Thank you for your answer. If your code is working with DCMTKImageIO and not GDCMImageIO, I would be happy to see it. For me it works using gdcm but not using dcmtk (compilation is ok, but no dicom is written in my output directory after execution), and I would like to use dcmtk. De : Matias Montroull [via ITK Insight Users] [mailto:ml-node+s2283740n7587037h21 at n2.nabble.com] Envoy? : mardi 24 mars 2015 16:11 ? : Audrey Istace Objet : Re: [ITK-users] itk - Writing dicom files from single 3D file I'm able to write individual slices from a mha or mhd file, is that the same as nifti file? if so, I can send you the code, I think it's a copy/paste from one of the examples out there. On Mon, Mar 23, 2015 at 12:11 PM, AI <[hidden email]> wrote: Hello, I would like to write Dicom files from a nifti image files using DCMTKImageIO. In the code below, I read a nifti file using itkImageFileReader, and then try to write dicom files using itkImageSeriesWriter. I was not able to do it, probably because of the SetMetaDataDictionaryArray method, that I don?t know how to use since I don?t read dicom series as input. Can you help me with that ? Thank you very much, Audrey #include "itkDCMTKImageIO.h" #include "itkNumericSeriesFileNames.h" #include "itkImageFileReader.h" #include "itkImageSeriesWriter.h" int main(int argc, char *argv[]) { typedef signed short PixelType; const unsigned int Dimension = 3; typedef itk::Image< PixelType, Dimension > ImageType; typedef itk::Image< PixelType, 2 > OutputImageType; typedef itk::ImageFileReader< ImageType > ReaderType; typedef itk::DCMTKImageIO ImageIOType; typedef itk::NumericSeriesFileNames NamesGeneratorType; typedef itk::ImageSeriesWriter< ImageType, OutputImageType > WriterType; ImageIOType::Pointer dcmtkIO = ImageIOType::New(); NamesGeneratorType::Pointer namesGenerator = NamesGeneratorType::New(); ReaderType::Pointer reader = ReaderType::New(); WriterType::Pointer writer = WriterType::New(); reader->SetFileName( "../../out.nii" ); reader->Update(); itksys::SystemTools::MakeDirectory( "../../OutputDicom/" ); std::string seriesFormat = "../../OutputDicom/IM%d.dcm"; namesGenerator->SetSeriesFormat (seriesFormat.c_str()); namesGenerator->SetStartIndex (1); namesGenerator->SetEndIndex (166); writer->SetInput( reader->GetOutput() ); writer->SetImageIO( dcmtkIO ); writer->SetFileNames( namesGenerator->GetFileNames() ); // writer->SetMetaDataDictionaryArray( reader->GetMetaDataDictionaryArray() ); writer->Update(); } -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/itk-Writing-dicom-files-from-single-3D-file-tp7587034.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 ________________________________ If you reply to this email, your message will be added to the discussion below: http://itk-insight-users.2283740.n2.nabble.com/itk-Writing-dicom-files-from-single-3D-file-tp7587034p7587037.html To unsubscribe from itk - Writing dicom files from single 3D file, click here. NAML -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/itk-Writing-dicom-files-from-single-3D-file-tp7587034p7587040.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From matimontg at gmail.com Tue Mar 24 12:08:13 2015 From: matimontg at gmail.com (Matias Montroull) Date: Tue, 24 Mar 2015 13:08:13 -0300 Subject: [ITK-users] itk - Writing dicom files from single 3D file In-Reply-To: References: <1427123473731-7587034.post@n2.nabble.com> Message-ID: Al, the code I have is using GDCM: typedef itk::GDCMImageIO ImageIOType; On Tue, Mar 24, 2015 at 12:57 PM, AI wrote: > Hi Matias, > > Thank you for your answer. > If your code is working with DCMTKImageIO and not GDCMImageIO, I would be > happy to see it. > For me it works using gdcm but not using dcmtk (compilation is ok, but no > dicom is written in my output directory after execution), and I would like > to use dcmtk. > > De : Matias Montroull [via ITK Insight Users] [mailto: > ml-node+s2283740n7587037h21 at n2.nabble.com] > Envoy? : mardi 24 mars 2015 16:11 > ? : Audrey Istace > Objet : Re: [ITK-users] itk - Writing dicom files from single 3D file > > I'm able to write individual slices from a mha or mhd file, is that the > same as nifti file? if so, I can send you the code, I think it's a > copy/paste from one of the examples out there. > > On Mon, Mar 23, 2015 at 12:11 PM, AI <[hidden > email]> wrote: > Hello, > > I would like to write Dicom files from a nifti image files using > DCMTKImageIO. In the code below, I read a nifti file using > itkImageFileReader, and then try to write dicom files using > itkImageSeriesWriter. I was not able to do it, probably because of the > SetMetaDataDictionaryArray method, that I don?t know how to use since I > don?t read dicom series as input. Can you help me with that ? > > Thank you very much, > > Audrey > > #include "itkDCMTKImageIO.h" > #include "itkNumericSeriesFileNames.h" > #include "itkImageFileReader.h" > #include "itkImageSeriesWriter.h" > > int main(int argc, char *argv[]) > { > typedef signed short > PixelType; > const unsigned int > Dimension = 3; > typedef itk::Image< PixelType, Dimension > > ImageType; > typedef itk::Image< PixelType, 2 > > OutputImageType; > typedef itk::ImageFileReader< ImageType > > ReaderType; > typedef itk::DCMTKImageIO > ImageIOType; > typedef itk::NumericSeriesFileNames > NamesGeneratorType; > typedef itk::ImageSeriesWriter< ImageType, OutputImageType > > WriterType; > > ImageIOType::Pointer dcmtkIO = ImageIOType::New(); > NamesGeneratorType::Pointer namesGenerator = > NamesGeneratorType::New(); > ReaderType::Pointer reader = ReaderType::New(); > WriterType::Pointer writer = WriterType::New(); > > reader->SetFileName( "../../out.nii" ); > reader->Update(); > > > > itksys::SystemTools::MakeDirectory( "../../OutputDicom/" ); > > std::string seriesFormat = "../../OutputDicom/IM%d.dcm"; > namesGenerator->SetSeriesFormat (seriesFormat.c_str()); > namesGenerator->SetStartIndex (1); > namesGenerator->SetEndIndex (166); > > > writer->SetInput( reader->GetOutput() ); > writer->SetImageIO( dcmtkIO ); > writer->SetFileNames( namesGenerator->GetFileNames() ); > // writer->SetMetaDataDictionaryArray( > reader->GetMetaDataDictionaryArray() ); > writer->Update(); > } > > > > > -- > View this message in context: > http://itk-insight-users.2283740.n2.nabble.com/itk-Writing-dicom-files-from-single-3D-file-tp7587034.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 > > ________________________________ > If you reply to this email, your message will be added to the discussion > below: > > http://itk-insight-users.2283740.n2.nabble.com/itk-Writing-dicom-files-from-single-3D-file-tp7587034p7587037.html > To unsubscribe from itk - Writing dicom files from single 3D file, click > here< > http://itk-insight-users.2283740.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=7587034&code=YXVkcmV5LmlzdGFjZUBpbWF2aWUuZnJ8NzU4NzAzNHw4NzExNjY2MzA= > >. > NAML< > http://itk-insight-users.2283740.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml > > > > > > > -- > View this message in context: > http://itk-insight-users.2283740.n2.nabble.com/itk-Writing-dicom-files-from-single-3D-file-tp7587034p7587040.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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From audrey.istace at imavie.fr Tue Mar 24 12:12:38 2015 From: audrey.istace at imavie.fr (AI) Date: Tue, 24 Mar 2015 09:12:38 -0700 (MST) Subject: [ITK-users] itk - Writing dicom files from single 3D file In-Reply-To: References: <1427123473731-7587034.post@n2.nabble.com> Message-ID: Thank you. If someone has already writen dicom files using itkDCMTKImageIO.h, please help me ! De : Matias Montroull [via ITK Insight Users] [mailto:ml-node+s2283740n7587041h45 at n2.nabble.com] Envoy? : mardi 24 mars 2015 17:09 ? : Audrey Istace Objet : Re: [ITK-users] itk - Writing dicom files from single 3D file Al, the code I have is using GDCM: typedef itk::GDCMImageIO ImageIOType; On Tue, Mar 24, 2015 at 12:57 PM, AI <[hidden email]> wrote: Hi Matias, Thank you for your answer. If your code is working with DCMTKImageIO and not GDCMImageIO, I would be happy to see it. For me it works using gdcm but not using dcmtk (compilation is ok, but no dicom is written in my output directory after execution), and I would like to use dcmtk. De : Matias Montroull [via ITK Insight Users] [mailto:[hidden email]] Envoy? : mardi 24 mars 2015 16:11 ? : Audrey Istace Objet : Re: [ITK-users] itk - Writing dicom files from single 3D file I'm able to write individual slices from a mha or mhd file, is that the same as nifti file? if so, I can send you the code, I think it's a copy/paste from one of the examples out there. On Mon, Mar 23, 2015 at 12:11 PM, AI <[hidden email]> wrote: Hello, I would like to write Dicom files from a nifti image files using DCMTKImageIO. In the code below, I read a nifti file using itkImageFileReader, and then try to write dicom files using itkImageSeriesWriter. I was not able to do it, probably because of the SetMetaDataDictionaryArray method, that I don?t know how to use since I don?t read dicom series as input. Can you help me with that ? Thank you very much, Audrey #include "itkDCMTKImageIO.h" #include "itkNumericSeriesFileNames.h" #include "itkImageFileReader.h" #include "itkImageSeriesWriter.h" int main(int argc, char *argv[]) { typedef signed short PixelType; const unsigned int Dimension = 3; typedef itk::Image< PixelType, Dimension > ImageType; typedef itk::Image< PixelType, 2 > OutputImageType; typedef itk::ImageFileReader< ImageType > ReaderType; typedef itk::DCMTKImageIO ImageIOType; typedef itk::NumericSeriesFileNames NamesGeneratorType; typedef itk::ImageSeriesWriter< ImageType, OutputImageType > WriterType; ImageIOType::Pointer dcmtkIO = ImageIOType::New(); NamesGeneratorType::Pointer namesGenerator = NamesGeneratorType::New(); ReaderType::Pointer reader = ReaderType::New(); WriterType::Pointer writer = WriterType::New(); reader->SetFileName( "../../out.nii" ); reader->Update(); itksys::SystemTools::MakeDirectory( "../../OutputDicom/" ); std::string seriesFormat = "../../OutputDicom/IM%d.dcm"; namesGenerator->SetSeriesFormat (seriesFormat.c_str()); namesGenerator->SetStartIndex (1); namesGenerator->SetEndIndex (166); writer->SetInput( reader->GetOutput() ); writer->SetImageIO( dcmtkIO ); writer->SetFileNames( namesGenerator->GetFileNames() ); // writer->SetMetaDataDictionaryArray( reader->GetMetaDataDictionaryArray() ); writer->Update(); } -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/itk-Writing-dicom-files-from-single-3D-file-tp7587034.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 ________________________________ If you reply to this email, your message will be added to the discussion below: http://itk-insight-users.2283740.n2.nabble.com/itk-Writing-dicom-files-from-single-3D-file-tp7587034p7587037.html To unsubscribe from itk - Writing dicom files from single 3D file, click here< NAML -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/itk-Writing-dicom-files-from-single-3D-file-tp7587034p7587040.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 ________________________________ If you reply to this email, your message will be added to the discussion below: http://itk-insight-users.2283740.n2.nabble.com/itk-Writing-dicom-files-from-single-3D-file-tp7587034p7587041.html To unsubscribe from itk - Writing dicom files from single 3D file, click here. NAML -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/itk-Writing-dicom-files-from-single-3D-file-tp7587034p7587042.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From matt.mccormick at kitware.com Tue Mar 24 12:43:50 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 24 Mar 2015 12:43:50 -0400 Subject: [ITK-users] itk - Writing dicom files from single 3D file In-Reply-To: <1427123473731-7587034.post@n2.nabble.com> References: <1427123473731-7587034.post@n2.nabble.com> Message-ID: Hi, DCMTKImageIO not serialize or de-serialize DICOM tags to / from its MetaDataDictionaryArray currently like GDCM does. HTH, Matt On Mon, Mar 23, 2015 at 11:11 AM, AI wrote: > Hello, > > I would like to write Dicom files from a nifti image files using > DCMTKImageIO. In the code below, I read a nifti file using > itkImageFileReader, and then try to write dicom files using > itkImageSeriesWriter. I was not able to do it, probably because of the > SetMetaDataDictionaryArray method, that I don?t know how to use since I > don?t read dicom series as input. Can you help me with that ? > > Thank you very much, > > Audrey > > #include "itkDCMTKImageIO.h" > #include "itkNumericSeriesFileNames.h" > #include "itkImageFileReader.h" > #include "itkImageSeriesWriter.h" > > int main(int argc, char *argv[]) > { > typedef signed short > PixelType; > const unsigned int > Dimension = 3; > typedef itk::Image< PixelType, Dimension > > ImageType; > typedef itk::Image< PixelType, 2 > > OutputImageType; > typedef itk::ImageFileReader< ImageType > > ReaderType; > typedef itk::DCMTKImageIO > ImageIOType; > typedef itk::NumericSeriesFileNames > NamesGeneratorType; > typedef itk::ImageSeriesWriter< ImageType, OutputImageType > > WriterType; > > ImageIOType::Pointer dcmtkIO = ImageIOType::New(); > NamesGeneratorType::Pointer namesGenerator = > NamesGeneratorType::New(); > ReaderType::Pointer reader = ReaderType::New(); > WriterType::Pointer writer = WriterType::New(); > > reader->SetFileName( "../../out.nii" ); > reader->Update(); > > > > itksys::SystemTools::MakeDirectory( "../../OutputDicom/" ); > > std::string seriesFormat = "../../OutputDicom/IM%d.dcm"; > namesGenerator->SetSeriesFormat (seriesFormat.c_str()); > namesGenerator->SetStartIndex (1); > namesGenerator->SetEndIndex (166); > > > writer->SetInput( reader->GetOutput() ); > writer->SetImageIO( dcmtkIO ); > writer->SetFileNames( namesGenerator->GetFileNames() ); > // writer->SetMetaDataDictionaryArray( > reader->GetMetaDataDictionaryArray() ); > writer->Update(); > } > > > > > -- > View this message in context: http://itk-insight-users.2283740.n2.nabble.com/itk-Writing-dicom-files-from-single-3D-file-tp7587034.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 matimontg at gmail.com Tue Mar 24 13:45:16 2015 From: matimontg at gmail.com (Matias Montroull) Date: Tue, 24 Mar 2015 14:45:16 -0300 Subject: [ITK-users] ImageSeriesWriter | SimpleITK Message-ID: Hi, I'm looking for an example on how to convert an mhd or mha image into slices. I downloaded SimpleITK V0.9 Beta and was playing around with the new ImageSeriesWriter class but can't figure out how to do it. Do I need to declare a VectorString? Thanks, Matias. -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Tue Mar 24 13:50:43 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Tue, 24 Mar 2015 13:50:43 -0400 Subject: [ITK-users] ImageSeriesWriter | SimpleITK In-Reply-To: References: Message-ID: <0ED4F886-5DA7-408C-A834-E372D8C77564@mail.nih.gov> Yes, it you should use the VectorString SimpleITK for CSharp has for the fileNames argument. If you are having trouble please provide a small example, and what the error/problem is. Brad On Mar 24, 2015, at 1:45 PM, Matias Montroull wrote: > Hi, > > I'm looking for an example on how to convert an mhd or mha image into slices. I downloaded SimpleITK V0.9 Beta and was playing around with the new ImageSeriesWriter class but can't figure out how to do it. > Do I need to declare a VectorString? > Thanks, > > Matias. -------------- next part -------------- An HTML attachment was scrubbed... URL: From matimontg at gmail.com Tue Mar 24 13:56:12 2015 From: matimontg at gmail.com (Matias Montroull) Date: Tue, 24 Mar 2015 14:56:12 -0300 Subject: [ITK-users] ImageSeriesWriter | SimpleITK In-Reply-To: <0ED4F886-5DA7-408C-A834-E372D8C77564@mail.nih.gov> References: <0ED4F886-5DA7-408C-A834-E372D8C77564@mail.nih.gov> Message-ID: Bradley, Here's what I'm testing now (I'm trying to write a series of slices from a mha file) ImageFileReader imgreader = new ImageFileReader(); imgreader.SetFileName(path_pacientes + nombre_paciente + @"\Fusion\" + "resultado.mha"); itk.simple.Image imgtest = imgreader.Execute(); ImageSeriesWriter SeriesWriter = new ImageSeriesWriter(); VectorString vs = new VectorString(); //Here's where I struggle... vs.Add(path_pacientes + nombre_paciente + @"\Fusion\SalidaTest\imagen%03d.dcm"); //Is this rthe right way to include a vector of strings? SeriesWriter.SetFileNames(vs); On Tue, Mar 24, 2015 at 2:50 PM, Bradley Lowekamp wrote: > Yes, it you should use the VectorString SimpleITK for CSharp has for the > fileNames argument. > > If you are having trouble please provide a small example, and what the > error/problem is. > > Brad > > On Mar 24, 2015, at 1:45 PM, Matias Montroull wrote: > > Hi, > > I'm looking for an example on how to convert an mhd or mha image into > slices. I downloaded SimpleITK V0.9 Beta and was playing around with the > new ImageSeriesWriter class but can't figure out how to do it. > Do I need to declare a VectorString? > Thanks, > > Matias. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Tue Mar 24 14:12:47 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Tue, 24 Mar 2015 14:12:47 -0400 Subject: [ITK-users] ImageSeriesWriter | SimpleITK In-Reply-To: References: <0ED4F886-5DA7-408C-A834-E372D8C77564@mail.nih.gov> Message-ID: <1C0358A6-56D5-4D38-B21F-A875F85E09E3@mail.nih.gov> Hello, On Mar 24, 2015, at 1:56 PM, Matias Montroull wrote: > //Here's where I struggle... > vs.Add(path_pacientes + nombre_paciente + @"\Fusion\SalidaTest\imagen%03d.dcm"); //Is this rthe right way to include a vector of strings No that is not the write way. You actually need to create the list for file names. You needs something closer to what's here in the C++ test [1] but converted to CSharp. The length of the list must match the z size of the images. Many languages have convenient generator expressions or list comprehensions, which seems more natural than C printf formatting and the perils associated with it. The long way to do it is just write a little for loop, something like: for (i=0; i < img.GetSize()[2], ++i) vs.Add( "name {0}.ext".Format(i)) Brad [1] https://github.com/SimpleITK/SimpleITK/blob/master/Testing/Unit/IOTests.cxx#L123-L152 -------------- next part -------------- An HTML attachment was scrubbed... URL: From matimontg at gmail.com Tue Mar 24 17:19:04 2015 From: matimontg at gmail.com (Matias Montroull) Date: Tue, 24 Mar 2015 18:19:04 -0300 Subject: [ITK-users] ImageSeriesWriter | SimpleITK In-Reply-To: <1C0358A6-56D5-4D38-B21F-A875F85E09E3@mail.nih.gov> References: <0ED4F886-5DA7-408C-A834-E372D8C77564@mail.nih.gov> <1C0358A6-56D5-4D38-B21F-A875F85E09E3@mail.nih.gov> Message-ID: Thanks Bradley, So, I did this: ImageFileReader imgreader = new ImageFileReader(); imgreader.SetFileName(path_pacientes + nombre_paciente + @"\Fusion\" + "resultado.mha"); itk.simple.Image imgtest = imgreader.Execute(); ImageSeriesWriter SeriesWriter = new ImageSeriesWriter(); VectorString vs = new VectorString(); for (int i=0; i < imgtest.GetSize()[2]; ++i) { vs.Add("imagen {0}.dcm"); } SeriesWriter.SetFileNames(vs); SeriesWriter.Execute(imgtest, vs, false); And I only get one file name (imagen {0}.dcm), am I missing something? (I wasn't able to do this: "name {0}.ext".Format(i)) Thanks, Matias. On Tue, Mar 24, 2015 at 3:12 PM, Bradley Lowekamp wrote: > Hello, > > On Mar 24, 2015, at 1:56 PM, Matias Montroull wrote: > > //Here's where I struggle... > vs.Add(path_pacientes + nombre_paciente + > @"\Fusion\SalidaTest\imagen%03d.dcm"); //Is this rthe right way to include > a vector of strings > > > > No that is not the write way. You actually need to create the list for > file names. You needs something closer to what's here in the C++ test [1] > but converted to CSharp. The length of the list must match the z size of > the images. > > Many languages have convenient generator expressions or list > comprehensions, which seems more natural than C printf formatting and the > perils associated with it. > > The long way to do it is just write a little for loop, something like: > > for (i=0; i < img.GetSize()[2], ++i) > vs.Add( "name {0}.ext".Format(i)) > > Brad > > [1] > https://github.com/SimpleITK/SimpleITK/blob/master/Testing/Unit/IOTests.cxx#L123-L152 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matimontg at gmail.com Tue Mar 24 17:25:20 2015 From: matimontg at gmail.com (Matias Montroull) Date: Tue, 24 Mar 2015 18:25:20 -0300 Subject: [ITK-users] ImageSeriesWriter | SimpleITK In-Reply-To: References: <0ED4F886-5DA7-408C-A834-E372D8C77564@mail.nih.gov> <1C0358A6-56D5-4D38-B21F-A875F85E09E3@mail.nih.gov> Message-ID: Sorry... I figured out: here's the code that works, I missed to add the images using "i" as the variable that changes in every iteration as well as specifying the full path to the directory in the Add method ImageFileReader imgreader = new ImageFileReader(); imgreader.SetFileName(path_pacientes + nombre_paciente + @"\Fusion\" + "resultado.mha"); itk.simple.Image imgtest = imgreader.Execute(); ImageSeriesWriter SeriesWriter = new ImageSeriesWriter(); VectorString vs = new VectorString(); for (int i=0; i < imgtest.GetSize()[2]; ++i) { vs.Add(path_pacientes + nombre_paciente + @"\Fusion\Test\" + "imagen" + i + ".dcm"); } SeriesWriter.SetFileNames(vs); SeriesWriter.Execute(imgtest, vs, false); Thanks for all your help! Matias. On Tue, Mar 24, 2015 at 6:19 PM, Matias Montroull wrote: > Thanks Bradley, > > So, I did this: > > ImageFileReader imgreader = new ImageFileReader(); > imgreader.SetFileName(path_pacientes + nombre_paciente + > @"\Fusion\" + "resultado.mha"); > itk.simple.Image imgtest = imgreader.Execute(); > ImageSeriesWriter SeriesWriter = new ImageSeriesWriter(); > VectorString vs = new VectorString(); > for (int i=0; i < imgtest.GetSize()[2]; ++i) > { > vs.Add("imagen {0}.dcm"); > } > > SeriesWriter.SetFileNames(vs); > SeriesWriter.Execute(imgtest, vs, false); > > And I only get one file name (imagen {0}.dcm), am I missing something? (I > wasn't able to do this: "name {0}.ext".Format(i)) > > Thanks, > > Matias. > > On Tue, Mar 24, 2015 at 3:12 PM, Bradley Lowekamp > wrote: > >> Hello, >> >> On Mar 24, 2015, at 1:56 PM, Matias Montroull >> wrote: >> >> //Here's where I struggle... >> vs.Add(path_pacientes + nombre_paciente + >> @"\Fusion\SalidaTest\imagen%03d.dcm"); //Is this rthe right way to include >> a vector of strings >> >> >> >> No that is not the write way. You actually need to create the list for >> file names. You needs something closer to what's here in the C++ test [1] >> but converted to CSharp. The length of the list must match the z size of >> the images. >> >> Many languages have convenient generator expressions or list >> comprehensions, which seems more natural than C printf formatting and the >> perils associated with it. >> >> The long way to do it is just write a little for loop, something like: >> >> for (i=0; i < img.GetSize()[2], ++i) >> vs.Add( "name {0}.ext".Format(i)) >> >> Brad >> >> [1] >> https://github.com/SimpleITK/SimpleITK/blob/master/Testing/Unit/IOTests.cxx#L123-L152 >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From audrey.istace at imavie.fr Wed Mar 25 03:49:59 2015 From: audrey.istace at imavie.fr (Audrey Istace) Date: Wed, 25 Mar 2015 07:49:59 +0000 Subject: [ITK-users] itk - Writing dicom files from single 3D file In-Reply-To: References: <1427123473731-7587034.post@n2.nabble.com> Message-ID: Hi Matt, Thank you for answering. I am not sure to understand. Does that mean that I cannot write dicom files using DCMTKImageIO (or any other itk DCMTK class) ? -----Message d'origine----- De?: Matt McCormick [mailto:matt.mccormick at kitware.com] Envoy??: mardi 24 mars 2015 17:44 ??: Audrey Istace Cc?: insight-users at itk.org Objet?: Re: [ITK-users] itk - Writing dicom files from single 3D file Hi, DCMTKImageIO not serialize or de-serialize DICOM tags to / from its MetaDataDictionaryArray currently like GDCM does. HTH, Matt On Mon, Mar 23, 2015 at 11:11 AM, AI wrote: > Hello, > > I would like to write Dicom files from a nifti image files using > DCMTKImageIO. In the code below, I read a nifti file using > itkImageFileReader, and then try to write dicom files using > itkImageSeriesWriter. I was not able to do it, probably because of the > SetMetaDataDictionaryArray method, that I don?t know how to use since > I don?t read dicom series as input. Can you help me with that ? > > Thank you very much, > > Audrey > > #include "itkDCMTKImageIO.h" > #include "itkNumericSeriesFileNames.h" > #include "itkImageFileReader.h" > #include "itkImageSeriesWriter.h" > > int main(int argc, char *argv[]) > { > typedef signed short > PixelType; > const unsigned int > Dimension = 3; > typedef itk::Image< PixelType, Dimension > ImageType; > typedef itk::Image< PixelType, 2 > OutputImageType; > typedef itk::ImageFileReader< ImageType > ReaderType; > typedef itk::DCMTKImageIO ImageIOType; > typedef itk::NumericSeriesFileNames NamesGeneratorType; > typedef itk::ImageSeriesWriter< ImageType, > OutputImageType > WriterType; > > ImageIOType::Pointer dcmtkIO = ImageIOType::New(); > NamesGeneratorType::Pointer namesGenerator = > NamesGeneratorType::New(); > ReaderType::Pointer reader = ReaderType::New(); > WriterType::Pointer writer = WriterType::New(); > > reader->SetFileName( "../../out.nii" ); > reader->Update(); > > > > itksys::SystemTools::MakeDirectory( > "../../OutputDicom/" ); > > std::string seriesFormat = "../../OutputDicom/IM%d.dcm"; > namesGenerator->SetSeriesFormat (seriesFormat.c_str()); > namesGenerator->SetStartIndex (1); > namesGenerator->SetEndIndex (166); > > > writer->SetInput( reader->GetOutput() ); > writer->SetImageIO( dcmtkIO ); > writer->SetFileNames( namesGenerator->GetFileNames() ); > // writer->SetMetaDataDictionaryArray( > reader->GetMetaDataDictionaryArray() ); > writer->Update(); > } > > > > > -- > View this message in context: > http://itk-insight-users.2283740.n2.nabble.com/itk-Writing-dicom-files > -from-single-3D-file-tp7587034.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 matt.mccormick at kitware.com Wed Mar 25 10:02:38 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Wed, 25 Mar 2015 10:02:38 -0400 Subject: [ITK-users] itk - Writing dicom files from single 3D file In-Reply-To: References: <1427123473731-7587034.post@n2.nabble.com> Message-ID: Hi Audrey, It means that it is more difficult (than usual) to write DICOM images with the correct metadata. HTH, Matt On Wed, Mar 25, 2015 at 3:49 AM, Audrey Istace wrote: > Hi Matt, > > Thank you for answering. > I am not sure to understand. Does that mean that I cannot write dicom files using DCMTKImageIO (or any other itk DCMTK class) ? > > -----Message d'origine----- > De : Matt McCormick [mailto:matt.mccormick at kitware.com] > Envoy? : mardi 24 mars 2015 17:44 > ? : Audrey Istace > Cc : insight-users at itk.org > Objet : Re: [ITK-users] itk - Writing dicom files from single 3D file > > Hi, > > DCMTKImageIO not serialize or de-serialize DICOM tags to / from its MetaDataDictionaryArray currently like GDCM does. > > HTH, > Matt > > On Mon, Mar 23, 2015 at 11:11 AM, AI wrote: >> Hello, >> >> I would like to write Dicom files from a nifti image files using >> DCMTKImageIO. In the code below, I read a nifti file using >> itkImageFileReader, and then try to write dicom files using >> itkImageSeriesWriter. I was not able to do it, probably because of the >> SetMetaDataDictionaryArray method, that I don?t know how to use since >> I don?t read dicom series as input. Can you help me with that ? >> >> Thank you very much, >> >> Audrey >> >> #include "itkDCMTKImageIO.h" >> #include "itkNumericSeriesFileNames.h" >> #include "itkImageFileReader.h" >> #include "itkImageSeriesWriter.h" >> >> int main(int argc, char *argv[]) >> { >> typedef signed short >> PixelType; >> const unsigned int >> Dimension = 3; >> typedef itk::Image< PixelType, Dimension > ImageType; >> typedef itk::Image< PixelType, 2 > OutputImageType; >> typedef itk::ImageFileReader< ImageType > ReaderType; >> typedef itk::DCMTKImageIO ImageIOType; >> typedef itk::NumericSeriesFileNames NamesGeneratorType; >> typedef itk::ImageSeriesWriter< ImageType, >> OutputImageType > WriterType; >> >> ImageIOType::Pointer dcmtkIO = ImageIOType::New(); >> NamesGeneratorType::Pointer namesGenerator = >> NamesGeneratorType::New(); >> ReaderType::Pointer reader = ReaderType::New(); >> WriterType::Pointer writer = WriterType::New(); >> >> reader->SetFileName( "../../out.nii" ); >> reader->Update(); >> >> >> >> itksys::SystemTools::MakeDirectory( >> "../../OutputDicom/" ); >> >> std::string seriesFormat = "../../OutputDicom/IM%d.dcm"; >> namesGenerator->SetSeriesFormat (seriesFormat.c_str()); >> namesGenerator->SetStartIndex (1); >> namesGenerator->SetEndIndex (166); >> >> >> writer->SetInput( reader->GetOutput() ); >> writer->SetImageIO( dcmtkIO ); >> writer->SetFileNames( namesGenerator->GetFileNames() ); >> // writer->SetMetaDataDictionaryArray( >> reader->GetMetaDataDictionaryArray() ); >> writer->Update(); >> } >> >> >> >> >> -- >> View this message in context: >> http://itk-insight-users.2283740.n2.nabble.com/itk-Writing-dicom-files >> -from-single-3D-file-tp7587034.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 matimontg at gmail.com Wed Mar 25 18:17:51 2015 From: matimontg at gmail.com (Matias Montroull) Date: Wed, 25 Mar 2015 19:17:51 -0300 Subject: [ITK-users] SimpleITK | ImagePositionPatient and origins Message-ID: Hi, I was testing the new ImageSeriesWriter in the new SimpleITK 0.9 Beta and for some reason it's not copying the Image Position Patient information when writing the slices. any ideas why this happens? Here's my code: ImageFileReader imgreader_resultado = new ImageFileReader(); imgreader_resultado.SetFileName(path_pacientes + nombre_paciente + @"\Fusion\" + "resultado.mha"); itk.simple.Image imgresultado = imgreader_resultado.Execute(); ImageSeriesWriter SeriesWriter_resultado = new ImageSeriesWriter(); VectorString vs_resultado = new VectorString(); for (int i = 0; i < imgresultado.GetSize()[2]; ++i) { vs_resultado.Add(path_pacientes + nombre_paciente + @"\Fusion\Resultado\" + "imagen" + i + ".dcm"); } SeriesWriter_resultado.SetFileNames(vs_resultado); if (!Directory.Exists(path_pacientes + nombre_paciente + @"\Fusion\Resultado")) //Si se abri? el plan y nunca se hizo registraci?n previamente, se crea el directorio Registraci?n { Directory.CreateDirectory(path_pacientes + nombre_paciente + @"\Fusion\Resultado"); } SeriesWriter_resultado.Execute(imgresultado, vs_resultado, false); Thank you, Matias. -------------- next part -------------- An HTML attachment was scrubbed... URL: From JohannesWeber at gmx.at Thu Mar 26 05:24:22 2015 From: JohannesWeber at gmx.at (JohannesWeber at gmx.at) Date: Thu, 26 Mar 2015 10:24:22 +0100 Subject: [ITK-users] setting big spherical neighborhoods to center voxel value Message-ID: An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Thu Mar 26 08:36:27 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Thu, 26 Mar 2015 08:36:27 -0400 Subject: [ITK-users] setting big spherical neighborhoods to center voxel value In-Reply-To: References: Message-ID: <6E34D00A-F187-4E5E-A2E4-6F490D8CE87C@mail.nih.gov> Hello, If you have a 3D image and you are visiting a neighborhood of size 20^3, you are doing 8000 visits per pixel there is no way to make this efficient. You have a big O algorithm problem. The Neighborhood iterator would be a the more ITK way of doing what you are trying to do [1] [2]. But that's is not the order of efficiency improvement you need. You need to revise your algorithm so you only visit each pixel once. Perhaps with region growing and queues, or auxiliary images to keep track of the current distance or other data. Hope that helps, Brad [1] http://www.itk.org/Doxygen/html/classitk_1_1NeighborhoodIterator.html [2] http://itk.org/Wiki/ITK/Examples/Iterators/NeighborhoodIterator On Mar 26, 2015, at 5:24 AM, JohannesWeber at gmx.at wrote: > Hello everyone, > > I have the following problem: after calculating the distance map (e.g. with DanielssonDistanceMapImageFilter) I am getting rid of most of the voxels (= setting 0) after calculating a so called distance ridge (kind of a skeleton). Now I want for every voxel of this distance ridge that it is a center voxel for a spherical neighborhood with the radius equal to the distance value of the voxel, and all voxels included in this sphere are set to the distance value of the voxel of the distance ridge (the center voxel of the sphere). So that means the neighborhoods can become big, e.g. radius of 10, or 20 voxels. The problem is here the performance... I implemented it somehow, but the performance nowhere near it should be. > e.g. going through the image with a neighborhood iterator and vor every voxel bigger than 0 creating a neighborhood with the radius with the distance value of this voxel that seems to take very long alone to create and indexing the neighborhood. > another approach I tried is to extract all the voxels of the distance ridge, iterate through them and calculate for every ridge voxel the region and iterate through the region doing proper calculations: > > for (int rp = 0; rp < nRidgePoints; rp++) > { > ImageType::IndexType s1Index; > const int i = ridgePointsIndex[0][rp]; > const int j = ridgePointsIndex[1][rp]; > const int k = ridgePointsIndex[2][rp]; > const float r = ridgePointsValues[rp]; > > rSquared = (int) ((r * r) + 0.5f); > rInt = (int) r; > if(rInt < r) rInt++; > iStart = i - rInt; > if(iStart < 0) iStart = 0; > iStop = i + rInt; > if(iStop >= imageSize[0]) iStop = imageSize[0] - 1; > jStart = j - rInt; > if(jStart < 0) jStart = 0; > jStop = j + rInt; > if(jStop >= imageSize[1]) jStop = imageSize[1] - 1; > kStart = k - rInt; > if(kStart < 0) kStart = 0; > kStop = k + rInt; > if(kStop >= imageSize[2]) kStop = imageSize[2] - 1; > ImageType::IndexType index; > ImageType::SizeType size; > index[0] = iStart; > index[1] = jStart; > index[2] = kStart; > size[0] = iStop - iStart + 1; > size[1] = jStop - jStart + 1; > size[2] = kStop - kStart + 1; > ImageType::RegionType region; > region.SetIndex(index); > region.SetSize(size); > ImageRegionIteratorWithIndexType iteratorWithIndex (distanceRidge, region); > > for (iteratorWithIndex.GoToBegin(); !iteratorWithIndex.IsAtEnd(); iteratorWithIndex++) > { > s1Index = iteratorWithIndex.GetIndex(); > r1SquaredK = (s1Index[0] - i) * (s1Index[0] - i); > r1SquaredJK = r1SquaredK + (s1Index[1] - j) * (s1Index[1] - j); > if(r1SquaredJK <= rSquared) > { > r1Squared = r1SquaredJK + (s1Index[2] - k) * (s1Index[2] - k); > if (r1Squared <= rSquared) > { > s1 = iteratorWithIndex.Get(); > if (rSquared > s1) > { > iteratorWithIndex.Set(rSquared); > } > } > } > } > > } > > so every approach I tried until now is very slow comparing to other implementations of the algorithm I want to do... would maybe spatial objects help me somehow? But I do not really understand how they work... > thanks for your help! > > greetings, > Johannes > _____________________________________ > 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 matt.mccormick at kitware.com Thu Mar 26 08:47:13 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 26 Mar 2015 08:47:13 -0400 Subject: [ITK-users] ITK dicom reader wrong spacing In-Reply-To: References: Message-ID: Hi Aiert, VolView uses a different, custom method for loading DICOM series than ITK-SNAP and Slicer. Spacing in DICOM is tricky -- spacing and spacing-like information is specified in many different tags. To find the tag that you are looking for gdcmdump and similar tools can be used to inspect the tags. HTH, Matt On Thu, Mar 26, 2015 at 8:18 AM, Amundarain, Aiert wrote: > Hi Matt. > > I have tried the solution you suggested but the final result is the same. I tried opening the dicom series in ITK-SNAP and Slicer with similar result. However, Volview loads the DICOM series properly. Do you know the difference among those programs when they load DICOM Series? all the programs are based in ITK. > > Thank you > > -----Original Message----- > From: Matt McCormick [mailto:matt.mccormick at kitware.com] > Sent: jueves, 19 de marzo de 2015 21:20 > To: Amundarain, Aiert > Cc: Insight-users at itk.org > Subject: Re: [ITK-users] ITK dicom reader wrong spacing > > Hi Aiert, > > It is possible to use DCMTK instead of GDCM. Turn on Module_ITKIODCMTK in your CMake configuration. See the itkDCMTKSeriesReadImageWriter.cxx test for example usage. > > HTH, > Matt > > On Wed, Mar 18, 2015 at 7:43 AM, Amundarain, Aiert wrote: >> I have a DICOM Image serie that itk does not read properly. The x,y,z >> spacing are incorrect and the return value is the default one (1,1,1). >> >> If I read this DICOM Image serie using vtk (vtkDICOMImageReader), the >> reading is correct. >> >> Both softwares are developed by kitware but the results are different. >> >> >> >> Is is possible to read the dicom files using ITK without using the >> gdcm library? >> >> >> >> 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://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 Thu Mar 26 09:12:28 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Thu, 26 Mar 2015 09:12:28 -0400 Subject: [ITK-users] SimpleITK | ImagePositionPatient and origins In-Reply-To: References: Message-ID: <369AD1DD-ABBC-4F3B-BFD7-0ECAB831EC94@mail.nih.gov> Hello, Can you please create a JIRA ticket to track this issue? https://issues.itk.org/jira/browse/SIMPLEITK Thank you, Brad On Mar 25, 2015, at 6:17 PM, Matias Montroull wrote: > Hi, > > I was testing the new ImageSeriesWriter in the new SimpleITK 0.9 Beta and for some reason it's not copying the Image Position Patient information when writing the slices. > > any ideas why this happens? > > Here's my code: > ImageFileReader imgreader_resultado = new ImageFileReader(); > imgreader_resultado.SetFileName(path_pacientes + nombre_paciente + @"\Fusion\" + "resultado.mha"); > itk.simple.Image imgresultado = imgreader_resultado.Execute(); > ImageSeriesWriter SeriesWriter_resultado = new ImageSeriesWriter(); > VectorString vs_resultado = new VectorString(); > for (int i = 0; i < imgresultado.GetSize()[2]; ++i) > { > vs_resultado.Add(path_pacientes + nombre_paciente + @"\Fusion\Resultado\" + "imagen" + i + ".dcm"); > } > > SeriesWriter_resultado.SetFileNames(vs_resultado); > > if (!Directory.Exists(path_pacientes + nombre_paciente + @"\Fusion\Resultado")) //Si se abri? el plan y nunca se hizo registraci?n previamente, se crea el directorio Registraci?n > { > Directory.CreateDirectory(path_pacientes + nombre_paciente + @"\Fusion\Resultado"); > } > > SeriesWriter_resultado.Execute(imgresultado, vs_resultado, false); > > Thank you, > > Matias. > _____________________________________ > 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 matimontg at gmail.com Thu Mar 26 09:38:12 2015 From: matimontg at gmail.com (Matias Montroull) Date: Thu, 26 Mar 2015 10:38:12 -0300 Subject: [ITK-users] SimpleITK | ImagePositionPatient and origins In-Reply-To: <369AD1DD-ABBC-4F3B-BFD7-0ECAB831EC94@mail.nih.gov> References: <369AD1DD-ABBC-4F3B-BFD7-0ECAB831EC94@mail.nih.gov> Message-ID: Hi Brad, I just created a JIRA issue: https://issues.itk.org/jira/browse/SIMPLEITK-627 Regards, Matias. On Thu, Mar 26, 2015 at 10:12 AM, Bradley Lowekamp wrote: > Hello, > > Can you please create a JIRA ticket to track this issue? > > https://issues.itk.org/jira/browse/SIMPLEITK > > Thank you, > Brad > > On Mar 25, 2015, at 6:17 PM, Matias Montroull wrote: > > > Hi, > > > > I was testing the new ImageSeriesWriter in the new SimpleITK 0.9 Beta > and for some reason it's not copying the Image Position Patient information > when writing the slices. > > > > any ideas why this happens? > > > > Here's my code: > > ImageFileReader imgreader_resultado = new ImageFileReader(); > > imgreader_resultado.SetFileName(path_pacientes + > nombre_paciente + @"\Fusion\" + "resultado.mha"); > > itk.simple.Image imgresultado = > imgreader_resultado.Execute(); > > ImageSeriesWriter SeriesWriter_resultado = new > ImageSeriesWriter(); > > VectorString vs_resultado = new VectorString(); > > for (int i = 0; i < imgresultado.GetSize()[2]; ++i) > > { > > vs_resultado.Add(path_pacientes + nombre_paciente + > @"\Fusion\Resultado\" + "imagen" + i + ".dcm"); > > } > > > > SeriesWriter_resultado.SetFileNames(vs_resultado); > > > > if (!Directory.Exists(path_pacientes + nombre_paciente + > @"\Fusion\Resultado")) //Si se abri? el plan y nunca se hizo registraci?n > previamente, se crea el directorio Registraci?n > > { > > Directory.CreateDirectory(path_pacientes + > nombre_paciente + @"\Fusion\Resultado"); > > } > > > > SeriesWriter_resultado.Execute(imgresultado, vs_resultado, > false); > > > > Thank you, > > > > Matias. > > _____________________________________ > > 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 mihail.isakov at googlemail.com Thu Mar 26 15:30:32 2015 From: mihail.isakov at googlemail.com (Mihail Isakov) Date: Thu, 26 Mar 2015 20:30:32 +0100 Subject: [ITK-users] SimpleITK | ImagePositionPatient and origins In-Reply-To: References: <369AD1DD-ABBC-4F3B-BFD7-0ECAB831EC94@mail.nih.gov> Message-ID: Hi, just guessing ... and it is also applicable to many other DICOM read/write questions here ...There are dozens of DICOM media storage classes (secondary capture, MR, CT, enhanced MR, US and so on ) and they have different sets of tags, many of them are conditional, it is very very complicated with DICOM... so complicated that 100% compliant files are rare .. most likely by default "secondary capture" is taken and it doesn't have image postion patient and image orientation patient... Check 0002|0002 (MediaStorageSOPClassUID) and 0008|0016 (SOPClassUID). To set particular IOD something like this can work (with GDCM, don't know how does it work with ITK metadata dictionary, i gave it up and did it with pure GDCM for a while) gdcm::ImageWriter writer; gdcm::Image & image = writer.GetImage(); gdcm::DataSet & ds = writer.GetFile().GetDataSet(); gdcm::Attribute<0x0008,0x0016, gdcm::VR::UI> asop; asop.SetValue("1.2.840.10008.5.1.4.1.1.4"); // MR Image IOD Modules ds.Replace(asop.GetAsDataElement()); without warranty, try to ask GDCM developers and DICOM people So far GDCM is trying the best to be DICOM correct.. Regards, Mihail "1.2.840.10008.1.3.10" , "Basic Directory IOD Modules" "1.2.840.10008.5.1.4.1.1.1" , "CR Image IOD Modules" "1.2.840.10008.5.1.4.1.1.1.1" , "Digital X Ray Image IOD Modules" // DX IOD (see B.5.1.1) "1.2.840.10008.5.1.4.1.1.1.1.1" , "Digital X Ray Image IOD Modules" // DX IOD (see B.5.1.1) "1.2.840.10008.5.1.4.1.1.1.2" , "Digital Mammography X Ray Image IOD Modules" // (see B.5.1.2) "1.2.840.10008.5.1.4.1.1.1.2.1" , "Digital Mammography X Ray Image IOD Modules"// (see B.5.1.2) "1.2.840.10008.5.1.4.1.1.1.3" , "Digital Intra Oral X Ray Image IOD Modules" // (see B.5.1.3) "1.2.840.10008.5.1.4.1.1.1.3.1" , "Digital Intra Oral X Ray Image IOD Modules" // (see B.5.1.3) "1.2.840.10008.5.1.4.1.1.2" , "CT Image IOD Modules" "1.2.840.10008.5.1.4.1.1.2.1" , "Enhanced CT Image IOD Modules" // (see B.5.1.7) "1.2.840.10008.5.1.4.1.1.3.1" , "US Multi Frame Image IOD Modules" "1.2.840.10008.5.1.4.1.1.4" , "MR Image IOD Modules" "1.2.840.10008.5.1.4.1.1.4.1" , "Enhanced MR Image IOD Modules" // (see B.5.1.6) "1.2.840.10008.5.1.4.1.1.4.2" , "MR Spectroscopy IOD Modules" "1.2.840.10008.5.1.4.1.1.4.3" , "Enhanced MR Color Image" "1.2.840.10008.5.1.4.1.1.6.1" , "US Image IOD Modules" "1.2.840.10008.5.1.4.1.1.6.2" , "Enhanced US Volume" "1.2.840.10008.5.1.4.1.1.7" , "SC Image IOD Modules" "1.2.840.10008.5.1.4.1.1.7.1" , "Multi Frame Single Bit SC Image IOD Modules" "1.2.840.10008.5.1.4.1.1.7.2" , "Multi Frame Grayscale Byte SC Image IOD Modules" "1.2.840.10008.5.1.4.1.1.7.3" , "Multi Frame Grayscale Word SC Image IOD Modules" "1.2.840.10008.5.1.4.1.1.7.4" , "Multi Frame True Color SC Image IOD Modules" "1.2.840.10008.5.1.4.1.1.9.1.1" , "12 Lead ECG IOD Modules" "1.2.840.10008.5.1.4.1.1.9.1.2" , "General ECG IOD Modules" "1.2.840.10008.5.1.4.1.1.9.1.3" , "Ambulatory ECG IOD Modules" "1.2.840.10008.5.1.4.1.1.9.2.1" , "Hemodynamic IOD Modules" "1.2.840.10008.5.1.4.1.1.9.3.1" , "Basic Cardiac EP IOD Modules" // Cardiac Electrophysiology Waveform "1.2.840.10008.5.1.4.1.1.9.4.1" , "Basic Voice Audio IOD Modules" "1.2.840.10008.5.1.4.1.1.9.4.2" , "General Audio Waveform" "1.2.840.10008.5.1.4.1.1.9.5.1" , "Arterial Pulse Waveform" "1.2.840.10008.5.1.4.1.1.9.6.1" , "Respiratory Waveform" "1.2.840.10008.5.1.4.1.1.11.1" , "Grayscale Softcopy Presentation State IOD Modules" "1.2.840.10008.5.1.4.1.1.11.2" , "Color Softcopy Presentation State" "1.2.840.10008.5.1.4.1.1.11.3" , "Pseudo-Color Softcopy Presentation State" "1.2.840.10008.5.1.4.1.1.11.4" , "Blending Softcopy Presentation State" "1.2.840.10008.5.1.4.1.1.11.5" , "IOD defined in PS 3.3" "1.2.840.10008.5.1.4.1.1.12.1" , "X Ray Angiographic Image IOD Modules" "1.2.840.10008.5.1.4.1.1.12.1.1" , "Enhanced X Ray Angiographic Image IOD Modules" "1.2.840.10008.5.1.4.1.1.12.2" , "XRF Image IOD Modules" "1.2.840.10008.5.1.4.1.1.12.2.1" , "Enhanced X Ray RF Image IOD Modules" "1.2.840.10008.5.1.4.1.1.13.1.1" , "X Ray 3D Angiographic Image IOD Modules" "1.2.840.10008.5.1.4.1.1.13.1.2" , "X-Ray 3D Craniofacial Image" "1.2.840.10008.5.1.4.1.1.13.1.3" , "IOD defined in PS 3.3" "1.2.840.10008.5.1.4.1.1.20" , "NM Image IOD Modules" "1.2.840.10008.5.1.4.1.1.66" , "Raw Data IOD Modules" "1.2.840.10008.5.1.4.1.1.66.1" , "Spatial Registration IOD Modules" "1.2.840.10008.5.1.4.1.1.66.2" , "Spatial Fiducials IOD Modules" "1.2.840.10008.5.1.4.1.1.66.3" , "Deformable Spatial Registration" "1.2.840.10008.5.1.4.1.1.66.4" , "Segmentation IOD Modules" "1.2.840.10008.5.1.4.1.1.66.5" , "Surface Segmentation" "1.2.840.10008.5.1.4.1.1.67" , "Real World Value Mapping" "1.2.840.10008.5.1.4.1.1.77.1.1" , "VL Endoscopic Image IOD Modules" "1.2.840.10008.5.1.4.1.1.77.1.1.1" , "Video Endoscopic Image IOD Modules" "1.2.840.10008.5.1.4.1.1.77.1.2" , "VL Microscopic Image" "1.2.840.10008.5.1.4.1.1.77.1.2.1" , "Video Microscopic Image" "1.2.840.10008.5.1.4.1.1.77.1.3" , "VL Slide-Coordinates Microscopic Image" "1.2.840.10008.5.1.4.1.1.77.1.4" , "VL Photographic Image IOD Modules" "1.2.840.10008.5.1.4.1.1.77.1.4.1" , "Video Photographic Image" "1.2.840.10008.5.1.4.1.1.77.1.5.1" , "Ophthalmic Photography 8 Bit Image" "1.2.840.10008.5.1.4.1.1.77.1.5.2" , "Ophthalmic Photography 16 Bit Image" "1.2.840.10008.5.1.4.1.1.77.1.5.3" , "Stereometric Relationship" "1.2.840.10008.5.1.4.1.1.77.1.5.4" , "Ophthalmic Tomography Image" "1.2.840.10008.5.1.4.1.1.78.1" , "Lensometry Measurements" "1.2.840.10008.5.1.4.1.1.78.2" , "Autorefraction Measurements" "1.2.840.10008.5.1.4.1.1.78.3" , "Keratometry Measurements" "1.2.840.10008.5.1.4.1.1.78.4" , "Subjective Refraction Measurements" "1.2.840.10008.5.1.4.1.1.78.5" , "Visual Acuity Measurements" "1.2.840.10008.5.1.4.1.1.78.6" , "Spectacle Prescription Report" "1.2.840.10008.5.1.4.1.1.79.1" , "Macular Grid Thickness and Volume Report" "1.2.840.10008.5.1.4.1.1.88.11" , "Basic Text SR IOD Modules" "1.2.840.10008.5.1.4.1.1.88.22" , "Enhanced SR IOD Modules" "1.2.840.10008.5.1.4.1.1.88.33" , "Comprehensive SR IOD Modules" "1.2.840.10008.5.1.4.1.1.88.40" , "Procedure Log" "1.2.840.10008.5.1.4.1.1.88.50" , "Mammography CAD SR IOD Modules" "1.2.840.10008.5.1.4.1.1.88.59" , "Key Object Selection Document IOD Modules" "1.2.840.10008.5.1.4.1.1.88.65" , "Chest CAD SR IOD" "1.2.840.10008.5.1.4.1.1.88.67" , "X Ray Radiation Dose SR IOD Modules" "1.2.840.10008.5.1.4.1.1.88.69" , "Colon CAD SR IOD" "1.2.840.10008.5.1.4.1.1.104.1" , "Encapsulated PDF IOD Modules" "1.2.840.10008.5.1.4.1.1.104.2" , "Encapsulated CDA IOD Modules" "1.2.840.10008.5.1.4.1.1.128" , "PET Image IOD Modules" "1.2.840.10008.5.1.4.1.1.130" , "IOD defined in PS 3.3" "1.2.840.10008.5.1.4.1.1.131" , "Basic Structured Display IOD" "1.2.840.10008.5.1.4.1.1.481.1" , "RT Image IOD Modules" "1.2.840.10008.5.1.4.1.1.481.2" , "RT Dose IOD Modules" "1.2.840.10008.5.1.4.1.1.481.3" , "RT Structure Set IOD Modules" "1.2.840.10008.5.1.4.1.1.481.4" , "RT Beams Treatment Record IOD Modules" "1.2.840.10008.5.1.4.1.1.481.5" , "RT Plan IOD Modules" "1.2.840.10008.5.1.4.1.1.481.6" , "RT Brachy Treatment Record IOD Modules" "1.2.840.10008.5.1.4.1.1.481.7" , "RT Treatment Summary Record IOD Modules" "1.2.840.10008.5.1.4.1.1.481.8" , "RT Ion Plan IOD Modules" "1.2.840.10008.5.1.4.1.1.481.9" , "RT Ion Beams Treatment Record IOD Modules" "1.2.840.10008.5.1.4.38.1" , "Hanging Protocol IOD Modules" "1.2.840.10008.5.1.4.39.1" , "Color Palette IOD" // Deprecated: "1.2.840.10008.3.1.2.3.3" , "Modality Performed Procedure Step IOD Modules" "1.2.840.10008.5.1.4.1.1.5" , "NM Image IOD Modules" "1.2.840.10008.5.1.4.1.1.6" , "US Image IOD Modules" "1.2.840.10008.5.1.4.1.1.3" , "US Multi Frame Image IOD Modules" "1.2.840.10008.5.1.4.1.1.12.3" , "" // XRayAngiographicBiplaneImageStorage // private: "1.3.12.2.1107.5.9.1" , "Siemens Non-image IOD Modules" // CSA Non-Image Storage On Thu, Mar 26, 2015 at 2:38 PM, Matias Montroull wrote: > Hi Brad, I just created a JIRA issue: > https://issues.itk.org/jira/browse/SIMPLEITK-627 > Regards, > Matias. > > On Thu, Mar 26, 2015 at 10:12 AM, Bradley Lowekamp > wrote: >> >> Hello, >> >> Can you please create a JIRA ticket to track this issue? >> >> https://issues.itk.org/jira/browse/SIMPLEITK >> >> Thank you, >> Brad >> >> On Mar 25, 2015, at 6:17 PM, Matias Montroull wrote: >> >> > Hi, >> > >> > I was testing the new ImageSeriesWriter in the new SimpleITK 0.9 Beta >> > and for some reason it's not copying the Image Position Patient information >> > when writing the slices. >> > >> > any ideas why this happens? >> > >> > Here's my code: >> > ImageFileReader imgreader_resultado = new ImageFileReader(); >> > imgreader_resultado.SetFileName(path_pacientes + >> > nombre_paciente + @"\Fusion\" + "resultado.mha"); >> > itk.simple.Image imgresultado = >> > imgreader_resultado.Execute(); >> > ImageSeriesWriter SeriesWriter_resultado = new >> > ImageSeriesWriter(); >> > VectorString vs_resultado = new VectorString(); >> > for (int i = 0; i < imgresultado.GetSize()[2]; ++i) >> > { >> > vs_resultado.Add(path_pacientes + nombre_paciente + >> > @"\Fusion\Resultado\" + "imagen" + i + ".dcm"); >> > } >> > >> > SeriesWriter_resultado.SetFileNames(vs_resultado); >> > >> > if (!Directory.Exists(path_pacientes + nombre_paciente + >> > @"\Fusion\Resultado")) //Si se abri? el plan y nunca se hizo registraci?n >> > previamente, se crea el directorio Registraci?n >> > { >> > Directory.CreateDirectory(path_pacientes + >> > nombre_paciente + @"\Fusion\Resultado"); >> > } >> > >> > SeriesWriter_resultado.Execute(imgresultado, vs_resultado, >> > false); >> > >> > Thank you, >> > >> > Matias. >> > _____________________________________ >> > 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 > From richard.beare at gmail.com Thu Mar 26 17:02:54 2015 From: richard.beare at gmail.com (Richard Beare) Date: Fri, 27 Mar 2015 08:02:54 +1100 Subject: [ITK-users] setting big spherical neighborhoods to center voxel value In-Reply-To: <6E34D00A-F187-4E5E-A2E4-6F490D8CE87C@mail.nih.gov> References: <6E34D00A-F187-4E5E-A2E4-6F490D8CE87C@mail.nih.gov> Message-ID: This isn't a complete solution, but might give you some ideas. The part about using the skeleton points, which are distance transform voxels, as the source for the radius, can be implemented using spatially variant morphology. I have a short publication about doing this efficiently with parabolic functions. However this doesn't propagate the voxel value, only producing a mask. I have thought about combining with label dilation, to propagate a label value, but haven't done it yet. A queue based approach to something similar is discussed in: "Labelled reconstruction of binary objects: a vector propagation algorithm", buckley and lagerstrom On Thu, Mar 26, 2015 at 11:36 PM, Bradley Lowekamp wrote: > Hello, > > If you have a 3D image and you are visiting a neighborhood of size 20^3, > you are doing 8000 visits per pixel there is no way to make this efficient. > You have a big O algorithm problem. > > The Neighborhood iterator would be a the more ITK way of doing what you > are trying to do [1] [2]. But that's is not the order of efficiency > improvement you need. > > You need to revise your algorithm so you only visit each pixel once. > Perhaps with region growing and queues, or auxiliary images to keep track > of the current distance or other data. > > Hope that helps, > Brad > > [1] http://www.itk.org/Doxygen/html/classitk_1_1NeighborhoodIterator.html > [2] http://itk.org/Wiki/ITK/Examples/Iterators/NeighborhoodIterator > > On Mar 26, 2015, at 5:24 AM, JohannesWeber at gmx.at wrote: > > Hello everyone, > > I have the following problem: after calculating the distance map (e.g. > with DanielssonDistanceMapImageFilter) I am getting rid of most of the > voxels (= setting 0) after calculating a so called distance ridge (kind of > a skeleton). Now I want for every voxel of this distance ridge that it is a > center voxel for a spherical neighborhood with the radius equal to the > distance value of the voxel, and all voxels included in this sphere are set > to the distance value of the voxel of the distance ridge (the center voxel > of the sphere). So that means the neighborhoods can become big, e.g. radius > of 10, or 20 voxels. The problem is here the performance... I implemented > it somehow, but the performance nowhere near it should be. > e.g. going through the image with a neighborhood iterator and vor every > voxel bigger than 0 creating a neighborhood with the radius with the > distance value of this voxel that seems to take very long alone to create > and indexing the neighborhood. > another approach I tried is to extract all the voxels of the distance > ridge, iterate through them and calculate for every ridge voxel the region > and iterate through the region doing proper calculations: > > for (int rp = 0; rp < nRidgePoints; rp++) > { > ImageType::IndexType s1Index; > const int i = ridgePointsIndex[0][rp]; > const int j = ridgePointsIndex[1][rp]; > const int k = ridgePointsIndex[2][rp]; > const float r = ridgePointsValues[rp]; > > rSquared = (int) ((r * r) + 0.5f); > rInt = (int) r; > if(rInt < r) rInt++; > iStart = i - rInt; > if(iStart < 0) iStart = 0; > iStop = i + rInt; > if(iStop >= imageSize[0]) iStop = imageSize[0] - 1; > jStart = j - rInt; > if(jStart < 0) jStart = 0; > jStop = j + rInt; > if(jStop >= imageSize[1]) jStop = imageSize[1] - 1; > kStart = k - rInt; > if(kStart < 0) kStart = 0; > kStop = k + rInt; > if(kStop >= imageSize[2]) kStop = imageSize[2] - 1; > ImageType::IndexType index; > ImageType::SizeType size; > index[0] = iStart; > index[1] = jStart; > index[2] = kStart; > size[0] = iStop - iStart + 1; > size[1] = jStop - jStart + 1; > size[2] = kStop - kStart + 1; > ImageType::RegionType region; > region.SetIndex(index); > region.SetSize(size); > ImageRegionIteratorWithIndexType iteratorWithIndex (distanceRidge, > region); > > for (iteratorWithIndex.GoToBegin(); !iteratorWithIndex.IsAtEnd(); > iteratorWithIndex++) > { > s1Index = iteratorWithIndex.GetIndex(); > r1SquaredK = (s1Index[0] - i) * (s1Index[0] - i); > r1SquaredJK = r1SquaredK + (s1Index[1] - j) * (s1Index[1] - j); > if(r1SquaredJK <= rSquared) > { > r1Squared = r1SquaredJK + (s1Index[2] - k) * (s1Index[2] - > k); > if (r1Squared <= rSquared) > { > s1 = iteratorWithIndex.Get(); > if (rSquared > s1) > { > iteratorWithIndex.Set(rSquared); > > } > } > } > } > > } > > so every approach I tried until now is very slow comparing to other > implementations of the algorithm I want to do... would maybe spatial > objects help me somehow? But I do not really understand how they work... > thanks for your help! > > greetings, > Johannes > _____________________________________ > 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 richard.beare at gmail.com Thu Mar 26 18:47:10 2015 From: richard.beare at gmail.com (Richard Beare) Date: Fri, 27 Mar 2015 09:47:10 +1100 Subject: [ITK-users] setting big spherical neighborhoods to center voxel value In-Reply-To: References: <6E34D00A-F187-4E5E-A2E4-6F490D8CE87C@mail.nih.gov> Message-ID: Here's another option - I haven't thought it through completely so could be far from the mark, but I think it is close. consider the following: A - input mask B - distance transform of mask (positive values inside the mask) C - ridge lines in B (sort of skeleton) You are aiming to create an image of spheres, centres on voxels in C, with size set by the "brightness" at centre location in C. Suppose you can create the spatially variant dilation by a sphere using the parabolic tools I mentioned in the previous message - that gives you another mask: D - spatially variant dilation of C Now invert C and take the distance transform to give E. take a distance transform of D and add to E, then mask by D. The idea here is that if you add two distance transforms together you end up with a flat surface, at least in the case where the second DT is computed from peaks in the first. The result should be a sort of tube, of varying thickness, where the voxel value corresponds to the tube thickness (possibly with a uniform offset). Note that I don't think you will see sphere corresponding to the brightest skeleton points using this approach, but the result may be useful for your application. Also, a couple of notes regarding the direct approach. If you use neighbourhoods, which is the appropriate ITK structure, then avoid visiting all voxels with the neighbourhood iterator. Use a standard single voxel iterator to find the skeleton voxels, then move the neighbourhood iterator to that location. There are also some optimizations you can use if you do some checks of the change in sphere size between neighbours. If the spheres were all identically sized then it is feasible to construct lists of voxels that are not in common between neighbouring spheres, and just visit those, which is a big saving. Much trickier when the sizes aren't the same, but I'd guess that for a given skeleton there'd be a relatively small number of combinations of neighbouring sizes. On Fri, Mar 27, 2015 at 8:02 AM, Richard Beare wrote: > This isn't a complete solution, but might give you some ideas. > > The part about using the skeleton points, which are distance transform > voxels, as the source for the radius, can be implemented using spatially > variant morphology. I have a short publication about doing this efficiently > with parabolic functions. However this doesn't propagate the voxel value, > only producing a mask. I have thought about combining with label dilation, > to propagate a label value, but haven't done it yet. > > A queue based approach to something similar is discussed in: > "Labelled reconstruction of binary objects: a vector propagation > algorithm", buckley and lagerstrom > > On Thu, Mar 26, 2015 at 11:36 PM, Bradley Lowekamp > wrote: > >> Hello, >> >> If you have a 3D image and you are visiting a neighborhood of size 20^3, >> you are doing 8000 visits per pixel there is no way to make this efficient. >> You have a big O algorithm problem. >> >> The Neighborhood iterator would be a the more ITK way of doing what you >> are trying to do [1] [2]. But that's is not the order of efficiency >> improvement you need. >> >> You need to revise your algorithm so you only visit each pixel once. >> Perhaps with region growing and queues, or auxiliary images to keep track >> of the current distance or other data. >> >> Hope that helps, >> Brad >> >> [1] http://www.itk.org/Doxygen/html/classitk_1_1NeighborhoodIterator.html >> [2] http://itk.org/Wiki/ITK/Examples/Iterators/NeighborhoodIterator >> >> On Mar 26, 2015, at 5:24 AM, JohannesWeber at gmx.at wrote: >> >> Hello everyone, >> >> I have the following problem: after calculating the distance map (e.g. >> with DanielssonDistanceMapImageFilter) I am getting rid of most of the >> voxels (= setting 0) after calculating a so called distance ridge (kind of >> a skeleton). Now I want for every voxel of this distance ridge that it is a >> center voxel for a spherical neighborhood with the radius equal to the >> distance value of the voxel, and all voxels included in this sphere are set >> to the distance value of the voxel of the distance ridge (the center voxel >> of the sphere). So that means the neighborhoods can become big, e.g. radius >> of 10, or 20 voxels. The problem is here the performance... I implemented >> it somehow, but the performance nowhere near it should be. >> e.g. going through the image with a neighborhood iterator and vor every >> voxel bigger than 0 creating a neighborhood with the radius with the >> distance value of this voxel that seems to take very long alone to create >> and indexing the neighborhood. >> another approach I tried is to extract all the voxels of the distance >> ridge, iterate through them and calculate for every ridge voxel the region >> and iterate through the region doing proper calculations: >> >> for (int rp = 0; rp < nRidgePoints; rp++) >> { >> ImageType::IndexType s1Index; >> const int i = ridgePointsIndex[0][rp]; >> const int j = ridgePointsIndex[1][rp]; >> const int k = ridgePointsIndex[2][rp]; >> const float r = ridgePointsValues[rp]; >> >> rSquared = (int) ((r * r) + 0.5f); >> rInt = (int) r; >> if(rInt < r) rInt++; >> iStart = i - rInt; >> if(iStart < 0) iStart = 0; >> iStop = i + rInt; >> if(iStop >= imageSize[0]) iStop = imageSize[0] - 1; >> jStart = j - rInt; >> if(jStart < 0) jStart = 0; >> jStop = j + rInt; >> if(jStop >= imageSize[1]) jStop = imageSize[1] - 1; >> kStart = k - rInt; >> if(kStart < 0) kStart = 0; >> kStop = k + rInt; >> if(kStop >= imageSize[2]) kStop = imageSize[2] - 1; >> ImageType::IndexType index; >> ImageType::SizeType size; >> index[0] = iStart; >> index[1] = jStart; >> index[2] = kStart; >> size[0] = iStop - iStart + 1; >> size[1] = jStop - jStart + 1; >> size[2] = kStop - kStart + 1; >> ImageType::RegionType region; >> region.SetIndex(index); >> region.SetSize(size); >> ImageRegionIteratorWithIndexType iteratorWithIndex >> (distanceRidge, region); >> >> for (iteratorWithIndex.GoToBegin(); !iteratorWithIndex.IsAtEnd(); >> iteratorWithIndex++) >> { >> s1Index = iteratorWithIndex.GetIndex(); >> r1SquaredK = (s1Index[0] - i) * (s1Index[0] - i); >> r1SquaredJK = r1SquaredK + (s1Index[1] - j) * (s1Index[1] - >> j); >> if(r1SquaredJK <= rSquared) >> { >> r1Squared = r1SquaredJK + (s1Index[2] - k) * (s1Index[2] >> - k); >> if (r1Squared <= rSquared) >> { >> s1 = iteratorWithIndex.Get(); >> if (rSquared > s1) >> { >> iteratorWithIndex.Set(rSquared); >> >> } >> } >> } >> } >> >> } >> >> so every approach I tried until now is very slow comparing to other >> implementations of the algorithm I want to do... would maybe spatial >> objects help me somehow? But I do not really understand how they work... >> thanks for your help! >> >> greetings, >> Johannes >> _____________________________________ >> 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 matt.mccormick at kitware.com Fri Mar 27 00:43:51 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Fri, 27 Mar 2015 00:43:51 -0400 Subject: [ITK-users] Updated Gerrit Code Review! Message-ID: As previously noted, we now have an updated Gerrit Code Review instance! See http://review.source.kitware.com This was a major upgrade from version 2.2.2 to version 2.10.1. This update was required for a change in authentication mechanism. Our Gerrit instance previously only had support for OpenID authentication. However, Google has dropped support for OpenID. The updated instance uses GitHub OAuth2 authentication. Community members now login with their GitHub account [1]. If an existing user's GitHub account has one of their email addresses registered with their previous Gerrit account, their old Gerrit account will automatically be associated with their GitHub login. In the future, we will also add support for patch submission via GitHub pull requests. The upgraded Gerrit instance also bring brings many new features. Here are some highlights: - There is a new user interface. When existing users log in, they will be presented with the option to stay with the old user interface or migrate to the new user interface. Interface choice can be changed in Settings -> Preferences. The new interface contains a number of usability and presentation improvements. For example, it is now easier to see and step through patches in a branch. - There are now a number of ways to download a change including patch files and archives. Note that the "Checkout" line has changed slightly in that it checks out 'FETCH_HEAD' instead of a named branch with '-b topic-name'. It is still possible to modify the line pasted in your terminal by replacing 'FETCH_HEAD' with '-b topic-name'. This new default prevents the proliferation of branches in a reviewer's repository and it prevents confusion of new reviewers when they try to checkout a branch with the same name as an existing branch. - A number of new preferences are available for the diff view. - There are many other user interface enhancements. We have also greatly improved how our patch robots builds occur and their capabilities. This will be discussed in another thread. To discuss more about Gerrit and learn more about how to participate in ITK, join us tomorrow on the Hangout [2] [1] http://www.itk.org/Wiki/ITK/Git/Account [2] https://plus.google.com/u/1/events/cv779d1fdghhko68eef25a9e30c From audrey.istace at imavie.fr Fri Mar 27 08:57:18 2015 From: audrey.istace at imavie.fr (AI) Date: Fri, 27 Mar 2015 05:57:18 -0700 (MST) Subject: [ITK-users] itk - Writing dicom files from single 3D file In-Reply-To: References: <1427123473731-7587034.post@n2.nabble.com> Message-ID: <1427461038272-7587063.post@n2.nabble.com> Hi Matt, I saw in the source code that MetaData was not handled at all in itkDCMTKImageIO, whereas it is handled in itkGDCMImageIO. Is that why I can't write dicom files with DCMTK as easily as I can using GDCM ? Do you know if itkDCMTKImageIO will be improved in future itk versions ? Thank you, Audrey -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/itk-Writing-dicom-files-from-single-3D-file-tp7587034p7587063.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From blowekamp at mail.nih.gov Fri Mar 27 09:33:34 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Fri, 27 Mar 2015 09:33:34 -0400 Subject: [ITK-users] possible to get a closest-point map from a distance map in ITK? In-Reply-To: References: <22EC75E8215562428ACADFA35877A25A26187E3F@JANEWAY.ts.odu.edu> <564311ED-2E71-4B12-919B-C36B78084AF8@mail.nih.gov> Message-ID: Hello, Sorry for the delay in following up with this! Here is some information about how to create a module for your code: http://insightsoftwareconsortium.github.io/ITKBarCamp-doc/ITK/ConstructITKModule/index.html Please note that for a remote module it should not begin with the "ITK" prefix. Here is also some policy related info to: http://www.itk.org/Wiki/ITK/Policy_and_Procedures_for_Adding_Remote_Modules Please let us know if you need help. I think many people would appreciate getting easier access to these advanced morphology algorithms. Brad On Mar 4, 2015, at 3:19 PM, Richard Beare wrote: > Good thought - I haven't looked into that. Is it easy to do? My ITK efforts are lagging due to lack of time at present, I'm afraid. > > On Thu, Mar 5, 2015 at 1:30 AM, Bradley Lowekamp wrote: > Richard, > > You have some nice additional morphological filters in those repositories. I have been meaning to give them a try. > > Given that you have Insight Journal articles for them, have you considered making them more readily available to the community by adding and converting them into Remote modules for ITK? > > Brad > > On Mar 2, 2015, at 3:37 PM, Richard Beare wrote: > >> I've written a set of label erosion and dilation filters that might do what you're after. I've also got some spatially varying morphology filters, but have't put them on the insight journal. The label erode dilate filters aren't outputing the distance map, so they aren't exactly what you want, but they use the same kind of computation internally. Thus you could use them in conjunction with the parabolic distance transforms to get labels and distances. >> >> https://github.com/richardbeare/LabelErodeDilate.git >> https://github.com/richardbeare/parabolicMorphology.git >> >> The insight journal article. >> >> http://hdl.handle.net/10380/3399 >> >> >> I can provide more details about the spatially variant stuff if it is of interest. Note that it only works with binary images, and simply weights the input image. >> >> On Tue, Mar 3, 2015 at 6:45 AM, Audette, Michel A. wrote: >> Dear ITK users, >> >> >> a student of mine would like to use the ITK implementation of distance maps in a way where the point label of the closest initial boundary is propagated throughout, i.e. a closest boundary point map. Is there something like this implemented already in ITK? I would like to use something like this to produce a spatially varying distance threshold. >> >> >> Thanks for your kind support. >> >> >> Michel >> >> >> Michel Audette, Ph.D. >> Assistant Professor, >> Department of Modeling, Simulation and Visualization Engineering, >> Old Dominion University, >> Norfolk, VA. >> >> _____________________________________ >> 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 matt.mccormick at kitware.com Fri Mar 27 09:59:51 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Fri, 27 Mar 2015 09:59:51 -0400 Subject: [ITK-users] itk - Writing dicom files from single 3D file In-Reply-To: <1427461038272-7587063.post@n2.nabble.com> References: <1427123473731-7587034.post@n2.nabble.com> <1427461038272-7587063.post@n2.nabble.com> Message-ID: Hi Audrey, > I saw in the source code that MetaData was not handled at all in > itkDCMTKImageIO, whereas it is handled in itkGDCMImageIO. Is that why I > can't write dicom files with DCMTK as easily as I can using GDCM ? Yes. > Do you know if itkDCMTKImageIO will be improved in future itk versions ? There are not any active plans of which I am aware. However, contributions are welcome [1]. Thanks, Matt [1] http://insightsoftwareconsortium.github.io/ITKBarCamp-doc/CommunitySoftwareProcess/SubmitAPatchToGerrit/index.html From seidel at cvrti.utah.edu Fri Mar 27 10:16:12 2015 From: seidel at cvrti.utah.edu (Thomas Seidel) Date: Fri, 27 Mar 2015 08:16:12 -0600 Subject: [ITK-users] How to Calculate Hessian Matrix from Gradient Image? Message-ID: Hi all, I would like to calculate the hessian matrix and get an output of type SymmetricSecondRankTensor pixel from a gradient image. The irk HessianRecursiveGaussianImageFilter uses as input an intensity image. However, I would like to implement a method for vessel detection based on the following algorithm: 1. GradientImageFilter 2. GradientVectorFlowImageFilter 3. get the hessian Matrix from 2. (this is my problem) 4. Hessian3DToVesselnessImageFilter How can I get from the vector field in 2. to the hessian matrix I need for 3.? Thanks for your help, Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Fri Mar 27 11:02:46 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Fri, 27 Mar 2015 11:02:46 -0400 Subject: [ITK-users] How to Calculate Hessian Matrix from Gradient Image? In-Reply-To: References: Message-ID: <99977733-F928-4D49-AF1D-F86EDA34612D@mail.nih.gov> Hello, I don't think there is going to be anything turnkey to do what you want. I'd looking to writing a custom filter for this specialized task. You can either base it off the the HessianRecursiveGaussianImageFilter [1] , which utilizes filters per-component and adaptors. Or do a discrite approach along the lines of something I have done here [2]. Hope that helps, Brad [1] https://github.com/InsightSoftwareConsortium/ITK/blob/1ce0e5dd3b2d9c7a7a9353dfb8b728ada8d71320/Modules/Filtering/ImageFeature/include/itkHessianRecursiveGaussianImageFilter.hxx#L187-L368 [2] https://github.com/blowekamp/itkLocalDiscreteHessian/blob/30aa775494c20eaf9e085781ae233e0511773758/include/itkHessianImageFilter.hxx#L132-L174 On Mar 27, 2015, at 10:16 AM, Thomas Seidel wrote: > Hi all, > > I would like to calculate the hessian matrix and get an output of type SymmetricSecondRankTensor pixel from a gradient image. > > The irk HessianRecursiveGaussianImageFilter uses as input an intensity image. > However, I would like to implement a method for vessel detection based on the following algorithm: > > 1. GradientImageFilter > 2. GradientVectorFlowImageFilter > 3. get the hessian Matrix from 2. (this is my problem) > 4. Hessian3DToVesselnessImageFilter > > > How can I get from the vector field in 2. to the hessian matrix I need for 3.? > > Thanks for your help, > Thomas > _____________________________________ > 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 zivrafael.yaniv at nih.gov Fri Mar 27 15:24:21 2015 From: zivrafael.yaniv at nih.gov (Yaniv, Ziv Rafael (NIH/NLM/LHC) [C]) Date: Fri, 27 Mar 2015 19:24:21 +0000 Subject: [ITK-users] NLM Pill Image Recognition - Request for Information Message-ID: Dear colleagues, Please excuse this slightly off topic mail. I would like to bring to your attention the following request for information which may be of interest to some in the community. The National Library of Medicine (NLM) has issued a call for participation in a Pill Image Recognition (PIR) Request for Information (RFI). Unidentified and misidentified prescription pills present challenges for individuals and professionals. Unidentified pills can be found by family members, health professionals, educators, and law enforcement. The nine out of 10 US citizens over age 65 who take more than one prescription pill can be prone to misidentifying those pills. This PIR RFI is a pilot for a forthcoming PIR Challenge whose goal is to develop smart phone apps that individuals can use to take pictures of prescription pills and then search for and retrieve pill images and associated data of likely matches in an NLM database. NLM anticipates that respondents will include professionals and students, individually or in teams, in computer vision and computer graphics working on content-based image retrieval. Instructions for responding to the RFI are at http://pir.nlm.nih.gov/pilot/instructions.html The deadline for submissions to this RFI is Friday, May 15, 2015. Questions and comments are welcome at pir at nlm.nih.gov. best regards Ziv -- Ziv Yaniv, PhD, Office of High Performance Computing and Communications National Library of Medicine National Institutes of Health Bldg. 38A, Room B1N30D 8600 Rockville Pike, Bethesda, MD, 20894 Phone:+1-301-435-6633 Email: zivyaniv at nih.gov From wumengda at gmail.com Fri Mar 27 22:45:28 2015 From: wumengda at gmail.com (Wei Xiong) Date: Sat, 28 Mar 2015 03:45:28 +0100 Subject: [ITK-users] from: Wei Xiong Message-ID: Hi http://ARMOIRIES-BOIS.COM/hunt.php?greatest=y68cvbe7b7pzkc wumengda at gmail.com Sent from my iPhone From matimontg at gmail.com Sat Mar 28 08:57:00 2015 From: matimontg at gmail.com (Matias Montroull) Date: Sat, 28 Mar 2015 09:57:00 -0300 Subject: [ITK-users] SimpleITK | chnage Window Levels on an image Message-ID: Hi, I would like to change the window width and window center of an image using ITK. I guess it may be simple but I can't find the filter that would do that. Thanks, Matias. -------------- next part -------------- An HTML attachment was scrubbed... URL: From zivrafael.yaniv at nih.gov Sat Mar 28 10:47:50 2015 From: zivrafael.yaniv at nih.gov (Yaniv, Ziv Rafael (NIH/NLM/LHC) [C]) Date: Sat, 28 Mar 2015 14:47:50 +0000 Subject: [ITK-users] SimpleITK | chnage Window Levels on an image In-Reply-To: References: Message-ID: The filter is: itk::IntensityWindowingImageFilter Ziv ________________________________ From: Matias Montroull [matimontg at gmail.com] Sent: Saturday, March 28, 2015 8:57 AM To: insight-users at itk.org Users Subject: [ITK-users] SimpleITK | chnage Window Levels on an image Hi, I would like to change the window width and window center of an image using ITK. I guess it may be simple but I can't find the filter that would do that. Thanks, Matias. From matimontg at gmail.com Sat Mar 28 10:55:18 2015 From: matimontg at gmail.com (Matias Montroull) Date: Sat, 28 Mar 2015 11:55:18 -0300 Subject: [ITK-users] SimpleITK | chnage Window Levels on an image In-Reply-To: References: Message-ID: Thanks Yaniv, So if I would like to set the Levels of an image to let's say: WC 120 and WW 40, how should I use the variables below to do so? filter->SetWindowMinimum(?); filter->SetWindowMaximum(?); I guess the above sentence just defines the range of the levels and not the actual level Thank you, Matias. On Sat, Mar 28, 2015 at 11:47 AM, Yaniv, Ziv Rafael (NIH/NLM/LHC) [C] < zivrafael.yaniv at nih.gov> wrote: > The filter is: > > itk::IntensityWindowingImageFilter > > > Ziv > ________________________________ > From: Matias Montroull [matimontg at gmail.com] > Sent: Saturday, March 28, 2015 8:57 AM > To: insight-users at itk.org Users > Subject: [ITK-users] SimpleITK | chnage Window Levels on an image > > Hi, > > I would like to change the window width and window center of an image > using ITK. > > I guess it may be simple but I can't find the filter that would do that. > > Thanks, > > Matias. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zivrafael.yaniv at nih.gov Sat Mar 28 11:22:32 2015 From: zivrafael.yaniv at nih.gov (Yaniv, Ziv Rafael (NIH/NLM/LHC) [C]) Date: Sat, 28 Mar 2015 15:22:32 +0000 Subject: [ITK-users] SimpleITK | chnage Window Levels on an image In-Reply-To: References: , Message-ID: My understanding is that you want to set the window and level. You can do this directly using the SetWindowLevel method: http://www.itk.org/Doxygen/html/classitk_1_1IntensityWindowingImageFilter.html#ad99d5bd667dd23391ff3e2b2db1ce92d Ziv ________________________________ From: Matias Montroull [matimontg at gmail.com] Sent: Saturday, March 28, 2015 10:55 AM To: Yaniv, Ziv Rafael (NIH/NLM/LHC) [C] Cc: insight-users at itk.org Users Subject: Re: [ITK-users] SimpleITK | chnage Window Levels on an image Thanks Yaniv, So if I would like to set the Levels of an image to let's say: WC 120 and WW 40, how should I use the variables below to do so? filter->SetWindowMinimum(?); filter->SetWindowMaximum(?); I guess the above sentence just defines the range of the levels and not the actual level Thank you, Matias. On Sat, Mar 28, 2015 at 11:47 AM, Yaniv, Ziv Rafael (NIH/NLM/LHC) [C] > wrote: The filter is: itk::IntensityWindowingImageFilter Ziv ________________________________ From: Matias Montroull [matimontg at gmail.com] Sent: Saturday, March 28, 2015 8:57 AM To: insight-users at itk.org Users Subject: [ITK-users] SimpleITK | chnage Window Levels on an image Hi, I would like to change the window width and window center of an image using ITK. I guess it may be simple but I can't find the filter that would do that. Thanks, Matias. From gabrielgimenez85 at gmail.com Sat Mar 28 19:09:59 2015 From: gabrielgimenez85 at gmail.com (=?UTF-8?Q?Gabriel_A=2E_Gim=C3=A9nez?=) Date: Sat, 28 Mar 2015 16:09:59 -0700 (MST) Subject: [ITK-users] Resample and Directions in Image Registration Message-ID: <1427584199821-7587074.post@n2.nabble.com> Hello everyone, I am confused with some concepts ... In the munual (version 4.6) of ITK it is mentioned about ResamplingFilter (page 129): *"Probably the most important thing to keep in mind when resampling images is that the transform is used to map points from the output image space into the input image space."* This mean that the parameters are passed to filter mapped points from the output image to the input image, right? Then in the chapter about registration mentioned (page 174) : *"The Transform that is optimized in the ITK registration framework is the one that maps points from the physical space of the fixed image into the physical space of the moving image"* This indicates that the transformation parameters mapped points from the fixed image to moving image ( In the example ?Hello World Registration" this is observed ), right ? During the resampling, at the end of registration for the resulting image, this is done: *resampler->SetTransform( registration->GetOutput()->Get() );* *Why this? should not be pass to the filter the opposite transformation?* I've read much... but I still very confusing concepts like these... (physical spaces, grid/pixel spaces, directions of the transformations, etc...) Thanks in advance ... -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Resample-and-Directions-in-Image-Registration-tp7587074.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From lluna.nova at gmail.com Sat Mar 28 19:44:14 2015 From: lluna.nova at gmail.com (=?UTF-8?B?UG9sIE1vbnPDsyBQdXJ0w60=?=) Date: Sun, 29 Mar 2015 00:44:14 +0100 Subject: [ITK-users] itk and const-correctness Message-ID: Hello all, What is the preferred way to achieve const-correctness in ITK? I've stumbled with this 2010 post: http://itk-insight-users.2283740.n2.nabble.com/itk-SmartPointer-problem-making-code-const-correct-td5109890.html which suggests using raw pointers as arguments and pass ::Pointer in practice. Like the first function of http://www.itk.org/Wiki/ITK/Examples/Utilities/PassImageToFunction with myStandardPointer(image); Is that still the case in 2014? Cheers, Pol -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Sat Mar 28 22:49:23 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Sat, 28 Mar 2015 22:49:23 -0400 Subject: [ITK-users] itk and const-correctness In-Reply-To: References: Message-ID: <041919CE-D608-4D99-B7EC-2FA83841E278@mail.nih.gov> Hello Pol, I don't think anything has changed on this front [1]. So this is still the case for 2014 and 2015. ITK's style is to be more explicit with conversions than implicit and this is consistent with that philosophy. Brad [1] https://github.com/InsightSoftwareConsortium/ITK/commits/master/Modules/Core/Common/include/itkSmartPointer.h On Mar 28, 2015, at 7:44 PM, Pol Mons? Purt? wrote: > Hello all, > > What is the preferred way to achieve const-correctness in ITK? > > I've stumbled with this 2010 post: http://itk-insight-users.2283740.n2.nabble.com/itk-SmartPointer-problem-making-code-const-correct-td5109890.html > > which suggests using raw pointers as arguments and pass ::Pointer in practice. Like the first function of http://www.itk.org/Wiki/ITK/Examples/Utilities/PassImageToFunction with > myStandardPointer(image); > > Is that still the case in 2014? > > Cheers, > > Pol > > > _____________________________________ > 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 matt.mccormick at kitware.com Sun Mar 29 10:47:02 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Sun, 29 Mar 2015 10:47:02 -0400 Subject: [ITK-users] Resample and Directions in Image Registration In-Reply-To: <1427584199821-7587074.post@n2.nabble.com> References: <1427584199821-7587074.post@n2.nabble.com> Message-ID: Hi Gabriel, > In the munual (version 4.6) of ITK it is mentioned about ResamplingFilter > (page 129): > > *"Probably the most important thing to keep in mind when resampling images > is that the transform > is used to map points from the output image space into the input image > space."* > > This mean that the parameters are passed to filter mapped points from the > output image to the input image, right? Correct. > Then in the chapter about registration mentioned (page 174) : > > *"The Transform that is optimized in the ITK registration framework is the > one that maps points > from the physical space of the fixed image into the physical space of the > moving image"* > > This indicates that the transformation parameters mapped points from the > fixed image to moving image ( In the example ?Hello World Registration" this > is observed ), right ? Yes. These are consistent. The resampled output image is sampled on the grid of points in physical space where the fixed image is sampled. HTH, Matt From gabrielgimenez85 at gmail.com Sun Mar 29 17:25:58 2015 From: gabrielgimenez85 at gmail.com (=?UTF-8?Q?Gabriel_A=2E_Gim=C3=A9nez?=) Date: Sun, 29 Mar 2015 14:25:58 -0700 (MST) Subject: [ITK-users] Resample and Directions in Image Registration In-Reply-To: References: <1427584199821-7587074.post@n2.nabble.com> Message-ID: <1427664358535-7587078.post@n2.nabble.com> Hi Matt, thanks for your answer...It is now clear to me ... Matt! another question please ... what is the normal runtime of Mattes Mutual Information Metric with 3D images? It is normal to be in the range of 2.5 to 4 seconds? I use CT and MR images ... and this is my configuration: samplingPercentage = 0.002; samplingStrategy = RegistrationType::REGULAR; NumberOfHistogramBins = 50 thank you very much! -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Resample-and-Directions-in-Image-Registration-tp7587074p7587078.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From matt.mccormick at kitware.com Sun Mar 29 18:07:09 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Sun, 29 Mar 2015 18:07:09 -0400 Subject: [ITK-users] Resample and Directions in Image Registration In-Reply-To: <1427664358535-7587078.post@n2.nabble.com> References: <1427584199821-7587074.post@n2.nabble.com> <1427664358535-7587078.post@n2.nabble.com> Message-ID: Hi Gabriel, > Hi Matt, thanks for your answer...It is now clear to me ... Great! > Matt! another question please ... what is the normal runtime of Mattes > Mutual Information Metric with 3D images? It is normal to be in the range of > 2.5 to 4 seconds? I use CT and MR images ... and this is my configuration: > > samplingPercentage = 0.002; > samplingStrategy = RegistrationType::REGULAR; > NumberOfHistogramBins = 50 I do not know offhand what the expected computation time is, but I would not be surprised if it was that slow on 3D images. Matt From JohannesWeber at gmx.at Mon Mar 30 03:51:42 2015 From: JohannesWeber at gmx.at (Johannes Weber) Date: Mon, 30 Mar 2015 09:51:42 +0200 Subject: [ITK-users] setting big spherical neighborhoods to center voxel value In-Reply-To: References: <6E34D00A-F187-4E5E-A2E4-6F490D8CE87C@mail.nih.gov> , Message-ID: An HTML attachment was scrubbed... URL: From richard.beare at gmail.com Mon Mar 30 04:52:03 2015 From: richard.beare at gmail.com (Richard Beare) Date: Mon, 30 Mar 2015 19:52:03 +1100 Subject: [ITK-users] setting big spherical neighborhoods to center voxel value In-Reply-To: References: <6E34D00A-F187-4E5E-A2E4-6F490D8CE87C@mail.nih.gov> Message-ID: I guess the obvious common traps need to be checked - confirm you are in Release mode. Things like neighbourhood iterators can be very expensive in debug mode. Also, the neighbourhood iterator will be doing some sort of edge of image safety check, which your other code may not be doing (I haven't checked). The neighbourhood iterator isn't, I guess, really designed to be resized every time it is used. Normally you set it up once and apply it lots of times. I've no clue as to how expensive the initialisation is, but it may pay to keep a structure containing iterators that you've already allocated so that you can pick the right one and move it. It may turn out that the design is really bad for your problem, with performance being destroyed by the creation phase, that isn't an issue in the normal use case. Continuing to use it will give you edge safety and dimension independence, but I guess you'll need to address the issue of initialization by being clever about the reuse of iterators. One way to do that would be to use a pass to record the location and value of all of the skeleton points, sort them by brightness, then visit in order so that neighbourhoods can be reused without resizing. This assumes, of course that the skeletons contain much fewer voxels than the image. On Mon, Mar 30, 2015 at 6:51 PM, Johannes Weber wrote: > thank you for your answers! > > I tried out following idea of yours: "If you use neighbourhoods, which is > the appropriate ITK structure, then avoid visiting all voxels with the > neighbourhood iterator. Use a standard single voxel iterator to find the > skeleton voxels, then move the neighbourhood iterator to that location." > this is fast until I use the SetRadius method of the neighborhood > iterator... it goes up form about 2 seconds to 1 minute. > for(iterator.GoToBegin(); !iterator.IsAtEnd(); iterator++) > { > if(iterator.Get() > 0) > { > neighborhoodIterator.SetLocation(iterator.GetIndex()); > radius.Fill( (int) iterator.Get()); > neighborhoodIterator.SetRadius(radius); > } > } > > Than I implemented what I want to do by direct accessing the image array: > float * imgArray = distanceRidge->GetBufferPointer(); > > and for every ridge point (value > 0) in the image I go through the > desired region with 3 for loops: > > for (int i1 = iStart; i1 <= iStop; i1++) > { > r1SquaredK = (i1 - i) * (i1 - i); > for (int j1 = jStart; j1 <= jStop; j1++) > { > r1SquaredJK = r1SquaredK + (j1 - j) * (j1 - j); > if(r1SquaredJK <= rSquared) > { > for (int k1 = kStart; k1 <= kStop; k1++) > { > r1Squared = r1SquaredJK + (k1 - k) * (k1 - k); > if (r1Squared <= rSquared) > { > s1 = imgArray[i1 + imageSize[0] * (j1 + > imageSize[1] * k1)]; > if(rSquared > s1) > { > imgArray[i1 + imageSize[0] * (j1 + > imageSize[1] * k1)] = rSquared; > } > } > } > } > } > } > > and this works fine! and it is really fast! with this approach I am > getting there where I want to be. > I am doing the same with the neighborhood iterator, or I also tried out > doing it with a image region iterator and instead of going through the > desired region with 3 for loops I always set the region of the iterator > (see my first email). > So what I am asking myself is now, if it is so much faster using directly > the flat array where the image data is saved... is it also a proper way to > do it like this? and is there a different way of implementing this, which > is as fast as with flat array but using iterators from ITK or other > functions/options from ITK? > > *Gesendet:* Freitag, 27. M?rz 2015 um 00:47 Uhr > *Von:* "Richard Beare" > *An:* Richard.Beare at ieee.org > *Cc:* "Johannes Weber" , "Insight Users" < > insight-users at itk.org> > *Betreff:* Re: [ITK-users] setting big spherical neighborhoods to center > voxel value > Here's another option - I haven't thought it through completely so > could be far from the mark, but I think it is close. > > consider the following: > > A - input mask > B - distance transform of mask (positive values inside the mask) > C - ridge lines in B (sort of skeleton) > > You are aiming to create an image of spheres, centres on voxels in C, with > size set by the "brightness" at centre location in C. > > Suppose you can create the spatially variant dilation by a sphere using > the parabolic tools I mentioned in the previous message - that gives you > another mask: > > D - spatially variant dilation of C > > Now invert C and take the distance transform to give E. > take a distance transform of D and add to E, then mask by D. The idea here > is that if you add two distance transforms together you end up with a flat > surface, at least in the case where the second DT is computed from peaks in > the first. > > The result should be a sort of tube, of varying thickness, where the voxel > value corresponds to the tube thickness (possibly with a uniform offset). > Note that I don't think you will see sphere corresponding to the brightest > skeleton points using this approach, but the result may be useful for your > application. > > > Also, a couple of notes regarding the direct approach. > > If you use neighbourhoods, which is the appropriate ITK structure, then > avoid visiting all voxels with the neighbourhood iterator. Use a standard > single voxel iterator to find the skeleton voxels, then move the > neighbourhood iterator to that location. > > > There are also some optimizations you can use if you do some checks of > the change in sphere size between neighbours. If the spheres were all > identically sized then it is feasible to construct lists of voxels that are > not in common between neighbouring spheres, and just visit those, which is > a big saving. Much trickier when the sizes aren't the same, but I'd guess > that for a given skeleton there'd be a relatively small number of > combinations of neighbouring sizes. > > > > On Fri, Mar 27, 2015 at 8:02 AM, Richard Beare > wrote: >> >> This isn't a complete solution, but might give you some ideas. >> >> The part about using the skeleton points, which are distance transform >> voxels, as the source for the radius, can be implemented using spatially >> variant morphology. I have a short publication about doing this efficiently >> with parabolic functions. However this doesn't propagate the voxel value, >> only producing a mask. I have thought about combining with label dilation, >> to propagate a label value, but haven't done it yet. >> >> A queue based approach to something similar is discussed in: >> "Labelled reconstruction of binary objects: a vector propagation >> algorithm", buckley and lagerstrom >> >> On Thu, Mar 26, 2015 at 11:36 PM, Bradley Lowekamp < >> blowekamp at mail.nih.gov> wrote: >>> >>> Hello, >>> >>> If you have a 3D image and you are visiting a neighborhood of size 20^3, >>> you are doing 8000 visits per pixel there is no way to make this efficient. >>> You have a big O algorithm problem. >>> >>> The Neighborhood iterator would be a the more ITK way of doing what you >>> are trying to do [1] [2]. But that's is not the order of efficiency >>> improvement you need. >>> >>> You need to revise your algorithm so you only visit each pixel once. >>> Perhaps with region growing and queues, or auxiliary images to keep track >>> of the current distance or other data. >>> >>> Hope that helps, >>> Brad >>> >>> [1] >>> http://www.itk.org/Doxygen/html/classitk_1_1NeighborhoodIterator.html >>> [2] http://itk.org/Wiki/ITK/Examples/Iterators/NeighborhoodIterator >>> >>> On Mar 26, 2015, at 5:24 AM, JohannesWeber at gmx.at wrote: >>> >>> >>> Hello everyone, >>> >>> I have the following problem: after calculating the distance map (e.g. >>> with DanielssonDistanceMapImageFilter) I am getting rid of most of the >>> voxels (= setting 0) after calculating a so called distance ridge (kind of >>> a skeleton). Now I want for every voxel of this distance ridge that it is a >>> center voxel for a spherical neighborhood with the radius equal to the >>> distance value of the voxel, and all voxels included in this sphere are set >>> to the distance value of the voxel of the distance ridge (the center voxel >>> of the sphere). So that means the neighborhoods can become big, e.g. radius >>> of 10, or 20 voxels. The problem is here the performance... I implemented >>> it somehow, but the performance nowhere near it should be. >>> e.g. going through the image with a neighborhood iterator and vor every >>> voxel bigger than 0 creating a neighborhood with the radius with the >>> distance value of this voxel that seems to take very long alone to create >>> and indexing the neighborhood. >>> another approach I tried is to extract all the voxels of the distance >>> ridge, iterate through them and calculate for every ridge voxel the region >>> and iterate through the region doing proper calculations: >>> >>> for (int rp = 0; rp < nRidgePoints; rp++) >>> { >>> ImageType::IndexType s1Index; >>> const int i = ridgePointsIndex[0][rp]; >>> const int j = ridgePointsIndex[1][rp]; >>> const int k = ridgePointsIndex[2][rp]; >>> const float r = ridgePointsValues[rp]; >>> >>> rSquared = (int) ((r * r) + 0.5f); >>> rInt = (int) r; >>> if(rInt < r) rInt++; >>> iStart = i - rInt; >>> if(iStart < 0) iStart = 0; >>> iStop = i + rInt; >>> if(iStop >= imageSize[0]) iStop = imageSize[0] - 1; >>> jStart = j - rInt; >>> if(jStart < 0) jStart = 0; >>> jStop = j + rInt; >>> if(jStop >= imageSize[1]) jStop = imageSize[1] - 1; >>> kStart = k - rInt; >>> if(kStart < 0) kStart = 0; >>> kStop = k + rInt; >>> if(kStop >= imageSize[2]) kStop = imageSize[2] - 1; >>> ImageType::IndexType index; >>> ImageType::SizeType size; >>> index[0] = iStart; >>> index[1] = jStart; >>> index[2] = kStart; >>> size[0] = iStop - iStart + 1; >>> size[1] = jStop - jStart + 1; >>> size[2] = kStop - kStart + 1; >>> ImageType::RegionType region; >>> region.SetIndex(index); >>> region.SetSize(size); >>> ImageRegionIteratorWithIndexType iteratorWithIndex >>> (distanceRidge, region); >>> >>> for (iteratorWithIndex.GoToBegin(); >>> !iteratorWithIndex.IsAtEnd(); iteratorWithIndex++) >>> { >>> s1Index = iteratorWithIndex.GetIndex(); >>> r1SquaredK = (s1Index[0] - i) * (s1Index[0] - i); >>> r1SquaredJK = r1SquaredK + (s1Index[1] - j) * (s1Index[1] - >>> j); >>> if(r1SquaredJK <= rSquared) >>> { >>> r1Squared = r1SquaredJK + (s1Index[2] - k) * (s1Index[2] >>> - k); >>> if (r1Squared <= rSquared) >>> { >>> s1 = iteratorWithIndex.Get(); >>> if (rSquared > s1) >>> { >>> iteratorWithIndex.Set(rSquared); >>> >>> } >>> } >>> } >>> } >>> >>> } >>> >>> so every approach I tried until now is very slow comparing to other >>> implementations of the algorithm I want to do... would maybe spatial >>> objects help me somehow? But I do not really understand how they work... >>> thanks for your help! >>> >>> greetings, >>> Johannes >>> _____________________________________ >>> 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 grothausmann.roman at mh-hannover.de Mon Mar 30 05:25:25 2015 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Mon, 30 Mar 2015 11:25:25 +0200 Subject: [ITK-users] automated splitting and pasting of volumes for use in external programs In-Reply-To: References: <0B31CB6B-D4D0-48B1-A019-775E1E09E686@mail.nih.gov> Message-ID: <55191685.9020706@mh-hannover.de> Dear mailing list members, A dataset I work on is too big to load completely into itksnap for manual adjustment of the automatic pre-segementation with watersheds. The full resolution is needed, so I cannot work with a re-sampled version. The only possible easy solution I see at the moment is to split up the 3D image into smaller blocks of sizes as equal as possible, do the itsnap interaction, and finally paste all blocks of the resulting segmentation back together. Would itkImageRegionSplitterMultidimensional be the right filter for the splitting of blocks as equal in size as possible? Is there a "logger" like e.g. itkXMLFileOutputWindow (as used in itkStreamingImageFilterTest2.cxx) that could be used to store the regions corresponding to each block-file to use that for itkPasteImageFilter to combine these blocks later again? Not needed now, but perhaps lager: Is there some nice way to handle overlaps in this case that is already implemented in itk, something like itkImageRegionSplitterMultidimensional::SetOverlap()? Many thanks for any help or hints. Roman On 17/03/15 18:13, Pol Mons? Purt? wrote: > I guess the way to go would be to take the splitter (probably > ImageRegionSplitterMultidimensional now that I look at it) and extend it to > support overlap. If I do it, I'll let you know in case it is of interest to > anyone. For now I'll stick to my class. -- 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 lluna.nova at gmail.com Mon Mar 30 05:50:39 2015 From: lluna.nova at gmail.com (=?UTF-8?B?UG9sIE1vbnPDsyBQdXJ0w60=?=) Date: Mon, 30 Mar 2015 11:50:39 +0200 Subject: [ITK-users] registering ROI Message-ID: Hello all, tl; dr How can I reset the index of two labelObjects' bounding box generated from a ROIExtractor output to the original image's LargestPossibleRegion() coordinate system? -- I need to apply a series of (non-itk) operations on a ShapeLabelObject present in a small ROI of the image with the purpose of dividing it in two. I was using ROI filter because among other things I want the Indexes to be referred to the ROI so it is less complex to refer to the voxels' coordinates. But afterwards I need the original Index so that the GetBoundingBox() of the two generated label objects returns a region that refers to the original image repectively, while maintaining the size (probably index offset shift) of the new labelobject. I could do as for now and store the roi and then do something like (roi.getIndex() + obj->GetBoudingBox().GetIndex() ) to create a shifted bounding box, but maybe there is a better way to do it, as read in the documentation: The origin coordinates of the output images will be computed in such a way that if mapped to physical space, the output image will overlay the input image with perfect registration. In other words, a registration process between the output image and the input image will return an identity transform. So how could I remap to the original "physical space"? I don't know to what does that phrase refer to, but it sounds like it's exactly what I am trying to do. I've looked into SetRequestedRegion also as an alternative, but that would not give me indexes relative to roi, so I would have to substract them right before the operations, which might be an option too, but I believe things get complicated if I do that. Cheers, Pol -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Mon Mar 30 07:15:19 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Mon, 30 Mar 2015 07:15:19 -0400 Subject: [ITK-users] [ITK] registering ROI In-Reply-To: References: Message-ID: Hello, Since you have done the ROI extraction with ITK, then the physical location of each pixel has been maintained. Use the ROI Image's TransformIndexToPhysicalPoint method[1], then use your original image's TransformPhysicalPointToIndex method[2]. This would be the most generalized and robust method which the documentation refers too. You could use it to validate your optimized approach. Yes, alternatively you can use the RegionOfInterestImageFilter ( I believe ) to extract a region which has a non-zero starting index, and is the same indexing and the input image. Alternatively you can use the pipeline and rely on the streaming to produce the regions, but then you have to deal with the fact that the buffered region is different than the largest possible region. There are many possibilities on what to do here. Hope that helps, Brad [1] http://www.itk.org/Doxygen/html/classitk_1_1ImageBase.html#ab003313ba1a078d89a832dc0a35d2efa [2] http://www.itk.org/Doxygen/html/classitk_1_1ImageBase.html#af4a7c9c3787e9fdafbaaade2e02efa25 On Mar 30, 2015, at 5:50 AM, Pol Mons? Purt? wrote: > Hello all, > > tl; dr > > How can I reset the index of two labelObjects' bounding box generated from a ROIExtractor output to the original image's LargestPossibleRegion() coordinate system? > > -- > > I need to apply a series of (non-itk) operations on a ShapeLabelObject present in a small ROI of the image with the purpose of dividing it in two. I was using ROI filter because among other things I want the Indexes to be referred to the ROI so it is less complex to refer to the voxels' coordinates. > > But afterwards I need the original Index so that the GetBoundingBox() of the two generated label objects returns a region that refers to the original image repectively, while maintaining the size (probably index offset shift) of the new labelobject. > > I could do as for now and store the roi and then do something like (roi.getIndex() + obj->GetBoudingBox().GetIndex() ) to create a shifted bounding box, but maybe there is a better way to do it, as read in the documentation: > > The origin coordinates of the output images will be computed in such a way that if mapped to physical space, the output image will overlay the input image with perfect registration. In other words, a registration process between the output image and the input image will return an identity transform. > > So how could I remap to the original "physical space"? I don't know to what does that phrase refer to, but it sounds like it's exactly what I am trying to do. > > I've looked into SetRequestedRegion also as an alternative, but that would not give me indexes relative to roi, so I would have to substract them right before the operations, which might be an option too, but I believe things get complicated if I do that. > > Cheers, > > Pol > > > > > _____________________________________ > 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 blowekamp at mail.nih.gov Mon Mar 30 09:06:55 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Mon, 30 Mar 2015 09:06:55 -0400 Subject: [ITK-users] setting big spherical neighborhoods to center voxel value In-Reply-To: References: <6E34D00A-F187-4E5E-A2E4-6F490D8CE87C@mail.nih.gov> Message-ID: <4F13082D-A19A-4BF2-B720-9418E39C2510@mail.nih.gov> Hello, Yes please check the obvious things first. Recently I had similar requirements for an algorithm; I needed to iterate over a sparse set of neighborhoods. I ended up creating ImageScanlineImageIterators for each neighborhood. You may want to try the approach here [1] ( apologize of not having more comments there). If it works for you, I'd be quite interested if the performance comparison. HTH, Brad [1] https://github.com/blowekamp/itkSuperPixel/blob/d63741c87067376f0a1e5651a7f96964974c724b/include/itkSLICImageFilter.hxx#L238-L277 On Mar 30, 2015, at 4:52 AM, Richard Beare wrote: > I guess the obvious common traps need to be checked - confirm you are in Release mode. Things like neighbourhood iterators can be very expensive in debug mode. Also, the neighbourhood iterator will be doing some sort of edge of image safety check, which your other code may not be doing (I haven't checked). The neighbourhood iterator isn't, I guess, really designed to be resized every time it is used. Normally you set it up once and apply it lots of times. I've no clue as to how expensive the initialisation is, but it may pay to keep a structure containing iterators that you've already allocated so that you can pick the right one and move it. > > It may turn out that the design is really bad for your problem, with performance being destroyed by the creation phase, that isn't an issue in the normal use case. Continuing to use it will give you edge safety and dimension independence, but I guess you'll need to address the issue of initialization by being clever about the reuse of iterators. > > One way to do that would be to use a pass to record the location and value of all of the skeleton points, sort them by brightness, then visit in order so that neighbourhoods can be reused without resizing. This assumes, of course that the skeletons contain much fewer voxels than the image. > > > On Mon, Mar 30, 2015 at 6:51 PM, Johannes Weber wrote: > thank you for your answers! > > I tried out following idea of yours: "If you use neighbourhoods, which is the appropriate ITK structure, then avoid visiting all voxels with the neighbourhood iterator. Use a standard single voxel iterator to find the skeleton voxels, then move the neighbourhood iterator to that location." > this is fast until I use the SetRadius method of the neighborhood iterator... it goes up form about 2 seconds to 1 minute. > for(iterator.GoToBegin(); !iterator.IsAtEnd(); iterator++) > { > if(iterator.Get() > 0) > { > neighborhoodIterator.SetLocation(iterator.GetIndex()); > radius.Fill( (int) iterator.Get()); > neighborhoodIterator.SetRadius(radius); > } > } > > Than I implemented what I want to do by direct accessing the image array: > float * imgArray = distanceRidge->GetBufferPointer(); > > and for every ridge point (value > 0) in the image I go through the desired region with 3 for loops: > > for (int i1 = iStart; i1 <= iStop; i1++) > { > r1SquaredK = (i1 - i) * (i1 - i); > for (int j1 = jStart; j1 <= jStop; j1++) > { > r1SquaredJK = r1SquaredK + (j1 - j) * (j1 - j); > if(r1SquaredJK <= rSquared) > { > for (int k1 = kStart; k1 <= kStop; k1++) > { > r1Squared = r1SquaredJK + (k1 - k) * (k1 - k); > if (r1Squared <= rSquared) > { > s1 = imgArray[i1 + imageSize[0] * (j1 + imageSize[1] * k1)]; > if(rSquared > s1) > { > imgArray[i1 + imageSize[0] * (j1 + imageSize[1] * k1)] = rSquared; > } > } > } > } > } > } > > and this works fine! and it is really fast! with this approach I am getting there where I want to be. > I am doing the same with the neighborhood iterator, or I also tried out doing it with a image region iterator and instead of going through the desired region with 3 for loops I always set the region of the iterator (see my first email). > So what I am asking myself is now, if it is so much faster using directly the flat array where the image data is saved... is it also a proper way to do it like this? and is there a different way of implementing this, which is as fast as with flat array but using iterators from ITK or other functions/options from ITK? > > Gesendet: Freitag, 27. M?rz 2015 um 00:47 Uhr > Von: "Richard Beare" > An: Richard.Beare at ieee.org > Cc: "Johannes Weber" , "Insight Users" > Betreff: Re: [ITK-users] setting big spherical neighborhoods to center voxel value > Here's another option - I haven't thought it through completely so could be far from the mark, but I think it is close. > > consider the following: > > A - input mask > B - distance transform of mask (positive values inside the mask) > C - ridge lines in B (sort of skeleton) > > You are aiming to create an image of spheres, centres on voxels in C, with size set by the "brightness" at centre location in C. > > Suppose you can create the spatially variant dilation by a sphere using the parabolic tools I mentioned in the previous message - that gives you another mask: > > D - spatially variant dilation of C > > Now invert C and take the distance transform to give E. > take a distance transform of D and add to E, then mask by D. The idea here is that if you add two distance transforms together you end up with a flat surface, at least in the case where the second DT is computed from peaks in the first. > > The result should be a sort of tube, of varying thickness, where the voxel value corresponds to the tube thickness (possibly with a uniform offset). Note that I don't think you will see sphere corresponding to the brightest skeleton points using this approach, but the result may be useful for your application. > > > Also, a couple of notes regarding the direct approach. > > If you use neighbourhoods, which is the appropriate ITK structure, then avoid visiting all voxels with the neighbourhood iterator. Use a standard single voxel iterator to find the skeleton voxels, then move the neighbourhood iterator to that location. > > > There are also some optimizations you can use if you do some checks of the change in sphere size between neighbours. If the spheres were all identically sized then it is feasible to construct lists of voxels that are not in common between neighbouring spheres, and just visit those, which is a big saving. Much trickier when the sizes aren't the same, but I'd guess that for a given skeleton there'd be a relatively small number of combinations of neighbouring sizes. > > > > On Fri, Mar 27, 2015 at 8:02 AM, Richard Beare wrote: > This isn't a complete solution, but might give you some ideas. > > The part about using the skeleton points, which are distance transform voxels, as the source for the radius, can be implemented using spatially variant morphology. I have a short publication about doing this efficiently with parabolic functions. However this doesn't propagate the voxel value, only producing a mask. I have thought about combining with label dilation, to propagate a label value, but haven't done it yet. > > A queue based approach to something similar is discussed in: > "Labelled reconstruction of binary objects: a vector propagation algorithm", buckley and lagerstrom > > On Thu, Mar 26, 2015 at 11:36 PM, Bradley Lowekamp wrote: > Hello, > > If you have a 3D image and you are visiting a neighborhood of size 20^3, you are doing 8000 visits per pixel there is no way to make this efficient. You have a big O algorithm problem. > > The Neighborhood iterator would be a the more ITK way of doing what you are trying to do [1] [2]. But that's is not the order of efficiency improvement you need. > > You need to revise your algorithm so you only visit each pixel once. Perhaps with region growing and queues, or auxiliary images to keep track of the current distance or other data. > > Hope that helps, > Brad > > [1] http://www.itk.org/Doxygen/html/classitk_1_1NeighborhoodIterator.html > [2] http://itk.org/Wiki/ITK/Examples/Iterators/NeighborhoodIterator > > On Mar 26, 2015, at 5:24 AM, JohannesWeber at gmx.at wrote: > > Hello everyone, > > I have the following problem: after calculating the distance map (e.g. with DanielssonDistanceMapImageFilter) I am getting rid of most of the voxels (= setting 0) after calculating a so called distance ridge (kind of a skeleton). Now I want for every voxel of this distance ridge that it is a center voxel for a spherical neighborhood with the radius equal to the distance value of the voxel, and all voxels included in this sphere are set to the distance value of the voxel of the distance ridge (the center voxel of the sphere). So that means the neighborhoods can become big, e.g. radius of 10, or 20 voxels. The problem is here the performance... I implemented it somehow, but the performance nowhere near it should be. > e.g. going through the image with a neighborhood iterator and vor every voxel bigger than 0 creating a neighborhood with the radius with the distance value of this voxel that seems to take very long alone to create and indexing the neighborhood. > another approach I tried is to extract all the voxels of the distance ridge, iterate through them and calculate for every ridge voxel the region and iterate through the region doing proper calculations: > > for (int rp = 0; rp < nRidgePoints; rp++) > { > ImageType::IndexType s1Index; > const int i = ridgePointsIndex[0][rp]; > const int j = ridgePointsIndex[1][rp]; > const int k = ridgePointsIndex[2][rp]; > const float r = ridgePointsValues[rp]; > > rSquared = (int) ((r * r) + 0.5f); > rInt = (int) r; > if(rInt < r) rInt++; > iStart = i - rInt; > if(iStart < 0) iStart = 0; > iStop = i + rInt; > if(iStop >= imageSize[0]) iStop = imageSize[0] - 1; > jStart = j - rInt; > if(jStart < 0) jStart = 0; > jStop = j + rInt; > if(jStop >= imageSize[1]) jStop = imageSize[1] - 1; > kStart = k - rInt; > if(kStart < 0) kStart = 0; > kStop = k + rInt; > if(kStop >= imageSize[2]) kStop = imageSize[2] - 1; > ImageType::IndexType index; > ImageType::SizeType size; > index[0] = iStart; > index[1] = jStart; > index[2] = kStart; > size[0] = iStop - iStart + 1; > size[1] = jStop - jStart + 1; > size[2] = kStop - kStart + 1; > ImageType::RegionType region; > region.SetIndex(index); > region.SetSize(size); > ImageRegionIteratorWithIndexType iteratorWithIndex (distanceRidge, region); > > for (iteratorWithIndex.GoToBegin(); !iteratorWithIndex.IsAtEnd(); iteratorWithIndex++) > { > s1Index = iteratorWithIndex.GetIndex(); > r1SquaredK = (s1Index[0] - i) * (s1Index[0] - i); > r1SquaredJK = r1SquaredK + (s1Index[1] - j) * (s1Index[1] - j); > if(r1SquaredJK <= rSquared) > { > r1Squared = r1SquaredJK + (s1Index[2] - k) * (s1Index[2] - k); > if (r1Squared <= rSquared) > { > s1 = iteratorWithIndex.Get(); > if (rSquared > s1) > { > iteratorWithIndex.Set(rSquared); > } > } > } > } > > } > > so every approach I tried until now is very slow comparing to other implementations of the algorithm I want to do... would maybe spatial objects help me somehow? But I do not really understand how they work... > thanks for your help! > > greetings, > Johannes > _____________________________________ > 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 > > > _____________________________________ > 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 lluna.nova at gmail.com Mon Mar 30 09:53:20 2015 From: lluna.nova at gmail.com (=?UTF-8?B?UG9sIE1vbnPDsyBQdXJ0w60=?=) Date: Mon, 30 Mar 2015 15:53:20 +0200 Subject: [ITK-users] [ITK] registering ROI In-Reply-To: References: Message-ID: Hello Bradley, Great, I'll try out the first approach you suggested. Alternativelly, if I still have the RegionType roi at hand, how could I use it to my advantatge using setRegions of the output image? Something that does the reverse of RegionOfInterestImageFilter. And what about the approach of changing the BoundingBox's index of the labelObject? -- On a side note, I am confused by your second paragraph, in my case: Since you have done the ROI extraction with ITK and > you can use the RegionOfInterestImageFilter > are the same thing. I indeed used the filter to extract the ROI, the indices are re-computed so they start to [0,0,0], not with the same indexing as the first image as you said (and that's what I want, so all good here ;)). Maybe you were referring to the physical point? Cheers, Pol 2015-03-30 13:15 GMT+02:00 Bradley Lowekamp : > Hello, > > Since you have done the ROI extraction with ITK, then the physical > location of each pixel has been maintained. Use the ROI Image's > TransformIndexToPhysicalPoint method[1], then use your original image's > TransformPhysicalPointToIndex method[2]. This would be the most generalized > and robust method which the documentation refers too. You could use it to > validate your optimized approach. > > Yes, alternatively you can use the RegionOfInterestImageFilter ( I believe > ) to extract a region which has a non-zero starting index, and is the same > indexing and the input image. Alternatively you can use the pipeline and > rely on the streaming to produce the regions, but then you have to deal > with the fact that the buffered region is different than the largest > possible region. There are many possibilities on what to do here. > > Hope that helps, > Brad > > [1] > http://www.itk.org/Doxygen/html/classitk_1_1ImageBase.html#ab003313ba1a078d89a832dc0a35d2efa > [2] > http://www.itk.org/Doxygen/html/classitk_1_1ImageBase.html#af4a7c9c3787e9fdafbaaade2e02efa25 > > On Mar 30, 2015, at 5:50 AM, Pol Mons? Purt? wrote: > > > Hello all, > > > > tl; dr > > > > How can I reset the index of two labelObjects' bounding box generated > from a ROIExtractor output to the original image's LargestPossibleRegion() > coordinate system? > > > > -- > > > > I need to apply a series of (non-itk) operations on a ShapeLabelObject > present in a small ROI of the image with the purpose of dividing it in two. > I was using ROI filter because among other things I want the Indexes to be > referred to the ROI so it is less complex to refer to the voxels' > coordinates. > > > > But afterwards I need the original Index so that the GetBoundingBox() of > the two generated label objects returns a region that refers to the > original image repectively, while maintaining the size (probably index > offset shift) of the new labelobject. > > > > I could do as for now and store the roi and then do something like > (roi.getIndex() + obj->GetBoudingBox().GetIndex() ) to create a shifted > bounding box, but maybe there is a better way to do it, as read in the > documentation: > > > > The origin coordinates of the output images will be computed in such a > way that if mapped to physical space, the output image will overlay the > input image with perfect registration. In other words, a registration > process between the output image and the input image will return an > identity transform. > > > > So how could I remap to the original "physical space"? I don't know to > what does that phrase refer to, but it sounds like it's exactly what I am > trying to do. > > > > I've looked into SetRequestedRegion also as an alternative, but that > would not give me indexes relative to roi, so I would have to substract > them right before the operations, which might be an option too, but I > believe things get complicated if I do that. > > > > Cheers, > > > > Pol > > > > > > > > > > _____________________________________ > > 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 Mon Mar 30 10:02:27 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 30 Mar 2015 10:02:27 -0400 Subject: [ITK-users] automated splitting and pasting of volumes for use in external programs In-Reply-To: <55191685.9020706@mh-hannover.de> References: <0B31CB6B-D4D0-48B1-A019-775E1E09E686@mail.nih.gov> <55191685.9020706@mh-hannover.de> Message-ID: Hi Roman, You probably want to use the streaming capabilities of the ITK pipeline. This is covered in more detailed in the ITK Software Guide. The pipeline internally uses ImageRegionSplitter classes. Overlaps are handled by propagation of the RequestedRegion throughout the pipeline. To monitor the changes in the regions, use the PipelineMonitorImageFilter [1]. HTH, Matt [1] http://www.itk.org/Doxygen/html/classitk_1_1PipelineMonitorImageFilter.html On Mon, Mar 30, 2015 at 5:25 AM, Dr. Roman Grothausmann wrote: > Dear mailing list members, > > > A dataset I work on is too big to load completely into itksnap for manual > adjustment of the automatic pre-segementation with watersheds. The full > resolution is needed, so I cannot work with a re-sampled version. The only > possible easy solution I see at the moment is to split up the 3D image into > smaller blocks of sizes as equal as possible, do the itsnap interaction, and > finally paste all blocks of the resulting segmentation back together. > Would itkImageRegionSplitterMultidimensional be the right filter for the > splitting of blocks as equal in size as possible? > Is there a "logger" like e.g. itkXMLFileOutputWindow (as used in > itkStreamingImageFilterTest2.cxx) that could be used to store the regions > corresponding to each block-file to use that for itkPasteImageFilter to > combine these blocks later again? > Not needed now, but perhaps lager: Is there some nice way to handle overlaps > in this case that is already implemented in itk, something like > itkImageRegionSplitterMultidimensional::SetOverlap()? > > Many thanks for any help or hints. > Roman > > On 17/03/15 18:13, Pol Mons? Purt? wrote: >> >> I guess the way to go would be to take the splitter (probably >> ImageRegionSplitterMultidimensional now that I look at it) and extend it >> to >> support overlap. If I do it, I'll let you know in case it is of interest >> to >> anyone. For now I'll stick to my class. > > > > -- > 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 Mar 30 10:49:03 2015 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 30 Mar 2015 10:49:03 -0400 Subject: [ITK-users] Updates to Gerrit Robot Builds Message-ID: Hi folks, Along with our recent Gerrit upgrade, we have also re-worked and greatly improved the robot builds for proposed patches. The new system uses the Gerrit Trigger plugin for Jenkins. Two Jenkins instances currently will create robot builds, one on the Azure cloud for Linux and Windows builds [1] and one at Kitware for MacOSX builds. Improvements include: - More builds executors with a more reliable uptime. The Azure builds will now spin up and spin down on demand, and they stay up more reliably. We now have two full-time MacOSX build executors. - MacOSX builds are now running the latest version of XCode and generating fully green build results. - Remote Module submissions will have their module enabled during submission. - Builds report when they are finished and add a +1 or -1 Verified status automatically. It is much more useful to know when the builds finish as opposed to when the builds start. The notification makes is easier to know at a glance whether a patch builds cleanly. Links are included to filtered CDash build results. Links are also included to the Jenkins jobs on Azure, which has a useful link to the full console output. - New and more extensive build controls. The following comments will initiate builds: request build: all request build: windows request build: osx request build: linux request build: python The 'request build: all' comment will generate Windows, MacOSX, and Linux builds. The 'request build: python' comment will initiate builds with Python wrapping. These commands have been added and will be updated on the Git development wiki page [2] Happy testing :-), Matt [1] http://itkjenkins.cloudapp.net [2] http://www.itk.org/Wiki/ITK/Git/Develop From majcjc at gmail.com Mon Mar 30 12:24:48 2015 From: majcjc at gmail.com (Lin M) Date: Mon, 30 Mar 2015 12:24:48 -0400 Subject: [ITK-users] What's the difference between itkFastMarchingImageFilterBase and itkFastMarchingImageFilter? Message-ID: Hi all, I'm wondering what's the difference between itkFastMarchingImageFilterBase and itkFastMarchingImageFilter. I'm currently using itkFastMarchingImageFilterBase on a 3D image (512*512*365) whose computational time is much slower than I expected (about 250secs). I'm trying to find a way to improve that but I really don't have a clue now. Can you give me some suggestions about that? Thank you very much! Best, Lin -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Mon Mar 30 13:15:31 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Mon, 30 Mar 2015 13:15:31 -0400 Subject: [ITK-users] What's the difference between itkFastMarchingImageFilterBase and itkFastMarchingImageFilter? In-Reply-To: References: Message-ID: <5377FDCD-B8C2-475A-9E6E-80FAC10A05FF@mail.nih.gov> Hello, The itkFastMarchingImageFilterBase, is new and more generalized with a support for generalized stopping criteria and a base infrastructure that can run on quad-edge meshes. The plain itkFastMarchingImageFilter is a bit faster but missing some features and flexibility. HTH, Brad On Mar 30, 2015, at 12:24 PM, Lin M wrote: > Hi all, > > I'm wondering what's the difference between itkFastMarchingImageFilterBase and itkFastMarchingImageFilter. > > I'm currently using itkFastMarchingImageFilterBase on a 3D image (512*512*365) whose computational time is much slower than I expected (about 250secs). I'm trying to find a way to improve that but I really don't have a clue now. Can you give me some suggestions about that? Thank you very much! > > Best, > Lin > _____________________________________ > 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 majcjc at gmail.com Mon Mar 30 13:47:38 2015 From: majcjc at gmail.com (Lin M) Date: Mon, 30 Mar 2015 13:47:38 -0400 Subject: [ITK-users] What's the difference between itkFastMarchingImageFilterBase and itkFastMarchingImageFilter? In-Reply-To: <5377FDCD-B8C2-475A-9E6E-80FAC10A05FF@mail.nih.gov> References: <5377FDCD-B8C2-475A-9E6E-80FAC10A05FF@mail.nih.gov> Message-ID: Hi Brad, Thank you for your reply! Do you think it's normal to take about 250 secs on a 512*512*365 image to compute the result? I followed the example from here http://www.itk.org/Doxygen/html/SphinxExamples_2src_2Filtering_2FastMarching_2CreateDistanceMapFromSeeds_2Code_8cxx-example.html#_a2 I'm using a i7-860 16G 64bit win8 machine. Best, Lin On Mon, Mar 30, 2015 at 1:15 PM, Bradley Lowekamp wrote: > Hello, > > The itkFastMarchingImageFilterBase, is new and more generalized with a > support for generalized stopping criteria and a base infrastructure that > can run on quad-edge meshes. The plain itkFastMarchingImageFilter is a bit > faster but missing some features and flexibility. > > HTH, > Brad > > > On Mar 30, 2015, at 12:24 PM, Lin M wrote: > > Hi all, > > I'm wondering what's the difference between itkFastMarchingImageFilterBase > and itkFastMarchingImageFilter. > > I'm currently using itkFastMarchingImageFilterBase on a 3D image > (512*512*365) whose computational time is much slower than I expected > (about 250secs). I'm trying to find a way to improve that but I really > don't have a clue now. Can you give me some suggestions about that? Thank > you very much! > > Best, > Lin > _____________________________________ > 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 bill.lorensen at gmail.com Mon Mar 30 13:57:05 2015 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Mon, 30 Mar 2015 10:57:05 -0700 Subject: [ITK-users] What's the difference between itkFastMarchingImageFilterBase and itkFastMarchingImageFilter? In-Reply-To: References: <5377FDCD-B8C2-475A-9E6E-80FAC10A05FF@mail.nih.gov> Message-ID: Is your windows build a Release build or Debug build? On Mon, Mar 30, 2015 at 10:47 AM, Lin M wrote: > Hi Brad, > > Thank you for your reply! Do you think it's normal to take about 250 secs on > a 512*512*365 image to compute the result? > > I followed the example from here > http://www.itk.org/Doxygen/html/SphinxExamples_2src_2Filtering_2FastMarching_2CreateDistanceMapFromSeeds_2Code_8cxx-example.html#_a2 > > I'm using a i7-860 16G 64bit win8 machine. > > Best, > Lin > > On Mon, Mar 30, 2015 at 1:15 PM, Bradley Lowekamp > wrote: >> >> Hello, >> >> The itkFastMarchingImageFilterBase, is new and more generalized with a >> support for generalized stopping criteria and a base infrastructure that can >> run on quad-edge meshes. The plain itkFastMarchingImageFilter is a bit >> faster but missing some features and flexibility. >> >> HTH, >> Brad >> >> >> On Mar 30, 2015, at 12:24 PM, Lin M wrote: >> >> Hi all, >> >> I'm wondering what's the difference between itkFastMarchingImageFilterBase >> and itkFastMarchingImageFilter. >> >> I'm currently using itkFastMarchingImageFilterBase on a 3D image >> (512*512*365) whose computational time is much slower than I expected (about >> 250secs). I'm trying to find a way to improve that but I really don't have a >> clue now. Can you give me some suggestions about that? Thank you very much! >> >> Best, >> Lin >> _____________________________________ >> 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 > -- Unpaid intern in BillsBasement at noware dot com From majcjc at gmail.com Mon Mar 30 14:00:49 2015 From: majcjc at gmail.com (Lin M) Date: Mon, 30 Mar 2015 14:00:49 -0400 Subject: [ITK-users] What's the difference between itkFastMarchingImageFilterBase and itkFastMarchingImageFilter? In-Reply-To: References: <5377FDCD-B8C2-475A-9E6E-80FAC10A05FF@mail.nih.gov> Message-ID: Hi Bill, It's a Release build. Best, Lin On Mon, Mar 30, 2015 at 1:57 PM, Bill Lorensen wrote: > Is your windows build a Release build or Debug build? > > On Mon, Mar 30, 2015 at 10:47 AM, Lin M wrote: > > Hi Brad, > > > > Thank you for your reply! Do you think it's normal to take about 250 > secs on > > a 512*512*365 image to compute the result? > > > > I followed the example from here > > > http://www.itk.org/Doxygen/html/SphinxExamples_2src_2Filtering_2FastMarching_2CreateDistanceMapFromSeeds_2Code_8cxx-example.html#_a2 > > > > I'm using a i7-860 16G 64bit win8 machine. > > > > Best, > > Lin > > > > On Mon, Mar 30, 2015 at 1:15 PM, Bradley Lowekamp < > blowekamp at mail.nih.gov> > > wrote: > >> > >> Hello, > >> > >> The itkFastMarchingImageFilterBase, is new and more generalized with a > >> support for generalized stopping criteria and a base infrastructure > that can > >> run on quad-edge meshes. The plain itkFastMarchingImageFilter is a bit > >> faster but missing some features and flexibility. > >> > >> HTH, > >> Brad > >> > >> > >> On Mar 30, 2015, at 12:24 PM, Lin M wrote: > >> > >> Hi all, > >> > >> I'm wondering what's the difference between > itkFastMarchingImageFilterBase > >> and itkFastMarchingImageFilter. > >> > >> I'm currently using itkFastMarchingImageFilterBase on a 3D image > >> (512*512*365) whose computational time is much slower than I expected > (about > >> 250secs). I'm trying to find a way to improve that but I really don't > have a > >> clue now. Can you give me some suggestions about that? Thank you very > much! > >> > >> Best, > >> Lin > >> _____________________________________ > >> 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 > > > > > > -- > Unpaid intern in BillsBasement at noware dot com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Mon Mar 30 14:32:02 2015 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Mon, 30 Mar 2015 14:32:02 -0400 Subject: [ITK-users] What's the difference between itkFastMarchingImageFilterBase and itkFastMarchingImageFilter? In-Reply-To: References: <5377FDCD-B8C2-475A-9E6E-80FAC10A05FF@mail.nih.gov> Message-ID: Hello, I just completed a quick performance test in SimpleITK: In [1]: import SimpleITK as sitk In [2]: print sitk.Version() SimpleITK Version: 0.9.0b01 Compiled: Feb 19 2015 00:47:16 In [3]: img = sitk.Image(512,515,365,sitk.sitkFloat32) In [4]: img += 1 In [5]: %timeit -n 1 -r 1 sitk.FastMarchingBase( img, [[10,10,10]]) 1 loops, best of 1: 4min 1s per loop In [6]: %timeit -n 1 -r 1 sitk.FastMarching( img, [[10,10,10]]) 1 loops, best of 1: 5min per loop Your time does strike me as slow but it is on par with what I got on my i7 MacBook Pro. I recall previous experiments yielding the non-Base as the clear winner. This constant image is a convoluted example and may not reflect real world performance. Perhaps you can improve the stopping citera, so as to not compute more that needed. HTH, Brad On Mar 30, 2015, at 2:00 PM, Lin M wrote: > Hi Bill, > > It's a Release build. > > Best, > Lin > > On Mon, Mar 30, 2015 at 1:57 PM, Bill Lorensen wrote: > Is your windows build a Release build or Debug build? > > On Mon, Mar 30, 2015 at 10:47 AM, Lin M wrote: > > Hi Brad, > > > > Thank you for your reply! Do you think it's normal to take about 250 secs on > > a 512*512*365 image to compute the result? > > > > I followed the example from here > > http://www.itk.org/Doxygen/html/SphinxExamples_2src_2Filtering_2FastMarching_2CreateDistanceMapFromSeeds_2Code_8cxx-example.html#_a2 > > > > I'm using a i7-860 16G 64bit win8 machine. > > > > Best, > > Lin > > > > On Mon, Mar 30, 2015 at 1:15 PM, Bradley Lowekamp > > wrote: > >> > >> Hello, > >> > >> The itkFastMarchingImageFilterBase, is new and more generalized with a > >> support for generalized stopping criteria and a base infrastructure that can > >> run on quad-edge meshes. The plain itkFastMarchingImageFilter is a bit > >> faster but missing some features and flexibility. > >> > >> HTH, > >> Brad > >> > >> > >> On Mar 30, 2015, at 12:24 PM, Lin M wrote: > >> > >> Hi all, > >> > >> I'm wondering what's the difference between itkFastMarchingImageFilterBase > >> and itkFastMarchingImageFilter. > >> > >> I'm currently using itkFastMarchingImageFilterBase on a 3D image > >> (512*512*365) whose computational time is much slower than I expected (about > >> 250secs). I'm trying to find a way to improve that but I really don't have a > >> clue now. Can you give me some suggestions about that? Thank you very much! > >> > >> Best, > >> Lin > >> _____________________________________ > >> 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 > > > > > > -- > Unpaid intern in BillsBasement at noware dot com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lluna.nova at gmail.com Mon Mar 30 17:02:38 2015 From: lluna.nova at gmail.com (=?UTF-8?B?UG9sIE1vbnPDsyBQdXJ0w60=?=) Date: Mon, 30 Mar 2015 23:02:38 +0200 Subject: [ITK-users] Region of two labelObjects Message-ID: Hello all, I have two label objects, how can I merge the two BoundingBoxes together so I know the necessary size of the image? (other than creating it myself by searching max/min of each dimension) How come LabelMap doesn't resize automatically when objects are added? It could. template< typename TImageType > void labelObjects2Image(ShapeLabelObjectType* labelObject1, ShapeLabelObjectType* labelObject2, typename TImageType::Pointer& labelMapImage){ typedef itk::ShapeLabelObject< typename TImageType::PixelType, TImageType::ImageDimension > ShapeLabelObjectType; typedef itk::LabelMap< ShapeLabelObjectType > LabelMapType; typedef itk::LabelMapToLabelImageFilter< LabelMapType, TImageType > Label2VolumeFilter; *--> region = labelObject1->GetBoundingBox() "+" labelObject2->GetBoundingBox()* auto segLabelMap = LabelMapType::New(); segLabelMap->SetRegions(region); segLabelMap->Allocate(); segLabelMap->AddLabelObject(labelObject1); segLabelMap->AddLabelObject(labelObject2); auto label2volume = Label2VolumeFilter::New(); label2volume->SetInput(segLabelMap); label2volume->Update(); labelMapImage = label2volume->GetOutput(); } Cheers, Pol -------------- next part -------------- An HTML attachment was scrubbed... URL: From gabrielgimenez85 at gmail.com Mon Mar 30 20:05:49 2015 From: gabrielgimenez85 at gmail.com (=?UTF-8?Q?Gabriel_A=2E_Gim=C3=A9nez?=) Date: Mon, 30 Mar 2015 20:05:49 -0400 Subject: [ITK-users] Resample and Directions in Image Registration In-Reply-To: References: <1427584199821-7587074.post@n2.nabble.com> <1427664358535-7587078.post@n2.nabble.com> Message-ID: Thanks Matt!! ;-) El 29/03/2015 18:07, "Matt McCormick" escribi?: > Hi Gabriel, > > > Hi Matt, thanks for your answer...It is now clear to me ... > > Great! > > > Matt! another question please ... what is the normal runtime of Mattes > > Mutual Information Metric with 3D images? It is normal to be in the > range of > > 2.5 to 4 seconds? I use CT and MR images ... and this is my > configuration: > > > > samplingPercentage = 0.002; > > samplingStrategy = RegistrationType::REGULAR; > > NumberOfHistogramBins = 50 > > I do not know offhand what the expected computation time is, but I > would not be surprised if it was that slow on 3D images. > > Matt > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lchauvin at bwh.harvard.edu Tue Mar 31 10:21:50 2015 From: lchauvin at bwh.harvard.edu (Laurent Chauvin) Date: Tue, 31 Mar 2015 10:21:50 -0400 Subject: [ITK-users] Constrain a transform for optimizer Message-ID: Hello ITK users, I'm trying to use a Levenberg-Marquardt optimizer to find a point in a plane (based on a cost function). For now I create a itk::TranslationTransform< double, 3 > and set it to the Levenberg-Marquardt optmizer. However, I know the point I'm looking for is included in a plane. I was wondering if there is a way to constrain the transform to only check points in the plane (to avoid looking for points out of the plane to speed up the optimization process) ? Thank you very much. -- Laurent Chauvin, MS Surgical Navigation and Robotics Laboratory, Radiology Department Brigham And Women's Hospital, Harvard Medical School http://wiki.ncigt.org/index.php/User:Lchauvin -------------- next part -------------- An HTML attachment was scrubbed... URL: From grothausmann.roman at mh-hannover.de Tue Mar 31 15:10:44 2015 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Tue, 31 Mar 2015 21:10:44 +0200 Subject: [ITK-users] automated splitting and pasting of volumes for use in external programs In-Reply-To: References: <0B31CB6B-D4D0-48B1-A019-775E1E09E686@mail.nih.gov> <55191685.9020706@mh-hannover.de> Message-ID: <551AF134.4080804@mh-hannover.de> Dear Matt, Thanks for Your quick reply. If I got Your hint right, You suggest writing my own filter (that e.g. does the writing of the chunk to a file) and put an itkStreamingImageFilter after it supplying it with the # of chunks and the type of splitter. If I understand the ITK Software Guide correctly, such a filter needs to be threaded, i.e. have a ThreadedGenerateData. I tried that with a simple AddFilter that should just add a constant according to the chunk number to the region it is supposed to process (files attached). However it stops due to region miss-matches. I can't see why. With just GenerateData it seems like it is not streaming, according to the PipelineMonitorImageFilter. What would be the correct way to go? Many thanks for looking into this. Roman On 30/03/15 16:02, Matt McCormick wrote: > Hi Roman, > > You probably want to use the streaming capabilities of the ITK > pipeline. This is covered in more detailed in the ITK Software Guide. > The pipeline internally uses ImageRegionSplitter classes. Overlaps are > handled by propagation of the RequestedRegion throughout the pipeline. > To monitor the changes in the regions, use the > PipelineMonitorImageFilter [1]. > > HTH, > Matt > > [1] http://www.itk.org/Doxygen/html/classitk_1_1PipelineMonitorImageFilter.html > > On Mon, Mar 30, 2015 at 5:25 AM, Dr. Roman Grothausmann > wrote: >> Dear mailing list members, >> >> >> A dataset I work on is too big to load completely into itksnap for manual >> adjustment of the automatic pre-segementation with watersheds. The full >> resolution is needed, so I cannot work with a re-sampled version. The only >> possible easy solution I see at the moment is to split up the 3D image into >> smaller blocks of sizes as equal as possible, do the itsnap interaction, and >> finally paste all blocks of the resulting segmentation back together. >> Would itkImageRegionSplitterMultidimensional be the right filter for the >> splitting of blocks as equal in size as possible? >> Is there a "logger" like e.g. itkXMLFileOutputWindow (as used in >> itkStreamingImageFilterTest2.cxx) that could be used to store the regions >> corresponding to each block-file to use that for itkPasteImageFilter to >> combine these blocks later again? >> Not needed now, but perhaps lager: Is there some nice way to handle overlaps >> in this case that is already implemented in itk, something like >> itkImageRegionSplitterMultidimensional::SetOverlap()? >> >> Many thanks for any help or hints. >> Roman >> >> On 17/03/15 18:13, Pol Mons? Purt? wrote: >>> >>> I guess the way to go would be to take the splitter (probably >>> ImageRegionSplitterMultidimensional now that I look at it) and extend it >>> to >>> support overlap. If I do it, I'll let you know in case it is of interest >>> to >>> anyone. For now I'll stick to my class. >> >> >> >> -- >> 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 -------------- next part -------------- A non-text attachment was scrubbed... Name: LabelShiftImageFilter.cxx Type: text/x-c++src Size: 11003 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: itkLabelShiftImageFilter.h Type: text/x-chdr Size: 2235 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: itkLabelShiftImageFilter.hxx Type: text/x-c++hdr Size: 1501 bytes Desc: not available URL: From gabrielgimenez85 at gmail.com Tue Mar 31 23:52:03 2015 From: gabrielgimenez85 at gmail.com (=?UTF-8?Q?Gabriel_A=2E_Gim=C3=A9nez?=) Date: Tue, 31 Mar 2015 20:52:03 -0700 (MST) Subject: [ITK-users] Working with RIRE Datasets Message-ID: <1427860323074-7587099.post@n2.nabble.com> Hi! how are you? I'm trying to use RIRE datasets..., for example: In the RIRE terminology we say "From CT to MR", this means that the "moving image" is the CT image and the fixed image is the MR image. Then, I need a transformation "T" to apply to the CT test points for the comparison with the "ground truth"...I'm not wrong about this? But my problem is that the ITK provides a transformation that maps poins of the fixed (MR) image on the moving image (CT) , I guess I need to get the inverse transformation...is that possible? I'm misunderstanding something? I hope you can help me...I need to test my implementation, thank you in advance. Regards, -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Working-with-RIRE-Datasets-tp7587099.html Sent from the ITK Insight Users mailing list archive at Nabble.com.