From donelron at web.de Fri Aug 1 04:27:22 2014 From: donelron at web.de (donelron) Date: Fri, 1 Aug 2014 01:27:22 -0700 (PDT) Subject: [ITK-users] Inconsistent results for same histogram on same image when PixelType of image is different In-Reply-To: <1406833109934-34366.post@n7.nabble.com> References: <1406833109934-34366.post@n7.nabble.com> Message-ID: <1406881642374-34367.post@n7.nabble.com> Just one short addition / correction to my post: If I was able to use for example that would also be more than enough. Basically, I just need up to around 1000 different gray values in the image in which I have to calculate the histogram. So, unsigned char with 256 different values is obviously not enough... -- View this message in context: http://itk-users.7.n7.nabble.com/Inconsistent-results-for-same-histogram-on-same-image-when-PixelType-of-image-is-different-tp34366p34367.html Sent from the ITK - Users mailing list archive at Nabble.com. From mallikarjun49 at gmail.com Fri Aug 1 07:06:12 2014 From: mallikarjun49 at gmail.com (Mallikarjun K) Date: Fri, 1 Aug 2014 16:36:12 +0530 Subject: [ITK-users] itkSmoothingQuadEdgeMeshFilter Help!! In-Reply-To: References: Message-ID: Thanks Bill for your answer. The reason I am using this pipeline is that SmoothingQEMeshFilter has an additional parameter for smoothing which is delaunay conforming which helps to optimize aspect ratio of triangles while smoothing and thus produces better output.Is there anything similar filter in the vtk pipeline.I used vtkWindowedSincPolydatafilter which is not giving the output as good as QEMeshSmoothing filter. Thanks for your help On Thu, Jul 31, 2014 at 5:14 PM, Bill Lorensen wrote: > If you have it in vtk, I suggest using the vtk pipeline to smooth the data. > > On Thu, Jul 31, 2014 at 1:35 AM, Mallikarjun K > wrote: > > Hi Bill, > > Thanks for the replay. > > > > Yes,I built both ITK and my app with Release ,I forgot to mention it in > the > > previous post.Actually the data set is the output of > > vtkDiscreteMarchingCubes algorithm(around 5MB) and need to smooth .I > saved > > this marching cube's output as .vtk file and read it using > > itkVTKPolyDataReader and then I am giving this reader's output to > > itkSmoothingQuadEdgeMeshFilter's input. > > > > I checked the execution time of each step in the pipeline ,after > > SmothingQEMeshFilter has got it's input ,it is taking time to process the > > data. > > > > Thank you > > > > > > > > On Wed, Jul 30, 2014 at 9:29 PM, Bill Lorensen > > wrote: > >> > >> First, make sure you are building ITK and your app with Release. A > >> Debug build can be 10-50 times slower. > >> > >> > >> On Wed, Jul 30, 2014 at 10:18 AM, Mallikarjun K < > mallikarjun49 at gmail.com> > >> wrote: > >> > Hi All, > >> > I am using itkSmoothingQuadEdgeMeshFilter for Surface Mesh > >> > smoothing.This > >> > filter is giving good results what I expected but taking more > execution > >> > time.can any one suggest me to reduce the execution time( multi > >> > threading > >> > or any parameters to add/remove )? > >> > > >> > Below is the code snippet > >> > /////// > >> > typedef itk::QuadEdgeMeshTraits double,double > >> > > > >> > qetraits; > >> > typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > > MeshType; > >> > > >> > //typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3 > MeshType; > >> > > >> > itk::OnesMatrixCoefficients< MeshType > coeff0; > >> > > >> > typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > > >> > SmoothingQuadEdgeMeshFilter; > >> > > >> > SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = > >> > SmoothingQuadEdgeMeshFilter::New(); > >> > > >> > QEMeshSmoother->SetInput("abc.vtk"); > >> > QEMeshSmoother->SetNumberOfIterations(5 ); > >> > QEMeshSmoother->SetRelaxationFactor( 0.5 ); > >> > QEMeshSmoother->SetDelaunayConforming(true ); > >> > QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); > >> > QEMeshSmoother->Update(); > >> > //// > >> > > >> > -- > >> > Regards: > >> > Mallik > >> > > >> > > >> > _____________________________________ > >> > Powered by www.kitware.com > >> > > >> > Visit other Kitware open-source projects at > >> > http://www.kitware.com/opensource/opensource.html > >> > > >> > Kitware offers ITK Training Courses, for more information visit: > >> > http://www.kitware.com/products/protraining.php > >> > > >> > Please keep messages on-topic and check the ITK FAQ at: > >> > http://www.itk.org/Wiki/ITK_FAQ > >> > > >> > Follow this link to subscribe/unsubscribe: > >> > http://public.kitware.com/mailman/listinfo/insight-users > >> > > >> > >> > >> > >> -- > >> Unpaid intern in BillsBasement at noware dot com > > > > > > > > > > -- > > Regards: > > Mallik > > > > > > -- > Unpaid intern in BillsBasement at noware dot com > -- *Regards:* Mallik -------------- next part -------------- An HTML attachment was scrubbed... URL: From rg.bumpy at gmail.com Fri Aug 1 09:47:48 2014 From: rg.bumpy at gmail.com (Bumpy RG) Date: Fri, 1 Aug 2014 15:47:48 +0200 Subject: [ITK-users] Whole body Segmentation-Identification Message-ID: Dear All, I have a dicom series having whole body image sequences, starting from head up to legs. My aim is to write an algorithm to automatically identify the body parts (lungs, spines, head etc.) from the dicom sequence. Although I am very new to the ITK world, I am following these steps in ITK (*I would appreciate if you comment whether I am following correct idea or not* ): 1. Read dicom series using 'DicomSeriesReadImageWrite2.cxx ' to create a 3D volume and save the result in mhd format. 2. Use 'ImageReadRegionOfInterestWrite.cxx' for separating various parts (like left lung, right lung, spines, head etc.) and save them in respective 3D volumes in mhd format. 3. Pick the various body parts prepared above, one by one and segment them using robust algorithm (say ThresholdSegmentationLevelSetImageFilter.cxx). 4. Use Mathematical Morphology to get better results. 5. Using the various results from above, form an algorithm for identifying the various body parts. Currently I am stuck in the second step because it is so hard to choose the co-ordinates for selecting proper region of interest. For example, I chose these points for ROI of right lung (I checked the co-ordinates using 3D slicer visualizer) and it does not give me good results : start[0] = 255; start[1] =165; start[2] = 0; *However I do not understand how to choose the points properly in ITK.* I would be really glad to have your response. Thanking you in advance. Kind Regards, Bumpy. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fttfzzx227 at 126.com Mon Aug 4 14:02:32 2014 From: fttfzzx227 at 126.com (tina) Date: Tue, 5 Aug 2014 02:02:32 +0800 Subject: [ITK-users] [Insight-users] Principal Axes pre-registration Message-ID: <000001cfb00e$448ce9b0$cda6bd10$@126.com> Hi, Can anybody tell me about how to implement a principal axes registration use ITK? I use itkCenteredVersorTransformInitializer.txx to initialize the VersorRigid3DTransform,but this function didn't implement the rotation,so I try to compute the angle of rotation from the fixedPrincipalAxes and the movingPrincipalAxes, is there any way else to get the rotation matrix? Another problem is does the rotation matrix only specify one axis of the coordinate? I mean: in order to registrate two coordinates(x,y,z;x',y',z'),we should implement the VersorRigid3DTransform 3 times? Any help would be greatly appreciated! Best regards, Tina -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Mon Aug 4 14:12:59 2014 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Mon, 4 Aug 2014 14:12:59 -0400 Subject: [ITK-users] [Insight-users] Principal Axes pre-registration In-Reply-To: <000001cfb00e$448ce9b0$cda6bd10$@126.com> References: <000001cfb00e$448ce9b0$cda6bd10$@126.com> Message-ID: <5F66F56B-AB5F-491D-91C4-E60A83770043@mail.nih.gov> Hello, I just wrapped this class for SimpleITK. I found it odd that by default the "ComputeRotation" parameter is set to off. With turing this parameter on I got good initialization for some anisotropic blobs. Did you turn this on? Regarding you other question regarding the VersorTransfrom. The "versor" representation for rotation an represent an arbitrary rotation about the origin. So one is quite sufficient. Brad On Aug 4, 2014, at 2:02 PM, tina wrote: > Hi, > Can anybody tell me about how to implement a principal axes registration use ITK? I use itkCenteredVersorTransformInitializer.txx to initialize the VersorRigid3DTransform,but this function didn?t implement the rotation,so I try to compute the angle of rotation from the fixedPrincipalAxes and the movingPrincipalAxes, is there any way else to get the rotation matrix? > Another problem is does the rotation matrix only specify one axis of the coordinate? I mean: in order to registrate two coordinates(x,y,z;x?,y?,z?),we should implement the VersorRigid3DTransform 3 times? > Any help would be greatly appreciated! > Best regards, > Tina > > _____________________________________ > 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 ctrueden at wisc.edu Mon Aug 4 15:35:38 2014 From: ctrueden at wisc.edu (Curtis Rueden) Date: Mon, 4 Aug 2014 14:35:38 -0500 Subject: [ITK-users] Extensions to the MetaImage (MHDs) IO-plugin to support compression and MHAs In-Reply-To: References: <27272_1406557413_s6SENUxH012254_53D65CD8.4080305@mh-hannover.de> Message-ID: Hi Roman, > I've extended the MetaImage (used by e.g. ITK/VTK) IO-plugin from > Kang Li (http://www.kangli.org/code/MetaImage_Reader_Writer.html) to > also support compression and local data storage, i.e. MHAs. The > MetaImage Reader/Writer from > (http://ij-plugins.sourceforge.net/plugins/3d-io/) seems not to > support this either. Reading and writing in Fiji was tested with MHDs > and MHAs created/read by ITK-4.5.1. While the plugin handles files > bigger than 4GB correctly, (for unknown reasons my) ITK seems to have > problems with MHDs/MHAs bigger than 4GB (in general). Interesting work. If you would like to get it upstream into Fiji, I suggest filing a Pull Request [1] against the IO repository [2]. Please also be aware that ImageJ is moving away from HandleExtraFileTypes hacks in favor of a unified Java library for image I/O known as SCIFIO [3]. There is already a SCIFIO/ITK bridge project [4, 5] that allows reading and writing SCIFIO formats within ITK. Regards, Curtis [1] https://help.github.com/articles/using-pull-requests [2] https://github.com/fiji/IO [3] http://imagej.net/SCIFIO [4] https://github.com/scifio/scifio-imageio [5] https://github.com/scifio/scifio-itk-bridge On Mon, Jul 28, 2014 at 12:34 PM, Williams, Norman K < norman-k-williams at uiowa.edu> wrote: > This is a good thing to submit to ITK proper; it would require conversion > to C++, though. > > On 7/28/14, 9:23 AM, "Dr. Roman Grothausmann" > wrote: > > >Dear mailing list members, > > > > > >I've extended the MetaImage (used by e.g. ITK/VTK) IO-plugin from Kang > >Li > >(http://www.kangli.org/code/MetaImage_Reader_Writer.html) to also support > >compression and local data storage, i.e. MHAs. The MetaImage > >Reader/Writer from > >(http://ij-plugins.sourceforge.net/plugins/3d-io/) seems not to support > >this > >either. > >Reading and writing in Fiji was tested with MHDs and MHAs created/read by > >ITK-4.5.1. While the plugin handles files bigger than 4GB correctly, (for > >unknown reasons my) ITK seems to have problems with MHDs/MHAs bigger than > >4GB > >(in general). > >The plugin does not check whether the size of the compressed data is > >correct, > >ITK however does. If the header lacks an entry of CompressedDataSize, ITK > >throws > >an error when reading/loading such a file. If the size specified with > >CompressedDataSize is too big, ITK just issues a warning. This was used > >as a > >workaround because I did not find an easy way in Java to put the correct > >value > >for CompressedDataSize without using extra temporary files (which might > >be quite > >big). > > > >Attached are the modified files (java-files, plugins.config and a > >repacked > >IO_-2.0.0-SNAPSHOT.jar). > >A modified HandleExtraFileTypes.java (based on: > >https://github.com/fiji/IO/blob/master/src/main/java/HandleExtraFileTypes > . > >java) > >is also included. > >Togehter with the modified Plugin it allows opening MHDs and MHAs > >directly. > > > > > >The repacked IO_-2.0.0-SNAPSHOT.jar was generated with: > > > >javac -cp /opt/fiji/Fiji.app/jars/ij-1.48a.jar:. MetaImage_Reader.java > >javac -cp /opt/fiji/Fiji.app/jars/ij-1.48a.jar:. MetaImage_Writer.java > >javac -cp /opt/fiji/Fiji.app/jars/ij-1.48a.jar:. MetaImage_CWriter.java > > > >javac -cp /opt/fiji/Fiji.app/jars/ij-1.48a.jar:. HandleExtraFileTypes.java > > > >The compiled Class-files were moved to a subfolder named io/: > >ExtendedFileOpener.class MetaImage_CWriter.class MetaImage_Writer.class > >ExtendedFileSaver.class MetaImage_Reader.class > >ReplacingInputStream.class > > > >And then included/replaced with zip: > >zip -r IO_-2.0.0-SNAPSHOT.jar plugins.config HandleExtraFileTypes.class > >io/ > > > >Feel free to add these extensions to the Plugin-Page or the ImageJ/Fiji > >repository. > >Any suggestions concerning improvements are very welcome. > > > > > >Many thanks for ImageJ/Fiji and the initial Metaimage IO-plugin. > >Roman > > > > > >-- > >Dr. Roman Grothausmann > > > >Tomographie und Digitale Bildverarbeitung > >Tomography and Digital Image Analysis > > > >Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 > >Medizinische Hochschule Hannover > >Carl-Neuberg-Str. 1 > >D-30625 Hannover > > > >Tel. +49 511 532-9574 > > > > > > > >====================================================================== > >A potentially unsafe attachment has been removed from this email > >message. See http://its.uiowa.edu/support/article/100806 for further > >information. > > > >Removed attachment name(s): > >IO_-2.0.0-SNAPSHOT.jar > >====================================================================== > > > > > > ________________________________ > Notice: This UI Health Care e-mail (including attachments) is covered by > the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is > confidential and may be legally privileged. If you are not the intended > recipient, you are hereby notified that any retention, dissemination, > distribution, or copying of this communication is strictly prohibited. > Please reply to the sender that you have received the message in error, > then delete it. Thank you. > ________________________________ > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vincent.ngai at gmail.com Tue Aug 5 05:26:31 2014 From: vincent.ngai at gmail.com (vincent ngai) Date: Tue, 5 Aug 2014 17:26:31 +0800 Subject: [ITK-users] AffineTransform to 4x4 matrix...again maybe Message-ID: Hi all, apologies if this has been asked before, I googled the above but only got 4x4 -> AffineTransform and not the other way around. I need to get the output of an AffineTransform after registration to my OpenGL renderer. >From what I understand, the AffineTransform is composed of a Rotation, Center of Rotation and Translation. So would the following sequence of 4x4 transformation be correct? OGLM = InvCRM * Rot * CRM * TM where CRM = 4x4 identity matrix with indices [ 12, 13, 14] set to XYZ value of GetCenter() InvCRM = Inverse of CRM Rot = 4x4 Identity matrix with 3x3 set to the rotation parameters TM = 4x4 identity matrix with indicies[ 12, 13, 14 ] set to the translation parameters Essentially: 1) translate center to origin 2) perform rotation 3) translate back to where we were 4) slap on translation I am doing the above, but for some reason the translation does not match up. The rotation seems fine. -- Regards, Vincent -------------- next part -------------- An HTML attachment was scrubbed... URL: From DotanG at azimutherapy.com Tue Aug 5 06:50:10 2014 From: DotanG at azimutherapy.com (Dotan Goberman) Date: Tue, 5 Aug 2014 12:50:10 +0200 Subject: [ITK-users] ContourExtractor2DImageFilter Message-ID: Hello itk users. I saw the ContourExtractor2DImageFilter in the itkreview module, is there another filter that get as input Image and extract the isocontour as Polyline? Thanx in advance. Dotan -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Tue Aug 5 09:12:25 2014 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Tue, 5 Aug 2014 09:12:25 -0400 Subject: [ITK-users] AffineTransform to 4x4 matrix...again maybe In-Reply-To: References: Message-ID: <4D7F2AA9-48DF-4C78-BC5E-B8609CBF45E0@mail.nih.gov> Hello, That looks pretty close, but I think CRM[12,13,14] should be -GetCenter(), with the negative there. Then the TM should be applied last, using your original notation with the previously mentioned correction I'd expect this to be correct: OGLM = TM * InvCRM * Rot * CRM Hope that helps, Brad [1] http://www.itk.org/Doxygen/html/classitk_1_1MatrixOffsetTransformBase.html On Aug 5, 2014, at 5:26 AM, vincent ngai wrote: > Hi all, apologies if this has been asked before, I googled the above but only got 4x4 -> AffineTransform and not the other way around. > > I need to get the output of an AffineTransform after registration to my OpenGL renderer. > > From what I understand, the AffineTransform is composed of a Rotation, Center of Rotation and Translation. > > So would the following sequence of 4x4 transformation be correct? > > OGLM = InvCRM * Rot * CRM * TM > > where > > CRM = 4x4 identity matrix with indices [ 12, 13, 14] set to XYZ value of GetCenter() > InvCRM = Inverse of CRM > Rot = 4x4 Identity matrix with 3x3 set to the rotation parameters > TM = 4x4 identity matrix with indicies[ 12, 13, 14 ] set to the translation parameters > > Essentially: > > 1) translate center to origin > 2) perform rotation > 3) translate back to where we were > 4) slap on translation > > I am doing the above, but for some reason the translation does not match up. The rotation seems fine. > -- > Regards, > Vincent > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users From mercikd at thomas.edu Tue Aug 5 14:34:06 2014 From: mercikd at thomas.edu (Dan Mercik) Date: Tue, 5 Aug 2014 18:34:06 +0000 Subject: [ITK-users] MultiThreader? Message-ID: <2ceb68bacb674825b2ca5e795c48800c@T9.tcnet.thomas.edu> Hey, After running my code I caught an exception trying to write deconstructing output. The error occurred during single method execute. I also got an error That the DownSampleImageFilter subclass should override this method. I took a snippet of error output I received which is located attached to this email. Do you have any idea on how to solve this issue? Daniel Mercik Computer Science Major Service Desk Technician Thomas College -------------- next part -------------- A non-text attachment was scrubbed... Name: Multithreader.JPG Type: image/jpeg Size: 56571 bytes Desc: Multithreader.JPG URL: From matt.mccormick at kitware.com Tue Aug 5 15:04:45 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 5 Aug 2014 15:04:45 -0400 Subject: [ITK-users] [ITK] MultiThreader? In-Reply-To: <2ceb68bacb674825b2ca5e795c48800c@T9.tcnet.thomas.edu> References: <2ceb68bacb674825b2ca5e795c48800c@T9.tcnet.thomas.edu> Message-ID: Hi Dan, Does your DownSampleImageFilter have a ThreadedGenerateData method? If so, its method may need to be updated to use "ThreadIdType" as indicated in the error message. Hope this helps, Matt On Tue, Aug 5, 2014 at 2:34 PM, Dan Mercik wrote: > Hey, > > After running my code I caught an exception trying to write deconstructing output. The error occurred > > during single method execute. I also got an error That the DownSampleImageFilter subclass should override this method. I took a snippet of error output I received which is located attached to this email. Do you have any idea on how to solve this issue? > > Daniel Mercik > > Computer Science Major > > Service Desk Technician > > Thomas College > > _____________________________________ > 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 vincent.ngai at gmail.com Tue Aug 5 22:08:13 2014 From: vincent.ngai at gmail.com (vincent ngai) Date: Wed, 6 Aug 2014 10:08:13 +0800 Subject: [ITK-users] AffineTransform to 4x4 matrix...again maybe In-Reply-To: <4D7F2AA9-48DF-4C78-BC5E-B8609CBF45E0@mail.nih.gov> References: <4D7F2AA9-48DF-4C78-BC5E-B8609CBF45E0@mail.nih.gov> Message-ID: Hi Bradley, Hmm, GetCenter() negated should be the same as InvCRM. I'll flip the order of the multiplication and see what happens, it could be the C++ operator*() order being different from the way its written. Its so annoying to get the results close but not exact :( Thanks On Tue, Aug 5, 2014 at 9:12 PM, Bradley Lowekamp wrote: > Hello, > > That looks pretty close, but I think CRM[12,13,14] should be -GetCenter(), > with the negative there. Then the TM should be applied last, using your > original notation with the previously mentioned correction I'd expect this > to be correct: > > OGLM = TM * InvCRM * Rot * CRM > > Hope that helps, > Brad > > [1] > http://www.itk.org/Doxygen/html/classitk_1_1MatrixOffsetTransformBase.html > > On Aug 5, 2014, at 5:26 AM, vincent ngai wrote: > > > Hi all, apologies if this has been asked before, I googled the above but > only got 4x4 -> AffineTransform and not the other way around. > > > > I need to get the output of an AffineTransform after registration to my > OpenGL renderer. > > > > From what I understand, the AffineTransform is composed of a Rotation, > Center of Rotation and Translation. > > > > So would the following sequence of 4x4 transformation be correct? > > > > OGLM = InvCRM * Rot * CRM * TM > > > > where > > > > CRM = 4x4 identity matrix with indices [ 12, 13, 14] set to XYZ > value of GetCenter() > > InvCRM = Inverse of CRM > > Rot = 4x4 Identity matrix with 3x3 set to the rotation parameters > > TM = 4x4 identity matrix with indicies[ 12, 13, 14 ] set to the > translation parameters > > > > Essentially: > > > > 1) translate center to origin > > 2) perform rotation > > 3) translate back to where we were > > 4) slap on translation > > > > I am doing the above, but for some reason the translation does not match > up. The rotation seems fine. > > -- > > Regards, > > Vincent > > _____________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Kitware offers ITK Training Courses, for more information visit: > > http://www.kitware.com/products/protraining.php > > > > Please keep messages on-topic and check the ITK FAQ at: > > http://www.itk.org/Wiki/ITK_FAQ > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/insight-users > > -- Regards, Vincent -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Wed Aug 6 00:10:56 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Wed, 6 Aug 2014 00:10:56 -0400 Subject: [ITK-users] [ITK] AffineTransform to 4x4 matrix...again maybe In-Reply-To: References: <4D7F2AA9-48DF-4C78-BC5E-B8609CBF45E0@mail.nih.gov> Message-ID: Hi Vincent, The values can also be used directly in the matrix as demonstrated here [1]. HTH, Matt [1] https://gist.github.com/thewtex/8712205 On Tue, Aug 5, 2014 at 10:08 PM, vincent ngai wrote: > Hi Bradley, > > Hmm, GetCenter() negated should be the same as InvCRM. I'll flip the order > of the multiplication and see what happens, it could be the C++ operator*() > order being different from the way its written. Its so annoying to get the > results close but not exact :( > > Thanks > > > On Tue, Aug 5, 2014 at 9:12 PM, Bradley Lowekamp > wrote: >> >> Hello, >> >> That looks pretty close, but I think CRM[12,13,14] should be -GetCenter(), >> with the negative there. Then the TM should be applied last, using your >> original notation with the previously mentioned correction I'd expect this >> to be correct: >> >> OGLM = TM * InvCRM * Rot * CRM >> >> Hope that helps, >> Brad >> >> [1] >> http://www.itk.org/Doxygen/html/classitk_1_1MatrixOffsetTransformBase.html >> >> On Aug 5, 2014, at 5:26 AM, vincent ngai wrote: >> >> > Hi all, apologies if this has been asked before, I googled the above but >> > only got 4x4 -> AffineTransform and not the other way around. >> > >> > I need to get the output of an AffineTransform after registration to my >> > OpenGL renderer. >> > >> > From what I understand, the AffineTransform is composed of a Rotation, >> > Center of Rotation and Translation. >> > >> > So would the following sequence of 4x4 transformation be correct? >> > >> > OGLM = InvCRM * Rot * CRM * TM >> > >> > where >> > >> > CRM = 4x4 identity matrix with indices [ 12, 13, 14] set to XYZ >> > value of GetCenter() >> > InvCRM = Inverse of CRM >> > Rot = 4x4 Identity matrix with 3x3 set to the rotation parameters >> > TM = 4x4 identity matrix with indicies[ 12, 13, 14 ] set to the >> > translation parameters >> > >> > Essentially: >> > >> > 1) translate center to origin >> > 2) perform rotation >> > 3) translate back to where we were >> > 4) slap on translation >> > >> > I am doing the above, but for some reason the translation does not match >> > up. The rotation seems fine. >> > -- >> > Regards, >> > Vincent >> > _____________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Kitware offers ITK Training Courses, for more information visit: >> > http://www.kitware.com/products/protraining.php >> > >> > Please keep messages on-topic and check the ITK FAQ at: >> > http://www.itk.org/Wiki/ITK_FAQ >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/insight-users >> > > > > -- > Regards, > Vincent > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > From vincent.ngai at gmail.com Wed Aug 6 02:51:28 2014 From: vincent.ngai at gmail.com (vincent ngai) Date: Wed, 6 Aug 2014 14:51:28 +0800 Subject: [ITK-users] [ITK] AffineTransform to 4x4 matrix...again maybe In-Reply-To: References: <4D7F2AA9-48DF-4C78-BC5E-B8609CBF45E0@mail.nih.gov> Message-ID: Thanks Matt for the link. On Wed, Aug 6, 2014 at 12:10 PM, Matt McCormick wrote: > Hi Vincent, > > The values can also be used directly in the matrix as demonstrated here > [1]. > > HTH, > Matt > > [1] https://gist.github.com/thewtex/8712205 > > On Tue, Aug 5, 2014 at 10:08 PM, vincent ngai > wrote: > > Hi Bradley, > > > > Hmm, GetCenter() negated should be the same as InvCRM. I'll flip the > order > > of the multiplication and see what happens, it could be the C++ > operator*() > > order being different from the way its written. Its so annoying to get > the > > results close but not exact :( > > > > Thanks > > > > > > On Tue, Aug 5, 2014 at 9:12 PM, Bradley Lowekamp > > > wrote: > >> > >> Hello, > >> > >> That looks pretty close, but I think CRM[12,13,14] should be > -GetCenter(), > >> with the negative there. Then the TM should be applied last, using your > >> original notation with the previously mentioned correction I'd expect > this > >> to be correct: > >> > >> OGLM = TM * InvCRM * Rot * CRM > >> > >> Hope that helps, > >> Brad > >> > >> [1] > >> > http://www.itk.org/Doxygen/html/classitk_1_1MatrixOffsetTransformBase.html > >> > >> On Aug 5, 2014, at 5:26 AM, vincent ngai > wrote: > >> > >> > Hi all, apologies if this has been asked before, I googled the above > but > >> > only got 4x4 -> AffineTransform and not the other way around. > >> > > >> > I need to get the output of an AffineTransform after registration to > my > >> > OpenGL renderer. > >> > > >> > From what I understand, the AffineTransform is composed of a Rotation, > >> > Center of Rotation and Translation. > >> > > >> > So would the following sequence of 4x4 transformation be correct? > >> > > >> > OGLM = InvCRM * Rot * CRM * TM > >> > > >> > where > >> > > >> > CRM = 4x4 identity matrix with indices [ 12, 13, 14] set to XYZ > >> > value of GetCenter() > >> > InvCRM = Inverse of CRM > >> > Rot = 4x4 Identity matrix with 3x3 set to the rotation > parameters > >> > TM = 4x4 identity matrix with indicies[ 12, 13, 14 ] set to the > >> > translation parameters > >> > > >> > Essentially: > >> > > >> > 1) translate center to origin > >> > 2) perform rotation > >> > 3) translate back to where we were > >> > 4) slap on translation > >> > > >> > I am doing the above, but for some reason the translation does not > match > >> > up. The rotation seems fine. > >> > -- > >> > Regards, > >> > Vincent > >> > _____________________________________ > >> > Powered by www.kitware.com > >> > > >> > Visit other Kitware open-source projects at > >> > http://www.kitware.com/opensource/opensource.html > >> > > >> > Kitware offers ITK Training Courses, for more information visit: > >> > http://www.kitware.com/products/protraining.php > >> > > >> > Please keep messages on-topic and check the ITK FAQ at: > >> > http://www.itk.org/Wiki/ITK_FAQ > >> > > >> > Follow this link to subscribe/unsubscribe: > >> > http://public.kitware.com/mailman/listinfo/insight-users > >> > > > > > > > > -- > > Regards, > > Vincent > > > > _____________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Kitware offers ITK Training Courses, for more information visit: > > http://www.kitware.com/products/protraining.php > > > > Please keep messages on-topic and check the ITK FAQ at: > > http://www.itk.org/Wiki/ITK_FAQ > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/insight-users > > > > _______________________________________________ > > Community mailing list > > Community at itk.org > > http://public.kitware.com/mailman/listinfo/community > > > -- Regards, Vincent -------------- next part -------------- An HTML attachment was scrubbed... URL: From mallikarjun49 at gmail.com Wed Aug 6 04:42:35 2014 From: mallikarjun49 at gmail.com (Mallikarjun K) Date: Wed, 6 Aug 2014 14:12:35 +0530 Subject: [ITK-users] itkSmoothingQuadEdgeMeshFilter Help!! In-Reply-To: References: Message-ID: Hi All, Can anyone suggest me if anything wrong I am doing in this below pipeline ,Where I used itkVtkPolydataReader to convert vtk Surface polydata to Itk QuadedgeMesh. Execution loop is being hung up for sometime(4 to 5 mins in release mode) at itkVtkPolydataReader . //// typedef itk::QuadEdgeMeshTraits qetraits; typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; itk::OnesMatrixCoefficients< MeshType > coeff0; typedef itk::VTKPolyDataReader< MeshType >VTKPolyDataReaderType; //typedef itk::VTKPolyDataWriter< MeshType >VTKPolyDataWriterType; //VTKPolyDataWriterType::Pointer ItkToVtkWriter=VTKPolyDataWriterType::New(); VTKPolyDataReaderType::Pointer VtkToItkReader=VTKPolyDataReaderType::New(); VtkToItkReader->SetFileName("abc.vtk"); VtkToItkReader->Update(); typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > SmoothingQuadEdgeMeshFilter; SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = SmoothingQuadEdgeMeshFilter::New(); QEMeshSmoother->SetInput(VtkToItkReader->GetOutPut()); QEMeshSmoother->SetNumberOfIterations(5 ); QEMeshSmoother->SetRelaxationFactor( 0.5 ); QEMeshSmoother->SetDelaunayConforming(true ); QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); QEMeshSmoother->Update(); //// On Fri, Aug 1, 2014 at 4:36 PM, Mallikarjun K wrote: > Thanks Bill for your answer. > > The reason I am using this pipeline is that SmoothingQEMeshFilter has an > additional parameter for smoothing which is delaunay conforming which helps > to optimize aspect ratio of triangles while smoothing and thus produces > better output.Is there anything similar filter in the vtk pipeline.I used > vtkWindowedSincPolydatafilter which is not giving the output as good as > QEMeshSmoothing filter. > > Thanks for your help > > > On Thu, Jul 31, 2014 at 5:14 PM, Bill Lorensen > wrote: > >> If you have it in vtk, I suggest using the vtk pipeline to smooth the >> data. >> >> On Thu, Jul 31, 2014 at 1:35 AM, Mallikarjun K >> wrote: >> > Hi Bill, >> > Thanks for the replay. >> > >> > Yes,I built both ITK and my app with Release ,I forgot to mention it in >> the >> > previous post.Actually the data set is the output of >> > vtkDiscreteMarchingCubes algorithm(around 5MB) and need to smooth .I >> saved >> > this marching cube's output as .vtk file and read it using >> > itkVTKPolyDataReader and then I am giving this reader's output to >> > itkSmoothingQuadEdgeMeshFilter's input. >> > >> > I checked the execution time of each step in the pipeline ,after >> > SmothingQEMeshFilter has got it's input ,it is taking time to process >> the >> > data. >> > >> > Thank you >> > >> > >> > >> > On Wed, Jul 30, 2014 at 9:29 PM, Bill Lorensen > > >> > wrote: >> >> >> >> First, make sure you are building ITK and your app with Release. A >> >> Debug build can be 10-50 times slower. >> >> >> >> >> >> On Wed, Jul 30, 2014 at 10:18 AM, Mallikarjun K < >> mallikarjun49 at gmail.com> >> >> wrote: >> >> > Hi All, >> >> > I am using itkSmoothingQuadEdgeMeshFilter for Surface Mesh >> >> > smoothing.This >> >> > filter is giving good results what I expected but taking more >> execution >> >> > time.can any one suggest me to reduce the execution time( multi >> >> > threading >> >> > or any parameters to add/remove )? >> >> > >> >> > Below is the code snippet >> >> > /////// >> >> > typedef itk::QuadEdgeMeshTraits> double,double >> >> > > >> >> > qetraits; >> >> > typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > >> MeshType; >> >> > >> >> > //typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3 > MeshType; >> >> > >> >> > itk::OnesMatrixCoefficients< MeshType > coeff0; >> >> > >> >> > typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > >> >> > SmoothingQuadEdgeMeshFilter; >> >> > >> >> > SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = >> >> > SmoothingQuadEdgeMeshFilter::New(); >> >> > >> >> > QEMeshSmoother->SetInput("abc.vtk"); >> >> > QEMeshSmoother->SetNumberOfIterations(5 ); >> >> > QEMeshSmoother->SetRelaxationFactor( 0.5 ); >> >> > QEMeshSmoother->SetDelaunayConforming(true ); >> >> > QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); >> >> > QEMeshSmoother->Update(); >> >> > //// >> >> > >> >> > -- >> >> > Regards: >> >> > Mallik >> >> > >> >> > >> >> > _____________________________________ >> >> > Powered by www.kitware.com >> >> > >> >> > Visit other Kitware open-source projects at >> >> > http://www.kitware.com/opensource/opensource.html >> >> > >> >> > Kitware offers ITK Training Courses, for more information visit: >> >> > http://www.kitware.com/products/protraining.php >> >> > >> >> > Please keep messages on-topic and check the ITK FAQ at: >> >> > http://www.itk.org/Wiki/ITK_FAQ >> >> > >> >> > Follow this link to subscribe/unsubscribe: >> >> > http://public.kitware.com/mailman/listinfo/insight-users >> >> > >> >> >> >> >> >> >> >> -- >> >> Unpaid intern in BillsBasement at noware dot com >> > >> > >> > >> > >> > -- >> > Regards: >> > Mallik >> > >> >> >> >> -- >> Unpaid intern in BillsBasement at noware dot com >> > > > > -- > *Regards:* > Mallik > > -- *Regards:* Mallik -------------- next part -------------- An HTML attachment was scrubbed... URL: From joseignacio.prieto at gmail.com Wed Aug 6 10:11:38 2014 From: joseignacio.prieto at gmail.com (Jose Ignacio Prieto) Date: Wed, 6 Aug 2014 10:11:38 -0400 Subject: [ITK-users] Distance map to 2D polygon Message-ID: Hi all, I need to get a distance (preferably signed) map 2D given a polygon input as polygonSpatialObject. I think it can be done by using SpatialObjectToImageFilter and then applying a distance map, but I was thinking that maybe it is not the optimal way to do it. It is more important that the result is fast rather than accurate. Thank you very much for any input. -- Ignacio Prieto Research Assistant Biomedical Imaging Center Pontificia Universidad Catolica de Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From arnaudgelas at gmail.com Thu Aug 7 04:52:53 2014 From: arnaudgelas at gmail.com (Arnaud Gelas) Date: Thu, 7 Aug 2014 10:52:53 +0200 Subject: [ITK-users] itkSmoothingQuadEdgeMeshFilter Help!! In-Reply-To: References: Message-ID: <20566F1B-1B71-411D-8C31-B25D4B24397A@gmail.com> Hi Malik, First of all, I would recommend using MeshFileReader instead of VTKPolyDataReader (I guess VTKPolyDataReader will be deprecated in near future?). Regarding now the smoothing procedure in itself. This class definitively misses some documentation and I will be adding some in the next few days (mainly extracted from the corresponding insight journal). At the end of each iteration, when the delaunay conforming flag is turned ON, the conformation is performed. So depending on the mesh configuration, mesh size and number of iterations, it can take ages? How large is your input mesh (number of points)? You can also check results, by running first a smoothing without delaunay conforming, then apply a delaunay conforming on the output. Results won't be as nice, but you should get significant speed improvement. Another possibility is to first do a clean poly data in vtk, with a small threshold to remove small edges in the input meshes (which results in lots of edge flipping after smoothing). HTH Arnaud On Aug 6, 2014, at 10:42 AM, Mallikarjun K wrote: > Hi All, > > Can anyone suggest me if anything wrong I am doing in this below pipeline ,Where I used itkVtkPolydataReader to convert vtk Surface polydata to Itk QuadedgeMesh. Execution loop is being hung up for sometime(4 to 5 mins in release mode) at itkVtkPolydataReader . > > > //// > > typedef itk::QuadEdgeMeshTraits qetraits; > > typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; > > itk::OnesMatrixCoefficients< MeshType > coeff0; > > typedef itk::VTKPolyDataReader< MeshType >VTKPolyDataReaderType; > //typedef itk::VTKPolyDataWriter< MeshType >VTKPolyDataWriterType; > > //VTKPolyDataWriterType::Pointer ItkToVtkWriter=VTKPolyDataWriterType::New(); > VTKPolyDataReaderType::Pointer VtkToItkReader=VTKPolyDataReaderType::New(); > > VtkToItkReader->SetFileName("abc.vtk"); > VtkToItkReader->Update(); > > typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > > SmoothingQuadEdgeMeshFilter; > > SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = SmoothingQuadEdgeMeshFilter::New(); > > > QEMeshSmoother->SetInput(VtkToItkReader->GetOutPut()); > QEMeshSmoother->SetNumberOfIterations(5 ); > QEMeshSmoother->SetRelaxationFactor( 0.5 ); > QEMeshSmoother->SetDelaunayConforming(true ); > QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); > > QEMeshSmoother->Update(); > > //// > > > On Fri, Aug 1, 2014 at 4:36 PM, Mallikarjun K wrote: > Thanks Bill for your answer. > > The reason I am using this pipeline is that SmoothingQEMeshFilter has an additional parameter for smoothing which is delaunay conforming which helps to optimize aspect ratio of triangles while smoothing and thus produces better output.Is there anything similar filter in the vtk pipeline.I used vtkWindowedSincPolydatafilter which is not giving the output as good as QEMeshSmoothing filter. > > Thanks for your help > > > On Thu, Jul 31, 2014 at 5:14 PM, Bill Lorensen wrote: > If you have it in vtk, I suggest using the vtk pipeline to smooth the data. > > On Thu, Jul 31, 2014 at 1:35 AM, Mallikarjun K wrote: > > Hi Bill, > > Thanks for the replay. > > > > Yes,I built both ITK and my app with Release ,I forgot to mention it in the > > previous post.Actually the data set is the output of > > vtkDiscreteMarchingCubes algorithm(around 5MB) and need to smooth .I saved > > this marching cube's output as .vtk file and read it using > > itkVTKPolyDataReader and then I am giving this reader's output to > > itkSmoothingQuadEdgeMeshFilter's input. > > > > I checked the execution time of each step in the pipeline ,after > > SmothingQEMeshFilter has got it's input ,it is taking time to process the > > data. > > > > Thank you > > > > > > > > On Wed, Jul 30, 2014 at 9:29 PM, Bill Lorensen > > wrote: > >> > >> First, make sure you are building ITK and your app with Release. A > >> Debug build can be 10-50 times slower. > >> > >> > >> On Wed, Jul 30, 2014 at 10:18 AM, Mallikarjun K > >> wrote: > >> > Hi All, > >> > I am using itkSmoothingQuadEdgeMeshFilter for Surface Mesh > >> > smoothing.This > >> > filter is giving good results what I expected but taking more execution > >> > time.can any one suggest me to reduce the execution time( multi > >> > threading > >> > or any parameters to add/remove )? > >> > > >> > Below is the code snippet > >> > /////// > >> > typedef itk::QuadEdgeMeshTraits >> > > > >> > qetraits; > >> > typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; > >> > > >> > //typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3 > MeshType; > >> > > >> > itk::OnesMatrixCoefficients< MeshType > coeff0; > >> > > >> > typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > > >> > SmoothingQuadEdgeMeshFilter; > >> > > >> > SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = > >> > SmoothingQuadEdgeMeshFilter::New(); > >> > > >> > QEMeshSmoother->SetInput("abc.vtk"); > >> > QEMeshSmoother->SetNumberOfIterations(5 ); > >> > QEMeshSmoother->SetRelaxationFactor( 0.5 ); > >> > QEMeshSmoother->SetDelaunayConforming(true ); > >> > QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); > >> > QEMeshSmoother->Update(); > >> > //// > >> > > >> > -- > >> > Regards: > >> > Mallik > >> > > >> > > >> > _____________________________________ > >> > Powered by www.kitware.com > >> > > >> > Visit other Kitware open-source projects at > >> > http://www.kitware.com/opensource/opensource.html > >> > > >> > Kitware offers ITK Training Courses, for more information visit: > >> > http://www.kitware.com/products/protraining.php > >> > > >> > Please keep messages on-topic and check the ITK FAQ at: > >> > http://www.itk.org/Wiki/ITK_FAQ > >> > > >> > Follow this link to subscribe/unsubscribe: > >> > http://public.kitware.com/mailman/listinfo/insight-users > >> > > >> > >> > >> > >> -- > >> Unpaid intern in BillsBasement at noware dot com > > > > > > > > > > -- > > Regards: > > Mallik > > > > > > -- > Unpaid intern in BillsBasement at noware dot com > > > > -- > Regards: > Mallik > > > > > -- > Regards: > Mallik > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From mallikarjun49 at gmail.com Thu Aug 7 06:09:50 2014 From: mallikarjun49 at gmail.com (Mallikarjun K) Date: Thu, 7 Aug 2014 15:39:50 +0530 Subject: [ITK-users] itkSmoothingQuadEdgeMeshFilter Help!! In-Reply-To: <20566F1B-1B71-411D-8C31-B25D4B24397A@gmail.com> References: <20566F1B-1B71-411D-8C31-B25D4B24397A@gmail.com> Message-ID: Hi Arnaud, Thanks for your reply and valuable suggestions. Number of points in my input mesh are 78928.In my pipeline I am already cleaning the polydata using vtkCleanPolyData filter.I will check the speed improvement and results with delaunay conforming turned OFF. Thank you On Thu, Aug 7, 2014 at 2:22 PM, Arnaud Gelas wrote: > Hi Malik, > > First of all, I would recommend using MeshFileReader instead of > VTKPolyDataReader (I guess VTKPolyDataReader will be deprecated in near > future?). > > Regarding now the smoothing procedure in itself. This class definitively > misses some documentation and I will be adding some in the next few days > (mainly extracted from the corresponding insight journal). > > At the end of each iteration, when the delaunay conforming flag is turned > ON, the conformation is performed. So depending on the mesh configuration, > mesh size and number of iterations, it can take ages? > How large is your input mesh (number of points)? > > You can also check results, by running first a smoothing without delaunay > conforming, then apply a delaunay conforming on the output. Results won't > be as nice, but you should get significant speed improvement. > Another possibility is to first do a clean poly data in vtk, with a small > threshold to remove small edges in the input meshes (which results in lots > of edge flipping after smoothing). > > HTH > Arnaud > > > On Aug 6, 2014, at 10:42 AM, Mallikarjun K > wrote: > > Hi All, > > Can anyone suggest me if anything wrong I am doing in this below pipeline > ,Where I used itkVtkPolydataReader to convert vtk Surface polydata to Itk > QuadedgeMesh. Execution loop is being hung up for sometime(4 to 5 mins in > release mode) at itkVtkPolydataReader . > > > //// > > typedef itk::QuadEdgeMeshTraits > qetraits; > > typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; > > itk::OnesMatrixCoefficients< MeshType > coeff0; > > typedef itk::VTKPolyDataReader< MeshType >VTKPolyDataReaderType; > //typedef itk::VTKPolyDataWriter< MeshType >VTKPolyDataWriterType; > > //VTKPolyDataWriterType::Pointer > ItkToVtkWriter=VTKPolyDataWriterType::New(); > VTKPolyDataReaderType::Pointer VtkToItkReader=VTKPolyDataReaderType::New(); > > VtkToItkReader->SetFileName("abc.vtk"); > VtkToItkReader->Update(); > > typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > > SmoothingQuadEdgeMeshFilter; > > SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = > SmoothingQuadEdgeMeshFilter::New(); > > QEMeshSmoother->SetInput(VtkToItkReader->GetOutPut()); > QEMeshSmoother->SetNumberOfIterations(5 ); > QEMeshSmoother->SetRelaxationFactor( 0.5 ); > QEMeshSmoother->SetDelaunayConforming(true ); > QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); > QEMeshSmoother->Update(); > > //// > > > On Fri, Aug 1, 2014 at 4:36 PM, Mallikarjun K > wrote: > >> Thanks Bill for your answer. >> >> The reason I am using this pipeline is that SmoothingQEMeshFilter has an >> additional parameter for smoothing which is delaunay conforming which helps >> to optimize aspect ratio of triangles while smoothing and thus produces >> better output.Is there anything similar filter in the vtk pipeline.I used >> vtkWindowedSincPolydatafilter which is not giving the output as good as >> QEMeshSmoothing filter. >> >> Thanks for your help >> >> >> On Thu, Jul 31, 2014 at 5:14 PM, Bill Lorensen >> wrote: >> >>> If you have it in vtk, I suggest using the vtk pipeline to smooth the >>> data. >>> >>> On Thu, Jul 31, 2014 at 1:35 AM, Mallikarjun K >>> wrote: >>> > Hi Bill, >>> > Thanks for the replay. >>> > >>> > Yes,I built both ITK and my app with Release ,I forgot to mention it >>> in the >>> > previous post.Actually the data set is the output of >>> > vtkDiscreteMarchingCubes algorithm(around 5MB) and need to smooth .I >>> saved >>> > this marching cube's output as .vtk file and read it using >>> > itkVTKPolyDataReader and then I am giving this reader's output to >>> > itkSmoothingQuadEdgeMeshFilter's input. >>> > >>> > I checked the execution time of each step in the pipeline ,after >>> > SmothingQEMeshFilter has got it's input ,it is taking time to process >>> the >>> > data. >>> > >>> > Thank you >>> > >>> > >>> > >>> > On Wed, Jul 30, 2014 at 9:29 PM, Bill Lorensen < >>> bill.lorensen at gmail.com> >>> > wrote: >>> >> >>> >> First, make sure you are building ITK and your app with Release. A >>> >> Debug build can be 10-50 times slower. >>> >> >>> >> >>> >> On Wed, Jul 30, 2014 at 10:18 AM, Mallikarjun K < >>> mallikarjun49 at gmail.com> >>> >> wrote: >>> >> > Hi All, >>> >> > I am using itkSmoothingQuadEdgeMeshFilter for Surface Mesh >>> >> > smoothing.This >>> >> > filter is giving good results what I expected but taking more >>> execution >>> >> > time.can any one suggest me to reduce the execution time( multi >>> >> > threading >>> >> > or any parameters to add/remove )? >>> >> > >>> >> > Below is the code snippet >>> >> > /////// >>> >> > typedef itk::QuadEdgeMeshTraits>> double,double >>> >> > > >>> >> > qetraits; >>> >> > typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > >>> MeshType; >>> >> > >>> >> > //typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3 > MeshType; >>> >> > >>> >> > itk::OnesMatrixCoefficients< MeshType > coeff0; >>> >> > >>> >> > typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > >>> >> > SmoothingQuadEdgeMeshFilter; >>> >> > >>> >> > SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = >>> >> > SmoothingQuadEdgeMeshFilter::New(); >>> >> > >>> >> > QEMeshSmoother->SetInput("abc.vtk"); >>> >> > QEMeshSmoother->SetNumberOfIterations(5 ); >>> >> > QEMeshSmoother->SetRelaxationFactor( 0.5 ); >>> >> > QEMeshSmoother->SetDelaunayConforming(true ); >>> >> > QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); >>> >> > QEMeshSmoother->Update(); >>> >> > //// >>> >> > >>> >> > -- >>> >> > Regards: >>> >> > Mallik >>> >> > >>> >> > >>> >> > _____________________________________ >>> >> > Powered by www.kitware.com >>> >> > >>> >> > Visit other Kitware open-source projects at >>> >> > http://www.kitware.com/opensource/opensource.html >>> >> > >>> >> > Kitware offers ITK Training Courses, for more information visit: >>> >> > http://www.kitware.com/products/protraining.php >>> >> > >>> >> > Please keep messages on-topic and check the ITK FAQ at: >>> >> > http://www.itk.org/Wiki/ITK_FAQ >>> >> > >>> >> > Follow this link to subscribe/unsubscribe: >>> >> > http://public.kitware.com/mailman/listinfo/insight-users >>> >> > >>> >> >>> >> >>> >> >>> >> -- >>> >> Unpaid intern in BillsBasement at noware dot com >>> > >>> > >>> > >>> > >>> > -- >>> > Regards: >>> > Mallik >>> > >>> >>> >>> >>> -- >>> Unpaid intern in BillsBasement at noware dot com >>> >> >> >> >> -- >> *Regards:* >> Mallik >> >> > > > -- > *Regards:* > Mallik > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > > -- *Regards:* Mallik -------------- next part -------------- An HTML attachment was scrubbed... URL: From mallikarjun49 at gmail.com Thu Aug 7 09:23:15 2014 From: mallikarjun49 at gmail.com (Mallikarjun K) Date: Thu, 7 Aug 2014 18:53:15 +0530 Subject: [ITK-users] itkSmoothingQuadEdgeMeshFilter Help!! In-Reply-To: References: <20566F1B-1B71-411D-8C31-B25D4B24397A@gmail.com> Message-ID: Hi Arnaud, Kindly have a look in the below code ,the problem is that even after QEMeshFilter output is saved as .stl file ,the program is still running for long time.I have observed in my tests that MeshFileReader seems to be the culprit. Any suggestions ? ///// #include #include #include #include #include #include #include #include #include #include #include "itkMesh.h" #include "itkQuadEdgeMesh.h" #include "itkQuadEdgeMeshTraits.h" #include "itkSmoothingQuadEdgeMeshFilter.h" #include "vtkSTLWriter.h" #include int main() { std::string Inputfilename="D:/temp.vtk"; //number of points of this mesh file is around 78K typedef itk::QuadEdgeMeshTraits qetraits; typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; itk::OnesMatrixCoefficients< MeshType > coeff0; typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType >SmoothingQuadEdgeMeshFilter; vtkSmartPointer polyDatawriter=vtkSmartPointer::New(); vtkSmartPointer polyDatareader=vtkSmartPointer::New(); SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = SmoothingQuadEdgeMeshFilter::New(); /* polyDatareader->SetFileName(Inputfilename.c_str() ); polyDatareader->ReleaseDataFlagOn(); polyDatareader->Update();*/ /*vtkSmartPointer triangleFilter = vtkSmartPointer::New(); triangleFilter->SetInput(polyDatareader->GetOutput()); triangleFilter->Update();*/ // /* vtkSmartPointer clean = vtkSmartPointer::New(); #if (VTK_MAJOR_VERSION < 6) clean->SetInput(triangleFilter->GetOutput() ); #else clean->SetInputData(triangleFilter->GetOutput() ); #endif clean->ConvertPolysToLinesOff(); clean->ConvertLinesToPointsOff(); clean->Update(); std::string Inputfilename2="D:/cleaned.vtk";*/ //// /*polyDatawriter->SetInput(clean->GetOutput()); polyDatawriter->SetFileName(Inputfilename2.c_str()); polyDatawriter->ReleaseDataFlagOn(); polyDatawriter->Write(); */ typedef itk::MeshFileReader MeshReaderType; MeshReaderType::Pointer Meshreader = MeshReaderType::New(); Meshreader->SetFileName(Inputfilename.c_str( )); Meshreader->Update(); /*MeshType::Pointer mesh = Meshreader->GetOutput(); mesh->DisconnectPipeline();*/ QEMeshSmoother->SetInput(Meshreader->GetOutput()/*mesh*/ ); QEMeshSmoother->SetNumberOfIterations(1 ); QEMeshSmoother->SetRelaxationFactor( 0.5 ); QEMeshSmoother->SetDelaunayConforming(true); QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); QEMeshSmoother->ReleaseDataFlagOn(); QEMeshSmoother->Update(); std::string Outputfilename="D:/tempOut.vtk"; typedef itk::MeshFileWriter MeshWriterType; MeshWriterType::Pointer Meshwriter = MeshWriterType::New(); Meshwriter->SetFileName(Outputfilename.c_str( )); Meshwriter->SetInput(QEMeshSmoother->GetOutput()); Meshwriter->Update(); polyDatareader->SetFileName(Outputfilename.c_str() ); polyDatareader->ReleaseDataFlagOn(); polyDatareader->Update(); vtkSmartPointer stlWriter=vtkSmartPointer::New(); stlWriter->SetInput( polyDatareader->GetOutput()); stlWriter->SetFileName("D:/QEoutput.stl"); stlWriter->SetFileTypeToASCII(); stlWriter->Write(); //Here it stops and taking long time return 0; } //// On Thu, Aug 7, 2014 at 3:39 PM, Mallikarjun K wrote: > Hi Arnaud, > > Thanks for your reply and valuable suggestions. > > Number of points in my input mesh are 78928.In my pipeline I am already > cleaning the polydata using vtkCleanPolyData filter.I will check the speed > improvement and results with delaunay conforming turned OFF. > > Thank you > > > On Thu, Aug 7, 2014 at 2:22 PM, Arnaud Gelas > wrote: > >> Hi Malik, >> >> First of all, I would recommend using MeshFileReader instead of >> VTKPolyDataReader (I guess VTKPolyDataReader will be deprecated in near >> future?). >> >> Regarding now the smoothing procedure in itself. This class definitively >> misses some documentation and I will be adding some in the next few days >> (mainly extracted from the corresponding insight journal). >> >> At the end of each iteration, when the delaunay conforming flag is turned >> ON, the conformation is performed. So depending on the mesh configuration, >> mesh size and number of iterations, it can take ages? >> How large is your input mesh (number of points)? >> >> You can also check results, by running first a smoothing without delaunay >> conforming, then apply a delaunay conforming on the output. Results won't >> be as nice, but you should get significant speed improvement. >> Another possibility is to first do a clean poly data in vtk, with a small >> threshold to remove small edges in the input meshes (which results in lots >> of edge flipping after smoothing). >> >> HTH >> Arnaud >> >> >> On Aug 6, 2014, at 10:42 AM, Mallikarjun K >> wrote: >> >> Hi All, >> >> Can anyone suggest me if anything wrong I am doing in this below pipeline >> ,Where I used itkVtkPolydataReader to convert vtk Surface polydata to Itk >> QuadedgeMesh. Execution loop is being hung up for sometime(4 to 5 mins in >> release mode) at itkVtkPolydataReader . >> >> >> //// >> >> typedef itk::QuadEdgeMeshTraits >> qetraits; >> >> typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; >> >> itk::OnesMatrixCoefficients< MeshType > coeff0; >> >> typedef itk::VTKPolyDataReader< MeshType >VTKPolyDataReaderType; >> //typedef itk::VTKPolyDataWriter< MeshType >VTKPolyDataWriterType; >> >> //VTKPolyDataWriterType::Pointer >> ItkToVtkWriter=VTKPolyDataWriterType::New(); >> VTKPolyDataReaderType::Pointer >> VtkToItkReader=VTKPolyDataReaderType::New(); >> >> VtkToItkReader->SetFileName("abc.vtk"); >> VtkToItkReader->Update(); >> >> typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > >> SmoothingQuadEdgeMeshFilter; >> >> SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = >> SmoothingQuadEdgeMeshFilter::New(); >> >> QEMeshSmoother->SetInput(VtkToItkReader->GetOutPut()); >> QEMeshSmoother->SetNumberOfIterations(5 ); >> QEMeshSmoother->SetRelaxationFactor( 0.5 ); >> QEMeshSmoother->SetDelaunayConforming(true ); >> QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); >> QEMeshSmoother->Update(); >> >> //// >> >> >> On Fri, Aug 1, 2014 at 4:36 PM, Mallikarjun K >> wrote: >> >>> Thanks Bill for your answer. >>> >>> The reason I am using this pipeline is that SmoothingQEMeshFilter has an >>> additional parameter for smoothing which is delaunay conforming which helps >>> to optimize aspect ratio of triangles while smoothing and thus produces >>> better output.Is there anything similar filter in the vtk pipeline.I used >>> vtkWindowedSincPolydatafilter which is not giving the output as good as >>> QEMeshSmoothing filter. >>> >>> Thanks for your help >>> >>> >>> On Thu, Jul 31, 2014 at 5:14 PM, Bill Lorensen >>> wrote: >>> >>>> If you have it in vtk, I suggest using the vtk pipeline to smooth the >>>> data. >>>> >>>> On Thu, Jul 31, 2014 at 1:35 AM, Mallikarjun K >>>> wrote: >>>> > Hi Bill, >>>> > Thanks for the replay. >>>> > >>>> > Yes,I built both ITK and my app with Release ,I forgot to mention it >>>> in the >>>> > previous post.Actually the data set is the output of >>>> > vtkDiscreteMarchingCubes algorithm(around 5MB) and need to smooth .I >>>> saved >>>> > this marching cube's output as .vtk file and read it using >>>> > itkVTKPolyDataReader and then I am giving this reader's output to >>>> > itkSmoothingQuadEdgeMeshFilter's input. >>>> > >>>> > I checked the execution time of each step in the pipeline ,after >>>> > SmothingQEMeshFilter has got it's input ,it is taking time to process >>>> the >>>> > data. >>>> > >>>> > Thank you >>>> > >>>> > >>>> > >>>> > On Wed, Jul 30, 2014 at 9:29 PM, Bill Lorensen < >>>> bill.lorensen at gmail.com> >>>> > wrote: >>>> >> >>>> >> First, make sure you are building ITK and your app with Release. A >>>> >> Debug build can be 10-50 times slower. >>>> >> >>>> >> >>>> >> On Wed, Jul 30, 2014 at 10:18 AM, Mallikarjun K < >>>> mallikarjun49 at gmail.com> >>>> >> wrote: >>>> >> > Hi All, >>>> >> > I am using itkSmoothingQuadEdgeMeshFilter for Surface Mesh >>>> >> > smoothing.This >>>> >> > filter is giving good results what I expected but taking more >>>> execution >>>> >> > time.can any one suggest me to reduce the execution time( multi >>>> >> > threading >>>> >> > or any parameters to add/remove )? >>>> >> > >>>> >> > Below is the code snippet >>>> >> > /////// >>>> >> > typedef itk::QuadEdgeMeshTraits>>> double,double >>>> >> > > >>>> >> > qetraits; >>>> >> > typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > >>>> MeshType; >>>> >> > >>>> >> > //typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3 > MeshType; >>>> >> > >>>> >> > itk::OnesMatrixCoefficients< MeshType > coeff0; >>>> >> > >>>> >> > typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > >>>> >> > SmoothingQuadEdgeMeshFilter; >>>> >> > >>>> >> > SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = >>>> >> > SmoothingQuadEdgeMeshFilter::New(); >>>> >> > >>>> >> > QEMeshSmoother->SetInput("abc.vtk"); >>>> >> > QEMeshSmoother->SetNumberOfIterations(5 ); >>>> >> > QEMeshSmoother->SetRelaxationFactor( 0.5 ); >>>> >> > QEMeshSmoother->SetDelaunayConforming(true ); >>>> >> > QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); >>>> >> > QEMeshSmoother->Update(); >>>> >> > //// >>>> >> > >>>> >> > -- >>>> >> > Regards: >>>> >> > Mallik >>>> >> > >>>> >> > >>>> >> > _____________________________________ >>>> >> > Powered by www.kitware.com >>>> >> > >>>> >> > Visit other Kitware open-source projects at >>>> >> > http://www.kitware.com/opensource/opensource.html >>>> >> > >>>> >> > Kitware offers ITK Training Courses, for more information visit: >>>> >> > http://www.kitware.com/products/protraining.php >>>> >> > >>>> >> > Please keep messages on-topic and check the ITK FAQ at: >>>> >> > http://www.itk.org/Wiki/ITK_FAQ >>>> >> > >>>> >> > Follow this link to subscribe/unsubscribe: >>>> >> > http://public.kitware.com/mailman/listinfo/insight-users >>>> >> > >>>> >> >>>> >> >>>> >> >>>> >> -- >>>> >> Unpaid intern in BillsBasement at noware dot com >>>> > >>>> > >>>> > >>>> > >>>> > -- >>>> > Regards: >>>> > Mallik >>>> > >>>> >>>> >>>> >>>> -- >>>> Unpaid intern in BillsBasement at noware dot com >>>> >>> >>> >>> >>> -- >>> *Regards:* >>> Mallik >>> >>> >> >> >> -- >> *Regards:* >> Mallik >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> >> >> > > > -- > *Regards:* > Mallik > > -- *Regards:* Mallik -------------- next part -------------- An HTML attachment was scrubbed... URL: From arnaudgelas at gmail.com Thu Aug 7 09:31:03 2014 From: arnaudgelas at gmail.com (Arnaud Gelas) Date: Thu, 7 Aug 2014 15:31:03 +0200 Subject: [ITK-users] itkSmoothingQuadEdgeMeshFilter Help!! In-Reply-To: References: <20566F1B-1B71-411D-8C31-B25D4B24397A@gmail.com> Message-ID: <305E1509-8EF7-4770-9236-3D639B9BF155@gmail.com> Shouldn't it be D://temp.vtk ? Isn't it missing one '/' ? Can you send this vtk file? On Aug 7, 2014, at 3:23 PM, Mallikarjun K wrote: > Hi Arnaud, > > Kindly have a look in the below code ,the problem is that even after QEMeshFilter output is saved as .stl file ,the program is still running for long time.I have observed in my tests that MeshFileReader seems to be the culprit. Any suggestions ? > > ///// > #include > #include > > #include > #include > #include > #include > #include > #include > #include > #include > #include "itkMesh.h" > #include "itkQuadEdgeMesh.h" > #include "itkQuadEdgeMeshTraits.h" > #include "itkSmoothingQuadEdgeMeshFilter.h" > #include "vtkSTLWriter.h" > #include > > int main() > { > std::string Inputfilename="D:/temp.vtk"; //number of points of this mesh file is around 78K > > typedef itk::QuadEdgeMeshTraits qetraits; > typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; > > itk::OnesMatrixCoefficients< MeshType > coeff0; > typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType >SmoothingQuadEdgeMeshFilter; > > vtkSmartPointer polyDatawriter=vtkSmartPointer::New(); > vtkSmartPointer polyDatareader=vtkSmartPointer::New(); > > SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = SmoothingQuadEdgeMeshFilter::New(); > > /* polyDatareader->SetFileName(Inputfilename.c_str() ); > polyDatareader->ReleaseDataFlagOn(); > polyDatareader->Update();*/ > > /*vtkSmartPointer triangleFilter = > vtkSmartPointer::New(); > triangleFilter->SetInput(polyDatareader->GetOutput()); > triangleFilter->Update();*/ > > // > /* vtkSmartPointer clean = vtkSmartPointer::New(); > #if (VTK_MAJOR_VERSION < 6) > clean->SetInput(triangleFilter->GetOutput() ); > #else > clean->SetInputData(triangleFilter->GetOutput() ); > #endif > > clean->ConvertPolysToLinesOff(); > clean->ConvertLinesToPointsOff(); > clean->Update(); > > std::string Inputfilename2="D:/cleaned.vtk";*/ > > //// > /*polyDatawriter->SetInput(clean->GetOutput()); > polyDatawriter->SetFileName(Inputfilename2.c_str()); > polyDatawriter->ReleaseDataFlagOn(); > polyDatawriter->Write(); */ > > typedef itk::MeshFileReader MeshReaderType; > MeshReaderType::Pointer Meshreader = MeshReaderType::New(); > Meshreader->SetFileName(Inputfilename.c_str( )); > Meshreader->Update(); > > /*MeshType::Pointer mesh = Meshreader->GetOutput(); > mesh->DisconnectPipeline();*/ > > > QEMeshSmoother->SetInput(Meshreader->GetOutput()/*mesh*/ ); > QEMeshSmoother->SetNumberOfIterations(1 ); > QEMeshSmoother->SetRelaxationFactor( 0.5 ); > QEMeshSmoother->SetDelaunayConforming(true); > QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); > > QEMeshSmoother->ReleaseDataFlagOn(); > > QEMeshSmoother->Update(); > > std::string Outputfilename="D:/tempOut.vtk"; > > typedef itk::MeshFileWriter MeshWriterType; > MeshWriterType::Pointer Meshwriter = MeshWriterType::New(); > Meshwriter->SetFileName(Outputfilename.c_str( )); > Meshwriter->SetInput(QEMeshSmoother->GetOutput()); > Meshwriter->Update(); > > polyDatareader->SetFileName(Outputfilename.c_str() ); > polyDatareader->ReleaseDataFlagOn(); > polyDatareader->Update(); > > vtkSmartPointer stlWriter=vtkSmartPointer::New(); > > stlWriter->SetInput( polyDatareader->GetOutput()); > stlWriter->SetFileName("D:/QEoutput.stl"); > stlWriter->SetFileTypeToASCII(); > stlWriter->Write(); > > //Here it stops and taking long time > > return 0; > > > } > //// > > > > On Thu, Aug 7, 2014 at 3:39 PM, Mallikarjun K wrote: > Hi Arnaud, > > Thanks for your reply and valuable suggestions. > > Number of points in my input mesh are 78928.In my pipeline I am already cleaning the polydata using vtkCleanPolyData filter.I will check the speed improvement and results with delaunay conforming turned OFF. > > Thank you > > > On Thu, Aug 7, 2014 at 2:22 PM, Arnaud Gelas wrote: > Hi Malik, > > First of all, I would recommend using MeshFileReader instead of VTKPolyDataReader (I guess VTKPolyDataReader will be deprecated in near future?). > > Regarding now the smoothing procedure in itself. This class definitively misses some documentation and I will be adding some in the next few days (mainly extracted from the corresponding insight journal). > > At the end of each iteration, when the delaunay conforming flag is turned ON, the conformation is performed. So depending on the mesh configuration, mesh size and number of iterations, it can take ages? > How large is your input mesh (number of points)? > > You can also check results, by running first a smoothing without delaunay conforming, then apply a delaunay conforming on the output. Results won't be as nice, but you should get significant speed improvement. > Another possibility is to first do a clean poly data in vtk, with a small threshold to remove small edges in the input meshes (which results in lots of edge flipping after smoothing). > > HTH > Arnaud > > > On Aug 6, 2014, at 10:42 AM, Mallikarjun K wrote: > >> Hi All, >> >> Can anyone suggest me if anything wrong I am doing in this below pipeline ,Where I used itkVtkPolydataReader to convert vtk Surface polydata to Itk QuadedgeMesh. Execution loop is being hung up for sometime(4 to 5 mins in release mode) at itkVtkPolydataReader . >> >> >> //// >> >> typedef itk::QuadEdgeMeshTraits qetraits; >> >> typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; >> >> itk::OnesMatrixCoefficients< MeshType > coeff0; >> >> typedef itk::VTKPolyDataReader< MeshType >VTKPolyDataReaderType; >> //typedef itk::VTKPolyDataWriter< MeshType >VTKPolyDataWriterType; >> >> //VTKPolyDataWriterType::Pointer ItkToVtkWriter=VTKPolyDataWriterType::New(); >> VTKPolyDataReaderType::Pointer VtkToItkReader=VTKPolyDataReaderType::New(); >> >> VtkToItkReader->SetFileName("abc.vtk"); >> VtkToItkReader->Update(); >> >> typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > >> SmoothingQuadEdgeMeshFilter; >> >> SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = SmoothingQuadEdgeMeshFilter::New(); >> >> >> QEMeshSmoother->SetInput(VtkToItkReader->GetOutPut()); >> QEMeshSmoother->SetNumberOfIterations(5 ); >> QEMeshSmoother->SetRelaxationFactor( 0.5 ); >> QEMeshSmoother->SetDelaunayConforming(true ); >> QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); >> >> QEMeshSmoother->Update(); >> >> //// >> >> >> On Fri, Aug 1, 2014 at 4:36 PM, Mallikarjun K wrote: >> Thanks Bill for your answer. >> >> The reason I am using this pipeline is that SmoothingQEMeshFilter has an additional parameter for smoothing which is delaunay conforming which helps to optimize aspect ratio of triangles while smoothing and thus produces better output.Is there anything similar filter in the vtk pipeline.I used vtkWindowedSincPolydatafilter which is not giving the output as good as QEMeshSmoothing filter. >> >> Thanks for your help >> >> >> On Thu, Jul 31, 2014 at 5:14 PM, Bill Lorensen wrote: >> If you have it in vtk, I suggest using the vtk pipeline to smooth the data. >> >> On Thu, Jul 31, 2014 at 1:35 AM, Mallikarjun K wrote: >> > Hi Bill, >> > Thanks for the replay. >> > >> > Yes,I built both ITK and my app with Release ,I forgot to mention it in the >> > previous post.Actually the data set is the output of >> > vtkDiscreteMarchingCubes algorithm(around 5MB) and need to smooth .I saved >> > this marching cube's output as .vtk file and read it using >> > itkVTKPolyDataReader and then I am giving this reader's output to >> > itkSmoothingQuadEdgeMeshFilter's input. >> > >> > I checked the execution time of each step in the pipeline ,after >> > SmothingQEMeshFilter has got it's input ,it is taking time to process the >> > data. >> > >> > Thank you >> > >> > >> > >> > On Wed, Jul 30, 2014 at 9:29 PM, Bill Lorensen >> > wrote: >> >> >> >> First, make sure you are building ITK and your app with Release. A >> >> Debug build can be 10-50 times slower. >> >> >> >> >> >> On Wed, Jul 30, 2014 at 10:18 AM, Mallikarjun K >> >> wrote: >> >> > Hi All, >> >> > I am using itkSmoothingQuadEdgeMeshFilter for Surface Mesh >> >> > smoothing.This >> >> > filter is giving good results what I expected but taking more execution >> >> > time.can any one suggest me to reduce the execution time( multi >> >> > threading >> >> > or any parameters to add/remove )? >> >> > >> >> > Below is the code snippet >> >> > /////// >> >> > typedef itk::QuadEdgeMeshTraits> >> > > >> >> > qetraits; >> >> > typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; >> >> > >> >> > //typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3 > MeshType; >> >> > >> >> > itk::OnesMatrixCoefficients< MeshType > coeff0; >> >> > >> >> > typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > >> >> > SmoothingQuadEdgeMeshFilter; >> >> > >> >> > SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = >> >> > SmoothingQuadEdgeMeshFilter::New(); >> >> > >> >> > QEMeshSmoother->SetInput("abc.vtk"); >> >> > QEMeshSmoother->SetNumberOfIterations(5 ); >> >> > QEMeshSmoother->SetRelaxationFactor( 0.5 ); >> >> > QEMeshSmoother->SetDelaunayConforming(true ); >> >> > QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); >> >> > QEMeshSmoother->Update(); >> >> > //// >> >> > >> >> > -- >> >> > Regards: >> >> > Mallik >> >> > >> >> > >> >> > _____________________________________ >> >> > Powered by www.kitware.com >> >> > >> >> > Visit other Kitware open-source projects at >> >> > http://www.kitware.com/opensource/opensource.html >> >> > >> >> > Kitware offers ITK Training Courses, for more information visit: >> >> > http://www.kitware.com/products/protraining.php >> >> > >> >> > Please keep messages on-topic and check the ITK FAQ at: >> >> > http://www.itk.org/Wiki/ITK_FAQ >> >> > >> >> > Follow this link to subscribe/unsubscribe: >> >> > http://public.kitware.com/mailman/listinfo/insight-users >> >> > >> >> >> >> >> >> >> >> -- >> >> Unpaid intern in BillsBasement at noware dot com >> > >> > >> > >> > >> > -- >> > Regards: >> > Mallik >> > >> >> >> >> -- >> Unpaid intern in BillsBasement at noware dot com >> >> >> >> -- >> Regards: >> Mallik >> >> >> >> >> -- >> Regards: >> Mallik >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users > > > > > -- > Regards: > Mallik > > > > > -- > Regards: > Mallik > -------------- next part -------------- An HTML attachment was scrubbed... URL: From arnaudgelas at gmail.com Thu Aug 7 10:40:20 2014 From: arnaudgelas at gmail.com (Arnaud Gelas) Date: Thu, 7 Aug 2014 16:40:20 +0200 Subject: [ITK-users] itkSmoothingQuadEdgeMeshFilter Help!! In-Reply-To: References: <20566F1B-1B71-411D-8C31-B25D4B24397A@gmail.com> <305E1509-8EF7-4770-9236-3D639B9BF155@gmail.com> Message-ID: It takes 29s on my machine in debug to run 5 iterations with Delaunay conforming set to true https://gist.github.com/arnaudgelas/0f20ebdaf53956f79997 On Aug 7, 2014, at 3:45 PM, Mallikarjun K wrote: > File path is correct.if it is '\'(backward slash) we have to add "D:\\" .since I used '/' it's not required to add "//". > > please find the attached .vtk file > > Thanks > > > On Thu, Aug 7, 2014 at 7:01 PM, Arnaud Gelas wrote: > Shouldn't it be D://temp.vtk ? Isn't it missing one '/' ? > > Can you send this vtk file? > > > On Aug 7, 2014, at 3:23 PM, Mallikarjun K wrote: > >> Hi Arnaud, >> >> Kindly have a look in the below code ,the problem is that even after QEMeshFilter output is saved as .stl file ,the program is still running for long time.I have observed in my tests that MeshFileReader seems to be the culprit. Any suggestions ? >> >> ///// >> #include >> #include >> >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include "itkMesh.h" >> #include "itkQuadEdgeMesh.h" >> #include "itkQuadEdgeMeshTraits.h" >> #include "itkSmoothingQuadEdgeMeshFilter.h" >> #include "vtkSTLWriter.h" >> #include >> >> int main() >> { >> std::string Inputfilename="D:/temp.vtk"; //number of points of this mesh file is around 78K >> >> typedef itk::QuadEdgeMeshTraits qetraits; >> typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; >> >> itk::OnesMatrixCoefficients< MeshType > coeff0; >> typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType >SmoothingQuadEdgeMeshFilter; >> >> vtkSmartPointer polyDatawriter=vtkSmartPointer::New(); >> vtkSmartPointer polyDatareader=vtkSmartPointer::New(); >> >> SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = SmoothingQuadEdgeMeshFilter::New(); >> >> /* polyDatareader->SetFileName(Inputfilename.c_str() ); >> polyDatareader->ReleaseDataFlagOn(); >> polyDatareader->Update();*/ >> >> /*vtkSmartPointer triangleFilter = >> vtkSmartPointer::New(); >> triangleFilter->SetInput(polyDatareader->GetOutput()); >> triangleFilter->Update();*/ >> >> // >> /* vtkSmartPointer clean = vtkSmartPointer::New(); >> #if (VTK_MAJOR_VERSION < 6) >> clean->SetInput(triangleFilter->GetOutput() ); >> #else >> clean->SetInputData(triangleFilter->GetOutput() ); >> #endif >> >> clean->ConvertPolysToLinesOff(); >> clean->ConvertLinesToPointsOff(); >> clean->Update(); >> >> std::string Inputfilename2="D:/cleaned.vtk";*/ >> >> //// >> /*polyDatawriter->SetInput(clean->GetOutput()); >> polyDatawriter->SetFileName(Inputfilename2.c_str()); >> polyDatawriter->ReleaseDataFlagOn(); >> polyDatawriter->Write(); */ >> >> typedef itk::MeshFileReader MeshReaderType; >> MeshReaderType::Pointer Meshreader = MeshReaderType::New(); >> Meshreader->SetFileName(Inputfilename.c_str( )); >> Meshreader->Update(); >> >> /*MeshType::Pointer mesh = Meshreader->GetOutput(); >> mesh->DisconnectPipeline();*/ >> >> >> QEMeshSmoother->SetInput(Meshreader->GetOutput()/*mesh*/ ); >> QEMeshSmoother->SetNumberOfIterations(1 ); >> QEMeshSmoother->SetRelaxationFactor( 0.5 ); >> QEMeshSmoother->SetDelaunayConforming(true); >> QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); >> >> QEMeshSmoother->ReleaseDataFlagOn(); >> >> QEMeshSmoother->Update(); >> >> std::string Outputfilename="D:/tempOut.vtk"; >> >> typedef itk::MeshFileWriter MeshWriterType; >> MeshWriterType::Pointer Meshwriter = MeshWriterType::New(); >> Meshwriter->SetFileName(Outputfilename.c_str( )); >> Meshwriter->SetInput(QEMeshSmoother->GetOutput()); >> Meshwriter->Update(); >> >> polyDatareader->SetFileName(Outputfilename.c_str() ); >> polyDatareader->ReleaseDataFlagOn(); >> polyDatareader->Update(); >> >> vtkSmartPointer stlWriter=vtkSmartPointer::New(); >> >> stlWriter->SetInput( polyDatareader->GetOutput()); >> stlWriter->SetFileName("D:/QEoutput.stl"); >> stlWriter->SetFileTypeToASCII(); >> stlWriter->Write(); >> >> //Here it stops and taking long time >> >> return 0; >> >> >> } >> //// >> >> >> >> On Thu, Aug 7, 2014 at 3:39 PM, Mallikarjun K wrote: >> Hi Arnaud, >> >> Thanks for your reply and valuable suggestions. >> >> Number of points in my input mesh are 78928.In my pipeline I am already cleaning the polydata using vtkCleanPolyData filter.I will check the speed improvement and results with delaunay conforming turned OFF. >> >> Thank you >> >> >> On Thu, Aug 7, 2014 at 2:22 PM, Arnaud Gelas wrote: >> Hi Malik, >> >> First of all, I would recommend using MeshFileReader instead of VTKPolyDataReader (I guess VTKPolyDataReader will be deprecated in near future?). >> >> Regarding now the smoothing procedure in itself. This class definitively misses some documentation and I will be adding some in the next few days (mainly extracted from the corresponding insight journal). >> >> At the end of each iteration, when the delaunay conforming flag is turned ON, the conformation is performed. So depending on the mesh configuration, mesh size and number of iterations, it can take ages? >> How large is your input mesh (number of points)? >> >> You can also check results, by running first a smoothing without delaunay conforming, then apply a delaunay conforming on the output. Results won't be as nice, but you should get significant speed improvement. >> Another possibility is to first do a clean poly data in vtk, with a small threshold to remove small edges in the input meshes (which results in lots of edge flipping after smoothing). >> >> HTH >> Arnaud >> >> >> On Aug 6, 2014, at 10:42 AM, Mallikarjun K wrote: >> >>> Hi All, >>> >>> Can anyone suggest me if anything wrong I am doing in this below pipeline ,Where I used itkVtkPolydataReader to convert vtk Surface polydata to Itk QuadedgeMesh. Execution loop is being hung up for sometime(4 to 5 mins in release mode) at itkVtkPolydataReader . >>> >>> >>> //// >>> >>> typedef itk::QuadEdgeMeshTraits qetraits; >>> >>> typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; >>> >>> itk::OnesMatrixCoefficients< MeshType > coeff0; >>> >>> typedef itk::VTKPolyDataReader< MeshType >VTKPolyDataReaderType; >>> //typedef itk::VTKPolyDataWriter< MeshType >VTKPolyDataWriterType; >>> >>> //VTKPolyDataWriterType::Pointer ItkToVtkWriter=VTKPolyDataWriterType::New(); >>> VTKPolyDataReaderType::Pointer VtkToItkReader=VTKPolyDataReaderType::New(); >>> >>> VtkToItkReader->SetFileName("abc.vtk"); >>> VtkToItkReader->Update(); >>> >>> typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > >>> SmoothingQuadEdgeMeshFilter; >>> >>> SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = SmoothingQuadEdgeMeshFilter::New(); >>> >>> >>> QEMeshSmoother->SetInput(VtkToItkReader->GetOutPut()); >>> QEMeshSmoother->SetNumberOfIterations(5 ); >>> QEMeshSmoother->SetRelaxationFactor( 0.5 ); >>> QEMeshSmoother->SetDelaunayConforming(true ); >>> QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); >>> >>> QEMeshSmoother->Update(); >>> >>> //// >>> >>> >>> On Fri, Aug 1, 2014 at 4:36 PM, Mallikarjun K wrote: >>> Thanks Bill for your answer. >>> >>> The reason I am using this pipeline is that SmoothingQEMeshFilter has an additional parameter for smoothing which is delaunay conforming which helps to optimize aspect ratio of triangles while smoothing and thus produces better output.Is there anything similar filter in the vtk pipeline.I used vtkWindowedSincPolydatafilter which is not giving the output as good as QEMeshSmoothing filter. >>> >>> Thanks for your help >>> >>> >>> On Thu, Jul 31, 2014 at 5:14 PM, Bill Lorensen wrote: >>> If you have it in vtk, I suggest using the vtk pipeline to smooth the data. >>> >>> On Thu, Jul 31, 2014 at 1:35 AM, Mallikarjun K wrote: >>> > Hi Bill, >>> > Thanks for the replay. >>> > >>> > Yes,I built both ITK and my app with Release ,I forgot to mention it in the >>> > previous post.Actually the data set is the output of >>> > vtkDiscreteMarchingCubes algorithm(around 5MB) and need to smooth .I saved >>> > this marching cube's output as .vtk file and read it using >>> > itkVTKPolyDataReader and then I am giving this reader's output to >>> > itkSmoothingQuadEdgeMeshFilter's input. >>> > >>> > I checked the execution time of each step in the pipeline ,after >>> > SmothingQEMeshFilter has got it's input ,it is taking time to process the >>> > data. >>> > >>> > Thank you >>> > >>> > >>> > >>> > On Wed, Jul 30, 2014 at 9:29 PM, Bill Lorensen >>> > wrote: >>> >> >>> >> First, make sure you are building ITK and your app with Release. A >>> >> Debug build can be 10-50 times slower. >>> >> >>> >> >>> >> On Wed, Jul 30, 2014 at 10:18 AM, Mallikarjun K >>> >> wrote: >>> >> > Hi All, >>> >> > I am using itkSmoothingQuadEdgeMeshFilter for Surface Mesh >>> >> > smoothing.This >>> >> > filter is giving good results what I expected but taking more execution >>> >> > time.can any one suggest me to reduce the execution time( multi >>> >> > threading >>> >> > or any parameters to add/remove )? >>> >> > >>> >> > Below is the code snippet >>> >> > /////// >>> >> > typedef itk::QuadEdgeMeshTraits>> >> > > >>> >> > qetraits; >>> >> > typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; >>> >> > >>> >> > //typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3 > MeshType; >>> >> > >>> >> > itk::OnesMatrixCoefficients< MeshType > coeff0; >>> >> > >>> >> > typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > >>> >> > SmoothingQuadEdgeMeshFilter; >>> >> > >>> >> > SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = >>> >> > SmoothingQuadEdgeMeshFilter::New(); >>> >> > >>> >> > QEMeshSmoother->SetInput("abc.vtk"); >>> >> > QEMeshSmoother->SetNumberOfIterations(5 ); >>> >> > QEMeshSmoother->SetRelaxationFactor( 0.5 ); >>> >> > QEMeshSmoother->SetDelaunayConforming(true ); >>> >> > QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); >>> >> > QEMeshSmoother->Update(); >>> >> > //// >>> >> > >>> >> > -- >>> >> > Regards: >>> >> > Mallik >>> >> > >>> >> > >>> >> > _____________________________________ >>> >> > Powered by www.kitware.com >>> >> > >>> >> > Visit other Kitware open-source projects at >>> >> > http://www.kitware.com/opensource/opensource.html >>> >> > >>> >> > Kitware offers ITK Training Courses, for more information visit: >>> >> > http://www.kitware.com/products/protraining.php >>> >> > >>> >> > Please keep messages on-topic and check the ITK FAQ at: >>> >> > http://www.itk.org/Wiki/ITK_FAQ >>> >> > >>> >> > Follow this link to subscribe/unsubscribe: >>> >> > http://public.kitware.com/mailman/listinfo/insight-users >>> >> > >>> >> >>> >> >>> >> >>> >> -- >>> >> Unpaid intern in BillsBasement at noware dot com >>> > >>> > >>> > >>> > >>> > -- >>> > Regards: >>> > Mallik >>> > >>> >>> >>> >>> -- >>> Unpaid intern in BillsBasement at noware dot com >>> >>> >>> >>> -- >>> Regards: >>> Mallik >>> >>> >>> >>> >>> -- >>> Regards: >>> Mallik >>> >>> _____________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://www.kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the ITK FAQ at: >>> http://www.itk.org/Wiki/ITK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/insight-users >> >> >> >> >> -- >> Regards: >> Mallik >> >> >> >> >> -- >> Regards: >> Mallik >> > > > > > -- > Regards: > Mallik > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mallikarjun49 at gmail.com Thu Aug 7 11:20:44 2014 From: mallikarjun49 at gmail.com (Mallikarjun K) Date: Thu, 7 Aug 2014 20:50:44 +0530 Subject: [ITK-users] itkSmoothingQuadEdgeMeshFilter Help!! In-Reply-To: References: <20566F1B-1B71-411D-8C31-B25D4B24397A@gmail.com> <305E1509-8EF7-4770-9236-3D639B9BF155@gmail.com> Message-ID: Hi Arnaud, Thanks,Can you please tell me your machine confuguration. I am running 4GB RAM,i3 on windows7. I have downloaded your project and tried to execute it and it is still the same problem Which I was facing earlier.Any suggestions ..... thank you On Thu, Aug 7, 2014 at 8:10 PM, Arnaud Gelas wrote: > It takes 29s on my machine in debug to run 5 iterations with Delaunay > conforming set to true > > https://gist.github.com/arnaudgelas/0f20ebdaf53956f79997 > > > On Aug 7, 2014, at 3:45 PM, Mallikarjun K wrote: > > File path is correct.if it is '\'(backward slash) we have to add "D:\\" > .since I used '/' it's not required to add "//". > > please find the attached .vtk file > > Thanks > > > On Thu, Aug 7, 2014 at 7:01 PM, Arnaud Gelas > wrote: > >> Shouldn't it be D://temp.vtk ? Isn't it missing one '/' ? >> >> Can you send this vtk file? >> >> >> On Aug 7, 2014, at 3:23 PM, Mallikarjun K >> wrote: >> >> Hi Arnaud, >> >> Kindly have a look in the below code ,the problem is that even after >> QEMeshFilter output is saved as .stl file ,the program is still running for >> long time.I have observed in my tests that MeshFileReader seems to be the >> culprit. Any suggestions ? >> >> ///// >> #include >> #include >> >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include >> #include "itkMesh.h" >> #include "itkQuadEdgeMesh.h" >> #include "itkQuadEdgeMeshTraits.h" >> #include "itkSmoothingQuadEdgeMeshFilter.h" >> #include "vtkSTLWriter.h" >> #include >> >> int main() >> { >> std::string Inputfilename="D:/temp.vtk"; //number of points of this >> mesh file is around 78K >> >> typedef itk::QuadEdgeMeshTraits >> qetraits; >> typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; >> itk::OnesMatrixCoefficients< MeshType > coeff0; >> typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType >> >SmoothingQuadEdgeMeshFilter; >> >> vtkSmartPointer >> polyDatawriter=vtkSmartPointer::New(); >> vtkSmartPointer >> polyDatareader=vtkSmartPointer::New(); >> >> SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = >> SmoothingQuadEdgeMeshFilter::New(); >> /* polyDatareader->SetFileName(Inputfilename.c_str() ); >> polyDatareader->ReleaseDataFlagOn(); >> polyDatareader->Update();*/ >> >> /*vtkSmartPointer triangleFilter = >> vtkSmartPointer::New(); >> triangleFilter->SetInput(polyDatareader->GetOutput()); >> triangleFilter->Update();*/ >> >> // >> /* vtkSmartPointer clean = >> vtkSmartPointer::New(); >> #if (VTK_MAJOR_VERSION < 6) >> clean->SetInput(triangleFilter->GetOutput() ); >> #else >> clean->SetInputData(triangleFilter->GetOutput() ); >> #endif >> clean->ConvertPolysToLinesOff(); >> clean->ConvertLinesToPointsOff(); >> clean->Update(); >> >> std::string Inputfilename2="D:/cleaned.vtk";*/ >> >> //// >> /*polyDatawriter->SetInput(clean->GetOutput()); >> polyDatawriter->SetFileName(Inputfilename2.c_str()); >> polyDatawriter->ReleaseDataFlagOn(); >> polyDatawriter->Write(); */ >> >> typedef itk::MeshFileReader MeshReaderType; >> MeshReaderType::Pointer Meshreader = MeshReaderType::New(); >> Meshreader->SetFileName(Inputfilename.c_str( )); >> Meshreader->Update(); >> >> /*MeshType::Pointer mesh = Meshreader->GetOutput(); >> mesh->DisconnectPipeline();*/ >> >> QEMeshSmoother->SetInput(Meshreader->GetOutput()/*mesh*/ ); >> QEMeshSmoother->SetNumberOfIterations(1 ); >> QEMeshSmoother->SetRelaxationFactor( 0.5 ); >> QEMeshSmoother->SetDelaunayConforming(true); >> QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); >> >> QEMeshSmoother->ReleaseDataFlagOn(); >> >> QEMeshSmoother->Update(); >> >> std::string Outputfilename="D:/tempOut.vtk"; >> >> typedef itk::MeshFileWriter MeshWriterType; >> MeshWriterType::Pointer Meshwriter = MeshWriterType::New(); >> Meshwriter->SetFileName(Outputfilename.c_str( )); >> Meshwriter->SetInput(QEMeshSmoother->GetOutput()); >> Meshwriter->Update(); >> >> polyDatareader->SetFileName(Outputfilename.c_str() ); >> polyDatareader->ReleaseDataFlagOn(); >> polyDatareader->Update(); >> >> vtkSmartPointer >> stlWriter=vtkSmartPointer::New(); >> stlWriter->SetInput( polyDatareader->GetOutput()); >> stlWriter->SetFileName("D:/QEoutput.stl"); >> stlWriter->SetFileTypeToASCII(); >> stlWriter->Write(); >> //Here it stops and taking long time >> >> return 0; >> >> } >> //// >> >> >> >> On Thu, Aug 7, 2014 at 3:39 PM, Mallikarjun K >> wrote: >> >>> Hi Arnaud, >>> >>> Thanks for your reply and valuable suggestions. >>> >>> Number of points in my input mesh are 78928.In my pipeline I am already >>> cleaning the polydata using vtkCleanPolyData filter.I will check the speed >>> improvement and results with delaunay conforming turned OFF. >>> >>> Thank you >>> >>> >>> On Thu, Aug 7, 2014 at 2:22 PM, Arnaud Gelas >>> wrote: >>> >>>> Hi Malik, >>>> >>>> First of all, I would recommend using MeshFileReader instead of >>>> VTKPolyDataReader (I guess VTKPolyDataReader will be deprecated in near >>>> future?). >>>> >>>> Regarding now the smoothing procedure in itself. This class >>>> definitively misses some documentation and I will be adding some in the >>>> next few days (mainly extracted from the corresponding insight journal). >>>> >>>> At the end of each iteration, when the delaunay conforming flag is >>>> turned ON, the conformation is performed. So depending on the mesh >>>> configuration, mesh size and number of iterations, it can take ages? >>>> How large is your input mesh (number of points)? >>>> >>>> You can also check results, by running first a smoothing without >>>> delaunay conforming, then apply a delaunay conforming on the output. >>>> Results won't be as nice, but you should get significant speed improvement. >>>> Another possibility is to first do a clean poly data in vtk, with a >>>> small threshold to remove small edges in the input meshes (which results in >>>> lots of edge flipping after smoothing). >>>> >>>> HTH >>>> Arnaud >>>> >>>> >>>> On Aug 6, 2014, at 10:42 AM, Mallikarjun K >>>> wrote: >>>> >>>> Hi All, >>>> >>>> Can anyone suggest me if anything wrong I am doing in this below >>>> pipeline ,Where I used itkVtkPolydataReader to convert vtk Surface polydata >>>> to Itk QuadedgeMesh. Execution loop is being hung up for sometime(4 to 5 >>>> mins in release mode) at itkVtkPolydataReader . >>>> >>>> >>>> //// >>>> >>>> typedef itk::QuadEdgeMeshTraits>>> > qetraits; >>>> >>>> typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; >>>> >>>> itk::OnesMatrixCoefficients< MeshType > coeff0; >>>> >>>> typedef itk::VTKPolyDataReader< MeshType >VTKPolyDataReaderType; >>>> //typedef itk::VTKPolyDataWriter< MeshType >VTKPolyDataWriterType; >>>> >>>> //VTKPolyDataWriterType::Pointer >>>> ItkToVtkWriter=VTKPolyDataWriterType::New(); >>>> VTKPolyDataReaderType::Pointer >>>> VtkToItkReader=VTKPolyDataReaderType::New(); >>>> >>>> VtkToItkReader->SetFileName("abc.vtk"); >>>> VtkToItkReader->Update(); >>>> >>>> typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > >>>> SmoothingQuadEdgeMeshFilter; >>>> >>>> SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = >>>> SmoothingQuadEdgeMeshFilter::New(); >>>> >>>> QEMeshSmoother->SetInput(VtkToItkReader->GetOutPut()); >>>> QEMeshSmoother->SetNumberOfIterations(5 ); >>>> QEMeshSmoother->SetRelaxationFactor( 0.5 ); >>>> QEMeshSmoother->SetDelaunayConforming(true ); >>>> QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); >>>> QEMeshSmoother->Update(); >>>> >>>> //// >>>> >>>> >>>> On Fri, Aug 1, 2014 at 4:36 PM, Mallikarjun K >>>> wrote: >>>> >>>>> Thanks Bill for your answer. >>>>> >>>>> The reason I am using this pipeline is that SmoothingQEMeshFilter has >>>>> an additional parameter for smoothing which is delaunay conforming which >>>>> helps to optimize aspect ratio of triangles while smoothing and thus >>>>> produces better output.Is there anything similar filter in the vtk >>>>> pipeline.I used vtkWindowedSincPolydatafilter which is not giving the >>>>> output as good as QEMeshSmoothing filter. >>>>> >>>>> Thanks for your help >>>>> >>>>> >>>>> On Thu, Jul 31, 2014 at 5:14 PM, Bill Lorensen < >>>>> bill.lorensen at gmail.com> wrote: >>>>> >>>>>> If you have it in vtk, I suggest using the vtk pipeline to smooth the >>>>>> data. >>>>>> >>>>>> On Thu, Jul 31, 2014 at 1:35 AM, Mallikarjun K < >>>>>> mallikarjun49 at gmail.com> wrote: >>>>>> > Hi Bill, >>>>>> > Thanks for the replay. >>>>>> > >>>>>> > Yes,I built both ITK and my app with Release ,I forgot to mention >>>>>> it in the >>>>>> > previous post.Actually the data set is the output of >>>>>> > vtkDiscreteMarchingCubes algorithm(around 5MB) and need to smooth >>>>>> .I saved >>>>>> > this marching cube's output as .vtk file and read it using >>>>>> > itkVTKPolyDataReader and then I am giving this reader's output to >>>>>> > itkSmoothingQuadEdgeMeshFilter's input. >>>>>> > >>>>>> > I checked the execution time of each step in the pipeline ,after >>>>>> > SmothingQEMeshFilter has got it's input ,it is taking time to >>>>>> process the >>>>>> > data. >>>>>> > >>>>>> > Thank you >>>>>> > >>>>>> > >>>>>> > >>>>>> > On Wed, Jul 30, 2014 at 9:29 PM, Bill Lorensen < >>>>>> bill.lorensen at gmail.com> >>>>>> > wrote: >>>>>> >> >>>>>> >> First, make sure you are building ITK and your app with Release. A >>>>>> >> Debug build can be 10-50 times slower. >>>>>> >> >>>>>> >> >>>>>> >> On Wed, Jul 30, 2014 at 10:18 AM, Mallikarjun K < >>>>>> mallikarjun49 at gmail.com> >>>>>> >> wrote: >>>>>> >> > Hi All, >>>>>> >> > I am using itkSmoothingQuadEdgeMeshFilter for Surface Mesh >>>>>> >> > smoothing.This >>>>>> >> > filter is giving good results what I expected but taking more >>>>>> execution >>>>>> >> > time.can any one suggest me to reduce the execution time( multi >>>>>> >> > threading >>>>>> >> > or any parameters to add/remove )? >>>>>> >> > >>>>>> >> > Below is the code snippet >>>>>> >> > /////// >>>>>> >> > typedef itk::QuadEdgeMeshTraits>>>>> double,double >>>>>> >> > > >>>>>> >> > qetraits; >>>>>> >> > typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > >>>>>> MeshType; >>>>>> >> > >>>>>> >> > //typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3 > MeshType; >>>>>> >> > >>>>>> >> > itk::OnesMatrixCoefficients< MeshType > coeff0; >>>>>> >> > >>>>>> >> > typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > >>>>>> >> > SmoothingQuadEdgeMeshFilter; >>>>>> >> > >>>>>> >> > SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = >>>>>> >> > SmoothingQuadEdgeMeshFilter::New(); >>>>>> >> > >>>>>> >> > QEMeshSmoother->SetInput("abc.vtk"); >>>>>> >> > QEMeshSmoother->SetNumberOfIterations(5 ); >>>>>> >> > QEMeshSmoother->SetRelaxationFactor( 0.5 ); >>>>>> >> > QEMeshSmoother->SetDelaunayConforming(true ); >>>>>> >> > QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); >>>>>> >> > QEMeshSmoother->Update(); >>>>>> >> > //// >>>>>> >> > >>>>>> >> > -- >>>>>> >> > Regards: >>>>>> >> > Mallik >>>>>> >> > >>>>>> >> > >>>>>> >> > _____________________________________ >>>>>> >> > Powered by www.kitware.com >>>>>> >> > >>>>>> >> > Visit other Kitware open-source projects at >>>>>> >> > http://www.kitware.com/opensource/opensource.html >>>>>> >> > >>>>>> >> > Kitware offers ITK Training Courses, for more information visit: >>>>>> >> > http://www.kitware.com/products/protraining.php >>>>>> >> > >>>>>> >> > Please keep messages on-topic and check the ITK FAQ at: >>>>>> >> > http://www.itk.org/Wiki/ITK_FAQ >>>>>> >> > >>>>>> >> > Follow this link to subscribe/unsubscribe: >>>>>> >> > http://public.kitware.com/mailman/listinfo/insight-users >>>>>> >> > >>>>>> >> >>>>>> >> >>>>>> >> >>>>>> >> -- >>>>>> >> Unpaid intern in BillsBasement at noware dot com >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > -- >>>>>> > Regards: >>>>>> > Mallik >>>>>> > >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Unpaid intern in BillsBasement at noware dot com >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> *Regards:* >>>>> Mallik >>>>> >>>>> >>>> >>>> >>>> -- >>>> *Regards:* >>>> Mallik >>>> >>>> _____________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Kitware offers ITK Training Courses, for more information visit: >>>> http://www.kitware.com/products/protraining.php >>>> >>>> Please keep messages on-topic and check the ITK FAQ at: >>>> http://www.itk.org/Wiki/ITK_FAQ >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/insight-users >>>> >>>> >>>> >>> >>> >>> -- >>> *Regards:* >>> Mallik >>> >>> >> >> >> -- >> *Regards:* >> Mallik >> >> >> > > > -- > *Regards:* > Mallik > > > > > -- *Regards:* Mallik -------------- next part -------------- An HTML attachment was scrubbed... URL: From arnaudgelas at gmail.com Fri Aug 8 04:44:26 2014 From: arnaudgelas at gmail.com (Arnaud Gelas) Date: Fri, 8 Aug 2014 10:44:26 +0200 Subject: [ITK-users] Motion under Mean Curvature with LevelSetv4 Framework In-Reply-To: References: Message-ID: Hi Cagatay, I just came back from vacation... Have you solved this problem? It would be great if we could make the equivalent code in the old framework to compare and fix what could be wrong. Have you done something like this? I'll start looking at it... Best, Arnaud On Tue, Jul 22, 2014 at 9:58 AM, Cagatay Bilgin wrote: > Dear ITK Community, > > I am trying to familiarize myself with the new level set classes. My goal > is to simulate motion under mean curvature using the new design. > > I have put together the following, looking at the examples and tests. > http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3872740/ is a great source to > understand the design and tests in source directory are very helpful, thank > you for the resources! > > The test scenario I have is a L shaped object. I would expect the object > to become somewhat ellipse and then disappear at the end of the evolution. > However I get the following results attached to the email. I don't quite > follow these results. Am I missing something obvious? > > Here is the code and CMakeLists.txt. I ran the program with ./Motion 100 0 > 0 0.05 > > #include "itkBinaryImageToLevelSetImageAdaptor.h" > #include "itkImageFileReader.h" > #include "itkLevelSetContainer.h" > #include "itkLevelSetEquationPropagationTerm.h" > #include "itkLevelSetEquationAdvectionTerm2.h" > #include "itkLevelSetEquationContainer.h" > #include "itkLevelSetEquationTermContainer.h" > #include "itkLevelSetEvolution.h" > #include "itkLevelSetEvolutionNumberOfIterationsStoppingCriterion.h" > #include "itkLevelSetDenseImage.h" > #include "itkVTKVisualizeImageLevelSetIsoValues.h" > #include "itkSinRegularizedHeavisideStepFunction.h" > #include "itkLevelSetIterationUpdateCommand.h" > #include "itkLevelSetEquationCurvatureTerm.h" > #include "itkCastImageFilter.h" > #include "itkWhitakerSparseLevelSetImage.h" > #include "itkSpatialObjectToImageFilter.h" > #include "itkEllipseSpatialObject.h" > > typedef itk::Image< float, 2 > FIT; > > /* > * L Shape > */ > void CreateSquareImage(FIT::Pointer image) > { > FIT::RegionType region; > FIT::IndexType start; > start[0] = 0; > start[1] = 0; > > FIT::SizeType size; > size[0] = 200; > size[1] = 300; > > region.SetSize(size); > region.SetIndex(start); > > image->SetRegions(region); > image->Allocate(); > > // Set pixels in a square to one value > for(unsigned int r = 20; r < 160; r++) > { > for(unsigned int c = 30; c < 100; c++) > { > FIT::IndexType pixelIndex; > pixelIndex[0] = r; > pixelIndex[1] = c; > > image->SetPixel(pixelIndex, 255); > } > } > > for(unsigned int r = 20; r < 80; r++) > { > for(unsigned int c = 100; c < 200; c++) > { > FIT::IndexType pixelIndex; > pixelIndex[0] = r; > pixelIndex[1] = c; > > image->SetPixel(pixelIndex, 255); > } > } > } > > > /* > */ > int main( int argc, char* argv[] ) > { > if( argc != 5) > { > std::cerr << "Missing Arguments" << std::endl; > std::cerr << argv[0] << std::endl; > std::cerr << "1- Number of Iterations" << std::endl; > std::cerr << "2- Propagation Term" << std::endl; > std::cerr << "3- Advection Term" << std::endl; > std::cerr << "4- Curvature Term" << std::endl; > return EXIT_FAILURE; > } > > // Image Dimension > const unsigned int Dimension = 2; > > typedef unsigned char InputPixelType; > typedef itk::Image< InputPixelType, Dimension > IIT; > typedef itk::Image< float, 2 > FIT; > > FIT::Pointer input = FIT::New(); > CreateSquareImage(input); > > int numberOfIterations = atoi( argv[1]); > > typedef float > LevelSetPixelType; > typedef itk::Image< LevelSetPixelType, Dimension > LSIT; > typedef itk::LevelSetDenseImage< LSIT > LST; > //typedef itk::WhitakerSparseLevelSetImage< LevelSetPixelType, 2 > LST; > > typedef LST::OutputType LevelSetOutputType; > typedef LST::OutputRealType LevelSetRealType; > > // convert a binary mask to a level-set function > typedef itk::BinaryImageToLevelSetImageAdaptor BI2LST; > BI2LST::Pointer adaptor = BI2LST::New(); > adaptor->SetInputImage( input ); > adaptor->Initialize(); > LST::Pointer levelSet = adaptor->GetLevelSet(); > > // The Heaviside function > typedef itk::SinRegularizedHeavisideStepFunction< LevelSetRealType, > LevelSetRealType > HeavisideFunctionType; > HeavisideFunctionType::Pointer heaviside = > HeavisideFunctionType::New(); > heaviside->SetEpsilon( 1 ); > > // Create the level set container > typedef itk::LevelSetContainer< itk::IdentifierType, LST > > LSContainerT; > LSContainerT::Pointer levelSetContainer = LSContainerT::New(); > levelSetContainer->SetHeaviside( heaviside ); > levelSetContainer->AddLevelSet( 0, levelSet ); > > // Create the terms. > typedef itk::LevelSetEquationPropagationTerm > PropagationTermType; > PropagationTermType::Pointer propagationTerm = > PropagationTermType::New(); > propagationTerm->SetInput(input); > propagationTerm->SetCoefficient(atof(argv[2])); > > typedef itk::LevelSetEquationAdvectionTerm2 > AdvectionTermType; > AdvectionTermType::Pointer advectionTerm = AdvectionTermType::New(); > advectionTerm->SetInput(input); > advectionTerm->SetCoefficient(atof(argv[3])); > > typedef itk::LevelSetEquationCurvatureTerm > CurvatureTermType; > CurvatureTermType::Pointer curvatureTerm = CurvatureTermType::New(); > //curvatureTerm->SetInput(input); > curvatureTerm->SetCoefficient(atof(argv[4])); > > > // Create term container (equation rhs) > typedef itk::LevelSetEquationTermContainer< FIT, LSContainerT > > TermContainerType; > TermContainerType::Pointer termContainer = TermContainerType::New(); > termContainer->SetLevelSetContainer( levelSetContainer ); > termContainer->SetInput( input ); > //termContainer->AddTerm( 0, propagationTerm ); > //termContainer->AddTerm( 1, advectionTerm ); > termContainer->AddTerm( 0, curvatureTerm ); > > // Create equation container > typedef itk::LevelSetEquationContainer< TermContainerType > > EquationContainerType; > EquationContainerType::Pointer equationContainer = > EquationContainerType::New(); > equationContainer->SetLevelSetContainer( levelSetContainer ); > equationContainer->AddEquation( 0, termContainer ); > > // Create stopping criteria > typedef itk::LevelSetEvolutionNumberOfIterationsStoppingCriterion< > LSContainerT > StoppingCriterionType; > StoppingCriterionType::Pointer criterion = > StoppingCriterionType::New(); > criterion->SetNumberOfIterations( numberOfIterations ); > > // Create the visualizer > typedef itk::VTKVisualizeImageLevelSetIsoValues< FIT, LST > > VisualizationType; > VisualizationType::Pointer visualizer = VisualizationType::New(); > visualizer->SetInputImage( input ); > visualizer->SetLevelSet( levelSet ); > visualizer->SetScreenCapture( true ); > > // Create evolution class > typedef itk::LevelSetEvolution< EquationContainerType, LST > > LevelSetEvolutionType; > LevelSetEvolutionType::Pointer evolution = > LevelSetEvolutionType::New(); > evolution->SetEquationContainer( equationContainer ); > evolution->SetStoppingCriterion( criterion ); > evolution->SetLevelSetContainer( levelSetContainer ); > > typedef itk::LevelSetIterationUpdateCommand< LevelSetEvolutionType, > VisualizationType > IterationUpdateCommandType; > IterationUpdateCommandType::Pointer iterationUpdateCommand = > IterationUpdateCommandType::New(); > iterationUpdateCommand->SetFilterToUpdate( visualizer ); > iterationUpdateCommand->SetUpdatePeriod( 1 ); > > evolution->AddObserver( itk::IterationEvent(), iterationUpdateCommand > ); > > evolution->Update(); > > return EXIT_SUCCESS; > } > > > > cmake_minimum_required(VERSION 2.8) > > project(CurvatureMotion) > > find_package(ITK REQUIRED) > include(${ITK_USE_FILE}) > > find_package(VTK REQUIRED) > include(${VTK_USE_FILE}) > > add_executable(Motion main.cpp) > target_link_libraries(Motion ${ITK_LIBRARIES} ${VTK_LIBRARIES}) > > [image: Inline image 4][image: Inline image 3] > -- > Cemal Cagatay Bilgin, PhD > Life Sciences Division > Lawrence Berkeley National Lab > MS977, One Cyclotron Road > Berkeley, CA 94720, USA > Email: ccbilgin at lbl.gov > > _____________________________________ > 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: levelset_040.png Type: image/png Size: 3421 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: levelset_000.png Type: image/png Size: 2652 bytes Desc: not available URL: From nicgallego at gmail.com Fri Aug 8 12:18:53 2014 From: nicgallego at gmail.com (Nicolas Gallego) Date: Fri, 8 Aug 2014 18:18:53 +0200 Subject: [ITK-users] [ITK] Whole body Segmentation-Identification In-Reply-To: References: Message-ID: Hi Bumpy, It seams that your problem is exploratory and will get benefit of manual interaction. Have you tried visualizing your images in ITKSnap for example? There are tools to do manual segmentation there. Hope that helps Nicol?s Gallego-Ortiz Universit? catholique de Louvain, Belgium 2014-08-01 15:47 GMT+02:00 Bumpy RG : > Dear All, > > I have a dicom series having whole body image sequences, starting from > head up to legs. > > My aim is to write an algorithm to automatically identify the body parts > (lungs, spines, head etc.) from the dicom sequence. > > Although I am very new to the ITK world, I am following these steps in ITK > (*I would appreciate if you comment whether I am following correct idea > or not*): > > 1. Read dicom series using 'DicomSeriesReadImageWrite2.cxx ' to create > a 3D volume and save the result in mhd format. > 2. Use 'ImageReadRegionOfInterestWrite.cxx' for separating various > parts (like left lung, right lung, spines, head etc.) and save them in > respective 3D volumes in mhd format. > 3. Pick the various body parts prepared above, one by one and segment > them using robust algorithm (say > ThresholdSegmentationLevelSetImageFilter.cxx). > 4. Use Mathematical Morphology to get better results. > 5. Using the various results from above, form an algorithm for > identifying the various body parts. > > Currently I am stuck in the second step because it is so hard to choose > the co-ordinates for selecting proper region of interest. > > For example, I chose these points for ROI of right lung (I checked the > co-ordinates using 3D slicer visualizer) and it does not give me good > results : > start[0] = 255; > start[1] =165; > start[2] = 0; > > *However I do not understand how to choose the points properly in ITK.* > > > I would be really glad to have your response. > > Thanking you in advance. > Kind Regards, > Bumpy. > > _____________________________________ > 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 Sat Aug 9 10:34:08 2014 From: matimontg at gmail.com (Matias Montroull) Date: Sat, 9 Aug 2014 11:34:08 -0300 Subject: [ITK-users] ITK ResampleDicom | Tags Message-ID: Hi, I'm using the ResmpleDicom example to convert a serie of images to a new serie with z spacing=1. Images are CT Everything works fine except that some Tags on the images are deleted during the process, I even see the rescale intercept is srt to 0 and the rescaletype is changed as well. The padding value also changes. Is there a way to avoid all this? My images WL and WC change once I run the Resample.. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From matimontg at gmail.com Sat Aug 9 10:42:28 2014 From: matimontg at gmail.com (Matias Montroull) Date: Sat, 9 Aug 2014 11:42:28 -0300 Subject: [ITK-users] ITK ResampleDicom | Tags In-Reply-To: References: Message-ID: I think the key is in this section of the code: CopyDictionary (*inputDict, *dict); Shouldn't copy the entire tags? On Sat, Aug 9, 2014 at 11:34 AM, Matias Montroull wrote: > Hi, > > I'm using the ResmpleDicom example to convert a serie of images to a new > serie with z spacing=1. Images are CT > > Everything works fine except that some Tags on the images are deleted > during the process, I even see the rescale intercept is srt to 0 and the > rescaletype is changed as well. The padding value also changes. > > Is there a way to avoid all this? My images WL and WC change once I run > the Resample.. > > Thanks! > -------------- next part -------------- An HTML attachment was scrubbed... URL: From grothausmann.roman at mh-hannover.de Mon Aug 11 01:15:45 2014 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Mon, 11 Aug 2014 07:15:45 +0200 Subject: [ITK-users] adding a global hierarchical watershed segmentation mode to itksnap Message-ID: <53E85181.8040607@mh-hannover.de> Dear mailing list members, For a long time now I've been searching for a replacement of the old SegmentationEditor (part of the InsightApplications) which I could not get to work even with older ITK-3.x. Somewhere I was told that it was integrated and maintained within itksnap. However the only tool in itksnap based on watershed segmentation seems to be the adaptive brush. It is very handy, but time-consuming in 3D and only for local segmentations. In contrast the SegmentationEditor used a global hierarchical watershed segmentation to pick labels from, see e.g. the video linked here: http://www.insight-journal.org/browse/publication/70 Quite often now I've stumbled over data, that would likely have profited a lot of such a tool for segmentation. If such a tool working with ITK-4.x does not exist any more, I thought of implementing it as a global WS segmentation mode in itksnap. That way making the tool easier to find, to use and to ensure maintenance (should it be integrated into the itksnap code base in the end) and also avoiding recoding a GUI with mouse interaction and such. My current idea is to start, similar to the snake-tool, with pre-filtering like smoothing and optional edge-detection. Then the main edit mode to consist of the usual 4 subwindows showing an overlay of the grey-image and the watershed segmentation of the hierarchical WS-filter (hWS), side-by-side to another label-dataset (loaded like a tiled overlay) which consist of the actually chosen labels from the hWS as the final data (FD). The interaction I'm considering would be to LMB click on a label in the hWS which is then added to the FD as the current fg label, or removed with a RMB. The hierachrchy level of the hWS could be controlled by a slider or the mouse wheel + Shift in nearly real time if some region demands higher or lower detailed segmentation. When the fg label is changed, the segmentation added or removed with further mouse interactions would modify the new fg label. When all is done and the global WS mode is left, the FD label-dataset is added to the main segmentation of itksnap. Would that be possible to implement in itksnap 3.x? What source files of the itksnap code base should I look at for: - the pre-filtering mode of the snake (for the smoothing and edge detection) - the mouse interactions (for e.g. adding the whell + Shift interaction) - possible examples for the dual layout Thanks for any comments, help or hints. 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 iyas.hamdan at gmail.com Mon Aug 11 03:35:25 2014 From: iyas.hamdan at gmail.com (Iyas Hamdan) Date: Mon, 11 Aug 2014 09:35:25 +0200 Subject: [ITK-users] 3D multimodal registration Message-ID: Hello all, I?m working on 3D multimodal image registration and I have a problem I've been struggling with for quite a while. I have a 3D MRI volume (fixed volume) and a 3D CT volume (moving volume), but those two volumes have different sizes (different dimensions and different number of slices). First of all I have a general question, how does the 3D registration in itk work basically ? I mean does it take the first slice from the fixed volume and try to find its correspondence in the moving volume ( by optimizing a metric ) and then go on to the next slice and so on? Or does it rather work with the whole volume and not slice by slice ? Because for me, lets imagine I have 50 MRI slices and 150 CT ones for example, but the field of view is different between both volumes. I mean the first MRI slice corresponds ( visually ) to the 50th CT slice for example so the first 49 CT slices don?t exist in the MRI volume. So when I apply my registration method ( affine transformation with the mutual information as the metric ) the registration fails to give a good result. It show no errors but the result volume is not well aligned with the fixed one. Although the transformation ( from the outside let?s say ) is correct, meaning the result volume has the same size as the fixed one and both volumes are on top of each other perfectly but the slices don?t look alike at all when I try to show both volumes on top of each other. Knowing that my initialization is good, and I tuned the parameters of the optimizer ( regular step gradient descent) and always ended up with almost the same result. So is that a normal behavior of itk to fail when the field of view is different ? Because I tried to cut off the first 49 CT slices, and created a new volume with the rest of the slices ( so that I had the same field of view with the MRI volume ), and when I applied the registration between this new volume and the MRI one, the registration worked perfectly and I had a very good result. So what?s wrong here ? and if the field of view is the problem how can I fix that automatically ? because I can delete the extra slices from one volume manually, but what I'm looking for is an automatic approach and I couldn?t think of one. Any hint would be really appreciated, Thanks in advance, Best regards, Iyas -------------- next part -------------- An HTML attachment was scrubbed... URL: From mercikd at thomas.edu Mon Aug 11 10:37:37 2014 From: mercikd at thomas.edu (Dan Mercik) Date: Mon, 11 Aug 2014 14:37:37 +0000 Subject: [ITK-users] Image Diffusion Message-ID: Good Morning, I'm doing a project that involves the fusion of multiple images. However, at the end of the fusion process I need to be able to diffuse the fuse imaged back to it's original stack images. I wanted to know if there an algorithm I can use to defuse my fused image? Any thoughts are more than welcome and I would be highly appreciative for your input. Daniel Mercik Computer Science Major Service Desk Technician Thomas College From lasso at queensu.ca Mon Aug 11 10:20:58 2014 From: lasso at queensu.ca (Andras Lasso) Date: Mon, 11 Aug 2014 14:20:58 +0000 Subject: [ITK-users] [ITK] adding a global hierarchical watershed segmentation mode to itksnap In-Reply-To: <53E85181.8040607@mh-hannover.de> References: <53E85181.8040607@mh-hannover.de> Message-ID: <0f32755d9980441ca0162728b088f00b@queensu.ca> Have you tried segmentation tools in 3D Slicer? There is a multi-label watershed segmentation tool that works in 3d (http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/Editor#WatershedFromMarkers), there are also a number of other generic semi-automatic segmentation tools (such as GrowCut) and a few fully-automatic specialized tools (for brain, airways, etc). Download the nightly build and also checkout the Segmentation category in the Extension Manager. Andras From: Dr. Roman Grothausmann Sent: ?Monday?, ?August? ?11?, ?2014 ?1?:?15? ?AM To: itksnap-users at googlegroups.com Cc: ITK Mailing List Dear mailing list members, For a long time now I've been searching for a replacement of the old SegmentationEditor (part of the InsightApplications) which I could not get to work even with older ITK-3.x. Somewhere I was told that it was integrated and maintained within itksnap. However the only tool in itksnap based on watershed segmentation seems to be the adaptive brush. It is very handy, but time-consuming in 3D and only for local segmentations. In contrast the SegmentationEditor used a global hierarchical watershed segmentation to pick labels from, see e.g. the video linked here: http://www.insight-journal.org/browse/publication/70 Quite often now I've stumbled over data, that would likely have profited a lot of such a tool for segmentation. If such a tool working with ITK-4.x does not exist any more, I thought of implementing it as a global WS segmentation mode in itksnap. That way making the tool easier to find, to use and to ensure maintenance (should it be integrated into the itksnap code base in the end) and also avoiding recoding a GUI with mouse interaction and such. My current idea is to start, similar to the snake-tool, with pre-filtering like smoothing and optional edge-detection. Then the main edit mode to consist of the usual 4 subwindows showing an overlay of the grey-image and the watershed segmentation of the hierarchical WS-filter (hWS), side-by-side to another label-dataset (loaded like a tiled overlay) which consist of the actually chosen labels from the hWS as the final data (FD). The interaction I'm considering would be to LMB click on a label in the hWS which is then added to the FD as the current fg label, or removed with a RMB. The hierachrchy level of the hWS could be controlled by a slider or the mouse wheel + Shift in nearly real time if some region demands higher or lower detailed segmentation. When the fg label is changed, the segmentation added or removed with further mouse interactions would modify the new fg label. When all is done and the global WS mode is left, the FD label-dataset is added to the main segmentation of itksnap. Would that be possible to implement in itksnap 3.x? What source files of the itksnap code base should I look at for: - the pre-filtering mode of the snake (for the smoothing and edge detection) - the mouse interactions (for e.g. adding the whell + Shift interaction) - possible examples for the dual layout Thanks for any comments, help or hints. Roman -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-9574 _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users _______________________________________________ Community mailing list Community at itk.org http://public.kitware.com/mailman/listinfo/community -------------- next part -------------- An HTML attachment was scrubbed... URL: From gass at vision.ee.ethz.ch Mon Aug 11 12:18:03 2014 From: gass at vision.ee.ethz.ch (Tobias Gass) Date: Mon, 11 Aug 2014 18:18:03 +0200 Subject: [ITK-users] Anti-alias filter Message-ID: Dear all, I'm having problems using the anti-alias filter, which I want to use in order to smooth a binary segmentation volume. I'm using essentially the example code from the repository, which for my input file seems to start oscillating after 2 iterations, leading to weird 'pointy' artifacts on the surface as can be seen from the attached screenshot (AA filter output is on the left, input on the right). Is there any parameter to set/implement which could improve the behavior of this filter? I'm assuming that my input is reasonable, or is this something the filter is expected to have problems with? It is notable that such errors seem to mainly appear in 'flat' regions of the volume, and are not apparent in the curved shaft of the bone. Any help, or pointers to further resources are appreciated, thanks, Tobias -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: AAFIlter.jpg Type: image/jpeg Size: 205294 bytes Desc: not available URL: From bill.lorensen at gmail.com Mon Aug 11 13:39:44 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Mon, 11 Aug 2014 13:39:44 -0400 Subject: [ITK-users] Anti-alias filter In-Reply-To: References: Message-ID: Can you post your code. The results do not look correct. On Mon, Aug 11, 2014 at 12:18 PM, Tobias Gass wrote: > Dear all, > > I'm having problems using the anti-alias filter, which I want to use in > order to smooth a binary segmentation volume. I'm using essentially the > example code from the repository, which for my input file seems to start > oscillating after 2 iterations, leading to weird 'pointy' artifacts on the > surface as can be seen from the attached screenshot (AA filter output is on > the left, input on the right). > > Is there any parameter to set/implement which could improve the behavior of > this filter? I'm assuming that my input is reasonable, or is this something > the filter is expected to have problems with? It is notable that such errors > seem to mainly appear in 'flat' regions of the volume, and are not apparent > in the curved shaft of the bone. > > Any help, or pointers to further resources are appreciated, > thanks, > Tobias > > _____________________________________ > 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 gass at vision.ee.ethz.ch Mon Aug 11 14:47:49 2014 From: gass at vision.ee.ethz.ch (Tobias Gass) Date: Mon, 11 Aug 2014 20:47:49 +0200 Subject: [ITK-users] Anti-alias filter In-Reply-To: References: Message-ID: > Can you post your code. The results do not look correct. Sure. The {write,read}Image functions are just convenient wrappers for the respective ITK tools. #include #include #include "argstream.h" #include "ImageUtils.h" #include "itkAntiAliasBinaryImageFilter.h" using namespace std; using namespace itk; int main(int argc, char ** argv) { feenableexcept(FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW); typedef short PixelType; typedef double OutputPixelType; const unsigned int D=3; typedef Image ImageType; typedef ImageType::Pointer ImagePointerType; typedef Image OutputImageType; typedef OutputImageType::Pointer OutputImagePointerType; argstream * as=new argstream(argc,argv); string inFile, outFile; double thresh=0.0; (*as) >> parameter ("in", inFile, " filename...", true); (*as) >> parameter ("out", outFile, " filename...", true); (*as) >> help(); as->defaultErrorHandling(); ImagePointerType img = ImageUtils::readImage(inFile); typedef itk::AntiAliasBinaryImageFilter AntiAliasBinaryImageFilterType; AntiAliasBinaryImageFilterType::Pointer antiAliasFilter = AntiAliasBinaryImageFilterType::New (); antiAliasFilter->SetInput(img); antiAliasFilter->SetNumberOfIterations(5); antiAliasFilter->SetMaximumRMSError(0.02); antiAliasFilter->Update(); // For increased code coverage. Does nothing. antiAliasFilter->GetMaximumRMSError(); antiAliasFilter->Update(); std::cout << "Maximum RMS change value threshold was: 0.02 " << std::endl; std::cout << "Last RMS change value was: " << antiAliasFilter->GetRMSChange() << std::endl; std::cout<< antiAliasFilter->GetElapsedIterations() <GetLowerBinaryValue()<<" "<< antiAliasFilter->GetUpperBinaryValue()<GetOutput(); ImageUtils::writeImage(outFile,out); return 1; } I tried different values for maxIter (1,2,3,4,5,10,100,1000) and maxRMSError (0.02 0.07 0.08 0.8), and the best visual results are achieved after one iteration where RMSE changes by about 0.08. This increases for all following iterations, which have an RMSE-change of about 0.25 for all number of iterations tested. All this is using ITK 4.5 pulled from the GIT repository a while ago, running on an intel i7 on Debian. Thanks a lot! Tobias > > On Mon, Aug 11, 2014 at 12:18 PM, Tobias Gass > wrote: > > Dear all, > > > > I'm having problems using the anti-alias filter, which I want to use in > > order to smooth a binary segmentation volume. I'm using essentially the > > example code from the repository, which for my input file seems to start > > oscillating after 2 iterations, leading to weird 'pointy' artifacts on > the > > surface as can be seen from the attached screenshot (AA filter output is > on > > the left, input on the right). > > > > Is there any parameter to set/implement which could improve the behavior > of > > this filter? I'm assuming that my input is reasonable, or is this > something > > the filter is expected to have problems with? It is notable that such > errors > > seem to mainly appear in 'flat' regions of the volume, and are not > apparent > > in the curved shaft of the bone. > > > > Any help, or pointers to further resources are appreciated, > > thanks, > > Tobias > > > > _____________________________________ > > 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 bill.lorensen at gmail.com Mon Aug 11 15:22:09 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Mon, 11 Aug 2014 15:22:09 -0400 Subject: [ITK-users] Anti-alias filter In-Reply-To: References: Message-ID: If you change typedef short PixelType; to typedef double PixelType; do the results change. On Mon, Aug 11, 2014 at 2:47 PM, Tobias Gass wrote: > >> Can you post your code. The results do not look correct. > > > Sure. The {write,read}Image functions are just convenient wrappers for the > respective ITK tools. > > > #include > > #include > > #include "argstream.h" > > #include "ImageUtils.h" > > #include "itkAntiAliasBinaryImageFilter.h" > > using namespace std; > > using namespace itk; > > > > > int main(int argc, char ** argv) > > { > > > feenableexcept(FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW); > > typedef short PixelType; > > typedef double OutputPixelType; > > const unsigned int D=3; > > typedef Image ImageType; > > > > typedef ImageType::Pointer ImagePointerType; > > > > typedef Image OutputImageType; > > typedef OutputImageType::Pointer OutputImagePointerType; > > > > argstream * as=new argstream(argc,argv); > > string inFile, outFile; > > double thresh=0.0; > > (*as) >> parameter ("in", inFile, " filename...", true); > > (*as) >> parameter ("out", outFile, " filename...", true); > > > (*as) >> help(); > > as->defaultErrorHandling(); > > > ImagePointerType img = ImageUtils::readImage(inFile); > > > typedef itk::AntiAliasBinaryImageFilter > > AntiAliasBinaryImageFilterType; > > > > AntiAliasBinaryImageFilterType::Pointer antiAliasFilter > > = AntiAliasBinaryImageFilterType::New (); > > antiAliasFilter->SetInput(img); > > antiAliasFilter->SetNumberOfIterations(5); > > antiAliasFilter->SetMaximumRMSError(0.02); > > > antiAliasFilter->Update(); > > > // For increased code coverage. Does nothing. > > antiAliasFilter->GetMaximumRMSError(); > > > > > antiAliasFilter->Update(); > > > std::cout << "Maximum RMS change value threshold was: 0.02 " << std::endl; > > std::cout << "Last RMS change value was: " << > antiAliasFilter->GetRMSChange() << std::endl; > > > std::cout<< antiAliasFilter->GetElapsedIterations() < > > std::cout<GetLowerBinaryValue()<<" "<< > antiAliasFilter->GetUpperBinaryValue()< > > OutputImagePointerType out=antiAliasFilter->GetOutput(); > > > ImageUtils::writeImage(outFile,out); > > > return 1; > > } > > > I tried different values for maxIter (1,2,3,4,5,10,100,1000) and maxRMSError > (0.02 0.07 0.08 0.8), and the best visual results are achieved after one > iteration where RMSE changes by about 0.08. This increases for all following > iterations, which have an RMSE-change of about 0.25 for all number of > iterations tested. All this is using ITK 4.5 pulled from the GIT repository > a while ago, running on an intel i7 on Debian. > > Thanks a lot! > Tobias > >> >> >> On Mon, Aug 11, 2014 at 12:18 PM, Tobias Gass >> wrote: >> > Dear all, >> > >> > I'm having problems using the anti-alias filter, which I want to use in >> > order to smooth a binary segmentation volume. I'm using essentially the >> > example code from the repository, which for my input file seems to start >> > oscillating after 2 iterations, leading to weird 'pointy' artifacts on >> > the >> > surface as can be seen from the attached screenshot (AA filter output is >> > on >> > the left, input on the right). >> > >> > Is there any parameter to set/implement which could improve the behavior >> > of >> > this filter? I'm assuming that my input is reasonable, or is this >> > something >> > the filter is expected to have problems with? It is notable that such >> > errors >> > seem to mainly appear in 'flat' regions of the volume, and are not >> > apparent >> > in the curved shaft of the bone. >> > >> > Any help, or pointers to further resources are appreciated, >> > thanks, >> > Tobias >> > >> > _____________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Kitware offers ITK Training Courses, for more information visit: >> > http://www.kitware.com/products/protraining.php >> > >> > Please keep messages on-topic and check the ITK FAQ at: >> > http://www.itk.org/Wiki/ITK_FAQ >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/insight-users >> > >> >> >> >> -- >> Unpaid intern in BillsBasement at noware dot com > > -- Unpaid intern in BillsBasement at noware dot com From bill.lorensen at gmail.com Mon Aug 11 15:22:44 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Mon, 11 Aug 2014 15:22:44 -0400 Subject: [ITK-users] Anti-alias filter In-Reply-To: References: Message-ID: How are you extracting the final isosurface? On Mon, Aug 11, 2014 at 3:22 PM, Bill Lorensen wrote: > If you change > typedef short PixelType; > to > typedef double PixelType; > > do the results change. > > > On Mon, Aug 11, 2014 at 2:47 PM, Tobias Gass wrote: >> >>> Can you post your code. The results do not look correct. >> >> >> Sure. The {write,read}Image functions are just convenient wrappers for the >> respective ITK tools. >> >> >> #include >> >> #include >> >> #include "argstream.h" >> >> #include "ImageUtils.h" >> >> #include "itkAntiAliasBinaryImageFilter.h" >> >> using namespace std; >> >> using namespace itk; >> >> >> >> >> int main(int argc, char ** argv) >> >> { >> >> >> feenableexcept(FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW); >> >> typedef short PixelType; >> >> typedef double OutputPixelType; >> >> const unsigned int D=3; >> >> typedef Image ImageType; >> >> >> >> typedef ImageType::Pointer ImagePointerType; >> >> >> >> typedef Image OutputImageType; >> >> typedef OutputImageType::Pointer OutputImagePointerType; >> >> >> >> argstream * as=new argstream(argc,argv); >> >> string inFile, outFile; >> >> double thresh=0.0; >> >> (*as) >> parameter ("in", inFile, " filename...", true); >> >> (*as) >> parameter ("out", outFile, " filename...", true); >> >> >> (*as) >> help(); >> >> as->defaultErrorHandling(); >> >> >> ImagePointerType img = ImageUtils::readImage(inFile); >> >> >> typedef itk::AntiAliasBinaryImageFilter >> >> AntiAliasBinaryImageFilterType; >> >> >> >> AntiAliasBinaryImageFilterType::Pointer antiAliasFilter >> >> = AntiAliasBinaryImageFilterType::New (); >> >> antiAliasFilter->SetInput(img); >> >> antiAliasFilter->SetNumberOfIterations(5); >> >> antiAliasFilter->SetMaximumRMSError(0.02); >> >> >> antiAliasFilter->Update(); >> >> >> // For increased code coverage. Does nothing. >> >> antiAliasFilter->GetMaximumRMSError(); >> >> >> >> >> antiAliasFilter->Update(); >> >> >> std::cout << "Maximum RMS change value threshold was: 0.02 " << std::endl; >> >> std::cout << "Last RMS change value was: " << >> antiAliasFilter->GetRMSChange() << std::endl; >> >> >> std::cout<< antiAliasFilter->GetElapsedIterations() <> >> >> std::cout<GetLowerBinaryValue()<<" "<< >> antiAliasFilter->GetUpperBinaryValue()<> >> >> OutputImagePointerType out=antiAliasFilter->GetOutput(); >> >> >> ImageUtils::writeImage(outFile,out); >> >> >> return 1; >> >> } >> >> >> I tried different values for maxIter (1,2,3,4,5,10,100,1000) and maxRMSError >> (0.02 0.07 0.08 0.8), and the best visual results are achieved after one >> iteration where RMSE changes by about 0.08. This increases for all following >> iterations, which have an RMSE-change of about 0.25 for all number of >> iterations tested. All this is using ITK 4.5 pulled from the GIT repository >> a while ago, running on an intel i7 on Debian. >> >> Thanks a lot! >> Tobias >> >>> >>> >>> On Mon, Aug 11, 2014 at 12:18 PM, Tobias Gass >>> wrote: >>> > Dear all, >>> > >>> > I'm having problems using the anti-alias filter, which I want to use in >>> > order to smooth a binary segmentation volume. I'm using essentially the >>> > example code from the repository, which for my input file seems to start >>> > oscillating after 2 iterations, leading to weird 'pointy' artifacts on >>> > the >>> > surface as can be seen from the attached screenshot (AA filter output is >>> > on >>> > the left, input on the right). >>> > >>> > Is there any parameter to set/implement which could improve the behavior >>> > of >>> > this filter? I'm assuming that my input is reasonable, or is this >>> > something >>> > the filter is expected to have problems with? It is notable that such >>> > errors >>> > seem to mainly appear in 'flat' regions of the volume, and are not >>> > apparent >>> > in the curved shaft of the bone. >>> > >>> > Any help, or pointers to further resources are appreciated, >>> > thanks, >>> > Tobias >>> > >>> > _____________________________________ >>> > Powered by www.kitware.com >>> > >>> > Visit other Kitware open-source projects at >>> > http://www.kitware.com/opensource/opensource.html >>> > >>> > Kitware offers ITK Training Courses, for more information visit: >>> > http://www.kitware.com/products/protraining.php >>> > >>> > Please keep messages on-topic and check the ITK FAQ at: >>> > http://www.itk.org/Wiki/ITK_FAQ >>> > >>> > Follow this link to subscribe/unsubscribe: >>> > http://public.kitware.com/mailman/listinfo/insight-users >>> > >>> >>> >>> >>> -- >>> Unpaid intern in BillsBasement at noware dot com >> >> > > > > -- > Unpaid intern in BillsBasement at noware dot com -- Unpaid intern in BillsBasement at noware dot com From gass at vision.ee.ethz.ch Mon Aug 11 15:38:45 2014 From: gass at vision.ee.ethz.ch (Tobias Gass) Date: Mon, 11 Aug 2014 21:38:45 +0200 Subject: [ITK-users] Anti-alias filter In-Reply-To: References: Message-ID: I will try that tomorrow morning (living in GMT+1). I used paraview to extract the isosurface, but also looked at the output of the AA-filter directly (which looked fuzzy). I can also post an image of that tomorrow. Thanks for your help! Tobias 2014-08-11 21:22 GMT+02:00 Bill Lorensen : > How are you extracting the final isosurface? > > On Mon, Aug 11, 2014 at 3:22 PM, Bill Lorensen > wrote: > > If you change > > typedef short PixelType; > > to > > typedef double PixelType; > > > > do the results change. > > > > > > On Mon, Aug 11, 2014 at 2:47 PM, Tobias Gass > wrote: > >> > >>> Can you post your code. The results do not look correct. > >> > >> > >> Sure. The {write,read}Image functions are just convenient wrappers for > the > >> respective ITK tools. > >> > >> > >> #include > >> > >> #include > >> > >> #include "argstream.h" > >> > >> #include "ImageUtils.h" > >> > >> #include "itkAntiAliasBinaryImageFilter.h" > >> > >> using namespace std; > >> > >> using namespace itk; > >> > >> > >> > >> > >> int main(int argc, char ** argv) > >> > >> { > >> > >> > >> feenableexcept(FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW); > >> > >> typedef short PixelType; > >> > >> typedef double OutputPixelType; > >> > >> const unsigned int D=3; > >> > >> typedef Image ImageType; > >> > >> > >> > >> typedef ImageType::Pointer ImagePointerType; > >> > >> > >> > >> typedef Image OutputImageType; > >> > >> typedef OutputImageType::Pointer OutputImagePointerType; > >> > >> > >> > >> argstream * as=new argstream(argc,argv); > >> > >> string inFile, outFile; > >> > >> double thresh=0.0; > >> > >> (*as) >> parameter ("in", inFile, " filename...", true); > >> > >> (*as) >> parameter ("out", outFile, " filename...", true); > >> > >> > >> (*as) >> help(); > >> > >> as->defaultErrorHandling(); > >> > >> > >> ImagePointerType img = ImageUtils::readImage(inFile); > >> > >> > >> typedef itk::AntiAliasBinaryImageFilter > >> > >> AntiAliasBinaryImageFilterType; > >> > >> > >> > >> AntiAliasBinaryImageFilterType::Pointer antiAliasFilter > >> > >> = AntiAliasBinaryImageFilterType::New (); > >> > >> antiAliasFilter->SetInput(img); > >> > >> antiAliasFilter->SetNumberOfIterations(5); > >> > >> antiAliasFilter->SetMaximumRMSError(0.02); > >> > >> > >> antiAliasFilter->Update(); > >> > >> > >> // For increased code coverage. Does nothing. > >> > >> antiAliasFilter->GetMaximumRMSError(); > >> > >> > >> > >> > >> antiAliasFilter->Update(); > >> > >> > >> std::cout << "Maximum RMS change value threshold was: 0.02 " << > std::endl; > >> > >> std::cout << "Last RMS change value was: " << > >> antiAliasFilter->GetRMSChange() << std::endl; > >> > >> > >> std::cout<< antiAliasFilter->GetElapsedIterations() < >> > >> > >> std::cout<GetLowerBinaryValue()<<" "<< > >> antiAliasFilter->GetUpperBinaryValue()< >> > >> > >> OutputImagePointerType out=antiAliasFilter->GetOutput(); > >> > >> > >> ImageUtils::writeImage(outFile,out); > >> > >> > >> return 1; > >> > >> } > >> > >> > >> I tried different values for maxIter (1,2,3,4,5,10,100,1000) and > maxRMSError > >> (0.02 0.07 0.08 0.8), and the best visual results are achieved after one > >> iteration where RMSE changes by about 0.08. This increases for all > following > >> iterations, which have an RMSE-change of about 0.25 for all number of > >> iterations tested. All this is using ITK 4.5 pulled from the GIT > repository > >> a while ago, running on an intel i7 on Debian. > >> > >> Thanks a lot! > >> Tobias > >> > >>> > >>> > >>> On Mon, Aug 11, 2014 at 12:18 PM, Tobias Gass > >>> wrote: > >>> > Dear all, > >>> > > >>> > I'm having problems using the anti-alias filter, which I want to use > in > >>> > order to smooth a binary segmentation volume. I'm using essentially > the > >>> > example code from the repository, which for my input file seems to > start > >>> > oscillating after 2 iterations, leading to weird 'pointy' artifacts > on > >>> > the > >>> > surface as can be seen from the attached screenshot (AA filter > output is > >>> > on > >>> > the left, input on the right). > >>> > > >>> > Is there any parameter to set/implement which could improve the > behavior > >>> > of > >>> > this filter? I'm assuming that my input is reasonable, or is this > >>> > something > >>> > the filter is expected to have problems with? It is notable that such > >>> > errors > >>> > seem to mainly appear in 'flat' regions of the volume, and are not > >>> > apparent > >>> > in the curved shaft of the bone. > >>> > > >>> > Any help, or pointers to further resources are appreciated, > >>> > thanks, > >>> > Tobias > >>> > > >>> > _____________________________________ > >>> > Powered by www.kitware.com > >>> > > >>> > Visit other Kitware open-source projects at > >>> > http://www.kitware.com/opensource/opensource.html > >>> > > >>> > Kitware offers ITK Training Courses, for more information visit: > >>> > http://www.kitware.com/products/protraining.php > >>> > > >>> > Please keep messages on-topic and check the ITK FAQ at: > >>> > http://www.itk.org/Wiki/ITK_FAQ > >>> > > >>> > Follow this link to subscribe/unsubscribe: > >>> > http://public.kitware.com/mailman/listinfo/insight-users > >>> > > >>> > >>> > >>> > >>> -- > >>> Unpaid intern in BillsBasement at noware dot com > >> > >> > > > > > > > > -- > > Unpaid intern in BillsBasement at noware dot com > > > > -- > Unpaid intern in BillsBasement at noware dot com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bill.lorensen at gmail.com Mon Aug 11 16:17:10 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Mon, 11 Aug 2014 16:17:10 -0400 Subject: [ITK-users] Anti-alias filter In-Reply-To: References: Message-ID: Paraview should do the right thing. On Mon, Aug 11, 2014 at 3:38 PM, Tobias Gass wrote: > I will try that tomorrow morning (living in GMT+1). I used paraview to > extract the isosurface, but also looked at the output of the AA-filter > directly (which looked fuzzy). I can also post an image of that tomorrow. > > Thanks for your help! > Tobias > > > 2014-08-11 21:22 GMT+02:00 Bill Lorensen : > >> How are you extracting the final isosurface? >> >> On Mon, Aug 11, 2014 at 3:22 PM, Bill Lorensen >> wrote: >> > If you change >> > typedef short PixelType; >> > to >> > typedef double PixelType; >> > >> > do the results change. >> > >> > >> > On Mon, Aug 11, 2014 at 2:47 PM, Tobias Gass >> > wrote: >> >> >> >>> Can you post your code. The results do not look correct. >> >> >> >> >> >> Sure. The {write,read}Image functions are just convenient wrappers for >> >> the >> >> respective ITK tools. >> >> >> >> >> >> #include >> >> >> >> #include >> >> >> >> #include "argstream.h" >> >> >> >> #include "ImageUtils.h" >> >> >> >> #include "itkAntiAliasBinaryImageFilter.h" >> >> >> >> using namespace std; >> >> >> >> using namespace itk; >> >> >> >> >> >> >> >> >> >> int main(int argc, char ** argv) >> >> >> >> { >> >> >> >> >> >> feenableexcept(FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW); >> >> >> >> typedef short PixelType; >> >> >> >> typedef double OutputPixelType; >> >> >> >> const unsigned int D=3; >> >> >> >> typedef Image ImageType; >> >> >> >> >> >> >> >> typedef ImageType::Pointer ImagePointerType; >> >> >> >> >> >> >> >> typedef Image OutputImageType; >> >> >> >> typedef OutputImageType::Pointer OutputImagePointerType; >> >> >> >> >> >> >> >> argstream * as=new argstream(argc,argv); >> >> >> >> string inFile, outFile; >> >> >> >> double thresh=0.0; >> >> >> >> (*as) >> parameter ("in", inFile, " filename...", true); >> >> >> >> (*as) >> parameter ("out", outFile, " filename...", true); >> >> >> >> >> >> (*as) >> help(); >> >> >> >> as->defaultErrorHandling(); >> >> >> >> >> >> ImagePointerType img = ImageUtils::readImage(inFile); >> >> >> >> >> >> typedef itk::AntiAliasBinaryImageFilter > >> OutputImageType> >> >> >> >> AntiAliasBinaryImageFilterType; >> >> >> >> >> >> >> >> AntiAliasBinaryImageFilterType::Pointer antiAliasFilter >> >> >> >> = AntiAliasBinaryImageFilterType::New (); >> >> >> >> antiAliasFilter->SetInput(img); >> >> >> >> antiAliasFilter->SetNumberOfIterations(5); >> >> >> >> antiAliasFilter->SetMaximumRMSError(0.02); >> >> >> >> >> >> antiAliasFilter->Update(); >> >> >> >> >> >> // For increased code coverage. Does nothing. >> >> >> >> antiAliasFilter->GetMaximumRMSError(); >> >> >> >> >> >> >> >> >> >> antiAliasFilter->Update(); >> >> >> >> >> >> std::cout << "Maximum RMS change value threshold was: 0.02 " << >> >> std::endl; >> >> >> >> std::cout << "Last RMS change value was: " << >> >> antiAliasFilter->GetRMSChange() << std::endl; >> >> >> >> >> >> std::cout<< antiAliasFilter->GetElapsedIterations() <> >> >> >> >> >> std::cout<GetLowerBinaryValue()<<" "<< >> >> antiAliasFilter->GetUpperBinaryValue()<> >> >> >> >> >> OutputImagePointerType out=antiAliasFilter->GetOutput(); >> >> >> >> >> >> ImageUtils::writeImage(outFile,out); >> >> >> >> >> >> return 1; >> >> >> >> } >> >> >> >> >> >> I tried different values for maxIter (1,2,3,4,5,10,100,1000) and >> >> maxRMSError >> >> (0.02 0.07 0.08 0.8), and the best visual results are achieved after >> >> one >> >> iteration where RMSE changes by about 0.08. This increases for all >> >> following >> >> iterations, which have an RMSE-change of about 0.25 for all number of >> >> iterations tested. All this is using ITK 4.5 pulled from the GIT >> >> repository >> >> a while ago, running on an intel i7 on Debian. >> >> >> >> Thanks a lot! >> >> Tobias >> >> >> >>> >> >>> >> >>> On Mon, Aug 11, 2014 at 12:18 PM, Tobias Gass >> >>> wrote: >> >>> > Dear all, >> >>> > >> >>> > I'm having problems using the anti-alias filter, which I want to use >> >>> > in >> >>> > order to smooth a binary segmentation volume. I'm using essentially >> >>> > the >> >>> > example code from the repository, which for my input file seems to >> >>> > start >> >>> > oscillating after 2 iterations, leading to weird 'pointy' artifacts >> >>> > on >> >>> > the >> >>> > surface as can be seen from the attached screenshot (AA filter >> >>> > output is >> >>> > on >> >>> > the left, input on the right). >> >>> > >> >>> > Is there any parameter to set/implement which could improve the >> >>> > behavior >> >>> > of >> >>> > this filter? I'm assuming that my input is reasonable, or is this >> >>> > something >> >>> > the filter is expected to have problems with? It is notable that >> >>> > such >> >>> > errors >> >>> > seem to mainly appear in 'flat' regions of the volume, and are not >> >>> > apparent >> >>> > in the curved shaft of the bone. >> >>> > >> >>> > Any help, or pointers to further resources are appreciated, >> >>> > thanks, >> >>> > Tobias >> >>> > >> >>> > _____________________________________ >> >>> > Powered by www.kitware.com >> >>> > >> >>> > Visit other Kitware open-source projects at >> >>> > http://www.kitware.com/opensource/opensource.html >> >>> > >> >>> > Kitware offers ITK Training Courses, for more information visit: >> >>> > http://www.kitware.com/products/protraining.php >> >>> > >> >>> > Please keep messages on-topic and check the ITK FAQ at: >> >>> > http://www.itk.org/Wiki/ITK_FAQ >> >>> > >> >>> > Follow this link to subscribe/unsubscribe: >> >>> > http://public.kitware.com/mailman/listinfo/insight-users >> >>> > >> >>> >> >>> >> >>> >> >>> -- >> >>> Unpaid intern in BillsBasement at noware dot com >> >> >> >> >> > >> > >> > >> > -- >> > Unpaid intern in BillsBasement at noware dot com >> >> >> >> -- >> Unpaid intern in BillsBasement at noware dot com > > -- Unpaid intern in BillsBasement at noware dot com From grothausmann.roman at mh-hannover.de Tue Aug 12 04:14:37 2014 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Tue, 12 Aug 2014 10:14:37 +0200 Subject: [ITK-users] [ITK] adding a global hierarchical watershed segmentation mode to itksnap In-Reply-To: <0f32755d9980441ca0162728b088f00b@queensu.ca> References: <53E85181.8040607@mh-hannover.de> <0f32755d9980441ca0162728b088f00b@queensu.ca> Message-ID: <53E9CCED.1000604@mh-hannover.de> Hi Andras, Many thanks for Your hints. We'll test them on our data. However, our data is not as standardized in quality as CT or MRT data and from our experience many of the "magic" segmentations demonstrated on CT or MRT data does not work on our data. However, of all the segmentation modules I could find in Slicer or elsewhere none was based on a hierarchical watershed algorithm like the SegmentationEditor of the InsightApplications. Is there any other that I've missed? Concerning my idea to implement this if no tool currently already exists: Would such an extension be of more use in Slicer or itksnap? For which of the both would it likely be easier to integrate the extension? Best wishes Roman On 11/08/14 16:20, Andras Lasso wrote: > Have you tried segmentation tools in 3D Slicer? There is a multi-label watershed > segmentation tool that works in 3d > (http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/Editor#WatershedFromMarkers), > there are also a number of other generic semi-automatic segmentation tools (such > as GrowCut) and a few fully-automatic specialized tools (for brain, > airways, etc). Download the nightly build and also checkout the Segmentation > category in the Extension Manager. > > Andras > > *From:* Dr. Roman Grothausmann > *Sent:* ?Monday?, ?August? ?11?, ?2014 ?1?:?15? ?AM > *To:* itksnap-users at googlegroups.com > *Cc:* ITK Mailing List > > Dear mailing list members, > > > For a long time now I've been searching for a replacement of the old > SegmentationEditor (part of the InsightApplications) which I could not get to > work even with older ITK-3.x. Somewhere I was told that it was integrated and > maintained within itksnap. However the only tool in itksnap based on watershed > segmentation seems to be the adaptive brush. It is very handy, but > time-consuming in 3D and only for local segmentations. In contrast the > SegmentationEditor used a global hierarchical watershed segmentation to pick > labels from, see e.g. the video linked here: > http://www.insight-journal.org/browse/publication/70 > Quite often now I've stumbled over data, that would likely have profited a lot > of such a tool for segmentation. > > If such a tool working with ITK-4.x does not exist any more, I thought of > implementing it as a global WS segmentation mode in itksnap. That way making the > tool easier to find, to use and to ensure maintenance (should it be integrated > into the itksnap code base in the end) and also avoiding recoding a GUI with > mouse interaction and such. > > My current idea is to start, similar to the snake-tool, with pre-filtering like > smoothing and optional edge-detection. > Then the main edit mode to consist of the usual 4 subwindows showing an overlay > of the grey-image and the watershed segmentation of the hierarchical WS-filter > (hWS), side-by-side to another label-dataset (loaded like a tiled overlay) which > consist of the actually chosen labels from the hWS as the final data (FD). > The interaction I'm considering would be to LMB click on a label in the hWS > which is then added to the FD as the current fg label, or removed with a RMB. > The hierachrchy level of the hWS could be controlled by a slider or the mouse > wheel + Shift in nearly real time if some region demands higher or lower > detailed segmentation. When the fg label is changed, the segmentation added or > removed with further mouse interactions would modify the new fg label. > When all is done and the global WS mode is left, the FD label-dataset is added > to the main segmentation of itksnap. > > Would that be possible to implement in itksnap 3.x? > What source files of the itksnap code base should I look at for: > - the pre-filtering mode of the snake (for the smoothing and edge detection) > - the mouse interactions (for e.g. adding the whell + Shift interaction) > - possible examples for the dual layout > > Thanks for any comments, help or hints. > Roman > > -- > Dr. Roman Grothausmann > > Tomographie und Digitale Bildverarbeitung > Tomography and Digital Image Analysis > > Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 > Medizinische Hochschule Hannover > Carl-Neuberg-Str. 1 > D-30625 Hannover > > Tel. +49 511 532-9574 > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community -- 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 gass at vision.ee.ethz.ch Tue Aug 12 04:44:22 2014 From: gass at vision.ee.ethz.ch (Tobias Gass) Date: Tue, 12 Aug 2014 10:44:22 +0200 Subject: [ITK-users] Anti-alias filter In-Reply-To: References: Message-ID: Hi, changing the PixelType did not yield any change. However, I did some further tests which seem to point at image spacing or total size to be the culprit. My original image is fairly high-res, with 0.25mm in-plane resolution and 0.75mm slice thickness and 512x512x409 voxel size. I tried resampling the image to different isotropic resolutions (0.25, 0.3, 0.34, 0.35, 0.4, 0.5, 0.75, 1)mm isotropic spacing. For all spacings down to 0.35mm, the AA filter converged nicely and the output looks as I'd expect it. Lower than 0.35mm spacing, and it fails in the way I described (from this spacing on the #vox is equal or greater than the #voxels in my original image). Any idea what might cause this, or what to further investigate? Thanks, Tobias 2014-08-11 22:17 GMT+02:00 Bill Lorensen : > Paraview should do the right thing. > > On Mon, Aug 11, 2014 at 3:38 PM, Tobias Gass > wrote: > > I will try that tomorrow morning (living in GMT+1). I used paraview to > > extract the isosurface, but also looked at the output of the AA-filter > > directly (which looked fuzzy). I can also post an image of that tomorrow. > > > > Thanks for your help! > > Tobias > > > > > > 2014-08-11 21:22 GMT+02:00 Bill Lorensen : > > > >> How are you extracting the final isosurface? > >> > >> On Mon, Aug 11, 2014 at 3:22 PM, Bill Lorensen > > >> wrote: > >> > If you change > >> > typedef short PixelType; > >> > to > >> > typedef double PixelType; > >> > > >> > do the results change. > >> > > >> > > >> > On Mon, Aug 11, 2014 at 2:47 PM, Tobias Gass > >> > wrote: > >> >> > >> >>> Can you post your code. The results do not look correct. > >> >> > >> >> > >> >> Sure. The {write,read}Image functions are just convenient wrappers > for > >> >> the > >> >> respective ITK tools. > >> >> > >> >> > >> >> #include > >> >> > >> >> #include > >> >> > >> >> #include "argstream.h" > >> >> > >> >> #include "ImageUtils.h" > >> >> > >> >> #include "itkAntiAliasBinaryImageFilter.h" > >> >> > >> >> using namespace std; > >> >> > >> >> using namespace itk; > >> >> > >> >> > >> >> > >> >> > >> >> int main(int argc, char ** argv) > >> >> > >> >> { > >> >> > >> >> > >> >> feenableexcept(FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW); > >> >> > >> >> typedef short PixelType; > >> >> > >> >> typedef double OutputPixelType; > >> >> > >> >> const unsigned int D=3; > >> >> > >> >> typedef Image ImageType; > >> >> > >> >> > >> >> > >> >> typedef ImageType::Pointer ImagePointerType; > >> >> > >> >> > >> >> > >> >> typedef Image OutputImageType; > >> >> > >> >> typedef OutputImageType::Pointer OutputImagePointerType; > >> >> > >> >> > >> >> > >> >> argstream * as=new argstream(argc,argv); > >> >> > >> >> string inFile, outFile; > >> >> > >> >> double thresh=0.0; > >> >> > >> >> (*as) >> parameter ("in", inFile, " filename...", true); > >> >> > >> >> (*as) >> parameter ("out", outFile, " filename...", true); > >> >> > >> >> > >> >> (*as) >> help(); > >> >> > >> >> as->defaultErrorHandling(); > >> >> > >> >> > >> >> ImagePointerType img = ImageUtils::readImage(inFile); > >> >> > >> >> > >> >> typedef itk::AntiAliasBinaryImageFilter >> >> OutputImageType> > >> >> > >> >> AntiAliasBinaryImageFilterType; > >> >> > >> >> > >> >> > >> >> AntiAliasBinaryImageFilterType::Pointer antiAliasFilter > >> >> > >> >> = AntiAliasBinaryImageFilterType::New (); > >> >> > >> >> antiAliasFilter->SetInput(img); > >> >> > >> >> antiAliasFilter->SetNumberOfIterations(5); > >> >> > >> >> antiAliasFilter->SetMaximumRMSError(0.02); > >> >> > >> >> > >> >> antiAliasFilter->Update(); > >> >> > >> >> > >> >> // For increased code coverage. Does nothing. > >> >> > >> >> antiAliasFilter->GetMaximumRMSError(); > >> >> > >> >> > >> >> > >> >> > >> >> antiAliasFilter->Update(); > >> >> > >> >> > >> >> std::cout << "Maximum RMS change value threshold was: 0.02 " << > >> >> std::endl; > >> >> > >> >> std::cout << "Last RMS change value was: " << > >> >> antiAliasFilter->GetRMSChange() << std::endl; > >> >> > >> >> > >> >> std::cout<< antiAliasFilter->GetElapsedIterations() < >> >> > >> >> > >> >> std::cout<GetLowerBinaryValue()<<" "<< > >> >> antiAliasFilter->GetUpperBinaryValue()< >> >> > >> >> > >> >> OutputImagePointerType out=antiAliasFilter->GetOutput(); > >> >> > >> >> > >> >> ImageUtils::writeImage(outFile,out); > >> >> > >> >> > >> >> return 1; > >> >> > >> >> } > >> >> > >> >> > >> >> I tried different values for maxIter (1,2,3,4,5,10,100,1000) and > >> >> maxRMSError > >> >> (0.02 0.07 0.08 0.8), and the best visual results are achieved after > >> >> one > >> >> iteration where RMSE changes by about 0.08. This increases for all > >> >> following > >> >> iterations, which have an RMSE-change of about 0.25 for all number of > >> >> iterations tested. All this is using ITK 4.5 pulled from the GIT > >> >> repository > >> >> a while ago, running on an intel i7 on Debian. > >> >> > >> >> Thanks a lot! > >> >> Tobias > >> >> > >> >>> > >> >>> > >> >>> On Mon, Aug 11, 2014 at 12:18 PM, Tobias Gass < > gass at vision.ee.ethz.ch> > >> >>> wrote: > >> >>> > Dear all, > >> >>> > > >> >>> > I'm having problems using the anti-alias filter, which I want to > use > >> >>> > in > >> >>> > order to smooth a binary segmentation volume. I'm using > essentially > >> >>> > the > >> >>> > example code from the repository, which for my input file seems to > >> >>> > start > >> >>> > oscillating after 2 iterations, leading to weird 'pointy' > artifacts > >> >>> > on > >> >>> > the > >> >>> > surface as can be seen from the attached screenshot (AA filter > >> >>> > output is > >> >>> > on > >> >>> > the left, input on the right). > >> >>> > > >> >>> > Is there any parameter to set/implement which could improve the > >> >>> > behavior > >> >>> > of > >> >>> > this filter? I'm assuming that my input is reasonable, or is this > >> >>> > something > >> >>> > the filter is expected to have problems with? It is notable that > >> >>> > such > >> >>> > errors > >> >>> > seem to mainly appear in 'flat' regions of the volume, and are not > >> >>> > apparent > >> >>> > in the curved shaft of the bone. > >> >>> > > >> >>> > Any help, or pointers to further resources are appreciated, > >> >>> > thanks, > >> >>> > Tobias > >> >>> > > >> >>> > _____________________________________ > >> >>> > Powered by www.kitware.com > >> >>> > > >> >>> > Visit other Kitware open-source projects at > >> >>> > http://www.kitware.com/opensource/opensource.html > >> >>> > > >> >>> > Kitware offers ITK Training Courses, for more information visit: > >> >>> > http://www.kitware.com/products/protraining.php > >> >>> > > >> >>> > Please keep messages on-topic and check the ITK FAQ at: > >> >>> > http://www.itk.org/Wiki/ITK_FAQ > >> >>> > > >> >>> > Follow this link to subscribe/unsubscribe: > >> >>> > http://public.kitware.com/mailman/listinfo/insight-users > >> >>> > > >> >>> > >> >>> > >> >>> > >> >>> -- > >> >>> Unpaid intern in BillsBasement at noware dot com > >> >> > >> >> > >> > > >> > > >> > > >> > -- > >> > Unpaid intern in BillsBasement at noware dot com > >> > >> > >> > >> -- > >> Unpaid intern in BillsBasement at noware dot com > > > > > > > > -- > Unpaid intern in BillsBasement at noware dot 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 gass at vision.ee.ethz.ch Tue Aug 12 08:33:14 2014 From: gass at vision.ee.ethz.ch (Tobias Gass) Date: Tue, 12 Aug 2014 14:33:14 +0200 Subject: [ITK-users] Anti-alias filter In-Reply-To: References: Message-ID: Update: meanwhile I also tried cropping the image to investigate the impact of the overall size (#voxels) of the image. It appears to not have an effect, the same artifacts occur when processing a significantly smaller region (1/2 size). 2014-08-12 10:44 GMT+02:00 Tobias Gass : > Hi, > > changing the PixelType did not yield any change. However, I did some > further tests which seem to point at image spacing or total size to be the > culprit. My original image is fairly high-res, with 0.25mm in-plane > resolution and 0.75mm slice thickness and 512x512x409 voxel size. I tried > resampling the image to different isotropic resolutions (0.25, 0.3, 0.34, > 0.35, 0.4, 0.5, 0.75, 1)mm isotropic spacing. For all spacings down to > 0.35mm, the AA filter converged nicely and the output looks as I'd expect > it. Lower than 0.35mm spacing, and it fails in the way I described (from > this spacing on the #vox is equal or greater than the #voxels in my > original image). > > Any idea what might cause this, or what to further investigate? > > Thanks, > Tobias > > > 2014-08-11 22:17 GMT+02:00 Bill Lorensen : > > Paraview should do the right thing. >> >> On Mon, Aug 11, 2014 at 3:38 PM, Tobias Gass >> wrote: >> > I will try that tomorrow morning (living in GMT+1). I used paraview to >> > extract the isosurface, but also looked at the output of the AA-filter >> > directly (which looked fuzzy). I can also post an image of that >> tomorrow. >> > >> > Thanks for your help! >> > Tobias >> > >> > >> > 2014-08-11 21:22 GMT+02:00 Bill Lorensen : >> > >> >> How are you extracting the final isosurface? >> >> >> >> On Mon, Aug 11, 2014 at 3:22 PM, Bill Lorensen < >> bill.lorensen at gmail.com> >> >> wrote: >> >> > If you change >> >> > typedef short PixelType; >> >> > to >> >> > typedef double PixelType; >> >> > >> >> > do the results change. >> >> > >> >> > >> >> > On Mon, Aug 11, 2014 at 2:47 PM, Tobias Gass > > >> >> > wrote: >> >> >> >> >> >>> Can you post your code. The results do not look correct. >> >> >> >> >> >> >> >> >> Sure. The {write,read}Image functions are just convenient wrappers >> for >> >> >> the >> >> >> respective ITK tools. >> >> >> >> >> >> >> >> >> #include >> >> >> >> >> >> #include >> >> >> >> >> >> #include "argstream.h" >> >> >> >> >> >> #include "ImageUtils.h" >> >> >> >> >> >> #include "itkAntiAliasBinaryImageFilter.h" >> >> >> >> >> >> using namespace std; >> >> >> >> >> >> using namespace itk; >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> int main(int argc, char ** argv) >> >> >> >> >> >> { >> >> >> >> >> >> >> >> >> feenableexcept(FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW); >> >> >> >> >> >> typedef short PixelType; >> >> >> >> >> >> typedef double OutputPixelType; >> >> >> >> >> >> const unsigned int D=3; >> >> >> >> >> >> typedef Image ImageType; >> >> >> >> >> >> >> >> >> >> >> >> typedef ImageType::Pointer ImagePointerType; >> >> >> >> >> >> >> >> >> >> >> >> typedef Image OutputImageType; >> >> >> >> >> >> typedef OutputImageType::Pointer OutputImagePointerType; >> >> >> >> >> >> >> >> >> >> >> >> argstream * as=new argstream(argc,argv); >> >> >> >> >> >> string inFile, outFile; >> >> >> >> >> >> double thresh=0.0; >> >> >> >> >> >> (*as) >> parameter ("in", inFile, " filename...", true); >> >> >> >> >> >> (*as) >> parameter ("out", outFile, " filename...", true); >> >> >> >> >> >> >> >> >> (*as) >> help(); >> >> >> >> >> >> as->defaultErrorHandling(); >> >> >> >> >> >> >> >> >> ImagePointerType img = ImageUtils::readImage(inFile); >> >> >> >> >> >> >> >> >> typedef itk::AntiAliasBinaryImageFilter > >> >> OutputImageType> >> >> >> >> >> >> AntiAliasBinaryImageFilterType; >> >> >> >> >> >> >> >> >> >> >> >> AntiAliasBinaryImageFilterType::Pointer antiAliasFilter >> >> >> >> >> >> = AntiAliasBinaryImageFilterType::New (); >> >> >> >> >> >> antiAliasFilter->SetInput(img); >> >> >> >> >> >> antiAliasFilter->SetNumberOfIterations(5); >> >> >> >> >> >> antiAliasFilter->SetMaximumRMSError(0.02); >> >> >> >> >> >> >> >> >> antiAliasFilter->Update(); >> >> >> >> >> >> >> >> >> // For increased code coverage. Does nothing. >> >> >> >> >> >> antiAliasFilter->GetMaximumRMSError(); >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> antiAliasFilter->Update(); >> >> >> >> >> >> >> >> >> std::cout << "Maximum RMS change value threshold was: 0.02 " << >> >> >> std::endl; >> >> >> >> >> >> std::cout << "Last RMS change value was: " << >> >> >> antiAliasFilter->GetRMSChange() << std::endl; >> >> >> >> >> >> >> >> >> std::cout<< antiAliasFilter->GetElapsedIterations() <> >> >> >> >> >> >> >> >> std::cout<GetLowerBinaryValue()<<" "<< >> >> >> antiAliasFilter->GetUpperBinaryValue()<> >> >> >> >> >> >> >> >> OutputImagePointerType out=antiAliasFilter->GetOutput(); >> >> >> >> >> >> >> >> >> ImageUtils::writeImage(outFile,out); >> >> >> >> >> >> >> >> >> return 1; >> >> >> >> >> >> } >> >> >> >> >> >> >> >> >> I tried different values for maxIter (1,2,3,4,5,10,100,1000) and >> >> >> maxRMSError >> >> >> (0.02 0.07 0.08 0.8), and the best visual results are achieved after >> >> >> one >> >> >> iteration where RMSE changes by about 0.08. This increases for all >> >> >> following >> >> >> iterations, which have an RMSE-change of about 0.25 for all number >> of >> >> >> iterations tested. All this is using ITK 4.5 pulled from the GIT >> >> >> repository >> >> >> a while ago, running on an intel i7 on Debian. >> >> >> >> >> >> Thanks a lot! >> >> >> Tobias >> >> >> >> >> >>> >> >> >>> >> >> >>> On Mon, Aug 11, 2014 at 12:18 PM, Tobias Gass < >> gass at vision.ee.ethz.ch> >> >> >>> wrote: >> >> >>> > Dear all, >> >> >>> > >> >> >>> > I'm having problems using the anti-alias filter, which I want to >> use >> >> >>> > in >> >> >>> > order to smooth a binary segmentation volume. I'm using >> essentially >> >> >>> > the >> >> >>> > example code from the repository, which for my input file seems >> to >> >> >>> > start >> >> >>> > oscillating after 2 iterations, leading to weird 'pointy' >> artifacts >> >> >>> > on >> >> >>> > the >> >> >>> > surface as can be seen from the attached screenshot (AA filter >> >> >>> > output is >> >> >>> > on >> >> >>> > the left, input on the right). >> >> >>> > >> >> >>> > Is there any parameter to set/implement which could improve the >> >> >>> > behavior >> >> >>> > of >> >> >>> > this filter? I'm assuming that my input is reasonable, or is this >> >> >>> > something >> >> >>> > the filter is expected to have problems with? It is notable that >> >> >>> > such >> >> >>> > errors >> >> >>> > seem to mainly appear in 'flat' regions of the volume, and are >> not >> >> >>> > apparent >> >> >>> > in the curved shaft of the bone. >> >> >>> > >> >> >>> > Any help, or pointers to further resources are appreciated, >> >> >>> > thanks, >> >> >>> > Tobias >> >> >>> > >> >> >>> > _____________________________________ >> >> >>> > Powered by www.kitware.com >> >> >>> > >> >> >>> > Visit other Kitware open-source projects at >> >> >>> > http://www.kitware.com/opensource/opensource.html >> >> >>> > >> >> >>> > Kitware offers ITK Training Courses, for more information visit: >> >> >>> > http://www.kitware.com/products/protraining.php >> >> >>> > >> >> >>> > Please keep messages on-topic and check the ITK FAQ at: >> >> >>> > http://www.itk.org/Wiki/ITK_FAQ >> >> >>> > >> >> >>> > Follow this link to subscribe/unsubscribe: >> >> >>> > http://public.kitware.com/mailman/listinfo/insight-users >> >> >>> > >> >> >>> >> >> >>> >> >> >>> >> >> >>> -- >> >> >>> Unpaid intern in BillsBasement at noware dot com >> >> >> >> >> >> >> >> > >> >> > >> >> > >> >> > -- >> >> > Unpaid intern in BillsBasement at noware dot com >> >> >> >> >> >> >> >> -- >> >> Unpaid intern in BillsBasement at noware dot com >> > >> > >> >> >> >> -- >> Unpaid intern in BillsBasement at noware dot 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 lasso at queensu.ca Tue Aug 12 08:42:31 2014 From: lasso at queensu.ca (Andras Lasso) Date: Tue, 12 Aug 2014 12:42:31 +0000 Subject: [ITK-users] [ITK] adding a global hierarchical watershed segmentation mode to itksnap In-Reply-To: <53E9CCED.1000604@mh-hannover.de> References: <53E85181.8040607@mh-hannover.de> <0f32755d9980441ca0162728b088f00b@queensu.ca> <53E9CCED.1000604@mh-hannover.de> Message-ID: Hi Roman, Try GrowCut segmentation. You paint a few strokes inside and outside your target(s) on one or a few slices and you may get a nice sementation. Using the FastGrowCut version you can edit/refine your inputs and as it is GPU-accelerated, it's fast (initial segmentation may take 20-30 seconds on a high-resolution volume but then the updates take just a few seconds). I've just used ITKSnap a couple of times, so I don't know it much. Slicer is a large, more comprehensive application framework, with a large user and developer community. You can add new segmentation methods to Slicer by writing a Python script that can use VTK, ITK, numpy, etc. No developer tools are needed, no need to compile anything, just download Slicer and you are ready to go. Of course you can also develop in C++, if you prefer; and if you download Eclipse then you can do step-by-step debugging of your Python module in Slicer, etc. You can share your module with others by uploading it to the extension manager (Slicer app store). More info: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers. Andras -----Original Message----- From: Dr. Roman Grothausmann [mailto:grothausmann.roman at mh-hannover.de] Sent: Tuesday, August 12, 2014 4:15 AM To: Andras Lasso Cc: itksnap-users at googlegroups.com; ITK Mailing List Subject: Re: [ITK] [ITK-users] adding a global hierarchical watershed segmentation mode to itksnap Hi Andras, Many thanks for Your hints. We'll test them on our data. However, our data is not as standardized in quality as CT or MRT data and from our experience many of the "magic" segmentations demonstrated on CT or MRT data does not work on our data. However, of all the segmentation modules I could find in Slicer or elsewhere none was based on a hierarchical watershed algorithm like the SegmentationEditor of the InsightApplications. Is there any other that I've missed? Concerning my idea to implement this if no tool currently already exists: Would such an extension be of more use in Slicer or itksnap? For which of the both would it likely be easier to integrate the extension? Best wishes Roman On 11/08/14 16:20, Andras Lasso wrote: > Have you tried segmentation tools in 3D Slicer? There is a multi-label > watershed segmentation tool that works in 3d > (http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modu > les/Editor#WatershedFromMarkers), there are also a number of other > generic semi-automatic segmentation tools (such as GrowCut) and a few > fully-automatic specialized tools (for brain, airways, etc). Download > the nightly build and also checkout the Segmentation category in the > Extension Manager. > > Andras > > *From:* Dr. Roman Grothausmann > > *Sent:* ?Monday?, ?August? ?11?, ?2014 ?1?:?15? ?AM > *To:* itksnap-users at googlegroups.com > > *Cc:* ITK Mailing List > > Dear mailing list members, > > > For a long time now I've been searching for a replacement of the old > SegmentationEditor (part of the InsightApplications) which I could not > get to work even with older ITK-3.x. Somewhere I was told that it was > integrated and maintained within itksnap. However the only tool in > itksnap based on watershed segmentation seems to be the adaptive > brush. It is very handy, but time-consuming in 3D and only for local > segmentations. In contrast the SegmentationEditor used a global > hierarchical watershed segmentation to pick labels from, see e.g. the video linked here: > http://www.insight-journal.org/browse/publication/70 > Quite often now I've stumbled over data, that would likely have > profited a lot of such a tool for segmentation. > > If such a tool working with ITK-4.x does not exist any more, I thought > of implementing it as a global WS segmentation mode in itksnap. That > way making the tool easier to find, to use and to ensure maintenance > (should it be integrated into the itksnap code base in the end) and > also avoiding recoding a GUI with mouse interaction and such. > > My current idea is to start, similar to the snake-tool, with > pre-filtering like smoothing and optional edge-detection. > Then the main edit mode to consist of the usual 4 subwindows showing > an overlay of the grey-image and the watershed segmentation of the > hierarchical WS-filter (hWS), side-by-side to another label-dataset > (loaded like a tiled overlay) which consist of the actually chosen labels from the hWS as the final data (FD). > The interaction I'm considering would be to LMB click on a label in > the hWS which is then added to the FD as the current fg label, or removed with a RMB. > The hierachrchy level of the hWS could be controlled by a slider or > the mouse wheel + Shift in nearly real time if some region demands > higher or lower detailed segmentation. When the fg label is changed, > the segmentation added or removed with further mouse interactions would modify the new fg label. > When all is done and the global WS mode is left, the FD label-dataset > is added to the main segmentation of itksnap. > > Would that be possible to implement in itksnap 3.x? > What source files of the itksnap code base should I look at for: > - the pre-filtering mode of the snake (for the smoothing and edge > detection) > - the mouse interactions (for e.g. adding the whell + Shift > interaction) > - possible examples for the dual layout > > Thanks for any comments, help or hints. > Roman > > -- > Dr. Roman Grothausmann > > Tomographie und Digitale Bildverarbeitung Tomography and Digital Image > Analysis > > Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 > Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 > D-30625 Hannover > > Tel. +49 511 532-9574 > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community -- 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 gass at vision.ee.ethz.ch Tue Aug 12 08:47:00 2014 From: gass at vision.ee.ethz.ch (Tobias Gass) Date: Tue, 12 Aug 2014 14:47:00 +0200 Subject: [ITK-users] Anti-alias filter In-Reply-To: References: Message-ID: Further update: when manually increasing the spacing of the input image (without resampling, thus not changing the size), the filter works well. This probably indicates numerical instability depending on image spacing somewhere in the code, which would probably be great if it could be fixed. Best, Tobias 2014-08-12 14:33 GMT+02:00 Tobias Gass : > Update: meanwhile I also tried cropping the image to investigate the > impact of the overall size (#voxels) of the image. It appears to not have > an effect, the same artifacts occur when processing a significantly smaller > region (1/2 size). > > > 2014-08-12 10:44 GMT+02:00 Tobias Gass : > > Hi, >> >> changing the PixelType did not yield any change. However, I did some >> further tests which seem to point at image spacing or total size to be the >> culprit. My original image is fairly high-res, with 0.25mm in-plane >> resolution and 0.75mm slice thickness and 512x512x409 voxel size. I tried >> resampling the image to different isotropic resolutions (0.25, 0.3, 0.34, >> 0.35, 0.4, 0.5, 0.75, 1)mm isotropic spacing. For all spacings down to >> 0.35mm, the AA filter converged nicely and the output looks as I'd expect >> it. Lower than 0.35mm spacing, and it fails in the way I described (from >> this spacing on the #vox is equal or greater than the #voxels in my >> original image). >> >> Any idea what might cause this, or what to further investigate? >> >> Thanks, >> Tobias >> >> >> 2014-08-11 22:17 GMT+02:00 Bill Lorensen : >> >> Paraview should do the right thing. >>> >>> On Mon, Aug 11, 2014 at 3:38 PM, Tobias Gass >>> wrote: >>> > I will try that tomorrow morning (living in GMT+1). I used paraview to >>> > extract the isosurface, but also looked at the output of the AA-filter >>> > directly (which looked fuzzy). I can also post an image of that >>> tomorrow. >>> > >>> > Thanks for your help! >>> > Tobias >>> > >>> > >>> > 2014-08-11 21:22 GMT+02:00 Bill Lorensen : >>> > >>> >> How are you extracting the final isosurface? >>> >> >>> >> On Mon, Aug 11, 2014 at 3:22 PM, Bill Lorensen < >>> bill.lorensen at gmail.com> >>> >> wrote: >>> >> > If you change >>> >> > typedef short PixelType; >>> >> > to >>> >> > typedef double PixelType; >>> >> > >>> >> > do the results change. >>> >> > >>> >> > >>> >> > On Mon, Aug 11, 2014 at 2:47 PM, Tobias Gass < >>> gass at vision.ee.ethz.ch> >>> >> > wrote: >>> >> >> >>> >> >>> Can you post your code. The results do not look correct. >>> >> >> >>> >> >> >>> >> >> Sure. The {write,read}Image functions are just convenient wrappers >>> for >>> >> >> the >>> >> >> respective ITK tools. >>> >> >> >>> >> >> >>> >> >> #include >>> >> >> >>> >> >> #include >>> >> >> >>> >> >> #include "argstream.h" >>> >> >> >>> >> >> #include "ImageUtils.h" >>> >> >> >>> >> >> #include "itkAntiAliasBinaryImageFilter.h" >>> >> >> >>> >> >> using namespace std; >>> >> >> >>> >> >> using namespace itk; >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> int main(int argc, char ** argv) >>> >> >> >>> >> >> { >>> >> >> >>> >> >> >>> >> >> feenableexcept(FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW); >>> >> >> >>> >> >> typedef short PixelType; >>> >> >> >>> >> >> typedef double OutputPixelType; >>> >> >> >>> >> >> const unsigned int D=3; >>> >> >> >>> >> >> typedef Image ImageType; >>> >> >> >>> >> >> >>> >> >> >>> >> >> typedef ImageType::Pointer ImagePointerType; >>> >> >> >>> >> >> >>> >> >> >>> >> >> typedef Image OutputImageType; >>> >> >> >>> >> >> typedef OutputImageType::Pointer OutputImagePointerType; >>> >> >> >>> >> >> >>> >> >> >>> >> >> argstream * as=new argstream(argc,argv); >>> >> >> >>> >> >> string inFile, outFile; >>> >> >> >>> >> >> double thresh=0.0; >>> >> >> >>> >> >> (*as) >> parameter ("in", inFile, " filename...", true); >>> >> >> >>> >> >> (*as) >> parameter ("out", outFile, " filename...", true); >>> >> >> >>> >> >> >>> >> >> (*as) >> help(); >>> >> >> >>> >> >> as->defaultErrorHandling(); >>> >> >> >>> >> >> >>> >> >> ImagePointerType img = >>> ImageUtils::readImage(inFile); >>> >> >> >>> >> >> >>> >> >> typedef itk::AntiAliasBinaryImageFilter >> >> >> OutputImageType> >>> >> >> >>> >> >> AntiAliasBinaryImageFilterType; >>> >> >> >>> >> >> >>> >> >> >>> >> >> AntiAliasBinaryImageFilterType::Pointer antiAliasFilter >>> >> >> >>> >> >> = AntiAliasBinaryImageFilterType::New (); >>> >> >> >>> >> >> antiAliasFilter->SetInput(img); >>> >> >> >>> >> >> antiAliasFilter->SetNumberOfIterations(5); >>> >> >> >>> >> >> antiAliasFilter->SetMaximumRMSError(0.02); >>> >> >> >>> >> >> >>> >> >> antiAliasFilter->Update(); >>> >> >> >>> >> >> >>> >> >> // For increased code coverage. Does nothing. >>> >> >> >>> >> >> antiAliasFilter->GetMaximumRMSError(); >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> antiAliasFilter->Update(); >>> >> >> >>> >> >> >>> >> >> std::cout << "Maximum RMS change value threshold was: 0.02 " << >>> >> >> std::endl; >>> >> >> >>> >> >> std::cout << "Last RMS change value was: " << >>> >> >> antiAliasFilter->GetRMSChange() << std::endl; >>> >> >> >>> >> >> >>> >> >> std::cout<< antiAliasFilter->GetElapsedIterations() <>> >> >> >>> >> >> >>> >> >> std::cout<GetLowerBinaryValue()<<" "<< >>> >> >> antiAliasFilter->GetUpperBinaryValue()<>> >> >> >>> >> >> >>> >> >> OutputImagePointerType out=antiAliasFilter->GetOutput(); >>> >> >> >>> >> >> >>> >> >> ImageUtils::writeImage(outFile,out); >>> >> >> >>> >> >> >>> >> >> return 1; >>> >> >> >>> >> >> } >>> >> >> >>> >> >> >>> >> >> I tried different values for maxIter (1,2,3,4,5,10,100,1000) and >>> >> >> maxRMSError >>> >> >> (0.02 0.07 0.08 0.8), and the best visual results are achieved >>> after >>> >> >> one >>> >> >> iteration where RMSE changes by about 0.08. This increases for all >>> >> >> following >>> >> >> iterations, which have an RMSE-change of about 0.25 for all number >>> of >>> >> >> iterations tested. All this is using ITK 4.5 pulled from the GIT >>> >> >> repository >>> >> >> a while ago, running on an intel i7 on Debian. >>> >> >> >>> >> >> Thanks a lot! >>> >> >> Tobias >>> >> >> >>> >> >>> >>> >> >>> >>> >> >>> On Mon, Aug 11, 2014 at 12:18 PM, Tobias Gass < >>> gass at vision.ee.ethz.ch> >>> >> >>> wrote: >>> >> >>> > Dear all, >>> >> >>> > >>> >> >>> > I'm having problems using the anti-alias filter, which I want >>> to use >>> >> >>> > in >>> >> >>> > order to smooth a binary segmentation volume. I'm using >>> essentially >>> >> >>> > the >>> >> >>> > example code from the repository, which for my input file seems >>> to >>> >> >>> > start >>> >> >>> > oscillating after 2 iterations, leading to weird 'pointy' >>> artifacts >>> >> >>> > on >>> >> >>> > the >>> >> >>> > surface as can be seen from the attached screenshot (AA filter >>> >> >>> > output is >>> >> >>> > on >>> >> >>> > the left, input on the right). >>> >> >>> > >>> >> >>> > Is there any parameter to set/implement which could improve the >>> >> >>> > behavior >>> >> >>> > of >>> >> >>> > this filter? I'm assuming that my input is reasonable, or is >>> this >>> >> >>> > something >>> >> >>> > the filter is expected to have problems with? It is notable that >>> >> >>> > such >>> >> >>> > errors >>> >> >>> > seem to mainly appear in 'flat' regions of the volume, and are >>> not >>> >> >>> > apparent >>> >> >>> > in the curved shaft of the bone. >>> >> >>> > >>> >> >>> > Any help, or pointers to further resources are appreciated, >>> >> >>> > thanks, >>> >> >>> > Tobias >>> >> >>> > >>> >> >>> > _____________________________________ >>> >> >>> > Powered by www.kitware.com >>> >> >>> > >>> >> >>> > Visit other Kitware open-source projects at >>> >> >>> > http://www.kitware.com/opensource/opensource.html >>> >> >>> > >>> >> >>> > Kitware offers ITK Training Courses, for more information visit: >>> >> >>> > http://www.kitware.com/products/protraining.php >>> >> >>> > >>> >> >>> > Please keep messages on-topic and check the ITK FAQ at: >>> >> >>> > http://www.itk.org/Wiki/ITK_FAQ >>> >> >>> > >>> >> >>> > Follow this link to subscribe/unsubscribe: >>> >> >>> > http://public.kitware.com/mailman/listinfo/insight-users >>> >> >>> > >>> >> >>> >>> >> >>> >>> >> >>> >>> >> >>> -- >>> >> >>> Unpaid intern in BillsBasement at noware dot com >>> >> >> >>> >> >> >>> >> > >>> >> > >>> >> > >>> >> > -- >>> >> > Unpaid intern in BillsBasement at noware dot com >>> >> >>> >> >>> >> >>> >> -- >>> >> Unpaid intern in BillsBasement at noware dot com >>> > >>> > >>> >>> >>> >>> -- >>> Unpaid intern in BillsBasement at noware dot 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 bill.lorensen at gmail.com Tue Aug 12 09:06:22 2014 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 12 Aug 2014 09:06:22 -0400 Subject: [ITK-users] Anti-alias filter In-Reply-To: References: Message-ID: Have you tried: UseImageSpacingOn(); On Tue, Aug 12, 2014 at 8:47 AM, Tobias Gass wrote: > Further update: when manually increasing the spacing of the input image > (without resampling, thus not changing the size), the filter works well. > This probably indicates numerical instability depending on image spacing > somewhere in the code, which would probably be great if it could be fixed. > > Best, > Tobias > > > 2014-08-12 14:33 GMT+02:00 Tobias Gass : > >> Update: meanwhile I also tried cropping the image to investigate the >> impact of the overall size (#voxels) of the image. It appears to not have an >> effect, the same artifacts occur when processing a significantly smaller >> region (1/2 size). >> >> >> 2014-08-12 10:44 GMT+02:00 Tobias Gass : >> >>> Hi, >>> >>> changing the PixelType did not yield any change. However, I did some >>> further tests which seem to point at image spacing or total size to be the >>> culprit. My original image is fairly high-res, with 0.25mm in-plane >>> resolution and 0.75mm slice thickness and 512x512x409 voxel size. I tried >>> resampling the image to different isotropic resolutions (0.25, 0.3, 0.34, >>> 0.35, 0.4, 0.5, 0.75, 1)mm isotropic spacing. For all spacings down to >>> 0.35mm, the AA filter converged nicely and the output looks as I'd expect >>> it. Lower than 0.35mm spacing, and it fails in the way I described (from >>> this spacing on the #vox is equal or greater than the #voxels in my original >>> image). >>> >>> Any idea what might cause this, or what to further investigate? >>> >>> Thanks, >>> Tobias >>> >>> >>> 2014-08-11 22:17 GMT+02:00 Bill Lorensen : >>> >>>> Paraview should do the right thing. >>>> >>>> On Mon, Aug 11, 2014 at 3:38 PM, Tobias Gass >>>> wrote: >>>> > I will try that tomorrow morning (living in GMT+1). I used paraview to >>>> > extract the isosurface, but also looked at the output of the AA-filter >>>> > directly (which looked fuzzy). I can also post an image of that >>>> > tomorrow. >>>> > >>>> > Thanks for your help! >>>> > Tobias >>>> > >>>> > >>>> > 2014-08-11 21:22 GMT+02:00 Bill Lorensen : >>>> > >>>> >> How are you extracting the final isosurface? >>>> >> >>>> >> On Mon, Aug 11, 2014 at 3:22 PM, Bill Lorensen >>>> >> >>>> >> wrote: >>>> >> > If you change >>>> >> > typedef short PixelType; >>>> >> > to >>>> >> > typedef double PixelType; >>>> >> > >>>> >> > do the results change. >>>> >> > >>>> >> > >>>> >> > On Mon, Aug 11, 2014 at 2:47 PM, Tobias Gass >>>> >> > >>>> >> > wrote: >>>> >> >> >>>> >> >>> Can you post your code. The results do not look correct. >>>> >> >> >>>> >> >> >>>> >> >> Sure. The {write,read}Image functions are just convenient wrappers >>>> >> >> for >>>> >> >> the >>>> >> >> respective ITK tools. >>>> >> >> >>>> >> >> >>>> >> >> #include >>>> >> >> >>>> >> >> #include >>>> >> >> >>>> >> >> #include "argstream.h" >>>> >> >> >>>> >> >> #include "ImageUtils.h" >>>> >> >> >>>> >> >> #include "itkAntiAliasBinaryImageFilter.h" >>>> >> >> >>>> >> >> using namespace std; >>>> >> >> >>>> >> >> using namespace itk; >>>> >> >> >>>> >> >> >>>> >> >> >>>> >> >> >>>> >> >> int main(int argc, char ** argv) >>>> >> >> >>>> >> >> { >>>> >> >> >>>> >> >> >>>> >> >> feenableexcept(FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW); >>>> >> >> >>>> >> >> typedef short PixelType; >>>> >> >> >>>> >> >> typedef double OutputPixelType; >>>> >> >> >>>> >> >> const unsigned int D=3; >>>> >> >> >>>> >> >> typedef Image ImageType; >>>> >> >> >>>> >> >> >>>> >> >> >>>> >> >> typedef ImageType::Pointer ImagePointerType; >>>> >> >> >>>> >> >> >>>> >> >> >>>> >> >> typedef Image OutputImageType; >>>> >> >> >>>> >> >> typedef OutputImageType::Pointer OutputImagePointerType; >>>> >> >> >>>> >> >> >>>> >> >> >>>> >> >> argstream * as=new argstream(argc,argv); >>>> >> >> >>>> >> >> string inFile, outFile; >>>> >> >> >>>> >> >> double thresh=0.0; >>>> >> >> >>>> >> >> (*as) >> parameter ("in", inFile, " filename...", true); >>>> >> >> >>>> >> >> (*as) >> parameter ("out", outFile, " filename...", true); >>>> >> >> >>>> >> >> >>>> >> >> (*as) >> help(); >>>> >> >> >>>> >> >> as->defaultErrorHandling(); >>>> >> >> >>>> >> >> >>>> >> >> ImagePointerType img = >>>> >> >> ImageUtils::readImage(inFile); >>>> >> >> >>>> >> >> >>>> >> >> typedef itk::AntiAliasBinaryImageFilter >>> >> >> OutputImageType> >>>> >> >> >>>> >> >> AntiAliasBinaryImageFilterType; >>>> >> >> >>>> >> >> >>>> >> >> >>>> >> >> AntiAliasBinaryImageFilterType::Pointer antiAliasFilter >>>> >> >> >>>> >> >> = AntiAliasBinaryImageFilterType::New (); >>>> >> >> >>>> >> >> antiAliasFilter->SetInput(img); >>>> >> >> >>>> >> >> antiAliasFilter->SetNumberOfIterations(5); >>>> >> >> >>>> >> >> antiAliasFilter->SetMaximumRMSError(0.02); >>>> >> >> >>>> >> >> >>>> >> >> antiAliasFilter->Update(); >>>> >> >> >>>> >> >> >>>> >> >> // For increased code coverage. Does nothing. >>>> >> >> >>>> >> >> antiAliasFilter->GetMaximumRMSError(); >>>> >> >> >>>> >> >> >>>> >> >> >>>> >> >> >>>> >> >> antiAliasFilter->Update(); >>>> >> >> >>>> >> >> >>>> >> >> std::cout << "Maximum RMS change value threshold was: 0.02 " << >>>> >> >> std::endl; >>>> >> >> >>>> >> >> std::cout << "Last RMS change value was: " << >>>> >> >> antiAliasFilter->GetRMSChange() << std::endl; >>>> >> >> >>>> >> >> >>>> >> >> std::cout<< antiAliasFilter->GetElapsedIterations() <>>> >> >> >>>> >> >> >>>> >> >> std::cout<GetLowerBinaryValue()<<" "<< >>>> >> >> antiAliasFilter->GetUpperBinaryValue()<>>> >> >> >>>> >> >> >>>> >> >> OutputImagePointerType out=antiAliasFilter->GetOutput(); >>>> >> >> >>>> >> >> >>>> >> >> ImageUtils::writeImage(outFile,out); >>>> >> >> >>>> >> >> >>>> >> >> return 1; >>>> >> >> >>>> >> >> } >>>> >> >> >>>> >> >> >>>> >> >> I tried different values for maxIter (1,2,3,4,5,10,100,1000) and >>>> >> >> maxRMSError >>>> >> >> (0.02 0.07 0.08 0.8), and the best visual results are achieved >>>> >> >> after >>>> >> >> one >>>> >> >> iteration where RMSE changes by about 0.08. This increases for all >>>> >> >> following >>>> >> >> iterations, which have an RMSE-change of about 0.25 for all number >>>> >> >> of >>>> >> >> iterations tested. All this is using ITK 4.5 pulled from the GIT >>>> >> >> repository >>>> >> >> a while ago, running on an intel i7 on Debian. >>>> >> >> >>>> >> >> Thanks a lot! >>>> >> >> Tobias >>>> >> >> >>>> >> >>> >>>> >> >>> >>>> >> >>> On Mon, Aug 11, 2014 at 12:18 PM, Tobias Gass >>>> >> >>> >>>> >> >>> wrote: >>>> >> >>> > Dear all, >>>> >> >>> > >>>> >> >>> > I'm having problems using the anti-alias filter, which I want >>>> >> >>> > to use >>>> >> >>> > in >>>> >> >>> > order to smooth a binary segmentation volume. I'm using >>>> >> >>> > essentially >>>> >> >>> > the >>>> >> >>> > example code from the repository, which for my input file seems >>>> >> >>> > to >>>> >> >>> > start >>>> >> >>> > oscillating after 2 iterations, leading to weird 'pointy' >>>> >> >>> > artifacts >>>> >> >>> > on >>>> >> >>> > the >>>> >> >>> > surface as can be seen from the attached screenshot (AA filter >>>> >> >>> > output is >>>> >> >>> > on >>>> >> >>> > the left, input on the right). >>>> >> >>> > >>>> >> >>> > Is there any parameter to set/implement which could improve the >>>> >> >>> > behavior >>>> >> >>> > of >>>> >> >>> > this filter? I'm assuming that my input is reasonable, or is >>>> >> >>> > this >>>> >> >>> > something >>>> >> >>> > the filter is expected to have problems with? It is notable >>>> >> >>> > that >>>> >> >>> > such >>>> >> >>> > errors >>>> >> >>> > seem to mainly appear in 'flat' regions of the volume, and are >>>> >> >>> > not >>>> >> >>> > apparent >>>> >> >>> > in the curved shaft of the bone. >>>> >> >>> > >>>> >> >>> > Any help, or pointers to further resources are appreciated, >>>> >> >>> > thanks, >>>> >> >>> > Tobias >>>> >> >>> > >>>> >> >>> > _____________________________________ >>>> >> >>> > Powered by www.kitware.com >>>> >> >>> > >>>> >> >>> > Visit other Kitware open-source projects at >>>> >> >>> > http://www.kitware.com/opensource/opensource.html >>>> >> >>> > >>>> >> >>> > Kitware offers ITK Training Courses, for more information >>>> >> >>> > visit: >>>> >> >>> > http://www.kitware.com/products/protraining.php >>>> >> >>> > >>>> >> >>> > Please keep messages on-topic and check the ITK FAQ at: >>>> >> >>> > http://www.itk.org/Wiki/ITK_FAQ >>>> >> >>> > >>>> >> >>> > Follow this link to subscribe/unsubscribe: >>>> >> >>> > http://public.kitware.com/mailman/listinfo/insight-users >>>> >> >>> > >>>> >> >>> >>>> >> >>> >>>> >> >>> >>>> >> >>> -- >>>> >> >>> Unpaid intern in BillsBasement at noware dot com >>>> >> >> >>>> >> >> >>>> >> > >>>> >> > >>>> >> > >>>> >> > -- >>>> >> > Unpaid intern in BillsBasement at noware dot com >>>> >> >>>> >> >>>> >> >>>> >> -- >>>> >> Unpaid intern in BillsBasement at noware dot com >>>> > >>>> > >>>> >>>> >>>> >>>> -- >>>> Unpaid intern in BillsBasement at noware dot 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 >>> >>> >> > -- Unpaid intern in BillsBasement at noware dot com From gass at vision.ee.ethz.ch Tue Aug 12 10:10:34 2014 From: gass at vision.ee.ethz.ch (Tobias Gass) Date: Tue, 12 Aug 2014 16:10:34 +0200 Subject: [ITK-users] Anti-alias filter In-Reply-To: References: Message-ID: Yes, this does result in the same problems as before. 2014-08-12 15:06 GMT+02:00 Bill Lorensen : > Have you tried: > UseImageSpacingOn(); > > > On Tue, Aug 12, 2014 at 8:47 AM, Tobias Gass > wrote: > > Further update: when manually increasing the spacing of the input image > > (without resampling, thus not changing the size), the filter works well. > > This probably indicates numerical instability depending on image spacing > > somewhere in the code, which would probably be great if it could be > fixed. > > > > Best, > > Tobias > > > > > > 2014-08-12 14:33 GMT+02:00 Tobias Gass : > > > >> Update: meanwhile I also tried cropping the image to investigate the > >> impact of the overall size (#voxels) of the image. It appears to not > have an > >> effect, the same artifacts occur when processing a significantly smaller > >> region (1/2 size). > >> > >> > >> 2014-08-12 10:44 GMT+02:00 Tobias Gass : > >> > >>> Hi, > >>> > >>> changing the PixelType did not yield any change. However, I did some > >>> further tests which seem to point at image spacing or total size to be > the > >>> culprit. My original image is fairly high-res, with 0.25mm in-plane > >>> resolution and 0.75mm slice thickness and 512x512x409 voxel size. I > tried > >>> resampling the image to different isotropic resolutions (0.25, 0.3, > 0.34, > >>> 0.35, 0.4, 0.5, 0.75, 1)mm isotropic spacing. For all spacings down to > >>> 0.35mm, the AA filter converged nicely and the output looks as I'd > expect > >>> it. Lower than 0.35mm spacing, and it fails in the way I described > (from > >>> this spacing on the #vox is equal or greater than the #voxels in my > original > >>> image). > >>> > >>> Any idea what might cause this, or what to further investigate? > >>> > >>> Thanks, > >>> Tobias > >>> > >>> > >>> 2014-08-11 22:17 GMT+02:00 Bill Lorensen : > >>> > >>>> Paraview should do the right thing. > >>>> > >>>> On Mon, Aug 11, 2014 at 3:38 PM, Tobias Gass > >>>> wrote: > >>>> > I will try that tomorrow morning (living in GMT+1). I used paraview > to > >>>> > extract the isosurface, but also looked at the output of the > AA-filter > >>>> > directly (which looked fuzzy). I can also post an image of that > >>>> > tomorrow. > >>>> > > >>>> > Thanks for your help! > >>>> > Tobias > >>>> > > >>>> > > >>>> > 2014-08-11 21:22 GMT+02:00 Bill Lorensen : > >>>> > > >>>> >> How are you extracting the final isosurface? > >>>> >> > >>>> >> On Mon, Aug 11, 2014 at 3:22 PM, Bill Lorensen > >>>> >> > >>>> >> wrote: > >>>> >> > If you change > >>>> >> > typedef short PixelType; > >>>> >> > to > >>>> >> > typedef double PixelType; > >>>> >> > > >>>> >> > do the results change. > >>>> >> > > >>>> >> > > >>>> >> > On Mon, Aug 11, 2014 at 2:47 PM, Tobias Gass > >>>> >> > > >>>> >> > wrote: > >>>> >> >> > >>>> >> >>> Can you post your code. The results do not look correct. > >>>> >> >> > >>>> >> >> > >>>> >> >> Sure. The {write,read}Image functions are just convenient > wrappers > >>>> >> >> for > >>>> >> >> the > >>>> >> >> respective ITK tools. > >>>> >> >> > >>>> >> >> > >>>> >> >> #include > >>>> >> >> > >>>> >> >> #include > >>>> >> >> > >>>> >> >> #include "argstream.h" > >>>> >> >> > >>>> >> >> #include "ImageUtils.h" > >>>> >> >> > >>>> >> >> #include "itkAntiAliasBinaryImageFilter.h" > >>>> >> >> > >>>> >> >> using namespace std; > >>>> >> >> > >>>> >> >> using namespace itk; > >>>> >> >> > >>>> >> >> > >>>> >> >> > >>>> >> >> > >>>> >> >> int main(int argc, char ** argv) > >>>> >> >> > >>>> >> >> { > >>>> >> >> > >>>> >> >> > >>>> >> >> feenableexcept(FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW); > >>>> >> >> > >>>> >> >> typedef short PixelType; > >>>> >> >> > >>>> >> >> typedef double OutputPixelType; > >>>> >> >> > >>>> >> >> const unsigned int D=3; > >>>> >> >> > >>>> >> >> typedef Image ImageType; > >>>> >> >> > >>>> >> >> > >>>> >> >> > >>>> >> >> typedef ImageType::Pointer ImagePointerType; > >>>> >> >> > >>>> >> >> > >>>> >> >> > >>>> >> >> typedef Image OutputImageType; > >>>> >> >> > >>>> >> >> typedef OutputImageType::Pointer OutputImagePointerType; > >>>> >> >> > >>>> >> >> > >>>> >> >> > >>>> >> >> argstream * as=new argstream(argc,argv); > >>>> >> >> > >>>> >> >> string inFile, outFile; > >>>> >> >> > >>>> >> >> double thresh=0.0; > >>>> >> >> > >>>> >> >> (*as) >> parameter ("in", inFile, " filename...", true); > >>>> >> >> > >>>> >> >> (*as) >> parameter ("out", outFile, " filename...", true); > >>>> >> >> > >>>> >> >> > >>>> >> >> (*as) >> help(); > >>>> >> >> > >>>> >> >> as->defaultErrorHandling(); > >>>> >> >> > >>>> >> >> > >>>> >> >> ImagePointerType img = > >>>> >> >> ImageUtils::readImage(inFile); > >>>> >> >> > >>>> >> >> > >>>> >> >> typedef itk::AntiAliasBinaryImageFilter >>>> >> >> OutputImageType> > >>>> >> >> > >>>> >> >> AntiAliasBinaryImageFilterType; > >>>> >> >> > >>>> >> >> > >>>> >> >> > >>>> >> >> AntiAliasBinaryImageFilterType::Pointer antiAliasFilter > >>>> >> >> > >>>> >> >> = AntiAliasBinaryImageFilterType::New (); > >>>> >> >> > >>>> >> >> antiAliasFilter->SetInput(img); > >>>> >> >> > >>>> >> >> antiAliasFilter->SetNumberOfIterations(5); > >>>> >> >> > >>>> >> >> antiAliasFilter->SetMaximumRMSError(0.02); > >>>> >> >> > >>>> >> >> > >>>> >> >> antiAliasFilter->Update(); > >>>> >> >> > >>>> >> >> > >>>> >> >> // For increased code coverage. Does nothing. > >>>> >> >> > >>>> >> >> antiAliasFilter->GetMaximumRMSError(); > >>>> >> >> > >>>> >> >> > >>>> >> >> > >>>> >> >> > >>>> >> >> antiAliasFilter->Update(); > >>>> >> >> > >>>> >> >> > >>>> >> >> std::cout << "Maximum RMS change value threshold was: 0.02 " > << > >>>> >> >> std::endl; > >>>> >> >> > >>>> >> >> std::cout << "Last RMS change value was: " << > >>>> >> >> antiAliasFilter->GetRMSChange() << std::endl; > >>>> >> >> > >>>> >> >> > >>>> >> >> std::cout<< antiAliasFilter->GetElapsedIterations() < >>>> >> >> > >>>> >> >> > >>>> >> >> std::cout<GetLowerBinaryValue()<<" "<< > >>>> >> >> antiAliasFilter->GetUpperBinaryValue()< >>>> >> >> > >>>> >> >> > >>>> >> >> OutputImagePointerType out=antiAliasFilter->GetOutput(); > >>>> >> >> > >>>> >> >> > >>>> >> >> ImageUtils::writeImage(outFile,out); > >>>> >> >> > >>>> >> >> > >>>> >> >> return 1; > >>>> >> >> > >>>> >> >> } > >>>> >> >> > >>>> >> >> > >>>> >> >> I tried different values for maxIter (1,2,3,4,5,10,100,1000) and > >>>> >> >> maxRMSError > >>>> >> >> (0.02 0.07 0.08 0.8), and the best visual results are achieved > >>>> >> >> after > >>>> >> >> one > >>>> >> >> iteration where RMSE changes by about 0.08. This increases for > all > >>>> >> >> following > >>>> >> >> iterations, which have an RMSE-change of about 0.25 for all > number > >>>> >> >> of > >>>> >> >> iterations tested. All this is using ITK 4.5 pulled from the GIT > >>>> >> >> repository > >>>> >> >> a while ago, running on an intel i7 on Debian. > >>>> >> >> > >>>> >> >> Thanks a lot! > >>>> >> >> Tobias > >>>> >> >> > >>>> >> >>> > >>>> >> >>> > >>>> >> >>> On Mon, Aug 11, 2014 at 12:18 PM, Tobias Gass > >>>> >> >>> > >>>> >> >>> wrote: > >>>> >> >>> > Dear all, > >>>> >> >>> > > >>>> >> >>> > I'm having problems using the anti-alias filter, which I want > >>>> >> >>> > to use > >>>> >> >>> > in > >>>> >> >>> > order to smooth a binary segmentation volume. I'm using > >>>> >> >>> > essentially > >>>> >> >>> > the > >>>> >> >>> > example code from the repository, which for my input file > seems > >>>> >> >>> > to > >>>> >> >>> > start > >>>> >> >>> > oscillating after 2 iterations, leading to weird 'pointy' > >>>> >> >>> > artifacts > >>>> >> >>> > on > >>>> >> >>> > the > >>>> >> >>> > surface as can be seen from the attached screenshot (AA > filter > >>>> >> >>> > output is > >>>> >> >>> > on > >>>> >> >>> > the left, input on the right). > >>>> >> >>> > > >>>> >> >>> > Is there any parameter to set/implement which could improve > the > >>>> >> >>> > behavior > >>>> >> >>> > of > >>>> >> >>> > this filter? I'm assuming that my input is reasonable, or is > >>>> >> >>> > this > >>>> >> >>> > something > >>>> >> >>> > the filter is expected to have problems with? It is notable > >>>> >> >>> > that > >>>> >> >>> > such > >>>> >> >>> > errors > >>>> >> >>> > seem to mainly appear in 'flat' regions of the volume, and > are > >>>> >> >>> > not > >>>> >> >>> > apparent > >>>> >> >>> > in the curved shaft of the bone. > >>>> >> >>> > > >>>> >> >>> > Any help, or pointers to further resources are appreciated, > >>>> >> >>> > thanks, > >>>> >> >>> > Tobias > >>>> >> >>> > > >>>> >> >>> > _____________________________________ > >>>> >> >>> > Powered by www.kitware.com > >>>> >> >>> > > >>>> >> >>> > Visit other Kitware open-source projects at > >>>> >> >>> > http://www.kitware.com/opensource/opensource.html > >>>> >> >>> > > >>>> >> >>> > Kitware offers ITK Training Courses, for more information > >>>> >> >>> > visit: > >>>> >> >>> > http://www.kitware.com/products/protraining.php > >>>> >> >>> > > >>>> >> >>> > Please keep messages on-topic and check the ITK FAQ at: > >>>> >> >>> > http://www.itk.org/Wiki/ITK_FAQ > >>>> >> >>> > > >>>> >> >>> > Follow this link to subscribe/unsubscribe: > >>>> >> >>> > http://public.kitware.com/mailman/listinfo/insight-users > >>>> >> >>> > > >>>> >> >>> > >>>> >> >>> > >>>> >> >>> > >>>> >> >>> -- > >>>> >> >>> Unpaid intern in BillsBasement at noware dot com > >>>> >> >> > >>>> >> >> > >>>> >> > > >>>> >> > > >>>> >> > > >>>> >> > -- > >>>> >> > Unpaid intern in BillsBasement at noware dot com > >>>> >> > >>>> >> > >>>> >> > >>>> >> -- > >>>> >> Unpaid intern in BillsBasement at noware dot com > >>>> > > >>>> > > >>>> > >>>> > >>>> > >>>> -- > >>>> Unpaid intern in BillsBasement at noware dot 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 > >>> > >>> > >> > > > > > > -- > Unpaid intern in BillsBasement at noware dot com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mercikd at thomas.edu Tue Aug 12 19:06:35 2014 From: mercikd at thomas.edu (Dan Mercik) Date: Tue, 12 Aug 2014 23:06:35 +0000 Subject: [ITK-users] TileImageFilter SideBySide Message-ID: Good Afternoon, I want to know if it's possible to have more than two image be side by side vertically? If so what would I have to change in the algorithm, would I have to make a loop for the amount of input images? Any help would be greatly appreciative. Daniel Mercik Computer Science Major Service Desk Technician Thomas College From michkapopoff at gmail.com Wed Aug 13 02:32:21 2014 From: michkapopoff at gmail.com (Michka Popoff) Date: Wed, 13 Aug 2014 08:32:21 +0200 Subject: [ITK-users] TileImageFilter SideBySide In-Reply-To: References: Message-ID: Hi Moving this mail to the new community mailing list For your problem, you should use the setLayout method [1] For 4 images, that would be: itk::FixedArray< unsigned int, 2 > layout; layout[0] = 4; layout[1] = 0; Michka [1] http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/TileImageFilter_SideBySide On 13 ao?t 2014, at 01:06, Dan Mercik wrote: > Good Afternoon, > > > > I want to know if it's possible to have more than two image be side by side vertically? If so what would I have to change in the algorithm, would I have to make a loop for the amount of input images? Any help would be greatly appreciative. > > > > Daniel Mercik > > Computer Science Major > > Service Desk Technician > > Thomas College > _____________________________________ > 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 sebastian.ordas at gmail.com Wed Aug 13 13:50:24 2014 From: sebastian.ordas at gmail.com (Sebastian Ordas) Date: Wed, 13 Aug 2014 14:50:24 -0300 Subject: [ITK-users] FDA agile practices guidance Message-ID: <53EBA560.208@gmail.com> Hello friends, Sorry if it is not the right place for asking this question, but does anyone know about resources about FDA guidances for implementing agile practices in the development of medical device software? In concrete, the document AAMI TIR45:2012 is the one I am seeking online. thank you, sebastian From Jared.Becksfort at STJUDE.ORG Wed Aug 13 13:57:54 2014 From: Jared.Becksfort at STJUDE.ORG (Becksfort, Jared) Date: Wed, 13 Aug 2014 12:57:54 -0500 Subject: [ITK-users] Rotation or registration by plane Message-ID: Hello, Sorry if this is a dumb question (I feel like it may be). I have a plane in an MRI. I would like to either: * Change the coordinate system to refer to this plane (transform coordinates by plane) * Transform the image so that this plane is in the center (transform image by plane) Is there a registration algorithm that allows this? Thanks, Jared ________________________________ Email Disclaimer: www.stjude.org/emaildisclaimer Consultation Disclaimer: www.stjude.org/consultationdisclaimer From grothausmann.roman at mh-hannover.de Thu Aug 14 06:42:10 2014 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Thu, 14 Aug 2014 12:42:10 +0200 Subject: [ITK-users] [ITK] adding a global hierarchical watershed segmentation mode to itksnap In-Reply-To: References: <53E85181.8040607@mh-hannover.de> <0f32755d9980441ca0162728b088f00b@queensu.ca> <53E9CCED.1000604@mh-hannover.de> Message-ID: <53EC9282.3090904@mh-hannover.de> Hi Paul, Many thanks for Your reply. The main problem that I often face with samples from material science is, that around 1000 labels are needed per tomogram, e.g. individual particles, regions, domains. So setting markers by hand is already very timeconsuming. Expanding each of these one after another is way to cumbersum. I'm not sure if I have tried clustering. At least it was not available as preprocessing mode (possibly because I only have a greyscale tomogram) as described in the ReleaseNotes (is there any other new docu?). I did not try supervised classification because dev32 does not run on our system and the self-compiled binary crashes at start up with a segmentation fault (see below). Anyway it seems not possible to have the snake-tool make multiple labels compete against each other, as e.g. in a global watershed approach. I'd be very happy if there was already a tool in order to achieve what I need but it seems there isn't, so I guess I've to start creating my own. With Andras hint about using Slicer, I'm now wondering whether I should implement it for itksnap or slicer. None of both seem to have a tool to join/remove labels from a base map to a result map by just LMB/RMB clicking, which I would find very helpful. Adding a hierarchical watershed to generate the base map and using the mouse wheel to change the level/granularity on the fly would then just be an extension. A tile view (e.g. both maps side by side) for all three axes as in itksnap would be handy for this join/remove tool. Does Slicer offer something like that as well? Is it possible to get also the overlay id together with the click position? That would even allow to choose an already existing label in the result map for modification by just a click. Any further recommendations for the start are very welcome. Thanks, Roman ______________________ LD_LIBRARY_PATH=/opt/itk-4.5.1/lib/:/opt/qt-5.3.1/5.3/gcc_64/lib/ vglrun ./ITK-SNAP QXcbConnection: Failed to initialize XRandr Qt: XKEYBOARD extension not present on the X server. ************************************* ITK-SNAP: Segmentation fault BACKTRACE: ./ITK-SNAP(_Z24SegmentationFaultHandleri+0x133)[0x7af9c3] /lib/x86_64-linux-gnu/libc.so.6(+0x324f0)[0x7f6e977224f0] /lib/x86_64-linux-gnu/libc.so.6(+0x11aedf)[0x7f6e9780aedf] /opt/qt-5.3.1/5.3/gcc_64/lib/libQt5Core.so.5(_ZN16QCoreApplication9argumentsEv+0x8c)[0x7f6ea8dbf6bc] /opt/qt-5.3.1/5.3/gcc_64/plugins/platforms/libqxcb.so(+0x4b213)[0x7f6e907df213] /opt/qt-5.3.1/5.3/gcc_64/plugins/platforms/libqxcb.so(+0x4b5f9)[0x7f6e907df5f9] /opt/qt-5.3.1/5.3/gcc_64/plugins/platforms/libqxcb.so(+0x58127)[0x7f6e907ec127] /opt/qt-5.3.1/5.3/gcc_64/plugins/platforms/libqxcb.so(+0x4b009)[0x7f6e907df009] /opt/qt-5.3.1/5.3/gcc_64/lib/libQt5Gui.so.5(_ZN7QWindow6createEv+0x33)[0x7f6ea9e89e03] /opt/qt-5.3.1/5.3/gcc_64/lib/libQt5OpenGL.so.5(_ZN10QGLContext13chooseContextEPKS_+0x121)[0x7f6eaad4bf51] /opt/qt-5.3.1/5.3/gcc_64/lib/libQt5OpenGL.so.5(_ZN10QGLContext6createEPKS_+0x39)[0x7f6eaad23609] /opt/qt-5.3.1/5.3/gcc_64/lib/libQt5OpenGL.so.5(_ZN9QGLWidget10setContextEP10QGLContextPKS0_b+0xa7)[0x7f6eaad4b8b7] /opt/qt-5.3.1/5.3/gcc_64/lib/libQt5OpenGL.so.5(_ZN16QGLWidgetPrivate11initContextEP10QGLContextPK9QGLWidget+0x7a)[0x7f6eaad28c2a] /opt/qt-5.3.1/5.3/gcc_64/lib/libQt5OpenGL.so.5(_ZN9QGLWidgetC2EP7QWidgetPKS_6QFlagsIN2Qt10WindowTypeEE+0x111)[0x7f6eaad29031] ./ITK-SNAP(_ZN19QtAbstractOpenGLBoxC1EP7QWidget+0xd)[0x849e3d] ./ITK-SNAP(_ZN16GenericSliceViewC2EP7QWidget+0x10)[0x848310] ./ITK-SNAP(_ZN17Ui_SliceViewPanel7setupUiEP7QWidget+0x235f)[0x840fbf] ./ITK-SNAP(_ZN14SliceViewPanelC1EP7QWidget+0x53)[0x839fc3] ./ITK-SNAP(_ZN18Ui_MainImageWindow7setupUiEP11QMainWindow+0x336b)[0x7d77bb] ./ITK-SNAP(_ZN15MainImageWindowC2EP7QWidget+0x64)[0x7c47b4] ./ITK-SNAP(main+0x1b3)[0x7aa8c3] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd)[0x7f6e9770eead] ./ITK-SNAP[0x7af6f9] ************************************* On 13/08/14 22:15, Paul Yushkevich wrote: > Hi Roman, > > I am not sure, have you experimented with some of the newer segmentation modes > in ITK-SNAP (clustering, available in the 3.0 release, and supervised > classification, available in the dev32 branch). These still operate using active > contours, but can generate per-label probability maps that could then be easily > converted into multilabel segmentations. I guess my main question is whether > heirarchical watershed segmentation offers advantages over these modes, and if > so, whether it may possibly be integrated as another segmentation mode in the > snake pipeline... > > Paul. > > > On Tue, Aug 12, 2014 at 4:14 AM, Dr. Roman Grothausmann > > > wrote: > > Hi Andras, > > > Many thanks for Your hints. We'll test them on our data. However, our data > is not as standardized in quality as CT or MRT data and from our experience > many of the "magic" segmentations demonstrated on CT or MRT data does not > work on our data. > However, of all the segmentation modules I could find in Slicer or elsewhere > none was based on a hierarchical watershed algorithm like the > SegmentationEditor of the InsightApplications. Is there any other that I've > missed? > Concerning my idea to implement this if no tool currently already exists: > Would such an extension be of more use in Slicer or itksnap? > For which of the both would it likely be easier to integrate the extension? > > Best wishes > Roman > > On 11/08/14 16:20, Andras Lasso wrote: > > Have you tried segmentation tools in 3D Slicer? There is a multi-label > watershed > segmentation tool that works in 3d > (http://www.slicer.org/__slicerWiki/index.php/__Documentation/Nightly/Modules/__Editor#WatershedFromMarkers > ), > there are also a number of other generic semi-automatic segmentation > tools (such > as GrowCut) and a few fully-automatic specialized tools (for brain, > airways, etc). Download the nightly build and also checkout the Segmentation > category in the Extension Manager. > > Andras > > *From:* Dr. Roman Grothausmann > > > *Sent:* Monday, August 11, 2014 1:15 AM > *To:* itksnap-users at googlegroups.com > > > > *Cc:* ITK Mailing List > > > > Dear mailing list members, > > > For a long time now I've been searching for a replacement of the old > SegmentationEditor (part of the InsightApplications) which I could not > get to > work even with older ITK-3.x. Somewhere I was told that it was > integrated and > maintained within itksnap. However the only tool in itksnap based on > watershed > segmentation seems to be the adaptive brush. It is very handy, but > time-consuming in 3D and only for local segmentations. In contrast the > SegmentationEditor used a global hierarchical watershed segmentation to pick > labels from, see e.g. the video linked here: > http://www.insight-journal.__org/browse/publication/70 > > Quite often now I've stumbled over data, that would likely have profited > a lot > of such a tool for segmentation. > > If such a tool working with ITK-4.x does not exist any more, I thought of > implementing it as a global WS segmentation mode in itksnap. That way > making the > tool easier to find, to use and to ensure maintenance (should it be > integrated > into the itksnap code base in the end) and also avoiding recoding a GUI with > mouse interaction and such. > > My current idea is to start, similar to the snake-tool, with > pre-filtering like > smoothing and optional edge-detection. > Then the main edit mode to consist of the usual 4 subwindows showing an > overlay > of the grey-image and the watershed segmentation of the hierarchical > WS-filter > (hWS), side-by-side to another label-dataset (loaded like a tiled > overlay) which > consist of the actually chosen labels from the hWS as the final data (FD). > The interaction I'm considering would be to LMB click on a label in the hWS > which is then added to the FD as the current fg label, or removed with a > RMB. > The hierachrchy level of the hWS could be controlled by a slider or the > mouse > wheel + Shift in nearly real time if some region demands higher or lower > detailed segmentation. When the fg label is changed, the segmentation > added or > removed with further mouse interactions would modify the new fg label. > When all is done and the global WS mode is left, the FD label-dataset is > added > to the main segmentation of itksnap. > > Would that be possible to implement in itksnap 3.x? > What source files of the itksnap code base should I look at for: > - the pre-filtering mode of the snake (for the smoothing and edge detection) > - the mouse interactions (for e.g. adding the whell + Shift interaction) > - possible examples for the dual layout > > Thanks for any comments, help or hints. > Roman > > -- > Dr. Roman Grothausmann > > Tomographie und Digitale Bildverarbeitung > Tomography and Digital Image Analysis > > Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 > Medizinische Hochschule Hannover > Carl-Neuberg-Str. 1 > D-30625 Hannover > > Tel. +49 511 532-9574 > _______________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/__opensource/opensource.html > > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/__products/protraining.php > > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK___FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/__mailman/listinfo/insight-users > > _________________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/__mailman/listinfo/community > > > > -- > 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 > > -- > You received this message because you are subscribed to the Google Groups > "itksnap-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to itksnap-users+unsubscribe at __googlegroups.com > . > To post to this group, send email to itksnap-users at googlegroups.com > __. > Visit this group at http://groups.google.com/__group/itksnap-users > . > For more options, visit https://groups.google.com/d/__optout > . > > > > > -- > Paul A. Yushkevich, Ph.D. > Associate Professor > Penn Image Computing and Science Laboratory > Department of Radiology > University of Pennsylvania > > -- > You received this message because you are subscribed to the Google Groups > "itksnap-users" group. > To unsubscribe from this group and stop receiving emails from it, send an email > to itksnap-users+unsubscribe at googlegroups.com > . > To post to this group, send email to itksnap-users at googlegroups.com > . > Visit this group at http://groups.google.com/group/itksnap-users. > For more options, visit https://groups.google.com/d/optout. -- 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 gass at vision.ee.ethz.ch Thu Aug 14 07:32:06 2014 From: gass at vision.ee.ethz.ch (Tobias Gass) Date: Thu, 14 Aug 2014 13:32:06 +0200 Subject: [ITK-users] Anti-alias filter In-Reply-To: References: Message-ID: Dear all, any further ideas on this one? Thanks, Tobias 2014-08-12 16:10 GMT+02:00 Tobias Gass : > Yes, this does result in the same problems as before. > > > 2014-08-12 15:06 GMT+02:00 Bill Lorensen : > > Have you tried: >> UseImageSpacingOn(); >> >> >> On Tue, Aug 12, 2014 at 8:47 AM, Tobias Gass >> wrote: >> > Further update: when manually increasing the spacing of the input image >> > (without resampling, thus not changing the size), the filter works well. >> > This probably indicates numerical instability depending on image spacing >> > somewhere in the code, which would probably be great if it could be >> fixed. >> > >> > Best, >> > Tobias >> > >> > >> > 2014-08-12 14:33 GMT+02:00 Tobias Gass : >> > >> >> Update: meanwhile I also tried cropping the image to investigate the >> >> impact of the overall size (#voxels) of the image. It appears to not >> have an >> >> effect, the same artifacts occur when processing a significantly >> smaller >> >> region (1/2 size). >> >> >> >> >> >> 2014-08-12 10:44 GMT+02:00 Tobias Gass : >> >> >> >>> Hi, >> >>> >> >>> changing the PixelType did not yield any change. However, I did some >> >>> further tests which seem to point at image spacing or total size to >> be the >> >>> culprit. My original image is fairly high-res, with 0.25mm in-plane >> >>> resolution and 0.75mm slice thickness and 512x512x409 voxel size. I >> tried >> >>> resampling the image to different isotropic resolutions (0.25, 0.3, >> 0.34, >> >>> 0.35, 0.4, 0.5, 0.75, 1)mm isotropic spacing. For all spacings down to >> >>> 0.35mm, the AA filter converged nicely and the output looks as I'd >> expect >> >>> it. Lower than 0.35mm spacing, and it fails in the way I described >> (from >> >>> this spacing on the #vox is equal or greater than the #voxels in my >> original >> >>> image). >> >>> >> >>> Any idea what might cause this, or what to further investigate? >> >>> >> >>> Thanks, >> >>> Tobias >> >>> >> >>> >> >>> 2014-08-11 22:17 GMT+02:00 Bill Lorensen : >> >>> >> >>>> Paraview should do the right thing. >> >>>> >> >>>> On Mon, Aug 11, 2014 at 3:38 PM, Tobias Gass > > >> >>>> wrote: >> >>>> > I will try that tomorrow morning (living in GMT+1). I used >> paraview to >> >>>> > extract the isosurface, but also looked at the output of the >> AA-filter >> >>>> > directly (which looked fuzzy). I can also post an image of that >> >>>> > tomorrow. >> >>>> > >> >>>> > Thanks for your help! >> >>>> > Tobias >> >>>> > >> >>>> > >> >>>> > 2014-08-11 21:22 GMT+02:00 Bill Lorensen > >: >> >>>> > >> >>>> >> How are you extracting the final isosurface? >> >>>> >> >> >>>> >> On Mon, Aug 11, 2014 at 3:22 PM, Bill Lorensen >> >>>> >> >> >>>> >> wrote: >> >>>> >> > If you change >> >>>> >> > typedef short PixelType; >> >>>> >> > to >> >>>> >> > typedef double PixelType; >> >>>> >> > >> >>>> >> > do the results change. >> >>>> >> > >> >>>> >> > >> >>>> >> > On Mon, Aug 11, 2014 at 2:47 PM, Tobias Gass >> >>>> >> > >> >>>> >> > wrote: >> >>>> >> >> >> >>>> >> >>> Can you post your code. The results do not look correct. >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> Sure. The {write,read}Image functions are just convenient >> wrappers >> >>>> >> >> for >> >>>> >> >> the >> >>>> >> >> respective ITK tools. >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> #include >> >>>> >> >> >> >>>> >> >> #include >> >>>> >> >> >> >>>> >> >> #include "argstream.h" >> >>>> >> >> >> >>>> >> >> #include "ImageUtils.h" >> >>>> >> >> >> >>>> >> >> #include "itkAntiAliasBinaryImageFilter.h" >> >>>> >> >> >> >>>> >> >> using namespace std; >> >>>> >> >> >> >>>> >> >> using namespace itk; >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> int main(int argc, char ** argv) >> >>>> >> >> >> >>>> >> >> { >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> feenableexcept(FE_INVALID|FE_DIVBYZERO|FE_OVERFLOW); >> >>>> >> >> >> >>>> >> >> typedef short PixelType; >> >>>> >> >> >> >>>> >> >> typedef double OutputPixelType; >> >>>> >> >> >> >>>> >> >> const unsigned int D=3; >> >>>> >> >> >> >>>> >> >> typedef Image ImageType; >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> typedef ImageType::Pointer ImagePointerType; >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> typedef Image OutputImageType; >> >>>> >> >> >> >>>> >> >> typedef OutputImageType::Pointer OutputImagePointerType; >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> argstream * as=new argstream(argc,argv); >> >>>> >> >> >> >>>> >> >> string inFile, outFile; >> >>>> >> >> >> >>>> >> >> double thresh=0.0; >> >>>> >> >> >> >>>> >> >> (*as) >> parameter ("in", inFile, " filename...", true); >> >>>> >> >> >> >>>> >> >> (*as) >> parameter ("out", outFile, " filename...", true); >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> (*as) >> help(); >> >>>> >> >> >> >>>> >> >> as->defaultErrorHandling(); >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> ImagePointerType img = >> >>>> >> >> ImageUtils::readImage(inFile); >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> typedef itk::AntiAliasBinaryImageFilter > >>>> >> >> OutputImageType> >> >>>> >> >> >> >>>> >> >> AntiAliasBinaryImageFilterType; >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> AntiAliasBinaryImageFilterType::Pointer antiAliasFilter >> >>>> >> >> >> >>>> >> >> = AntiAliasBinaryImageFilterType::New (); >> >>>> >> >> >> >>>> >> >> antiAliasFilter->SetInput(img); >> >>>> >> >> >> >>>> >> >> antiAliasFilter->SetNumberOfIterations(5); >> >>>> >> >> >> >>>> >> >> antiAliasFilter->SetMaximumRMSError(0.02); >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> antiAliasFilter->Update(); >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> // For increased code coverage. Does nothing. >> >>>> >> >> >> >>>> >> >> antiAliasFilter->GetMaximumRMSError(); >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> antiAliasFilter->Update(); >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> std::cout << "Maximum RMS change value threshold was: 0.02 " >> << >> >>>> >> >> std::endl; >> >>>> >> >> >> >>>> >> >> std::cout << "Last RMS change value was: " << >> >>>> >> >> antiAliasFilter->GetRMSChange() << std::endl; >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> std::cout<< antiAliasFilter->GetElapsedIterations() <> >>>> >> >> >> >>>> >> >> >> >>>> >> >> std::cout<GetLowerBinaryValue()<<" "<< >> >>>> >> >> antiAliasFilter->GetUpperBinaryValue()<> >>>> >> >> >> >>>> >> >> >> >>>> >> >> OutputImagePointerType out=antiAliasFilter->GetOutput(); >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> ImageUtils::writeImage(outFile,out); >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> return 1; >> >>>> >> >> >> >>>> >> >> } >> >>>> >> >> >> >>>> >> >> >> >>>> >> >> I tried different values for maxIter (1,2,3,4,5,10,100,1000) >> and >> >>>> >> >> maxRMSError >> >>>> >> >> (0.02 0.07 0.08 0.8), and the best visual results are achieved >> >>>> >> >> after >> >>>> >> >> one >> >>>> >> >> iteration where RMSE changes by about 0.08. This increases for >> all >> >>>> >> >> following >> >>>> >> >> iterations, which have an RMSE-change of about 0.25 for all >> number >> >>>> >> >> of >> >>>> >> >> iterations tested. All this is using ITK 4.5 pulled from the >> GIT >> >>>> >> >> repository >> >>>> >> >> a while ago, running on an intel i7 on Debian. >> >>>> >> >> >> >>>> >> >> Thanks a lot! >> >>>> >> >> Tobias >> >>>> >> >> >> >>>> >> >>> >> >>>> >> >>> >> >>>> >> >>> On Mon, Aug 11, 2014 at 12:18 PM, Tobias Gass >> >>>> >> >>> >> >>>> >> >>> wrote: >> >>>> >> >>> > Dear all, >> >>>> >> >>> > >> >>>> >> >>> > I'm having problems using the anti-alias filter, which I >> want >> >>>> >> >>> > to use >> >>>> >> >>> > in >> >>>> >> >>> > order to smooth a binary segmentation volume. I'm using >> >>>> >> >>> > essentially >> >>>> >> >>> > the >> >>>> >> >>> > example code from the repository, which for my input file >> seems >> >>>> >> >>> > to >> >>>> >> >>> > start >> >>>> >> >>> > oscillating after 2 iterations, leading to weird 'pointy' >> >>>> >> >>> > artifacts >> >>>> >> >>> > on >> >>>> >> >>> > the >> >>>> >> >>> > surface as can be seen from the attached screenshot (AA >> filter >> >>>> >> >>> > output is >> >>>> >> >>> > on >> >>>> >> >>> > the left, input on the right). >> >>>> >> >>> > >> >>>> >> >>> > Is there any parameter to set/implement which could improve >> the >> >>>> >> >>> > behavior >> >>>> >> >>> > of >> >>>> >> >>> > this filter? I'm assuming that my input is reasonable, or is >> >>>> >> >>> > this >> >>>> >> >>> > something >> >>>> >> >>> > the filter is expected to have problems with? It is notable >> >>>> >> >>> > that >> >>>> >> >>> > such >> >>>> >> >>> > errors >> >>>> >> >>> > seem to mainly appear in 'flat' regions of the volume, and >> are >> >>>> >> >>> > not >> >>>> >> >>> > apparent >> >>>> >> >>> > in the curved shaft of the bone. >> >>>> >> >>> > >> >>>> >> >>> > Any help, or pointers to further resources are appreciated, >> >>>> >> >>> > thanks, >> >>>> >> >>> > Tobias >> >>>> >> >>> > >> >>>> >> >>> > _____________________________________ >> >>>> >> >>> > Powered by www.kitware.com >> >>>> >> >>> > >> >>>> >> >>> > Visit other Kitware open-source projects at >> >>>> >> >>> > http://www.kitware.com/opensource/opensource.html >> >>>> >> >>> > >> >>>> >> >>> > Kitware offers ITK Training Courses, for more information >> >>>> >> >>> > visit: >> >>>> >> >>> > http://www.kitware.com/products/protraining.php >> >>>> >> >>> > >> >>>> >> >>> > Please keep messages on-topic and check the ITK FAQ at: >> >>>> >> >>> > http://www.itk.org/Wiki/ITK_FAQ >> >>>> >> >>> > >> >>>> >> >>> > Follow this link to subscribe/unsubscribe: >> >>>> >> >>> > http://public.kitware.com/mailman/listinfo/insight-users >> >>>> >> >>> > >> >>>> >> >>> >> >>>> >> >>> >> >>>> >> >>> >> >>>> >> >>> -- >> >>>> >> >>> Unpaid intern in BillsBasement at noware dot com >> >>>> >> >> >> >>>> >> >> >> >>>> >> > >> >>>> >> > >> >>>> >> > >> >>>> >> > -- >> >>>> >> > Unpaid intern in BillsBasement at noware dot com >> >>>> >> >> >>>> >> >> >>>> >> >> >>>> >> -- >> >>>> >> Unpaid intern in BillsBasement at noware dot com >> >>>> > >> >>>> > >> >>>> >> >>>> >> >>>> >> >>>> -- >> >>>> Unpaid intern in BillsBasement at noware dot 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 >> >>> >> >>> >> >> >> > >> >> >> >> -- >> Unpaid intern in BillsBasement at noware dot com >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From grothausmann.roman at mh-hannover.de Fri Aug 15 08:44:40 2014 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Fri, 15 Aug 2014 14:44:40 +0200 Subject: [ITK-users] [Insight-users] enhancing plate like structures (by modifying itkHessianSmoothed3DToVesselnessMeasureImageFilter) In-Reply-To: <22EC75E8215562428ACADFA35877A25A02F9FE@JANEWAY.ts.odu.edu> References: <22EC75E8215562428ACADFA35877A25A02F9FE@JANEWAY.ts.odu.edu> Message-ID: <53EE00B8.3030605@mh-hannover.de> Dear Michel, dear Luca, Coming back to Hessian-based measures of Yours, which I've tried out two years ago: Is my understanding correct that the response function V of [Desc?teaux et. al.MICCAI 2006] and [Luca ITK-Journal 2007] differ for N=3 and M=2? i.e. for N=3, M=2: Rblob = vnl_math_abs( l3 + l3 - l2 - l1 ) / l3 in itkDescoteauxSheetnessImageFilter corresponding to Ra (NOT Rb) in itkHessianToObjectnessMeasureImageFilter, which is undefined for N=3, M=2. Rsheet = l2 / l3 in itkDescoteauxSheetnessImageFilter corresponds to Rb in itkHessianToObjectnessMeasureImageFilter, both equal for N=3, M=2. When has each definition its optimal use? Additionally, In Desc?teaux2006 a zero level-set segmentation approach is described based on a vector field constructed from initial ellipsoids positioned at high sheetness measures. Are there ITK-Filters to achieve that same approach or something similar? Which would I need? Many thanks again for Your replies and help. Roman On 05/09/12 17:10, Audette, Michel A. wrote: > Do a google on sheetness. Maxime Desc?teaux and I had modified this type of > operator a few years back to improve the detection of curviplanar bones (MICCAI > paper, republished in J. Computer Assisted Surgery), which was a tweak of his > and Frangi's work on vesselness operators. > > Michel > > Michel Audette, Ph.D. > Assistant Professor, > Department of Modeling, Simulation and Visualization Engineering, > Old Dominion University, > Norfolk, VA. > ________________________________________ > From: insight-users-bounces at itk.org [insight-users-bounces at itk.org] on behalf of > Ho Cheung [hocheung20 at gmail.com] > Sent: Wednesday, September 05, 2012 8:41 AM > To: Dr. Roman Grothausmann > Cc: insight-users at itk.org; vmtk-users at lists.sourceforge.net; Luca Antiga > Subject: Re: [Insight-users] enhancing plate like structures (by modifying > itkHessianSmoothed3DToVesselnessMeasureImageFilter) > > Hi Dr. Grothausmann, > > The measure in ITK appears to be based on Sato > (http://www.spl.harvard.edu/archive/spl-pre2007/pages/papers/yoshi/node3.html#SECTION00021000000000000000) > and I don't see an easy way to modify it so that it detects plate like > structures instead of line like structures. > > If speed is not a major concern for you, may I suggest you implement a similar > measure? Frangi's original vesselness enhancement formula > (http://www.dtic.upf.edu/~afrangi/articles/miccai1998.pdf) can be easily > modified for what you need and is based on Eigenvalues like Sato. > > According to equations 10, 11, 12, 13 in Frangi's paper and my interpretation of > what the measures do, what you need is high Ra, Rb, and S values, so the formula > becomes: > > V = [1 - exp(-Ra^2/2a^2)][1 - exp(-Rb^2/2b^2)][1 - exp(-S^2/2c62)] > > Hope, this helps, > > Ho Cheung > Research Assistant > Bio-Image Analytics Laboratory - University of Houston > (832) 215-6347 > > > > On Sep 5, 2012, at 3:36 AM, Dr. Roman Grothausmann > wrote: > > > Dear mailing list members, dear Luca, > > > > > > Recently I was trying to enhance vascular structures from airways with the > vessel enhancement filters from ITK (objectness and vessel enhancement). The > problem is that these vessels are not filled in the tomograms our imaging > technique yields. Only the airway walls are imaged, which corresponds to an > uneven 2D surface. Since it is only a 3D not an ND problem, I tried to modify > itkHessianSmoothed3DToVesselnessMeasureImageFilter to enhance not vessels (1D) > structures but plates/walls. Therefore I exchanged lambda 1 and 3 in the > weighting function. Sadly, I could not get the filter to enhance the airway walls. > > Have I missed anything or would enhancing plateness this way only work for > not-curved planes? > > > > > > Here the important part of the diff of my changes: > > > > diff -au > itk/IJ-Vessel_Enhancement_Diffusion.1/itkHessianSmoothed3DToVesselnessMeasureImageFilter.txx > itk/plateness3D_01/itkHessianSmoothed3DToPlatenessMeasureImageFilter.txx > > > > > > > > + ////swap Lambda1 and Lambda3 to enhance "plateness" > > + double swap_tmp= Lambda1; > > + Lambda3= Lambda1; > > + Lambda1= swap_tmp; > > + ///swapping done > > + > > double Lambda1Abs = vnl_math_abs( Lambda1 ); > > double Lambda2Abs = vnl_math_abs( Lambda2 ); > > double Lambda3Abs = vnl_math_abs( Lambda3 ); > > @@ -162,14 +168,13 @@ > > double vesMeasure_3 = > > ( 1 - vcl_exp( -1.0 * (( vnl_math_sqr( S )) / ( 2.0 * ( GammaSqr))))); > > > > - double vesMeasure_4 = > > - vcl_exp ( -1.0 * ( 2.0 * vnl_math_sqr( m_C )) / > > - ( Lambda2Abs * (Lambda3Sqr))); > > + double vesMeasure_4 = 1; ////plateness for now not smoothed > > + //double vesMeasure_4 = vcl_exp ( -1.0 * ( 2.0 * vnl_math_sqr( m_C )) > / ( Lambda2Abs * (Lambda3Sqr))); ////check if this makes sense for plateness > > > > > > Many thanks for any help or hints. > > 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 > > 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://www.itk.org/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://www.itk.org/mailman/listinfo/insight-users > > > -- > BEGIN-ANTISPAM-VOTING-LINKS > ------------------------------------------------------ > > Teach CanIt if this mail (ID 699566122) is spam: > Spam: https://www.spamtrap.odu.edu/b.php?i=699566122&m=6758d860fb26&t=20120905&c=s > Not spam: > https://www.spamtrap.odu.edu/b.php?i=699566122&m=6758d860fb26&t=20120905&c=n > Forget vote: > https://www.spamtrap.odu.edu/b.php?i=699566122&m=6758d860fb26&t=20120905&c=f > ------------------------------------------------------ > END-ANTISPAM-VOTING-LINKS > -- 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 hms96 at scarletmail.rutgers.edu Mon Aug 18 10:01:22 2014 From: hms96 at scarletmail.rutgers.edu (Harsh Shah) Date: Mon, 18 Aug 2014 10:01:22 -0400 Subject: [ITK-users] Question About Buffers Message-ID: Hello, I wanted to know if itk had any resources that would allow me to set the value of an itk::Image m_buffer to a buffer I read in from my camera. If you could point me in the direction of a good example, I would appreciate it. Thank You -------------- next part -------------- An HTML attachment was scrubbed... URL: From grothausmann.roman at mh-hannover.de Mon Aug 18 10:03:25 2014 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Mon, 18 Aug 2014 16:03:25 +0200 Subject: [ITK-users] difference between trees constructed in itkWatershedImageFilter and itkComponentTree Message-ID: <53F207AD.3030503@mh-hannover.de> Dear mailing list members, Wherein lies the difference in the tree constructed in itkWatershedImageFilter and itkComponentTree contributed by Ga?tan Lehmann in http://www.insight-journal.org/browse/publication/210? In the article about the itkComponentTree (http://www.insight-journal.org/browse/publication/210) it says there is a contribution for the binary case in ITK. Which is it? ConnectedComponentImageFilter? Further in the text single template attribute are mentioned. Would these have to be computed separately with e.g. itkLabelImageToShapeLabelMapFilter? Thanks for any answers and explanations 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 mercikd at thomas.edu Mon Aug 18 10:05:49 2014 From: mercikd at thomas.edu (Dan Mercik) Date: Mon, 18 Aug 2014 14:05:49 +0000 Subject: [ITK-users] TileImageFilter SideBySide In-Reply-To: References: , Message-ID: Good Morning, The demonstration you showed me works great, however if I wanted to do 20 images that would take some time. So, I tried doing a for loop which didn't work exactly how I wanted it to work. I would like the program to take any amount of images and output them side by side , any ideas? The attachment shows the for loop I used similar to TileImageFilter CreateVolume example however when I use it for some odd reason only one image is being display side by side multiple times. Daniel Mercik Computer Science Major Service Desk Technician Thomas College ________________________________ From: Michka Popoff Sent: Wednesday, August 13, 2014 2:32 AM To: Dan Mercik Cc: ITK Mailing List; community at itk.org Subject: Re: [ITK-users] TileImageFilter SideBySide Hi Moving this mail to the new community mailing list For your problem, you should use the setLayout method [1] For 4 images, that would be: itk::FixedArray< unsigned int, 2 > layout; layout[0] = 4; layout[1] = 0; Michka [1] http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/TileImageFilter_SideBySide On 13 ao?t 2014, at 01:06, Dan Mercik > wrote: Good Afternoon, I want to know if it's possible to have more than two image be side by side vertically? If so what would I have to change in the algorithm, would I have to make a loop for the amount of input images? Any help would be greatly appreciative. Daniel Mercik Computer Science Major Service Desk Technician Thomas College _____________________________________ 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 embedded and charset-unspecified text was scrubbed... Name: TileImageFilter_SideBySide.cxx URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Tilesidebyside.JPG Type: image/jpeg Size: 59821 bytes Desc: Tilesidebyside.JPG URL: From michkapopoff at gmail.com Mon Aug 18 11:01:57 2014 From: michkapopoff at gmail.com (Michka Popoff) Date: Mon, 18 Aug 2014 17:01:57 +0200 Subject: [ITK-users] TileImageFilter SideBySide In-Reply-To: References: , Message-ID: Hi Going the way described in the CreateVolume example is the way to go. Why did you uncomment the DisconnectPipeline() call and Update() call in the for loop ? They need to stay there, else you will always use the last image. That?s why you see the same image, the single update call will be triggered at the end of the script and read only one image. You don?t need to call tileFilter->Update(), you can remove this line. The writer->Update() will take care of the pipeline update. As a bonus, you may wrap your writer->Update() call, to fetch errors at the end of the pipeline: try { writer->Update(); } catch( itk::ExceptionObject & error ) { std::cerr << "Error: " << error << std::endl; return EXIT_FAILURE; } I made a little Python prototype, the syntax is a little bit different than in C++ but it gives you the main idea. Michka On 18 ao?t 2014, at 16:05, Dan Mercik wrote: > Good Morning, > > > > The demonstration you showed me works great, however if I wanted to do 20 images that would take some time. So, I tried doing a for loop which didn't work exactly how I wanted it to work. I would like the program to take any amount of images and output them side by side , any ideas? The attachment shows the for loop I used similar to TileImageFilter CreateVolume example however when I use it for some odd reason only one image is being display side by side multiple times. > > > > Daniel Mercik > > Computer Science Major > > Service Desk Technician > > Thomas College > > ________________________________ > From: Michka Popoff > Sent: Wednesday, August 13, 2014 2:32 AM > To: Dan Mercik > Cc: ITK Mailing List; community at itk.org > Subject: Re: [ITK-users] TileImageFilter SideBySide > > Hi > > > Moving this mail to the new community mailing list > > > For your problem, you should use the setLayout method [1] > > > For 4 images, that would be: > > > > itk::FixedArray< unsigned int, 2 > layout; > > layout[0] = 4; > layout[1] = 0; > > > Michka > > > [1] http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/TileImageFilter_SideBySide > > On 13 ao?t 2014, at 01:06, Dan Mercik > wrote: > > Good Afternoon, > > > > I want to know if it's possible to have more than two image be side by side vertically? If so what would I have to change in the algorithm, would I have to make a loop for the amount of input images? Any help would be greatly appreciative. > > > > Daniel Mercik > > Computer Science Major > > Service Desk Technician > > Thomas College > _____________________________________ > 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: tiling.py Type: text/x-python-script Size: 881 bytes Desc: not available URL: -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.bergmeier at imes.uni-hannover.de Mon Aug 18 11:20:48 2014 From: jan.bergmeier at imes.uni-hannover.de (jan) Date: Mon, 18 Aug 2014 08:20:48 -0700 (PDT) Subject: [ITK-users] MutualInformationImageToImageMetric without transformation Message-ID: <1408375248616-7586081.post@n2.nabble.com> Hello, I want to perform a registration between two images without any transformation or optimization. I like to use the itk::MutualInformationImageToImageMetric. As I understand the itk metric, you have to use a transformation, an optimizer, an interpolator and so on. I want to compare one image to a set of images with mutual information as metric. So basically, I like to use the GetValue() method, without giving any parameters to it. Is there a way to do that, or another way to get just one mutual information value between two images? Thanks in advance, Jan -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/MutualInformationImageToImageMetric-without-transformation-tp7586081.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From anton.delehony at gmail.com Mon Aug 18 22:37:22 2014 From: anton.delehony at gmail.com (Anton Delehony) Date: Mon, 18 Aug 2014 22:37:22 -0400 Subject: [ITK-users] Deformation Field Modulation Message-ID: Hello, I have a general image processing question that I hope I can get some guidance from more experienced researchers. My data is composed of two 3d MRI volumes taken at end-inhale and end-exhale. I do non-rigid registration (demons) to estimate the overall transformation field between the two volumes. Then, I also have dynamic 2D slices that are taken continuously throughout the breathing cycle. I would like to "modulate" the overall field measured from registration by the measured 2D planes. Any suggestions? -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Tue Aug 19 00:31:19 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 19 Aug 2014 00:31:19 -0400 Subject: [ITK-users] Question About Buffers In-Reply-To: References: Message-ID: Hi Harsh, Yes, you can use ImportImageFilter [1] as in this example [2]. Hope this helps, Matt [1] http://www.itk.org/Doxygen/html/classitk_1_1ImportImageFilter.html [2] http://www.itk.org/Doxygen/html/DataRepresentation_2Image_2Image5_8cxx-example.html#_a1 On Mon, Aug 18, 2014 at 10:01 AM, Harsh Shah wrote: > Hello, > > I wanted to know if itk had any resources that would allow me to set the > value of an itk::Image m_buffer to a buffer I read in from my camera. If > you could point me in the direction of a good example, I would appreciate > it. > > Thank You > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://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 grothausmann.roman at mh-hannover.de Wed Aug 20 03:37:40 2014 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Wed, 20 Aug 2014 09:37:40 +0200 Subject: [ITK-users] TileImageFilter SideBySide In-Reply-To: References: , Message-ID: <53F45044.8010702@mh-hannover.de> Hi As this is a nice case of a question I have always had: In the case of the c++ example (http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/TileImageFilter_CreateVolume) InputImageType::Pointer inputImageTile; for (int i = 1; i < argc - 1; i++) { reader->SetFileName( argv[i] ); reader->UpdateLargestPossibleRegion(); inputImageTile = reader->GetOutput(); inputImageTile->DisconnectPipeline(); tiler->SetInput( inputImageNumber++, inputImageTile ); } When the reader output is assigned to inputImageTile, I thought this is only a pointer assignment and not a full copy of the image. However, I wonder, what makes sure the address space in the memory is not used (partially) again for the next image read? Is there a full copy created "behind the scene" at any point in the code? Or does the reader remember the address space of former images read even though DisconnectPipeline was called? Thanks for any explanations Roman On 18/08/14 17:01, Michka Popoff wrote: > Hi > > Going the way described in the CreateVolume example is the way to go. > > Why did you uncomment the DisconnectPipeline() call and Update() call in the for > loop ? They need to stay there, else you will always use the last image. > That?s why you see the same image, the single update call will be triggered at > the end of the script and read only one image. > > You don?t need to call tileFilter->Update(), you can remove this line. The > writer->Update() will take care of the pipeline update. > As a bonus, you may wrap your writer->Update() call, to fetch errors at the end > of the pipeline: > > try > { > writer->Update(); > } > catch( itk::ExceptionObject & error ) > { > std::cerr << "Error: " << error << std::endl; > return EXIT_FAILURE; > } > > I made a little Python prototype, the syntax is a little bit different than in > C++ but it gives you the main idea. > > Michka > > > > > On 18 ao?t 2014, at 16:05, Dan Mercik > wrote: > >> Good Morning, >> >> >> >> The demonstration you showed me works great, however if >> I wanted to do 20 images that would take some time. So, I tried doing a for >> loop which didn't work exactly how I wanted it to work. I would like the >> program to take any amount of images and output them side by side , any ideas? >> The attachment shows the for loop I used similar to TileImageFilter >> CreateVolume example however when I use it for some odd reason only one image >> is being display side by side multiple times. >> >> >> >> Daniel Mercik >> >> Computer Science Major >> >> Service Desk Technician >> >> Thomas College >> >> ________________________________ >> From: Michka Popoff > >> Sent: Wednesday, August 13, 2014 2:32 AM >> To: Dan Mercik >> Cc: ITK Mailing List;community at itk.org >> Subject: Re: [ITK-users] TileImageFilter SideBySide >> >> Hi >> >> >> Moving this mail to the new community mailing list >> >> >> For your problem, you should use the setLayout method [1] >> >> >> For 4 images, that would be: >> >> >> >> itk::FixedArray< unsigned int, 2 > layout; >> >> layout[0] = 4; >> layout[1] = 0; >> >> >> Michka >> >> >> [1] >> http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/TileImageFilter_SideBySide >> >> On 13 ao?t 2014, at 01:06, Dan Mercik > > wrote: >> >> Good Afternoon, >> >> >> >> I want to know if it's possible to have more than two image >> be side by side vertically? If so what would I have to change in the >> algorithm, would I have to make a loop for the amount of input images? Any >> help would be greatly appreciative. >> >> >> >> Daniel Mercik >> >> Computer Science Major >> >> Service Desk Technician >> >> Thomas College >> _____________________________________ >> Powered bywww.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 > -- 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 millerjv at gmail.com Wed Aug 20 07:16:59 2014 From: millerjv at gmail.com (Jim Miller) Date: Wed, 20 Aug 2014 07:16:59 -0400 Subject: [ITK-users] TileImageFilter SideBySide In-Reply-To: <53F45044.8010702@mh-hannover.de> References: <53F45044.8010702@mh-hannover.de> Message-ID: <2D7CC2D6-CD96-4778-8DFA-86382739FA01@gmail.com> Once DisconnectPipeline is called the Image object is completely disassociated with the source filter (in this case a reader). The source filter then constructs a new a Image object to serve as its output. For instance, if you call GetOutput() after calling DisconnectPipeline, you will get a different Image object than one retrieved before DisconnectPipeline is called. The pixel buffer is managed by the Image object, not the source/filter/reader. So after a call to DisconnectPipeline(), the reader has a new Image object as it its output and that new Image object has a distinct pixel buffer. Initially this pixel buffer is not even allocated. The act of reading the next image causes the reader to request the Image object to allocate the pixel buffer to an appropriate size. If DisconnectPipeline() was not called and the reader was asked to read another image of the same size or smaller, its output Image object would already have an allocated pixel buffer. The reader would still ask the Image object to allocate a pixel buffer of the appropriate size. But in this case, the Image object would recognize that it already has a block of memory of sufficient size and not do another allocation. Jim > On Aug 20, 2014, at 3:37 AM, "Dr. Roman Grothausmann" wrote: > > Hi > > > As this is a nice case of a question I have always had: In the case of the c++ example (http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/TileImageFilter_CreateVolume) > > InputImageType::Pointer inputImageTile; > > for (int i = 1; i < argc - 1; i++) > { > reader->SetFileName( argv[i] ); > reader->UpdateLargestPossibleRegion(); > inputImageTile = reader->GetOutput(); > inputImageTile->DisconnectPipeline(); > tiler->SetInput( inputImageNumber++, inputImageTile ); > } > > When the reader output is assigned to inputImageTile, I thought this is only a pointer assignment and not a full copy of the image. However, I wonder, what makes sure the address space in the memory is not used (partially) again for the next image read? Is there a full copy created "behind the scene" at any point in the code? Or does the reader remember the address space of former images read even though DisconnectPipeline was called? > > Thanks for any explanations > Roman > >> On 18/08/14 17:01, Michka Popoff wrote: >> Hi >> >> Going the way described in the CreateVolume example is the way to go. >> >> Why did you uncomment the DisconnectPipeline() call and Update() call in the for >> loop ? They need to stay there, else you will always use the last image. >> That?s why you see the same image, the single update call will be triggered at >> the end of the script and read only one image. >> >> You don?t need to call tileFilter->Update(), you can remove this line. The >> writer->Update() will take care of the pipeline update. >> As a bonus, you may wrap your writer->Update() call, to fetch errors at the end >> of the pipeline: >> >> try >> { >> writer->Update(); >> } >> catch( itk::ExceptionObject & error ) >> { >> std::cerr << "Error: " << error << std::endl; >> return EXIT_FAILURE; >> } >> >> I made a little Python prototype, the syntax is a little bit different than in >> C++ but it gives you the main idea. >> >> Michka >> >> >> >> >> On 18 ao?t 2014, at 16:05, Dan Mercik > > wrote: >> >>> Good Morning, >>> >>> >>> >>> The demonstration you showed me works great, however if >>> I wanted to do 20 images that would take some time. So, I tried doing a for >>> loop which didn't work exactly how I wanted it to work. I would like the >>> program to take any amount of images and output them side by side , any ideas? >>> The attachment shows the for loop I used similar to TileImageFilter >>> CreateVolume example however when I use it for some odd reason only one image >>> is being display side by side multiple times. >>> >>> >>> >>> Daniel Mercik >>> >>> Computer Science Major >>> >>> Service Desk Technician >>> >>> Thomas College >>> >>> ________________________________ >>> From: Michka Popoff > >>> Sent: Wednesday, August 13, 2014 2:32 AM >>> To: Dan Mercik >>> Cc: ITK Mailing List;community at itk.org >>> Subject: Re: [ITK-users] TileImageFilter SideBySide >>> >>> Hi >>> >>> >>> Moving this mail to the new community mailing list >>> >>> >>> For your problem, you should use the setLayout method [1] >>> >>> >>> For 4 images, that would be: >>> >>> >>> >>> itk::FixedArray< unsigned int, 2 > layout; >>> >>> layout[0] = 4; >>> layout[1] = 0; >>> >>> >>> Michka >>> >>> >>> [1] >>> http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/TileImageFilter_SideBySide >>> >>> On 13 ao?t 2014, at 01:06, Dan Mercik >> > wrote: >>> >>> Good Afternoon, >>> >>> >>> >>> I want to know if it's possible to have more than two image >>> be side by side vertically? If so what would I have to change in the >>> algorithm, would I have to make a loop for the amount of input images? Any >>> help would be greatly appreciative. >>> >>> >>> >>> Daniel Mercik >>> >>> Computer Science Major >>> >>> Service Desk Technician >>> >>> Thomas College >>> _____________________________________ >>> Powered bywww.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 > > -- > 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 grothausmann.roman at mh-hannover.de Wed Aug 20 07:59:40 2014 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Wed, 20 Aug 2014 13:59:40 +0200 Subject: [ITK-users] TileImageFilter SideBySide In-Reply-To: <2D7CC2D6-CD96-4778-8DFA-86382739FA01@gmail.com> References: <53F45044.8010702@mh-hannover.de> <2D7CC2D6-CD96-4778-8DFA-86382739FA01@gmail.com> Message-ID: <53F48DAC.5040005@mh-hannover.de> Thanks Jim for the great explanation, I understand now. So in simple CLI programs where an ITK pipeline is only updated once by the final writer: In order to limit maximum memory used during execution, would it be best to always store the output of a filter in the pipeline in an image object and then call DisconnectPipeline (and setting ReleaseDataFlagOn for the filter)? Many thanks again for the answer. Roman On 20/08/14 13:16, Jim Miller wrote: > Once DisconnectPipeline is called the Image object is completely > disassociated with the source filter (in this case a reader). The source > filter then constructs a new a Image object to serve as its output. For > instance, if you call GetOutput() after calling DisconnectPipeline, you will > get a different Image object than one retrieved before DisconnectPipeline is > called. > > The pixel buffer is managed by the Image object, not the > source/filter/reader. So after a call to DisconnectPipeline(), the reader has > a new Image object as it its output and that new Image object has a distinct > pixel buffer. Initially this pixel buffer is not even allocated. The act of > reading the next image causes the reader to request the Image object to > allocate the pixel buffer to an appropriate size. > > If DisconnectPipeline() was not called and the reader was asked to read > another image of the same size or smaller, its output Image object would > already have an allocated pixel buffer. The reader would still ask the Image > object to allocate a pixel buffer of the appropriate size. But in this case, > the Image object would recognize that it already has a block of memory of > sufficient size and not do another allocation. > > Jim > >> On Aug 20, 2014, at 3:37 AM, "Dr. Roman Grothausmann" >> wrote: >> >> Hi >> >> >> As this is a nice case of a question I have always had: In the case of the >> c++ example >> (http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/TileImageFilter_CreateVolume) >> >> >> InputImageType::Pointer inputImageTile; >> >> for (int i = 1; i < argc - 1; i++) { reader->SetFileName( argv[i] ); >> reader->UpdateLargestPossibleRegion(); inputImageTile = >> reader->GetOutput(); inputImageTile->DisconnectPipeline(); tiler->SetInput( >> inputImageNumber++, inputImageTile ); } >> >> When the reader output is assigned to inputImageTile, I thought this is >> only a pointer assignment and not a full copy of the image. However, I >> wonder, what makes sure the address space in the memory is not used >> (partially) again for the next image read? Is there a full copy created >> "behind the scene" at any point in the code? Or does the reader remember >> the address space of former images read even though DisconnectPipeline was >> called? >> >> Thanks for any explanations Roman >> >>> On 18/08/14 17:01, Michka Popoff wrote: Hi >>> >>> Going the way described in the CreateVolume example is the way to go. >>> >>> Why did you uncomment the DisconnectPipeline() call and Update() call in >>> the for loop ? They need to stay there, else you will always use the last >>> image. That?s why you see the same image, the single update call will be >>> triggered at the end of the script and read only one image. >>> >>> You don?t need to call tileFilter->Update(), you can remove this line. >>> The writer->Update() will take care of the pipeline update. As a bonus, >>> you may wrap your writer->Update() call, to fetch errors at the end of >>> the pipeline: >>> >>> try { writer->Update(); } catch( itk::ExceptionObject & error ) { >>> std::cerr << "Error: " << error << std::endl; return EXIT_FAILURE; } >>> >>> I made a little Python prototype, the syntax is a little bit different >>> than in C++ but it gives you the main idea. >>> >>> Michka >>> >>> >>> >>> >>> On 18 ao?t 2014, at 16:05, Dan Mercik >> > wrote: >>> >>>> Good Morning, >>>> >>>> >>>> >>>> The demonstration you showed me works great, however if I wanted to do >>>> 20 images that would take some time. So, I tried doing a for loop >>>> which didn't work exactly how I wanted it to work. I would like the >>>> program to take any amount of images and output them side by side , any >>>> ideas? The attachment shows the for loop I used similar to >>>> TileImageFilter CreateVolume example however when I use it for some odd >>>> reason only one image is being display side by side multiple times. >>>> >>>> >>>> >>>> Daniel Mercik >>>> >>>> Computer Science Major >>>> >>>> Service Desk Technician >>>> >>>> Thomas College >>>> >>>> ________________________________ From: Michka Popoff >>>> > Sent: >>>> Wednesday, August 13, 2014 2:32 AM To: Dan Mercik Cc: ITK Mailing >>>> List;community at itk.org Subject: Re: >>>> [ITK-users] TileImageFilter SideBySide >>>> >>>> Hi >>>> >>>> >>>> Moving this mail to the new community mailing list >>>> >>>> >>>> For your problem, you should use the setLayout method [1] >>>> >>>> >>>> For 4 images, that would be: >>>> >>>> >>>> >>>> itk::FixedArray< unsigned int, 2 > layout; >>>> >>>> layout[0] = 4; layout[1] = 0; >>>> >>>> >>>> Michka >>>> >>>> >>>> [1] >>>> http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/TileImageFilter_SideBySide >>>> >>>> >>>> On 13 ao?t 2014, at 01:06, Dan Mercik >>> > wrote: >>>> >>>> Good Afternoon, >>>> >>>> >>>> >>>> I want to know if it's possible to have more than two image be side by >>>> side vertically? If so what would I have to change in the algorithm, >>>> would I have to make a loop for the amount of input images? Any help >>>> would be greatly appreciative. >>>> >>>> >>>> >>>> Daniel Mercik >>>> >>>> Computer Science Major >>>> >>>> Service Desk Technician >>>> >>>> Thomas College _____________________________________ Powered >>>> bywww.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 >> >> -- Dr. Roman Grothausmann >> >> Tomographie und Digitale Bildverarbeitung Tomography and Digital Image >> Analysis >> >> Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische >> Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover >> >> Tel. +49 511 532-9574 _____________________________________ Powered by >> www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-9574 From arnaudgelas at gmail.com Wed Aug 20 10:03:32 2014 From: arnaudgelas at gmail.com (Arnaud Gelas) Date: Wed, 20 Aug 2014 16:03:32 +0200 Subject: [ITK-users] itkSmoothingQuadEdgeMeshFilter Help!! In-Reply-To: References: <20566F1B-1B71-411D-8C31-B25D4B24397A@gmail.com> <305E1509-8EF7-4770-9236-3D639B9BF155@gmail.com> Message-ID: <8E777677-5A6C-47A1-9ED6-030C85AB48B5@gmail.com> Hi, I have just submitted this patch for the documentation, can you please review it? http://review.source.kitware.com/#/c/16755/ I was running this code on Mac i5 with 4GB RAM, with both ITK and this program compiled in Debug? Best, Arnaud On Aug 7, 2014, at 5:20 PM, Mallikarjun K wrote: > Hi Arnaud, > > Thanks,Can you please tell me your machine confuguration. I am running 4GB RAM,i3 on windows7. > I have downloaded your project and tried to execute it and it is still the same problem Which I was facing earlier.Any suggestions ..... > > thank you > > > On Thu, Aug 7, 2014 at 8:10 PM, Arnaud Gelas wrote: > It takes 29s on my machine in debug to run 5 iterations with Delaunay conforming set to true > > https://gist.github.com/arnaudgelas/0f20ebdaf53956f79997 > > > On Aug 7, 2014, at 3:45 PM, Mallikarjun K wrote: > >> File path is correct.if it is '\'(backward slash) we have to add "D:\\" .since I used '/' it's not required to add "//". >> >> please find the attached .vtk file >> >> Thanks >> >> >> On Thu, Aug 7, 2014 at 7:01 PM, Arnaud Gelas wrote: >> Shouldn't it be D://temp.vtk ? Isn't it missing one '/' ? >> >> Can you send this vtk file? >> >> >> On Aug 7, 2014, at 3:23 PM, Mallikarjun K wrote: >> >>> Hi Arnaud, >>> >>> Kindly have a look in the below code ,the problem is that even after QEMeshFilter output is saved as .stl file ,the program is still running for long time.I have observed in my tests that MeshFileReader seems to be the culprit. Any suggestions ? >>> >>> ///// >>> #include >>> #include >>> >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include >>> #include "itkMesh.h" >>> #include "itkQuadEdgeMesh.h" >>> #include "itkQuadEdgeMeshTraits.h" >>> #include "itkSmoothingQuadEdgeMeshFilter.h" >>> #include "vtkSTLWriter.h" >>> #include >>> >>> int main() >>> { >>> std::string Inputfilename="D:/temp.vtk"; //number of points of this mesh file is around 78K >>> >>> typedef itk::QuadEdgeMeshTraits qetraits; >>> typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; >>> >>> itk::OnesMatrixCoefficients< MeshType > coeff0; >>> typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType >SmoothingQuadEdgeMeshFilter; >>> >>> vtkSmartPointer polyDatawriter=vtkSmartPointer::New(); >>> vtkSmartPointer polyDatareader=vtkSmartPointer::New(); >>> >>> SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = SmoothingQuadEdgeMeshFilter::New(); >>> >>> /* polyDatareader->SetFileName(Inputfilename.c_str() ); >>> polyDatareader->ReleaseDataFlagOn(); >>> polyDatareader->Update();*/ >>> >>> /*vtkSmartPointer triangleFilter = >>> vtkSmartPointer::New(); >>> triangleFilter->SetInput(polyDatareader->GetOutput()); >>> triangleFilter->Update();*/ >>> >>> // >>> /* vtkSmartPointer clean = vtkSmartPointer::New(); >>> #if (VTK_MAJOR_VERSION < 6) >>> clean->SetInput(triangleFilter->GetOutput() ); >>> #else >>> clean->SetInputData(triangleFilter->GetOutput() ); >>> #endif >>> >>> clean->ConvertPolysToLinesOff(); >>> clean->ConvertLinesToPointsOff(); >>> clean->Update(); >>> >>> std::string Inputfilename2="D:/cleaned.vtk";*/ >>> >>> //// >>> /*polyDatawriter->SetInput(clean->GetOutput()); >>> polyDatawriter->SetFileName(Inputfilename2.c_str()); >>> polyDatawriter->ReleaseDataFlagOn(); >>> polyDatawriter->Write(); */ >>> >>> typedef itk::MeshFileReader MeshReaderType; >>> MeshReaderType::Pointer Meshreader = MeshReaderType::New(); >>> Meshreader->SetFileName(Inputfilename.c_str( )); >>> Meshreader->Update(); >>> >>> /*MeshType::Pointer mesh = Meshreader->GetOutput(); >>> mesh->DisconnectPipeline();*/ >>> >>> >>> QEMeshSmoother->SetInput(Meshreader->GetOutput()/*mesh*/ ); >>> QEMeshSmoother->SetNumberOfIterations(1 ); >>> QEMeshSmoother->SetRelaxationFactor( 0.5 ); >>> QEMeshSmoother->SetDelaunayConforming(true); >>> QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); >>> >>> QEMeshSmoother->ReleaseDataFlagOn(); >>> >>> QEMeshSmoother->Update(); >>> >>> std::string Outputfilename="D:/tempOut.vtk"; >>> >>> typedef itk::MeshFileWriter MeshWriterType; >>> MeshWriterType::Pointer Meshwriter = MeshWriterType::New(); >>> Meshwriter->SetFileName(Outputfilename.c_str( )); >>> Meshwriter->SetInput(QEMeshSmoother->GetOutput()); >>> Meshwriter->Update(); >>> >>> polyDatareader->SetFileName(Outputfilename.c_str() ); >>> polyDatareader->ReleaseDataFlagOn(); >>> polyDatareader->Update(); >>> >>> vtkSmartPointer stlWriter=vtkSmartPointer::New(); >>> >>> stlWriter->SetInput( polyDatareader->GetOutput()); >>> stlWriter->SetFileName("D:/QEoutput.stl"); >>> stlWriter->SetFileTypeToASCII(); >>> stlWriter->Write(); >>> >>> //Here it stops and taking long time >>> >>> return 0; >>> >>> >>> } >>> //// >>> >>> >>> >>> On Thu, Aug 7, 2014 at 3:39 PM, Mallikarjun K wrote: >>> Hi Arnaud, >>> >>> Thanks for your reply and valuable suggestions. >>> >>> Number of points in my input mesh are 78928.In my pipeline I am already cleaning the polydata using vtkCleanPolyData filter.I will check the speed improvement and results with delaunay conforming turned OFF. >>> >>> Thank you >>> >>> >>> On Thu, Aug 7, 2014 at 2:22 PM, Arnaud Gelas wrote: >>> Hi Malik, >>> >>> First of all, I would recommend using MeshFileReader instead of VTKPolyDataReader (I guess VTKPolyDataReader will be deprecated in near future?). >>> >>> Regarding now the smoothing procedure in itself. This class definitively misses some documentation and I will be adding some in the next few days (mainly extracted from the corresponding insight journal). >>> >>> At the end of each iteration, when the delaunay conforming flag is turned ON, the conformation is performed. So depending on the mesh configuration, mesh size and number of iterations, it can take ages? >>> How large is your input mesh (number of points)? >>> >>> You can also check results, by running first a smoothing without delaunay conforming, then apply a delaunay conforming on the output. Results won't be as nice, but you should get significant speed improvement. >>> Another possibility is to first do a clean poly data in vtk, with a small threshold to remove small edges in the input meshes (which results in lots of edge flipping after smoothing). >>> >>> HTH >>> Arnaud >>> >>> >>> On Aug 6, 2014, at 10:42 AM, Mallikarjun K wrote: >>> >>>> Hi All, >>>> >>>> Can anyone suggest me if anything wrong I am doing in this below pipeline ,Where I used itkVtkPolydataReader to convert vtk Surface polydata to Itk QuadedgeMesh. Execution loop is being hung up for sometime(4 to 5 mins in release mode) at itkVtkPolydataReader . >>>> >>>> >>>> //// >>>> >>>> typedef itk::QuadEdgeMeshTraits qetraits; >>>> >>>> typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; >>>> >>>> itk::OnesMatrixCoefficients< MeshType > coeff0; >>>> >>>> typedef itk::VTKPolyDataReader< MeshType >VTKPolyDataReaderType; >>>> //typedef itk::VTKPolyDataWriter< MeshType >VTKPolyDataWriterType; >>>> >>>> //VTKPolyDataWriterType::Pointer ItkToVtkWriter=VTKPolyDataWriterType::New(); >>>> VTKPolyDataReaderType::Pointer VtkToItkReader=VTKPolyDataReaderType::New(); >>>> >>>> VtkToItkReader->SetFileName("abc.vtk"); >>>> VtkToItkReader->Update(); >>>> >>>> typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > >>>> SmoothingQuadEdgeMeshFilter; >>>> >>>> SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = SmoothingQuadEdgeMeshFilter::New(); >>>> >>>> >>>> QEMeshSmoother->SetInput(VtkToItkReader->GetOutPut()); >>>> QEMeshSmoother->SetNumberOfIterations(5 ); >>>> QEMeshSmoother->SetRelaxationFactor( 0.5 ); >>>> QEMeshSmoother->SetDelaunayConforming(true ); >>>> QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); >>>> >>>> QEMeshSmoother->Update(); >>>> >>>> //// >>>> >>>> >>>> On Fri, Aug 1, 2014 at 4:36 PM, Mallikarjun K wrote: >>>> Thanks Bill for your answer. >>>> >>>> The reason I am using this pipeline is that SmoothingQEMeshFilter has an additional parameter for smoothing which is delaunay conforming which helps to optimize aspect ratio of triangles while smoothing and thus produces better output.Is there anything similar filter in the vtk pipeline.I used vtkWindowedSincPolydatafilter which is not giving the output as good as QEMeshSmoothing filter. >>>> >>>> Thanks for your help >>>> >>>> >>>> On Thu, Jul 31, 2014 at 5:14 PM, Bill Lorensen wrote: >>>> If you have it in vtk, I suggest using the vtk pipeline to smooth the data. >>>> >>>> On Thu, Jul 31, 2014 at 1:35 AM, Mallikarjun K wrote: >>>> > Hi Bill, >>>> > Thanks for the replay. >>>> > >>>> > Yes,I built both ITK and my app with Release ,I forgot to mention it in the >>>> > previous post.Actually the data set is the output of >>>> > vtkDiscreteMarchingCubes algorithm(around 5MB) and need to smooth .I saved >>>> > this marching cube's output as .vtk file and read it using >>>> > itkVTKPolyDataReader and then I am giving this reader's output to >>>> > itkSmoothingQuadEdgeMeshFilter's input. >>>> > >>>> > I checked the execution time of each step in the pipeline ,after >>>> > SmothingQEMeshFilter has got it's input ,it is taking time to process the >>>> > data. >>>> > >>>> > Thank you >>>> > >>>> > >>>> > >>>> > On Wed, Jul 30, 2014 at 9:29 PM, Bill Lorensen >>>> > wrote: >>>> >> >>>> >> First, make sure you are building ITK and your app with Release. A >>>> >> Debug build can be 10-50 times slower. >>>> >> >>>> >> >>>> >> On Wed, Jul 30, 2014 at 10:18 AM, Mallikarjun K >>>> >> wrote: >>>> >> > Hi All, >>>> >> > I am using itkSmoothingQuadEdgeMeshFilter for Surface Mesh >>>> >> > smoothing.This >>>> >> > filter is giving good results what I expected but taking more execution >>>> >> > time.can any one suggest me to reduce the execution time( multi >>>> >> > threading >>>> >> > or any parameters to add/remove )? >>>> >> > >>>> >> > Below is the code snippet >>>> >> > /////// >>>> >> > typedef itk::QuadEdgeMeshTraits>>> >> > > >>>> >> > qetraits; >>>> >> > typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; >>>> >> > >>>> >> > //typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3 > MeshType; >>>> >> > >>>> >> > itk::OnesMatrixCoefficients< MeshType > coeff0; >>>> >> > >>>> >> > typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > >>>> >> > SmoothingQuadEdgeMeshFilter; >>>> >> > >>>> >> > SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = >>>> >> > SmoothingQuadEdgeMeshFilter::New(); >>>> >> > >>>> >> > QEMeshSmoother->SetInput("abc.vtk"); >>>> >> > QEMeshSmoother->SetNumberOfIterations(5 ); >>>> >> > QEMeshSmoother->SetRelaxationFactor( 0.5 ); >>>> >> > QEMeshSmoother->SetDelaunayConforming(true ); >>>> >> > QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); >>>> >> > QEMeshSmoother->Update(); >>>> >> > //// >>>> >> > >>>> >> > -- >>>> >> > Regards: >>>> >> > Mallik >>>> >> > >>>> >> > >>>> >> > _____________________________________ >>>> >> > Powered by www.kitware.com >>>> >> > >>>> >> > Visit other Kitware open-source projects at >>>> >> > http://www.kitware.com/opensource/opensource.html >>>> >> > >>>> >> > Kitware offers ITK Training Courses, for more information visit: >>>> >> > http://www.kitware.com/products/protraining.php >>>> >> > >>>> >> > Please keep messages on-topic and check the ITK FAQ at: >>>> >> > http://www.itk.org/Wiki/ITK_FAQ >>>> >> > >>>> >> > Follow this link to subscribe/unsubscribe: >>>> >> > http://public.kitware.com/mailman/listinfo/insight-users >>>> >> > >>>> >> >>>> >> >>>> >> >>>> >> -- >>>> >> Unpaid intern in BillsBasement at noware dot com >>>> > >>>> > >>>> > >>>> > >>>> > -- >>>> > Regards: >>>> > Mallik >>>> > >>>> >>>> >>>> >>>> -- >>>> Unpaid intern in BillsBasement at noware dot com >>>> >>>> >>>> >>>> -- >>>> Regards: >>>> Mallik >>>> >>>> >>>> >>>> >>>> -- >>>> Regards: >>>> Mallik >>>> >>>> _____________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Kitware offers ITK Training Courses, for more information visit: >>>> http://www.kitware.com/products/protraining.php >>>> >>>> Please keep messages on-topic and check the ITK FAQ at: >>>> http://www.itk.org/Wiki/ITK_FAQ >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/insight-users >>> >>> >>> >>> >>> -- >>> Regards: >>> Mallik >>> >>> >>> >>> >>> -- >>> Regards: >>> Mallik >>> >> >> >> >> >> -- >> Regards: >> Mallik >> >> > > > > > -- > Regards: > Mallik > -------------- next part -------------- An HTML attachment was scrubbed... URL: From arnaudgelas at gmail.com Wed Aug 20 10:28:58 2014 From: arnaudgelas at gmail.com (Arnaud Gelas) Date: Wed, 20 Aug 2014 16:28:58 +0200 Subject: [ITK-users] combining N images Message-ID: Hi all, I am trying to combine N images together into a single image of the same dimension. These N images have the same direction, but can have different origin, start index, spacing, size (there is no overlap). Then gaps in between images would be filled with a given constant value. Is there such a filter? or assuming I have already resampled all images to a common ground, is there a filter to do this? Thanks, Arnaud -------------- next part -------------- An HTML attachment was scrubbed... URL: From joseignacio.prieto at gmail.com Wed Aug 20 11:00:51 2014 From: joseignacio.prieto at gmail.com (Jose Ignacio Prieto) Date: Wed, 20 Aug 2014 11:00:51 -0400 Subject: [ITK-users] Composite Filter with variable stdvector of filters inside Message-ID: Hi all, I am trying to create a composite filter for a 4D dataset that will use different cascaded 2D filters on the inside. For this, I have created a double std vector that holds all the 2D filters. I have also set some param setters for this filters (that perform a double for inside, setting the param to each filter and then calling modified() on the outside one). I have another method called UpdateNumberofFilters, that depending on 2 ints (num of Z slices, num of T timeframes) will push back more filters to the 2D array of filters. My problem is that I dont know which function should call the UpdateNumofFilters. It should be done before the setters but after the constructor and after setting those two ints. I want to design it so that if I change a param after calling update I dont have to run the whole filter again, so I dont want it to be under the GenerateData() method. Thank you very much for your insights. Ignacio Prieto -- Ignacio Prieto Research Assistant Biomedical Imaging Center Pontificia Universida Catolica de Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From mercikd at thomas.edu Wed Aug 20 11:48:43 2014 From: mercikd at thomas.edu (Dan Mercik) Date: Wed, 20 Aug 2014 15:48:43 +0000 Subject: [ITK-users] Tiling Side by Side Question Message-ID: <5a78d43e709547e49519d34f2e74838e@T9.tcnet.thomas.edu> Hey, In my program I'm using a If Else statement to decide which direction I want my images to tile. So far, the If statement works if I want my images to tile horizontally, but It not working vertically. In my code if I input 1 my images would tile horizontally, anything input other than 1 should display my images vertically. Do anyone happen to see the problem in my if Else statement? Daniel Mercik Computer Science Major Service Desk Technician Thomas College -------------- next part -------------- A non-text attachment was scrubbed... Name: sidebyside tiling.JPG Type: image/jpeg Size: 67308 bytes Desc: sidebyside tiling.JPG URL: From arnaudgelas at gmail.com Wed Aug 20 11:51:19 2014 From: arnaudgelas at gmail.com (Arnaud Gelas) Date: Wed, 20 Aug 2014 17:51:19 +0200 Subject: [ITK-users] combining N images In-Reply-To: References: Message-ID: Hi, I do not want to add images, it is more something like pasting but I do not know in advance what would be the output image size, but it would be at least the bounding box of all images... Arnaud On Wednesday, August 20, 2014, Mordig, Maximilian Oliver < maximilian_oliver.mordig at roche.com> wrote: > Once you have resampled all images, you can use the itk AddFilter. > > > On Wed, Aug 20, 2014 at 4:28 PM, Arnaud Gelas > wrote: > >> Hi all, >> >> I am trying to combine N images together into a single image of the same >> dimension. >> >> These N images have the same direction, but can have different origin, >> start index, spacing, size (there is no overlap). Then gaps in between >> images would be filled with a given constant value. >> >> Is there such a filter? or assuming I have already resampled all images >> to a common ground, is there a filter to do this? >> >> Thanks, >> Arnaud >> >> _____________________________________ >> 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 brad at lowekamp.net Wed Aug 20 12:53:18 2014 From: brad at lowekamp.net (Bradley Lowekamp) Date: Wed, 20 Aug 2014 12:53:18 -0400 Subject: [ITK-users] [ITK] combining N images In-Reply-To: References: Message-ID: <41BB5486-E3F6-4196-8E58-C59F514C8800@mail.nih.gov> This may be of some use: https://github.com/blowekamp/itkStreamingSinc/blob/master/include/itkBoundingRegionImageSinc.h > On Aug 20, 2014, at 11:51 AM, Arnaud Gelas wrote: > > Hi, > > I do not want to add images, it is more something like pasting but I do not know in advance what would be the output image size, but it would be at least the bounding box of all images... > > Arnaud > >> On Wednesday, August 20, 2014, Mordig, Maximilian Oliver wrote: >> Once you have resampled all images, you can use the itk AddFilter. >> >> >>> On Wed, Aug 20, 2014 at 4:28 PM, Arnaud Gelas wrote: >>> Hi all, >>> >>> I am trying to combine N images together into a single image of the same dimension. >>> >>> These N images have the same direction, but can have different origin, start index, spacing, size (there is no overlap). Then gaps in between images would be filled with a given constant value. >>> >>> Is there such a filter? or assuming I have already resampled all images to a common ground, is there a filter to do this? >>> >>> Thanks, >>> Arnaud >>> >>> >>> _____________________________________ >>> 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 > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community -------------- next part -------------- An HTML attachment was scrubbed... URL: From yxp233 at postech.ac.kr Wed Aug 20 13:07:38 2014 From: yxp233 at postech.ac.kr (Xiaopeng Yang) Date: Thu, 21 Aug 2014 02:07:38 +0900 Subject: [ITK-users] Compiling ITK for GPU support In-Reply-To: <1405141094987070.021539.ptmail03@ptmail03> References: <1405141094987070.021539.ptmail03@ptmail03> Message-ID: <023f01cfbc99$3ecc2c60$bc648520$@ac.kr> Hello, I would like to develop GPU based program for image processing, so I tried to compile ITK with GPU support. My question is whether I shall install 3rd party program like CUDDA first? Thank you. Xiaopeng -------------- next part -------------- An HTML attachment was scrubbed... URL: From grothausmann.roman at mh-hannover.de Thu Aug 21 03:30:02 2014 From: grothausmann.roman at mh-hannover.de (Dr. Roman Grothausmann) Date: Thu, 21 Aug 2014 09:30:02 +0200 Subject: [ITK-users] Tiling Side by Side Question In-Reply-To: <5a78d43e709547e49519d34f2e74838e@T9.tcnet.thomas.edu> References: <5a78d43e709547e49519d34f2e74838e@T9.tcnet.thomas.edu> Message-ID: <53F59FFA.2070002@mh-hannover.de> Hm, haven't used that filter before but I'd think that you need to change layout[2] to layout[1]. On 20/08/14 17:48, Dan Mercik wrote: > Hey, > > > > In my program I'm using a If Else statement to decide which direction I want > my images to tile. So far, the If statement works if I want my images to tile > horizontally, but It not working vertically. In my code if I input 1 my > images would tile horizontally, anything input other than 1 should display my > images vertically. Do anyone happen to see the problem in my if Else > statement? > > > > > > Daniel Mercik > > Computer Science Major > > Service Desk Technician > > Thomas College > > > > _____________________________________ Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-9574 From michkapopoff at gmail.com Thu Aug 21 03:37:31 2014 From: michkapopoff at gmail.com (Michka Popoff) Date: Thu, 21 Aug 2014 09:37:31 +0200 Subject: [ITK-users] Tiling Side by Side Question In-Reply-To: <53F59FFA.2070002@mh-hannover.de> References: <5a78d43e709547e49519d34f2e74838e@T9.tcnet.thomas.edu> <53F59FFA.2070002@mh-hannover.de> Message-ID: <8BA6CC8C-BAFC-496A-8FA3-B2998B9745B6@gmail.com> Yes, layout[2] is for the third direction, when you do a stack. Do not set layout[2], as you set your FixedArray to be 2 dimensional. (else you should do itk::FixedArray< unsigned int, 3 > layout; So for vertical tiling it is: layout[0] = 0; layout[1] = i + 1; Michka On 21 ao?t 2014, at 09:30, Dr. Roman Grothausmann wrote: > Hm, haven't used that filter before but I'd think that you need to change layout[2] to layout[1]. > > On 20/08/14 17:48, Dan Mercik wrote: >> Hey, >> >> >> >> In my program I'm using a If Else statement to decide which direction I want >> my images to tile. So far, the If statement works if I want my images to tile >> horizontally, but It not working vertically. In my code if I input 1 my >> images would tile horizontally, anything input other than 1 should display my >> images vertically. Do anyone happen to see the problem in my if Else >> statement? >> >> >> >> >> >> Daniel Mercik >> >> Computer Science Major >> >> Service Desk Technician >> >> Thomas College >> >> >> >> _____________________________________ 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 > _____________________________________ > 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 yuetian926 at 163.com Thu Aug 21 04:55:17 2014 From: yuetian926 at 163.com (Yuetian Liu) Date: Thu, 21 Aug 2014 16:55:17 +0800 (CST) Subject: [ITK-users] How to fusion the MR volume to the CT volume Message-ID: <40b48479.b227.147f7c6f61b.Coremail.yuetian926@163.com> Hi itkusers, Recently I want to fuse the MR volume to the CT volume, but I search the itk mailist. I haven;t known how to realise it. And there isn't example in the InsightSoftwareGuide-4.5.0.pdf and InsightSphinxExamplesPDF-4.5.0.pdf. So I want to ask how to fuse the MR volume to the CT volume by itk. Thank you for helping me! Best Yuetian -------------- next part -------------- An HTML attachment was scrubbed... URL: From yuetian926 at 163.com Thu Aug 21 04:44:11 2014 From: yuetian926 at 163.com (Yuetian Liu) Date: Thu, 21 Aug 2014 16:44:11 +0800 (CST) Subject: [ITK-users] How to fusion the MR volume to the CT volume Message-ID: <49b24f0c.ad8d.147f7bccdd9.Coremail.yuetian926@163.com> Hi itkusers, Recently I want to fuse the MR volume to the CT volume, but I search the itk mailist. I haven;t known how to realise it. And there isn't example in the InsightSoftwareGuide-4.5.0.pdf and InsightSphinxExamplesPDF-4.5.0.pdf. So I want to ask how to fuse the MR volume to the CT volume by itk. Thank you for helping me! Best Yuetian -------------- next part -------------- An HTML attachment was scrubbed... URL: From arnaudgelas at gmail.com Thu Aug 21 06:47:17 2014 From: arnaudgelas at gmail.com (Arnaud Gelas) Date: Thu, 21 Aug 2014 12:47:17 +0200 Subject: [ITK-users] itkSmoothingQuadEdgeMeshFilter Help!! In-Reply-To: References: <20566F1B-1B71-411D-8C31-B25D4B24397A@gmail.com> <305E1509-8EF7-4770-9236-3D639B9BF155@gmail.com> <8E777677-5A6C-47A1-9ED6-030C85AB48B5@gmail.com> Message-ID: Hi, As of now, there is no progress event on this filter, so it is normal nothing happened. I'll submit another patch for progress event later today. To review the patch, you need to create an account on gerrit: http://review.source.kitware.com Then you ca volunteer to the review patch, you can add comments, accept, refuse? Else once you are registered, you can send me an email and I will add you as a reviewer. Best, Arnaud On Aug 21, 2014, at 12:11 PM, Mallikarjun K wrote: > Hi, > I am trying observe the progressEvent by using AddObserver method of this filter but I couldn't. Could you check the below code once. > > And one more thing,Could you guide me what exactly I have to do to Review the patch you have submitted. > > Thank you > > > ///progress > > #include > #include > > #include > #include > #include > #include > #include "itkMesh.h" > #include "itkQuadEdgeMesh.h" > #include "itkQuadEdgeMeshTraits.h" > #include "itkSmoothingQuadEdgeMeshFilter.h" > #include "itkCommand.h" > > class MyCommand : public itk::Command > { > public: > itkNewMacro( MyCommand ); > > public: > > void Execute(itk::Object *caller, const itk::EventObject & event) > { > Execute( (const itk::Object *)caller, event); > } > > void Execute(const itk::Object * object, const itk::EventObject & event) > { > std::cout << "Command called." << std::endl; > > if( typeid( itk::ProgressEvent ) == typeid( event ) ) > { > ::itk::ProcessObject::ConstPointer process = > dynamic_cast< const itk::ProcessObject *>( object/*caller*/ ); > > const int value = static_cast(process->GetProgress() * 100 ); > std::cout<<"progress:"< > > > } > > } > > }; > > int main( int argc, char* argv[] ) > { > > /*if( argc < 2 ) > { > std::cerr << "Usage: " << std::endl; > std::cerr << argv[0] << " inputImageFile outputImageFile flipAxisX flipAxisY" << std::endl; > return EXIT_FAILURE; > }*/ > > std::string Inputfilename="D:\\temp.vtk"; > typedef itk::QuadEdgeMeshTraits qetraits; > typedef itk::QuadEdgeMesh< double, 3,qetraits > MeshType; > > itk::OnesMatrixCoefficients< MeshType > coeff0; > typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType >SmoothingQuadEdgeMeshFilter; > > SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = SmoothingQuadEdgeMeshFilter::New(); > > typedef itk::MeshFileReader MeshReaderType; > MeshReaderType::Pointer Meshreader = MeshReaderType::New(); > Meshreader->SetFileName( Inputfilename.c_str()/*argv[1]*/ ); > // Meshreader->Update(); > > > MyCommand::Pointer myCommand = MyCommand::New(); > > QEMeshSmoother->SetInput(Meshreader->GetOutput() ); > QEMeshSmoother->SetNumberOfIterations( 1 ); > QEMeshSmoother->SetRelaxationFactor( 0.5 ); > QEMeshSmoother->SetDelaunayConforming(true); > QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); > QEMeshSmoother->AddObserver(itk::ProgressEvent, myCommand); > > // QEMeshSmoother->Update(); > std::string Outputfilename="D:\\tempOut2.vtk"; > > typedef itk::MeshFileWriter MeshWriterType; > MeshWriterType::Pointer Meshwriter = MeshWriterType::New(); > Meshwriter->SetFileName(Outputfilename.c_str() /*argv[2]*/ ); > Meshwriter->SetInput(QEMeshSmoother->GetOutput()); > > try > { > Meshwriter->Update(); > } > catch( itk::ExceptionObject& e ) > { > std::cerr << e.what() << std::endl; > } > > return 0; > > > } > > > On Wed, Aug 20, 2014 at 7:33 PM, Arnaud Gelas wrote: > Hi, > > I have just submitted this patch for the documentation, can you please review it? > > http://review.source.kitware.com/#/c/16755/ > > I was running this code on Mac i5 with 4GB RAM, with both ITK and this program compiled in Debug? > > Best, > Arnaud > > On Aug 7, 2014, at 5:20 PM, Mallikarjun K wrote: > >> Hi Arnaud, >> >> Thanks,Can you please tell me your machine confuguration. I am running 4GB RAM,i3 on windows7. >> I have downloaded your project and tried to execute it and it is still the same problem Which I was facing earlier.Any suggestions ..... >> >> thank you >> >> >> On Thu, Aug 7, 2014 at 8:10 PM, Arnaud Gelas wrote: >> It takes 29s on my machine in debug to run 5 iterations with Delaunay conforming set to true >> >> https://gist.github.com/arnaudgelas/0f20ebdaf53956f79997 >> >> >> On Aug 7, 2014, at 3:45 PM, Mallikarjun K wrote: >> >>> File path is correct.if it is '\'(backward slash) we have to add "D:\\" .since I used '/' it's not required to add "//". >>> >>> please find the attached .vtk file >>> >>> Thanks >>> >>> >>> On Thu, Aug 7, 2014 at 7:01 PM, Arnaud Gelas wrote: >>> Shouldn't it be D://temp.vtk ? Isn't it missing one '/' ? >>> >>> Can you send this vtk file? >>> >>> >>> On Aug 7, 2014, at 3:23 PM, Mallikarjun K wrote: >>> >>>> Hi Arnaud, >>>> >>>> Kindly have a look in the below code ,the problem is that even after QEMeshFilter output is saved as .stl file ,the program is still running for long time.I have observed in my tests that MeshFileReader seems to be the culprit. Any suggestions ? >>>> >>>> ///// >>>> #include >>>> #include >>>> >>>> #include >>>> #include >>>> #include >>>> #include >>>> #include >>>> #include >>>> #include >>>> #include >>>> #include "itkMesh.h" >>>> #include "itkQuadEdgeMesh.h" >>>> #include "itkQuadEdgeMeshTraits.h" >>>> #include "itkSmoothingQuadEdgeMeshFilter.h" >>>> #include "vtkSTLWriter.h" >>>> #include >>>> >>>> int main() >>>> { >>>> std::string Inputfilename="D:/temp.vtk"; //number of points of this mesh file is around 78K >>>> >>>> typedef itk::QuadEdgeMeshTraits qetraits; >>>> typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; >>>> >>>> itk::OnesMatrixCoefficients< MeshType > coeff0; >>>> typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType >SmoothingQuadEdgeMeshFilter; >>>> >>>> vtkSmartPointer polyDatawriter=vtkSmartPointer::New(); >>>> vtkSmartPointer polyDatareader=vtkSmartPointer::New(); >>>> >>>> SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = SmoothingQuadEdgeMeshFilter::New(); >>>> >>>> /* polyDatareader->SetFileName(Inputfilename.c_str() ); >>>> polyDatareader->ReleaseDataFlagOn(); >>>> polyDatareader->Update();*/ >>>> >>>> /*vtkSmartPointer triangleFilter = >>>> vtkSmartPointer::New(); >>>> triangleFilter->SetInput(polyDatareader->GetOutput()); >>>> triangleFilter->Update();*/ >>>> >>>> // >>>> /* vtkSmartPointer clean = vtkSmartPointer::New(); >>>> #if (VTK_MAJOR_VERSION < 6) >>>> clean->SetInput(triangleFilter->GetOutput() ); >>>> #else >>>> clean->SetInputData(triangleFilter->GetOutput() ); >>>> #endif >>>> >>>> clean->ConvertPolysToLinesOff(); >>>> clean->ConvertLinesToPointsOff(); >>>> clean->Update(); >>>> >>>> std::string Inputfilename2="D:/cleaned.vtk";*/ >>>> >>>> //// >>>> /*polyDatawriter->SetInput(clean->GetOutput()); >>>> polyDatawriter->SetFileName(Inputfilename2.c_str()); >>>> polyDatawriter->ReleaseDataFlagOn(); >>>> polyDatawriter->Write(); */ >>>> >>>> typedef itk::MeshFileReader MeshReaderType; >>>> MeshReaderType::Pointer Meshreader = MeshReaderType::New(); >>>> Meshreader->SetFileName(Inputfilename.c_str( )); >>>> Meshreader->Update(); >>>> >>>> /*MeshType::Pointer mesh = Meshreader->GetOutput(); >>>> mesh->DisconnectPipeline();*/ >>>> >>>> >>>> QEMeshSmoother->SetInput(Meshreader->GetOutput()/*mesh*/ ); >>>> QEMeshSmoother->SetNumberOfIterations(1 ); >>>> QEMeshSmoother->SetRelaxationFactor( 0.5 ); >>>> QEMeshSmoother->SetDelaunayConforming(true); >>>> QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); >>>> >>>> QEMeshSmoother->ReleaseDataFlagOn(); >>>> >>>> QEMeshSmoother->Update(); >>>> >>>> std::string Outputfilename="D:/tempOut.vtk"; >>>> >>>> typedef itk::MeshFileWriter MeshWriterType; >>>> MeshWriterType::Pointer Meshwriter = MeshWriterType::New(); >>>> Meshwriter->SetFileName(Outputfilename.c_str( )); >>>> Meshwriter->SetInput(QEMeshSmoother->GetOutput()); >>>> Meshwriter->Update(); >>>> >>>> polyDatareader->SetFileName(Outputfilename.c_str() ); >>>> polyDatareader->ReleaseDataFlagOn(); >>>> polyDatareader->Update(); >>>> >>>> vtkSmartPointer stlWriter=vtkSmartPointer::New(); >>>> >>>> stlWriter->SetInput( polyDatareader->GetOutput()); >>>> stlWriter->SetFileName("D:/QEoutput.stl"); >>>> stlWriter->SetFileTypeToASCII(); >>>> stlWriter->Write(); >>>> >>>> //Here it stops and taking long time >>>> >>>> return 0; >>>> >>>> >>>> } >>>> //// >>>> >>>> >>>> >>>> On Thu, Aug 7, 2014 at 3:39 PM, Mallikarjun K wrote: >>>> Hi Arnaud, >>>> >>>> Thanks for your reply and valuable suggestions. >>>> >>>> Number of points in my input mesh are 78928.In my pipeline I am already cleaning the polydata using vtkCleanPolyData filter.I will check the speed improvement and results with delaunay conforming turned OFF. >>>> >>>> Thank you >>>> >>>> >>>> On Thu, Aug 7, 2014 at 2:22 PM, Arnaud Gelas wrote: >>>> Hi Malik, >>>> >>>> First of all, I would recommend using MeshFileReader instead of VTKPolyDataReader (I guess VTKPolyDataReader will be deprecated in near future?). >>>> >>>> Regarding now the smoothing procedure in itself. This class definitively misses some documentation and I will be adding some in the next few days (mainly extracted from the corresponding insight journal). >>>> >>>> At the end of each iteration, when the delaunay conforming flag is turned ON, the conformation is performed. So depending on the mesh configuration, mesh size and number of iterations, it can take ages? >>>> How large is your input mesh (number of points)? >>>> >>>> You can also check results, by running first a smoothing without delaunay conforming, then apply a delaunay conforming on the output. Results won't be as nice, but you should get significant speed improvement. >>>> Another possibility is to first do a clean poly data in vtk, with a small threshold to remove small edges in the input meshes (which results in lots of edge flipping after smoothing). >>>> >>>> HTH >>>> Arnaud >>>> >>>> >>>> On Aug 6, 2014, at 10:42 AM, Mallikarjun K wrote: >>>> >>>>> Hi All, >>>>> >>>>> Can anyone suggest me if anything wrong I am doing in this below pipeline ,Where I used itkVtkPolydataReader to convert vtk Surface polydata to Itk QuadedgeMesh. Execution loop is being hung up for sometime(4 to 5 mins in release mode) at itkVtkPolydataReader . >>>>> >>>>> >>>>> //// >>>>> >>>>> typedef itk::QuadEdgeMeshTraits qetraits; >>>>> >>>>> typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; >>>>> >>>>> itk::OnesMatrixCoefficients< MeshType > coeff0; >>>>> >>>>> typedef itk::VTKPolyDataReader< MeshType >VTKPolyDataReaderType; >>>>> //typedef itk::VTKPolyDataWriter< MeshType >VTKPolyDataWriterType; >>>>> >>>>> //VTKPolyDataWriterType::Pointer ItkToVtkWriter=VTKPolyDataWriterType::New(); >>>>> VTKPolyDataReaderType::Pointer VtkToItkReader=VTKPolyDataReaderType::New(); >>>>> >>>>> VtkToItkReader->SetFileName("abc.vtk"); >>>>> VtkToItkReader->Update(); >>>>> >>>>> typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > >>>>> SmoothingQuadEdgeMeshFilter; >>>>> >>>>> SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = SmoothingQuadEdgeMeshFilter::New(); >>>>> >>>>> >>>>> QEMeshSmoother->SetInput(VtkToItkReader->GetOutPut()); >>>>> QEMeshSmoother->SetNumberOfIterations(5 ); >>>>> QEMeshSmoother->SetRelaxationFactor( 0.5 ); >>>>> QEMeshSmoother->SetDelaunayConforming(true ); >>>>> QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); >>>>> >>>>> QEMeshSmoother->Update(); >>>>> >>>>> //// >>>>> >>>>> >>>>> On Fri, Aug 1, 2014 at 4:36 PM, Mallikarjun K wrote: >>>>> Thanks Bill for your answer. >>>>> >>>>> The reason I am using this pipeline is that SmoothingQEMeshFilter has an additional parameter for smoothing which is delaunay conforming which helps to optimize aspect ratio of triangles while smoothing and thus produces better output.Is there anything similar filter in the vtk pipeline.I used vtkWindowedSincPolydatafilter which is not giving the output as good as QEMeshSmoothing filter. >>>>> >>>>> Thanks for your help >>>>> >>>>> >>>>> On Thu, Jul 31, 2014 at 5:14 PM, Bill Lorensen wrote: >>>>> If you have it in vtk, I suggest using the vtk pipeline to smooth the data. >>>>> >>>>> On Thu, Jul 31, 2014 at 1:35 AM, Mallikarjun K wrote: >>>>> > Hi Bill, >>>>> > Thanks for the replay. >>>>> > >>>>> > Yes,I built both ITK and my app with Release ,I forgot to mention it in the >>>>> > previous post.Actually the data set is the output of >>>>> > vtkDiscreteMarchingCubes algorithm(around 5MB) and need to smooth .I saved >>>>> > this marching cube's output as .vtk file and read it using >>>>> > itkVTKPolyDataReader and then I am giving this reader's output to >>>>> > itkSmoothingQuadEdgeMeshFilter's input. >>>>> > >>>>> > I checked the execution time of each step in the pipeline ,after >>>>> > SmothingQEMeshFilter has got it's input ,it is taking time to process the >>>>> > data. >>>>> > >>>>> > Thank you >>>>> > >>>>> > >>>>> > >>>>> > On Wed, Jul 30, 2014 at 9:29 PM, Bill Lorensen >>>>> > wrote: >>>>> >> >>>>> >> First, make sure you are building ITK and your app with Release. A >>>>> >> Debug build can be 10-50 times slower. >>>>> >> >>>>> >> >>>>> >> On Wed, Jul 30, 2014 at 10:18 AM, Mallikarjun K >>>>> >> wrote: >>>>> >> > Hi All, >>>>> >> > I am using itkSmoothingQuadEdgeMeshFilter for Surface Mesh >>>>> >> > smoothing.This >>>>> >> > filter is giving good results what I expected but taking more execution >>>>> >> > time.can any one suggest me to reduce the execution time( multi >>>>> >> > threading >>>>> >> > or any parameters to add/remove )? >>>>> >> > >>>>> >> > Below is the code snippet >>>>> >> > /////// >>>>> >> > typedef itk::QuadEdgeMeshTraits>>>> >> > > >>>>> >> > qetraits; >>>>> >> > typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; >>>>> >> > >>>>> >> > //typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3 > MeshType; >>>>> >> > >>>>> >> > itk::OnesMatrixCoefficients< MeshType > coeff0; >>>>> >> > >>>>> >> > typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > >>>>> >> > SmoothingQuadEdgeMeshFilter; >>>>> >> > >>>>> >> > SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = >>>>> >> > SmoothingQuadEdgeMeshFilter::New(); >>>>> >> > >>>>> >> > QEMeshSmoother->SetInput("abc.vtk"); >>>>> >> > QEMeshSmoother->SetNumberOfIterations(5 ); >>>>> >> > QEMeshSmoother->SetRelaxationFactor( 0.5 ); >>>>> >> > QEMeshSmoother->SetDelaunayConforming(true ); >>>>> >> > QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); >>>>> >> > QEMeshSmoother->Update(); >>>>> >> > //// >>>>> >> > >>>>> >> > -- >>>>> >> > Regards: >>>>> >> > Mallik >>>>> >> > >>>>> >> > >>>>> >> > _____________________________________ >>>>> >> > Powered by www.kitware.com >>>>> >> > >>>>> >> > Visit other Kitware open-source projects at >>>>> >> > http://www.kitware.com/opensource/opensource.html >>>>> >> > >>>>> >> > Kitware offers ITK Training Courses, for more information visit: >>>>> >> > http://www.kitware.com/products/protraining.php >>>>> >> > >>>>> >> > Please keep messages on-topic and check the ITK FAQ at: >>>>> >> > http://www.itk.org/Wiki/ITK_FAQ >>>>> >> > >>>>> >> > Follow this link to subscribe/unsubscribe: >>>>> >> > http://public.kitware.com/mailman/listinfo/insight-users >>>>> >> > >>>>> >> >>>>> >> >>>>> >> >>>>> >> -- >>>>> >> Unpaid intern in BillsBasement at noware dot com >>>>> > >>>>> > >>>>> > >>>>> > >>>>> > -- >>>>> > Regards: >>>>> > Mallik >>>>> > >>>>> >>>>> >>>>> >>>>> -- >>>>> Unpaid intern in BillsBasement at noware dot com >>>>> >>>>> >>>>> >>>>> -- >>>>> Regards: >>>>> Mallik >>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Regards: >>>>> Mallik >>>>> >>>>> _____________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Kitware offers ITK Training Courses, for more information visit: >>>>> http://www.kitware.com/products/protraining.php >>>>> >>>>> Please keep messages on-topic and check the ITK FAQ at: >>>>> http://www.itk.org/Wiki/ITK_FAQ >>>>> >>>>> Follow this link to subscribe/unsubscribe: >>>>> http://public.kitware.com/mailman/listinfo/insight-users >>>> >>>> >>>> >>>> >>>> -- >>>> Regards: >>>> Mallik >>>> >>>> >>>> >>>> >>>> -- >>>> Regards: >>>> Mallik >>>> >>> >>> >>> >>> >>> -- >>> Regards: >>> Mallik >>> >>> >> >> >> >> >> -- >> Regards: >> Mallik >> > > > > > -- > Regards: > Mallik > -------------- next part -------------- An HTML attachment was scrubbed... URL: From arnaudgelas at gmail.com Thu Aug 21 07:00:52 2014 From: arnaudgelas at gmail.com (Arnaud Gelas) Date: Thu, 21 Aug 2014 13:00:52 +0200 Subject: [ITK-users] itkSmoothingQuadEdgeMeshFilter Help!! In-Reply-To: References: <20566F1B-1B71-411D-8C31-B25D4B24397A@gmail.com> <305E1509-8EF7-4770-9236-3D639B9BF155@gmail.com> <8E777677-5A6C-47A1-9ED6-030C85AB48B5@gmail.com> Message-ID: <997CA50D-FE3F-4620-BBDD-CCCD9EB440E0@gmail.com> Here is the patch (for progress report): http://review.source.kitware.com/#/c/16769/ On Aug 21, 2014, at 12:47 PM, Arnaud Gelas wrote: > Hi, > > As of now, there is no progress event on this filter, so it is normal nothing happened. > > I'll submit another patch for progress event later today. > > To review the patch, you need to create an account on gerrit: > > http://review.source.kitware.com > > Then you ca volunteer to the review patch, you can add comments, accept, refuse? > Else once you are registered, you can send me an email and I will add you as a reviewer. > > Best, > Arnaud > > On Aug 21, 2014, at 12:11 PM, Mallikarjun K wrote: > >> Hi, >> I am trying observe the progressEvent by using AddObserver method of this filter but I couldn't. Could you check the below code once. >> >> And one more thing,Could you guide me what exactly I have to do to Review the patch you have submitted. >> >> Thank you >> >> >> ///progress >> >> #include >> #include >> >> #include >> #include >> #include >> #include >> #include "itkMesh.h" >> #include "itkQuadEdgeMesh.h" >> #include "itkQuadEdgeMeshTraits.h" >> #include "itkSmoothingQuadEdgeMeshFilter.h" >> #include "itkCommand.h" >> >> class MyCommand : public itk::Command >> { >> public: >> itkNewMacro( MyCommand ); >> >> public: >> >> void Execute(itk::Object *caller, const itk::EventObject & event) >> { >> Execute( (const itk::Object *)caller, event); >> } >> >> void Execute(const itk::Object * object, const itk::EventObject & event) >> { >> std::cout << "Command called." << std::endl; >> >> if( typeid( itk::ProgressEvent ) == typeid( event ) ) >> { >> ::itk::ProcessObject::ConstPointer process = >> dynamic_cast< const itk::ProcessObject *>( object/*caller*/ ); >> >> const int value = static_cast(process->GetProgress() * 100 ); >> std::cout<<"progress:"<> >> >> >> } >> >> } >> >> }; >> >> int main( int argc, char* argv[] ) >> { >> >> /*if( argc < 2 ) >> { >> std::cerr << "Usage: " << std::endl; >> std::cerr << argv[0] << " inputImageFile outputImageFile flipAxisX flipAxisY" << std::endl; >> return EXIT_FAILURE; >> }*/ >> >> std::string Inputfilename="D:\\temp.vtk"; >> typedef itk::QuadEdgeMeshTraits qetraits; >> typedef itk::QuadEdgeMesh< double, 3,qetraits > MeshType; >> >> itk::OnesMatrixCoefficients< MeshType > coeff0; >> typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType >SmoothingQuadEdgeMeshFilter; >> >> SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = SmoothingQuadEdgeMeshFilter::New(); >> >> typedef itk::MeshFileReader MeshReaderType; >> MeshReaderType::Pointer Meshreader = MeshReaderType::New(); >> Meshreader->SetFileName( Inputfilename.c_str()/*argv[1]*/ ); >> // Meshreader->Update(); >> >> >> MyCommand::Pointer myCommand = MyCommand::New(); >> >> QEMeshSmoother->SetInput(Meshreader->GetOutput() ); >> QEMeshSmoother->SetNumberOfIterations( 1 ); >> QEMeshSmoother->SetRelaxationFactor( 0.5 ); >> QEMeshSmoother->SetDelaunayConforming(true); >> QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); >> QEMeshSmoother->AddObserver(itk::ProgressEvent, myCommand); >> >> // QEMeshSmoother->Update(); >> std::string Outputfilename="D:\\tempOut2.vtk"; >> >> typedef itk::MeshFileWriter MeshWriterType; >> MeshWriterType::Pointer Meshwriter = MeshWriterType::New(); >> Meshwriter->SetFileName(Outputfilename.c_str() /*argv[2]*/ ); >> Meshwriter->SetInput(QEMeshSmoother->GetOutput()); >> >> try >> { >> Meshwriter->Update(); >> } >> catch( itk::ExceptionObject& e ) >> { >> std::cerr << e.what() << std::endl; >> } >> >> return 0; >> >> >> } >> >> >> On Wed, Aug 20, 2014 at 7:33 PM, Arnaud Gelas wrote: >> Hi, >> >> I have just submitted this patch for the documentation, can you please review it? >> >> http://review.source.kitware.com/#/c/16755/ >> >> I was running this code on Mac i5 with 4GB RAM, with both ITK and this program compiled in Debug? >> >> Best, >> Arnaud >> >> On Aug 7, 2014, at 5:20 PM, Mallikarjun K wrote: >> >>> Hi Arnaud, >>> >>> Thanks,Can you please tell me your machine confuguration. I am running 4GB RAM,i3 on windows7. >>> I have downloaded your project and tried to execute it and it is still the same problem Which I was facing earlier.Any suggestions ..... >>> >>> thank you >>> >>> >>> On Thu, Aug 7, 2014 at 8:10 PM, Arnaud Gelas wrote: >>> It takes 29s on my machine in debug to run 5 iterations with Delaunay conforming set to true >>> >>> https://gist.github.com/arnaudgelas/0f20ebdaf53956f79997 >>> >>> >>> On Aug 7, 2014, at 3:45 PM, Mallikarjun K wrote: >>> >>>> File path is correct.if it is '\'(backward slash) we have to add "D:\\" .since I used '/' it's not required to add "//". >>>> >>>> please find the attached .vtk file >>>> >>>> Thanks >>>> >>>> >>>> On Thu, Aug 7, 2014 at 7:01 PM, Arnaud Gelas wrote: >>>> Shouldn't it be D://temp.vtk ? Isn't it missing one '/' ? >>>> >>>> Can you send this vtk file? >>>> >>>> >>>> On Aug 7, 2014, at 3:23 PM, Mallikarjun K wrote: >>>> >>>>> Hi Arnaud, >>>>> >>>>> Kindly have a look in the below code ,the problem is that even after QEMeshFilter output is saved as .stl file ,the program is still running for long time.I have observed in my tests that MeshFileReader seems to be the culprit. Any suggestions ? >>>>> >>>>> ///// >>>>> #include >>>>> #include >>>>> >>>>> #include >>>>> #include >>>>> #include >>>>> #include >>>>> #include >>>>> #include >>>>> #include >>>>> #include >>>>> #include "itkMesh.h" >>>>> #include "itkQuadEdgeMesh.h" >>>>> #include "itkQuadEdgeMeshTraits.h" >>>>> #include "itkSmoothingQuadEdgeMeshFilter.h" >>>>> #include "vtkSTLWriter.h" >>>>> #include >>>>> >>>>> int main() >>>>> { >>>>> std::string Inputfilename="D:/temp.vtk"; //number of points of this mesh file is around 78K >>>>> >>>>> typedef itk::QuadEdgeMeshTraits qetraits; >>>>> typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; >>>>> >>>>> itk::OnesMatrixCoefficients< MeshType > coeff0; >>>>> typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType >SmoothingQuadEdgeMeshFilter; >>>>> >>>>> vtkSmartPointer polyDatawriter=vtkSmartPointer::New(); >>>>> vtkSmartPointer polyDatareader=vtkSmartPointer::New(); >>>>> >>>>> SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = SmoothingQuadEdgeMeshFilter::New(); >>>>> >>>>> /* polyDatareader->SetFileName(Inputfilename.c_str() ); >>>>> polyDatareader->ReleaseDataFlagOn(); >>>>> polyDatareader->Update();*/ >>>>> >>>>> /*vtkSmartPointer triangleFilter = >>>>> vtkSmartPointer::New(); >>>>> triangleFilter->SetInput(polyDatareader->GetOutput()); >>>>> triangleFilter->Update();*/ >>>>> >>>>> // >>>>> /* vtkSmartPointer clean = vtkSmartPointer::New(); >>>>> #if (VTK_MAJOR_VERSION < 6) >>>>> clean->SetInput(triangleFilter->GetOutput() ); >>>>> #else >>>>> clean->SetInputData(triangleFilter->GetOutput() ); >>>>> #endif >>>>> >>>>> clean->ConvertPolysToLinesOff(); >>>>> clean->ConvertLinesToPointsOff(); >>>>> clean->Update(); >>>>> >>>>> std::string Inputfilename2="D:/cleaned.vtk";*/ >>>>> >>>>> //// >>>>> /*polyDatawriter->SetInput(clean->GetOutput()); >>>>> polyDatawriter->SetFileName(Inputfilename2.c_str()); >>>>> polyDatawriter->ReleaseDataFlagOn(); >>>>> polyDatawriter->Write(); */ >>>>> >>>>> typedef itk::MeshFileReader MeshReaderType; >>>>> MeshReaderType::Pointer Meshreader = MeshReaderType::New(); >>>>> Meshreader->SetFileName(Inputfilename.c_str( )); >>>>> Meshreader->Update(); >>>>> >>>>> /*MeshType::Pointer mesh = Meshreader->GetOutput(); >>>>> mesh->DisconnectPipeline();*/ >>>>> >>>>> >>>>> QEMeshSmoother->SetInput(Meshreader->GetOutput()/*mesh*/ ); >>>>> QEMeshSmoother->SetNumberOfIterations(1 ); >>>>> QEMeshSmoother->SetRelaxationFactor( 0.5 ); >>>>> QEMeshSmoother->SetDelaunayConforming(true); >>>>> QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); >>>>> >>>>> QEMeshSmoother->ReleaseDataFlagOn(); >>>>> >>>>> QEMeshSmoother->Update(); >>>>> >>>>> std::string Outputfilename="D:/tempOut.vtk"; >>>>> >>>>> typedef itk::MeshFileWriter MeshWriterType; >>>>> MeshWriterType::Pointer Meshwriter = MeshWriterType::New(); >>>>> Meshwriter->SetFileName(Outputfilename.c_str( )); >>>>> Meshwriter->SetInput(QEMeshSmoother->GetOutput()); >>>>> Meshwriter->Update(); >>>>> >>>>> polyDatareader->SetFileName(Outputfilename.c_str() ); >>>>> polyDatareader->ReleaseDataFlagOn(); >>>>> polyDatareader->Update(); >>>>> >>>>> vtkSmartPointer stlWriter=vtkSmartPointer::New(); >>>>> >>>>> stlWriter->SetInput( polyDatareader->GetOutput()); >>>>> stlWriter->SetFileName("D:/QEoutput.stl"); >>>>> stlWriter->SetFileTypeToASCII(); >>>>> stlWriter->Write(); >>>>> >>>>> //Here it stops and taking long time >>>>> >>>>> return 0; >>>>> >>>>> >>>>> } >>>>> //// >>>>> >>>>> >>>>> >>>>> On Thu, Aug 7, 2014 at 3:39 PM, Mallikarjun K wrote: >>>>> Hi Arnaud, >>>>> >>>>> Thanks for your reply and valuable suggestions. >>>>> >>>>> Number of points in my input mesh are 78928.In my pipeline I am already cleaning the polydata using vtkCleanPolyData filter.I will check the speed improvement and results with delaunay conforming turned OFF. >>>>> >>>>> Thank you >>>>> >>>>> >>>>> On Thu, Aug 7, 2014 at 2:22 PM, Arnaud Gelas wrote: >>>>> Hi Malik, >>>>> >>>>> First of all, I would recommend using MeshFileReader instead of VTKPolyDataReader (I guess VTKPolyDataReader will be deprecated in near future?). >>>>> >>>>> Regarding now the smoothing procedure in itself. This class definitively misses some documentation and I will be adding some in the next few days (mainly extracted from the corresponding insight journal). >>>>> >>>>> At the end of each iteration, when the delaunay conforming flag is turned ON, the conformation is performed. So depending on the mesh configuration, mesh size and number of iterations, it can take ages? >>>>> How large is your input mesh (number of points)? >>>>> >>>>> You can also check results, by running first a smoothing without delaunay conforming, then apply a delaunay conforming on the output. Results won't be as nice, but you should get significant speed improvement. >>>>> Another possibility is to first do a clean poly data in vtk, with a small threshold to remove small edges in the input meshes (which results in lots of edge flipping after smoothing). >>>>> >>>>> HTH >>>>> Arnaud >>>>> >>>>> >>>>> On Aug 6, 2014, at 10:42 AM, Mallikarjun K wrote: >>>>> >>>>>> Hi All, >>>>>> >>>>>> Can anyone suggest me if anything wrong I am doing in this below pipeline ,Where I used itkVtkPolydataReader to convert vtk Surface polydata to Itk QuadedgeMesh. Execution loop is being hung up for sometime(4 to 5 mins in release mode) at itkVtkPolydataReader . >>>>>> >>>>>> >>>>>> //// >>>>>> >>>>>> typedef itk::QuadEdgeMeshTraits qetraits; >>>>>> >>>>>> typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; >>>>>> >>>>>> itk::OnesMatrixCoefficients< MeshType > coeff0; >>>>>> >>>>>> typedef itk::VTKPolyDataReader< MeshType >VTKPolyDataReaderType; >>>>>> //typedef itk::VTKPolyDataWriter< MeshType >VTKPolyDataWriterType; >>>>>> >>>>>> //VTKPolyDataWriterType::Pointer ItkToVtkWriter=VTKPolyDataWriterType::New(); >>>>>> VTKPolyDataReaderType::Pointer VtkToItkReader=VTKPolyDataReaderType::New(); >>>>>> >>>>>> VtkToItkReader->SetFileName("abc.vtk"); >>>>>> VtkToItkReader->Update(); >>>>>> >>>>>> typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > >>>>>> SmoothingQuadEdgeMeshFilter; >>>>>> >>>>>> SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = SmoothingQuadEdgeMeshFilter::New(); >>>>>> >>>>>> >>>>>> QEMeshSmoother->SetInput(VtkToItkReader->GetOutPut()); >>>>>> QEMeshSmoother->SetNumberOfIterations(5 ); >>>>>> QEMeshSmoother->SetRelaxationFactor( 0.5 ); >>>>>> QEMeshSmoother->SetDelaunayConforming(true ); >>>>>> QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); >>>>>> >>>>>> QEMeshSmoother->Update(); >>>>>> >>>>>> //// >>>>>> >>>>>> >>>>>> On Fri, Aug 1, 2014 at 4:36 PM, Mallikarjun K wrote: >>>>>> Thanks Bill for your answer. >>>>>> >>>>>> The reason I am using this pipeline is that SmoothingQEMeshFilter has an additional parameter for smoothing which is delaunay conforming which helps to optimize aspect ratio of triangles while smoothing and thus produces better output.Is there anything similar filter in the vtk pipeline.I used vtkWindowedSincPolydatafilter which is not giving the output as good as QEMeshSmoothing filter. >>>>>> >>>>>> Thanks for your help >>>>>> >>>>>> >>>>>> On Thu, Jul 31, 2014 at 5:14 PM, Bill Lorensen wrote: >>>>>> If you have it in vtk, I suggest using the vtk pipeline to smooth the data. >>>>>> >>>>>> On Thu, Jul 31, 2014 at 1:35 AM, Mallikarjun K wrote: >>>>>> > Hi Bill, >>>>>> > Thanks for the replay. >>>>>> > >>>>>> > Yes,I built both ITK and my app with Release ,I forgot to mention it in the >>>>>> > previous post.Actually the data set is the output of >>>>>> > vtkDiscreteMarchingCubes algorithm(around 5MB) and need to smooth .I saved >>>>>> > this marching cube's output as .vtk file and read it using >>>>>> > itkVTKPolyDataReader and then I am giving this reader's output to >>>>>> > itkSmoothingQuadEdgeMeshFilter's input. >>>>>> > >>>>>> > I checked the execution time of each step in the pipeline ,after >>>>>> > SmothingQEMeshFilter has got it's input ,it is taking time to process the >>>>>> > data. >>>>>> > >>>>>> > Thank you >>>>>> > >>>>>> > >>>>>> > >>>>>> > On Wed, Jul 30, 2014 at 9:29 PM, Bill Lorensen >>>>>> > wrote: >>>>>> >> >>>>>> >> First, make sure you are building ITK and your app with Release. A >>>>>> >> Debug build can be 10-50 times slower. >>>>>> >> >>>>>> >> >>>>>> >> On Wed, Jul 30, 2014 at 10:18 AM, Mallikarjun K >>>>>> >> wrote: >>>>>> >> > Hi All, >>>>>> >> > I am using itkSmoothingQuadEdgeMeshFilter for Surface Mesh >>>>>> >> > smoothing.This >>>>>> >> > filter is giving good results what I expected but taking more execution >>>>>> >> > time.can any one suggest me to reduce the execution time( multi >>>>>> >> > threading >>>>>> >> > or any parameters to add/remove )? >>>>>> >> > >>>>>> >> > Below is the code snippet >>>>>> >> > /////// >>>>>> >> > typedef itk::QuadEdgeMeshTraits>>>>> >> > > >>>>>> >> > qetraits; >>>>>> >> > typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3,qetraits > MeshType; >>>>>> >> > >>>>>> >> > //typedef itk::QuadEdgeMesh< vtkFloatingPointType, 3 > MeshType; >>>>>> >> > >>>>>> >> > itk::OnesMatrixCoefficients< MeshType > coeff0; >>>>>> >> > >>>>>> >> > typedef itk::SmoothingQuadEdgeMeshFilter< MeshType, MeshType > >>>>>> >> > SmoothingQuadEdgeMeshFilter; >>>>>> >> > >>>>>> >> > SmoothingQuadEdgeMeshFilter::Pointer QEMeshSmoother = >>>>>> >> > SmoothingQuadEdgeMeshFilter::New(); >>>>>> >> > >>>>>> >> > QEMeshSmoother->SetInput("abc.vtk"); >>>>>> >> > QEMeshSmoother->SetNumberOfIterations(5 ); >>>>>> >> > QEMeshSmoother->SetRelaxationFactor( 0.5 ); >>>>>> >> > QEMeshSmoother->SetDelaunayConforming(true ); >>>>>> >> > QEMeshSmoother->SetCoefficientsMethod( &coeff0 ); >>>>>> >> > QEMeshSmoother->Update(); >>>>>> >> > //// >>>>>> >> > >>>>>> >> > -- >>>>>> >> > Regards: >>>>>> >> > Mallik >>>>>> >> > >>>>>> >> > >>>>>> >> > _____________________________________ >>>>>> >> > Powered by www.kitware.com >>>>>> >> > >>>>>> >> > Visit other Kitware open-source projects at >>>>>> >> > http://www.kitware.com/opensource/opensource.html >>>>>> >> > >>>>>> >> > Kitware offers ITK Training Courses, for more information visit: >>>>>> >> > http://www.kitware.com/products/protraining.php >>>>>> >> > >>>>>> >> > Please keep messages on-topic and check the ITK FAQ at: >>>>>> >> > http://www.itk.org/Wiki/ITK_FAQ >>>>>> >> > >>>>>> >> > Follow this link to subscribe/unsubscribe: >>>>>> >> > http://public.kitware.com/mailman/listinfo/insight-users >>>>>> >> > >>>>>> >> >>>>>> >> >>>>>> >> >>>>>> >> -- >>>>>> >> Unpaid intern in BillsBasement at noware dot com >>>>>> > >>>>>> > >>>>>> > >>>>>> > >>>>>> > -- >>>>>> > Regards: >>>>>> > Mallik >>>>>> > >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Unpaid intern in BillsBasement at noware dot com >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Regards: >>>>>> Mallik >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Regards: >>>>>> Mallik >>>>>> >>>>>> _____________________________________ >>>>>> Powered by www.kitware.com >>>>>> >>>>>> Visit other Kitware open-source projects at >>>>>> http://www.kitware.com/opensource/opensource.html >>>>>> >>>>>> Kitware offers ITK Training Courses, for more information visit: >>>>>> http://www.kitware.com/products/protraining.php >>>>>> >>>>>> Please keep messages on-topic and check the ITK FAQ at: >>>>>> http://www.itk.org/Wiki/ITK_FAQ >>>>>> >>>>>> Follow this link to subscribe/unsubscribe: >>>>>> http://public.kitware.com/mailman/listinfo/insight-users >>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Regards: >>>>> Mallik >>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Regards: >>>>> Mallik >>>>> >>>> >>>> >>>> >>>> >>>> -- >>>> Regards: >>>> Mallik >>>> >>>> >>> >>> >>> >>> >>> -- >>> Regards: >>> Mallik >>> >> >> >> >> >> -- >> Regards: >> Mallik >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From maximilian_oliver.mordig at roche.com Thu Aug 21 10:52:53 2014 From: maximilian_oliver.mordig at roche.com (maximilian) Date: Thu, 21 Aug 2014 07:52:53 -0700 (PDT) Subject: [ITK-users] Modifying ValueAt function of SpatialObject Message-ID: <1408632773158-7586101.post@n2.nabble.com> Dear all, I am using the itk::SpatialObjectToImageFilter to convert a GroupSpatialObject (collection of several spatial objects) to an image. This filter is fine, however, if several spatial objects overlap at a location, the image's pixel value of that location is the first value returned by any spatial object in GroupSpatialObject (the ValueAt function is implemented in SpatialObject.hxx and iterates through its children; if one children matches, its value is immediately returned). I wanted the change the ValueAt() function to add up all the values returned by the ValueAt function if several SpatialObjects overlap at a location. To change the behavior, I have to inherit my new class, let's call it A, from GroupSpatialObject (collection of SpatialObjects) and redefine the method ValueAt(). The ValueAt() function in A has to be very similar to the ValueAt() defined in SpatialObject, but add up the values returned by its children spatial objects (instead of returning just the first match as it is currently implemented). The problem is that I need access m_TreeNode that is a list of all children (i.e. all objects contained in the GroupSpatialObject) to get the values of each child. However, m_TreeNode is declared private in the SpatialObject class. How can I circumvent this? Of course, I could copy-paste SpatialObject into a new class, but I consider this a very ugly solution, because I have to do so for all derived classes (like GroupSpatialObject, among others). Regards, Maximilian -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Modifying-ValueAt-function-of-SpatialObject-tp7586101.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From bilgincc at gmail.com Thu Aug 21 13:33:53 2014 From: bilgincc at gmail.com (Cagatay Bilgin) Date: Thu, 21 Aug 2014 10:33:53 -0700 Subject: [ITK-users] Different output with dense and sparse level set representations Message-ID: Hello everybody, I continue with my exploration of the new level set framework. I have modified one of the examples and have an advection field in the positive x direction. I would expect the initial contour to move in that direction and that's the case with the sparse representation. Using the dense representation however, only half of the contour moves to my surprise. Is this a bug or I am missing something here. Here is the code and the cmake file and snapshots of the movements. [image: Inline image 2][image: Inline image 1] #include "itkBinaryImageToLevelSetImageAdaptor.h" #include "itkLevelSetContainer.h" #include "itkLevelSetEquationPropagationTerm.h" #include "itkLevelSetEquationAdvectionTerm.h" #include "itkLevelSetEquationContainer.h" #include "itkLevelSetEquationTermContainer.h" #include "itkLevelSetEvolution.h" #include "itkLevelSetEvolutionNumberOfIterationsStoppingCriterion.h" #include "itkLevelSetDenseImage.h" #include "itkVTKVisualizeImageLevelSetIsoValues.h" #include "itkSinRegularizedHeavisideStepFunction.h" #include "itkLevelSetIterationUpdateCommand.h" #include "itkLevelSetEquationCurvatureTerm.h" #include "itkWhitakerSparseLevelSetImage.h" #include "itkLevelSetSparseImage.h" typedef itk::Image< float, 2 > FIT; void CreateSquareImage(FIT::Pointer image, FIT::Pointer prop, FIT::Pointer advec) { FIT::RegionType region; FIT::IndexType start; start[0] = 0; start[1] = 0; FIT::SizeType size; size[0] = 100; size[1] = 100; region.SetSize(size); region.SetIndex(start); image->SetRegions(region); image->Allocate(); image->FillBuffer(0); //constant grow in all directions prop->SetRegions(image->GetLargestPossibleRegion()); prop->Allocate(); prop->FillBuffer(1); //advec will increase in positive x direction advec->SetRegions(image->GetLargestPossibleRegion()); advec->Allocate(); advec->FillBuffer(0); // Set pixels in a square to one value for(unsigned int x = 35; x < 65; x++){ for(unsigned int y = 35; y < 65; y++){ FIT::IndexType pixelIndex; pixelIndex[0] = x; pixelIndex[1] = y; image->SetPixel(pixelIndex, 255); } } //advection in positive x direction for(unsigned int x = 0; x < 100; x++){ for(unsigned int y = 0; y < 100; y++){ FIT::IndexType pixelIndex; pixelIndex[0] = x; pixelIndex[1] = y; advec->SetPixel(pixelIndex, x); } } } /* */ int main(int argc, char* argv[] ) { using namespace itk; if(argc != 5) { std::cerr << "Missing Arguments" << std::endl; std::cerr << argv[0] << std::endl; std::cerr << "1- Number of Iterations" << std::endl; std::cerr << "2- Propagation Term" << std::endl; std::cerr << "3- Advection Term" << std::endl; std::cerr << "4- Curvature Term" << std::endl; return EXIT_FAILURE; } FIT::Pointer input = FIT::New(); FIT::Pointer prop = FIT::New(); FIT::Pointer advec = FIT::New(); CreateSquareImage(input, prop, advec); int numberOfIterations = atoi(argv[1]); typedef float LSPT; typedef Image< LSPT, 2 > LSIT; typedef LevelSetDenseImage< LSIT > LST; //typedef WhitakerSparseLevelSetImage< LSPT, 2 > LST; typedef LST::OutputRealType LSOutputT; // convert a binary mask to a level-set function typedef BinaryImageToLevelSetImageAdaptor BI2LST; BI2LST::Pointer adaptor = BI2LST::New(); adaptor->SetInputImage(input ); adaptor->Initialize(); LST::Pointer levelSet = adaptor->GetLevelSet(); // The Heaviside function typedef SinRegularizedHeavisideStepFunction HeavisideFunctionType; HeavisideFunctionType::Pointer heaviside = HeavisideFunctionType::New(); heaviside->SetEpsilon(1 ); // Create the level set container typedef LevelSetContainer< IdentifierType, LST > LSContainerT; LSContainerT::Pointer levelSetContainer = LSContainerT::New(); levelSetContainer->SetHeaviside(heaviside ); levelSetContainer->AddLevelSet(0, levelSet ); // Create the terms. typedef LevelSetEquationPropagationTerm PropT; PropT::Pointer propagationTerm = PropT::New(); propagationTerm->SetInput(prop); propagationTerm->SetCoefficient(atof(argv[2])); typedef LevelSetEquationAdvectionTerm AdvecT; AdvecT::Pointer advectionTerm = AdvecT::New(); advectionTerm->SetInput(advec); advectionTerm->SetCoefficient(atof(argv[3])); typedef LevelSetEquationCurvatureTerm CurvT; CurvT::Pointer curvatureTerm = CurvT::New(); curvatureTerm->SetCoefficient(atof(argv[4])); // Create term container (equation rhs) typedef LevelSetEquationTermContainer< FIT, LSContainerT > TermContainerT; TermContainerT::Pointer termContainer = TermContainerT::New(); termContainer->SetLevelSetContainer(levelSetContainer ); termContainer->SetInput(input ); termContainer->AddTerm(0, curvatureTerm ); termContainer->AddTerm(1, advectionTerm ); termContainer->AddTerm(2, propagationTerm ); // Create equation container typedef LevelSetEquationContainer< TermContainerT > EquationContainerType; EquationContainerType::Pointer equationContainer = EquationContainerType::New(); equationContainer->SetLevelSetContainer(levelSetContainer ); equationContainer->AddEquation(0, termContainer ); // Create stopping criteria typedef LevelSetEvolutionNumberOfIterationsStoppingCriterion< LSContainerT > StoppingCriterionType; StoppingCriterionType::Pointer criterion = StoppingCriterionType::New(); criterion->SetNumberOfIterations(numberOfIterations ); // Create the visualizer typedef VTKVisualizeImageLevelSetIsoValues< FIT, LST > VisT; VisT::Pointer visualizer = VisT::New(); visualizer->SetInputImage(input ); visualizer->SetLevelSet(levelSet ); visualizer->SetScreenCapture(true ); // Create evolution class typedef LevelSetEvolution< EquationContainerType, LST > LSEvolT; LSEvolT::Pointer evolution = LSEvolT::New(); evolution->SetEquationContainer(equationContainer ); evolution->SetStoppingCriterion(criterion ); evolution->SetLevelSetContainer(levelSetContainer ); typedef LevelSetIterationUpdateCommand< LSEvolT, VisT > IterationUpdateCommandType; IterationUpdateCommandType::Pointer iterationUpdateCommand = IterationUpdateCommandType::New(); iterationUpdateCommand->SetFilterToUpdate(visualizer ); iterationUpdateCommand->SetUpdatePeriod(1 ); evolution->AddObserver(IterationEvent(), iterationUpdateCommand ); evolution->Update(); return EXIT_SUCCESS; } cmake_minimum_required(VERSION 2.8) project(Motion) find_package(ITK REQUIRED) include(${ITK_USE_FILE}) find_package(VTK REQUIRED) include(${VTK_USE_FILE}) add_executable(Motion main.cpp) target_link_libraries(Motion ${ITK_LIBRARIES} ${VTK_LIBRARIES}) Params used for the experiment: Ran sparse representation with ./Motion 15 0 1 1 Ran dense representation with ./Motion 15 0 1 0 Cemal Cagatay Bilgin, PhD Life Sciences Division Lawrence Berkeley National Lab MS977, One Cyclotron Road Berkeley, CA 94720, USA Email: ccbilgin at lbl.gov -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: sparse_00015.png Type: image/png Size: 2848 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: dense_00010.png Type: image/png Size: 2737 bytes Desc: not available URL: From matt.mccormick at kitware.com Thu Aug 21 17:54:56 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 21 Aug 2014 17:54:56 -0400 Subject: [ITK-users] Friday gathering Message-ID: Hi, I will not be able to host or attend the regular gathering tomorrow. If someone is interested in hosting, please do so. Thanks, Matt From arnaudgelas at gmail.com Fri Aug 22 02:58:34 2014 From: arnaudgelas at gmail.com (Arnaud Gelas) Date: Fri, 22 Aug 2014 08:58:34 +0200 Subject: [ITK-users] [ITK] combining N images In-Reply-To: <41BB5486-E3F6-4196-8E58-C59F514C8800@mail.nih.gov> References: <41BB5486-E3F6-4196-8E58-C59F514C8800@mail.nih.gov> Message-ID: Hi Brad, Thanks for the link! It helped me to get on track... In the end, it was not that complicated to do all in one filter (let me know if anyone is interested). Arnaud On Wed, Aug 20, 2014 at 6:53 PM, Bradley Lowekamp wrote: > This may be of some use: > > > https://github.com/blowekamp/itkStreamingSinc/blob/master/include/itkBoundingRegionImageSinc.h > > On Aug 20, 2014, at 11:51 AM, Arnaud Gelas wrote: > > Hi, > > I do not want to add images, it is more something like pasting but I do > not know in advance what would be the output image size, but it would be at > least the bounding box of all images... > > Arnaud > > On Wednesday, August 20, 2014, Mordig, Maximilian Oliver < > maximilian_oliver.mordig at roche.com> wrote: > >> Once you have resampled all images, you can use the itk AddFilter. >> >> >> On Wed, Aug 20, 2014 at 4:28 PM, Arnaud Gelas >> wrote: >> >>> Hi all, >>> >>> I am trying to combine N images together into a single image of the same >>> dimension. >>> >>> These N images have the same direction, but can have different origin, >>> start index, spacing, size (there is no overlap). Then gaps in between >>> images would be filled with a given constant value. >>> >>> Is there such a filter? or assuming I have already resampled all images >>> to a common ground, is there a filter to do this? >>> >>> Thanks, >>> Arnaud >>> >>> _____________________________________ >>> 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 > > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vincent.ngai at gmail.com Fri Aug 22 03:30:44 2014 From: vincent.ngai at gmail.com (vincent ngai) Date: Fri, 22 Aug 2014 15:30:44 +0800 Subject: [ITK-users] Silly question on itk::Matrix Message-ID: Hi all, pardon me for this silly question on itk::Matrix. Why do I need to transpose a translation matrix after I copy the [x,y,z] translation values to the matrix[3]. I know conceptually it should not really matter whether its row or col major so long as you can post multiply or pre multiply with another vector. But the way operator*() works only allows for Matrix * P, and when I test the simple case of TranslationMatrix * Point, I would have to transpose the matrix. If I could also do Point * TranslationMatrix, then i wouldn't need to transpose. Any ideas? -- Regards, Vincent -------------- next part -------------- An HTML attachment was scrubbed... URL: From millerjv at gmail.com Fri Aug 22 07:14:11 2014 From: millerjv at gmail.com (Jim Miller) Date: Fri, 22 Aug 2014 07:14:11 -0400 Subject: [ITK-users] Silly question on itk::Matrix In-Reply-To: References: Message-ID: <0BBC89C9-0F67-48F1-99F4-AC89AF5C394B@gmail.com> ITK standard is that points are column vectors. Thus, matrix times a point a point is defined as Mat * P Jim > On Aug 22, 2014, at 3:30 AM, vincent ngai wrote: > > Hi all, pardon me for this silly question on itk::Matrix. Why do I need to transpose a translation matrix after I copy the [x,y,z] translation values to the matrix[3]. > > I know conceptually it should not really matter whether its row or col major so long as you can > post multiply or pre multiply with another vector. But the way operator*() works only allows for > Matrix * P, and when I test the simple case of TranslationMatrix * Point, I would have to transpose the matrix. If I could also do Point * TranslationMatrix, then i wouldn't need to transpose. > > Any ideas? > > -- > Regards, > Vincent > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users From joseignacio.prieto at gmail.com Fri Aug 22 19:45:37 2014 From: joseignacio.prieto at gmail.com (Jose Ignacio Prieto) Date: Fri, 22 Aug 2014 19:45:37 -0400 Subject: [ITK-users] 2D polygon stack to 3d mesh Message-ID: Hi all, I am dubious to which mail list use. I have an array of 2d snake segmentations for the left ventricle( a std vector of 20 rows with a closed convex 2d polygon each row) on ITK and I would like it to turn it into a mesh that can be visualized. Should I use QuadMeshEdge and then a Delaunay in ITk, or use Delaunay methods in VTK. Or maybe I should write an ad-hoc method given that the points are sorted so a triangle can be made with two consecutive polygon points and the closest one on the following slice. Thank you very much, Ignacio Prieto -- Ignacio Prieto Research Assistant Biomedical Imaging Center Pontificia Universidad Catolica de Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From vincent.ngai at gmail.com Fri Aug 22 21:49:32 2014 From: vincent.ngai at gmail.com (vincent ngai) Date: Sat, 23 Aug 2014 09:49:32 +0800 Subject: [ITK-users] Silly question on itk::Matrix In-Reply-To: <0BBC89C9-0F67-48F1-99F4-AC89AF5C394B@gmail.com> References: <0BBC89C9-0F67-48F1-99F4-AC89AF5C394B@gmail.com> Message-ID: Ah yes, so my question is why is the [] accessor not column major? If points are columns, the matrix elements for the Tx,Ty,Tz translation components should also be columnar? It just seems like extra work to need to get the matrix transpose just to do a Mat * P Regards, Vincent On Fri, Aug 22, 2014 at 7:14 PM, Jim Miller wrote: > ITK standard is that points are column vectors. Thus, matrix times a point > a point is defined as Mat * P > > Jim > > > On Aug 22, 2014, at 3:30 AM, vincent ngai > wrote: > > > > Hi all, pardon me for this silly question on itk::Matrix. Why do I need > to transpose a translation matrix after I copy the [x,y,z] translation > values to the matrix[3]. > > > > I know conceptually it should not really matter whether its row or col > major so long as you can > > post multiply or pre multiply with another vector. But the way > operator*() works only allows for > > Matrix * P, and when I test the simple case of TranslationMatrix * > Point, I would have to transpose the matrix. If I could also do Point * > TranslationMatrix, then i wouldn't need to transpose. > > > > Any ideas? > > > > -- > > Regards, > > Vincent > > _____________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Kitware offers ITK Training Courses, for more information visit: > > http://www.kitware.com/products/protraining.php > > > > Please keep messages on-topic and check the ITK FAQ at: > > http://www.itk.org/Wiki/ITK_FAQ > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/insight-users > -- Regards, Vincent -------------- next part -------------- An HTML attachment was scrubbed... URL: From millerjv at gmail.com Sat Aug 23 08:12:10 2014 From: millerjv at gmail.com (Jim Miller) Date: Sat, 23 Aug 2014 08:12:10 -0400 Subject: [ITK-users] Silly question on itk::Matrix In-Reply-To: References: <0BBC89C9-0F67-48F1-99F4-AC89AF5C394B@gmail.com> Message-ID: Matrices and images are row major order. Points and vectors are column vectors. No transpose is necessary. You can index element by element directly to set the column you want. Row major ordering is more popular than column major ordering. I think there are regional preferences as to the"proper" way. I also think electrical engineers prefer one way whereas mechanical engineers prefer the other. Probably is partially based on how disciplines view the composition of coordinate frames (inside out or outside in). Some systems allow you to use either convention. We found that leads to a lot of confusion and errors. So 15 years ago, when we started ITK, we chose to pick a single standard for the code. Jim > On Aug 22, 2014, at 9:49 PM, vincent ngai wrote: > > Ah yes, so my question is why is the [] accessor not column major? If points are columns, the matrix elements for the Tx,Ty,Tz translation components should also be columnar? It just seems like extra work to need to get the matrix transpose just to do a Mat * P > > Regards, > Vincent > > >> On Fri, Aug 22, 2014 at 7:14 PM, Jim Miller wrote: >> ITK standard is that points are column vectors. Thus, matrix times a point a point is defined as Mat * P >> >> Jim >> >> > On Aug 22, 2014, at 3:30 AM, vincent ngai wrote: >> > >> > Hi all, pardon me for this silly question on itk::Matrix. Why do I need to transpose a translation matrix after I copy the [x,y,z] translation values to the matrix[3]. >> > >> > I know conceptually it should not really matter whether its row or col major so long as you can >> > post multiply or pre multiply with another vector. But the way operator*() works only allows for >> > Matrix * P, and when I test the simple case of TranslationMatrix * Point, I would have to transpose the matrix. If I could also do Point * TranslationMatrix, then i wouldn't need to transpose. >> > >> > Any ideas? >> > >> > -- >> > Regards, >> > Vincent >> > _____________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Kitware offers ITK Training Courses, for more information visit: >> > http://www.kitware.com/products/protraining.php >> > >> > Please keep messages on-topic and check the ITK FAQ at: >> > http://www.itk.org/Wiki/ITK_FAQ >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/insight-users > > > > -- > Regards, > Vincent -------------- next part -------------- An HTML attachment was scrubbed... URL: From vincent.ngai at gmail.com Sun Aug 24 22:38:37 2014 From: vincent.ngai at gmail.com (vincent ngai) Date: Mon, 25 Aug 2014 10:38:37 +0800 Subject: [ITK-users] Silly question on itk::Matrix In-Reply-To: References: <0BBC89C9-0F67-48F1-99F4-AC89AF5C394B@gmail.com> Message-ID: Hi Jim, thanks for the background, that clarified things for me. Regards, Vincent On Sat, Aug 23, 2014 at 8:12 PM, Jim Miller wrote: > Matrices and images are row major order. Points and vectors are column > vectors. > > No transpose is necessary. You can index element by element directly to > set the column you want. > > Row major ordering is more popular than column major ordering. I think > there are regional preferences as to the"proper" way. I also think > electrical engineers prefer one way whereas mechanical engineers prefer the > other. Probably is partially based on how disciplines view the composition > of coordinate frames (inside out or outside in). > > Some systems allow you to use either convention. We found that leads to a > lot of confusion and errors. So 15 years ago, when we started ITK, we chose > to pick a single standard for the code. > > Jim > > On Aug 22, 2014, at 9:49 PM, vincent ngai wrote: > > Ah yes, so my question is why is the [] accessor not column major? If > points are columns, the matrix elements for the Tx,Ty,Tz translation > components should also be columnar? It just seems like extra work to need > to get the matrix transpose just to do a Mat * P > > Regards, > Vincent > > > On Fri, Aug 22, 2014 at 7:14 PM, Jim Miller wrote: > >> ITK standard is that points are column vectors. Thus, matrix times a >> point a point is defined as Mat * P >> >> Jim >> >> > On Aug 22, 2014, at 3:30 AM, vincent ngai >> wrote: >> > >> > Hi all, pardon me for this silly question on itk::Matrix. Why do I need >> to transpose a translation matrix after I copy the [x,y,z] translation >> values to the matrix[3]. >> > >> > I know conceptually it should not really matter whether its row or col >> major so long as you can >> > post multiply or pre multiply with another vector. But the way >> operator*() works only allows for >> > Matrix * P, and when I test the simple case of TranslationMatrix * >> Point, I would have to transpose the matrix. If I could also do Point * >> TranslationMatrix, then i wouldn't need to transpose. >> > >> > Any ideas? >> > >> > -- >> > Regards, >> > Vincent >> > _____________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Kitware offers ITK Training Courses, for more information visit: >> > http://www.kitware.com/products/protraining.php >> > >> > Please keep messages on-topic and check the ITK FAQ at: >> > http://www.itk.org/Wiki/ITK_FAQ >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/insight-users >> > > > > -- > Regards, > Vincent > > -- Regards, Vincent -------------- next part -------------- An HTML attachment was scrubbed... URL: From CHernando at telespazio.es Mon Aug 25 04:36:44 2014 From: CHernando at telespazio.es (Carlos Hernando Ramiro) Date: Mon, 25 Aug 2014 10:36:44 +0200 Subject: [ITK-users] UseAllPixelsOn with Mutual Information In-Reply-To: <800D4DFDAF353641B990F5CEB49F05E179B9C9@GORDONS.aurensis.com> References: <800D4DFDAF353641B990F5CEB49F05E179B9C9@GORDONS.aurensis.com> Message-ID: <53FAF59C.3040602@telespazio.es> Dear all, is seems that the method UseAllPixelsOn() does not work for the class itkMutualInformationImageToImageMetric. Then, what I can do to assure that all the pixels of an specific region are used to calculate this metric? Is there any alternative to UseAllPixelsOn()? Best regards Carlos From chernando at telespazio.es Mon Aug 25 05:20:45 2014 From: chernando at telespazio.es (carlos) Date: Mon, 25 Aug 2014 02:20:45 -0700 (PDT) Subject: [ITK-users] MutualInformationImageToImageMetric without transformation In-Reply-To: <1408375248616-7586081.post@n2.nabble.com> References: <1408375248616-7586081.post@n2.nabble.com> Message-ID: <1408958445955-7586112.post@n2.nabble.com> Dear Jan, I think that you can use the metric without optimizer, but that you need a transformation and an interpolator. You can use the translation transform (and the interpolator you prefer, although it will not influence): typedef itk::MutualInformationImageToImageMetric MIMetricType; MIMetricType::Pointer MImetric; typedef itk::TranslationTransform< double, ImageDimension > TransformType; TransformType::Pointer transform = TransformType::New(); MImetric->SetTransform(transform); and then call GetValue with the translation parameters [0,0] MIMetricType::TransformParametersType displacementMI(transform->ParametersDimension); displacementMI[0] = 0; displacementMI[1] = 0; MImetric->GetValue(displacementMI); Best regards Carlos -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/MutualInformationImageToImageMetric-without-transformation-tp7586081p7586112.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From dlrdave at aol.com Mon Aug 25 10:34:13 2014 From: dlrdave at aol.com (David Cole) Date: Mon, 25 Aug 2014 10:34:13 -0400 (EDT) Subject: [ITK-users] FDA agile practices guidance In-Reply-To: <53EBA560.208@gmail.com> References: <53EBA560.208@gmail.com> Message-ID: <8D18E88C674FD6D-1E58-23933@webmail-m289.sysops.aol.com> > anyone know about resources about FDA guidances for implementing agile > practices in the development of medical device software? In concrete, > the document AAMI TIR45:2012 is the one I am seeking online. Well, it's for sale at ansi.org for $150: http://webstore.ansi.org/RecordDetail.aspx?sku=AAMI+TIR45%3A2012+%28AAMI+TIR+45%3A2012%29 I couldn't find it anywhere else online. HTH, David C. From payalprajapati2808 at gmail.com Mon Aug 25 13:01:36 2014 From: payalprajapati2808 at gmail.com (mahi) Date: Mon, 25 Aug 2014 10:01:36 -0700 (PDT) Subject: [ITK-users] Problem in computing Eigenvalue for swir band of hdf taken by Imager payload Message-ID: <1408986096189-34456.post@n7.nabble.com> Hello All, I am new to ITK.I want to compute eigenvalue of SWIR band of .h5 File.I have tried it using itkSymmetricEigenAnalysis and vnl_symmetric_eigen .Both Programs work fine for a .tiff file(which i am using for experimental purpose) having dimension 256*256 and it works fine. SWIR band has dimension of 11220*11264. so I made it of 11264*11264 by padding extra zeros at rows starting from 11221. My problem is when i apply both program on this extended matrix it shows no error but also doesnt give any output.It gets stuck...Am i going in a right direction or not?Why this happen?I have attached both code. itk_image_to_matrix.cxx newsvd.cxx Q_matrixfinal.cxx Any help would be appriciated. Thank You, Payal -- View this message in context: http://itk-users.7.n7.nabble.com/Problem-in-computing-Eigenvalue-for-swir-band-of-hdf-taken-by-Imager-payload-tp34456.html Sent from the ITK - Users mailing list archive at Nabble.com. From mercikd at thomas.edu Mon Aug 25 14:44:28 2014 From: mercikd at thomas.edu (Dan Mercik) Date: Mon, 25 Aug 2014 18:44:28 +0000 Subject: [ITK-users] Tiling Side by Side Question Message-ID: <5d84846dd31f482d88152b7c19c56632@T9.tcnet.thomas.edu> Hey, I have 7 images to tile but only want 2 images to be tile horizontally and the other 5 other images to be tile vertically. When I declare the layouts like layout[0] = 2; layout[1] = 5; The x axis is always being filled. Is it possible to not fill that tile with an image? Daniel Mercik Computer Science Major Service Desk Technician Thomas College From millerjv at gmail.com Mon Aug 25 15:42:04 2014 From: millerjv at gmail.com (Jim Miller) Date: Mon, 25 Aug 2014 15:42:04 -0400 Subject: [ITK-users] Tiling Side by Side Question In-Reply-To: <5d84846dd31f482d88152b7c19c56632@T9.tcnet.thomas.edu> References: <5d84846dd31f482d88152b7c19c56632@T9.tcnet.thomas.edu> Message-ID: In this, I think you want to cascade two TileImage filters. One to tile the first two images horizontally. The second to Tile that result with your others vertically. Jim > On Aug 25, 2014, at 2:44 PM, Dan Mercik wrote: > > Hey, > > I have 7 images to tile but only want 2 images to be tile horizontally and the other 5 other images to be tile vertically. When I declare the layouts like > > layout[0] = 2; > > layout[1] = 5; > > The x axis is always being filled. Is it possible to not fill that tile with an image? > > > > Daniel Mercik > > Computer Science Major > > Service Desk Technician > > Thomas College > _____________________________________ > 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 Aug 25 23:46:52 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 25 Aug 2014 23:46:52 -0400 Subject: [ITK-users] Composite Filter with variable stdvector of filters inside In-Reply-To: References: Message-ID: Hi Ignacio, If I understand corrections, this may do want is desired: void SetNumberOfZSlices( int slices ) { if( m_NumberOfZSlices != slices ) { this->m_NumberOfZSlices = slices; this->UpdateNumberOfFilters(); this->Modified(); } } and a similar implementation for SetNumberOfTimeFrames(). Hope this helps, Matt On Wed, Aug 20, 2014 at 11:00 AM, Jose Ignacio Prieto wrote: > Hi all, > I am trying to create a composite filter for a 4D dataset that will use > different cascaded 2D filters on the inside. For this, I have created a > double std vector that holds all the 2D filters. I have also set some param > setters for this filters (that perform a double for inside, setting the > param to each filter and then calling modified() on the outside one). I have > another method called UpdateNumberofFilters, that depending on 2 ints (num > of Z slices, num of T timeframes) will push back more filters to the 2D > array of filters. > My problem is that I dont know which function should call the > UpdateNumofFilters. It should be done before the setters but after the > constructor and after setting those two ints. I want to design it so that if > I change a param after calling update I dont have to run the whole filter > again, so I dont want it to be under the GenerateData() method. > > Thank you very much for your insights. > > Ignacio Prieto > > -- > Ignacio Prieto > Research Assistant > Biomedical Imaging Center > Pontificia Universida Catolica de Chile > > > > _____________________________________ > 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 jan.bergmeier at imes.uni-hannover.de Tue Aug 26 09:08:26 2014 From: jan.bergmeier at imes.uni-hannover.de (jan) Date: Tue, 26 Aug 2014 06:08:26 -0700 (PDT) Subject: [ITK-users] MutualInformationImageToImageMetric without transformation In-Reply-To: <1408958445955-7586112.post@n2.nabble.com> References: <1408375248616-7586081.post@n2.nabble.com> <1408958445955-7586112.post@n2.nabble.com> Message-ID: <1409058506727-7586118.post@n2.nabble.com> Dear Carlos, thank you for your help. i'm still experiencing some difficulties. I tried your proposed way like this: typedef itk::MutualInformationImageToImageMetric< UChar2DImageType, UChar2DImageType > MetricType; typedef itk::TranslationTransform< double, 2 > TransformType; typedef itk::GradientDescentOptimizer OptimizerType; MetricType::Pointer metric = MetricType::New(); TransformType::Pointer transform = TransformType::New(); MetricType::TransformParametersType displacement( transform->ParametersDimension ); displacement[0] = 0.0; displacement[1] = 0.0; metric->SetFixedImage( fixedImage ); metric->SetMovingImage( movingImage); metric->SetTransform( transform ); metric->GetValue( displacement ); When I am trying to get the MI-value with the displacement parameters, my program crashes. i tried another way with an optimizer that does only one iteration: typedef itk::TranslationTransform< double, 2 > TransformType; typedef itk::GradientDescentOptimizer OptimizerType; typedef itk::LinearInterpolateImageFunction< UChar2DImageType, double > InterpolatorType; typedef itk::ImageRegistrationMethod< UChar2DImageType, UChar2DImageType > RegistrationType; typedef itk::MutualInformationImageToImageMetric< UChar2DImageType, UChar2DImageType > MetricType; typedef RegistrationType::ParametersType ParametersType; TransformType::Pointer transform = TransformType::New(); OptimizerType::Pointer optimizer = OptimizerType::New(); InterpolatorType::Pointer interpolator = InterpolatorType::New(); RegistrationType::Pointer registration = RegistrationType::New(); MetricType::Pointer metric = MetricType::New(); registration->SetOptimizer( optimizer ); registration->SetTransform( transform ); registration->SetInterpolator( interpolator ); registration->SetMetric( metric ); registration->SetFixedImage( fixedImage ); registration->SetMovingImage( movingImage ); ParametersType initialParameters( transform->GetNumberOfParameters() ); initialParameters[0] = 0.0; initialParameters[1] = 0.0; registration->SetInitialTransformParameters( initialParameters ); optimizer->SetNumberOfIterations( 1 ); try { registration->Update(); } catch( itk::ExceptionObject & err ) { std::cout << "ExceptionObject caught !" << std::endl; std::cout << err << std::endl; } double bestValue = optimizer->GetValue(); The problem here is that I get the following Error: "Description: itk::ERROR: MutualInformationImageToImageMetric(0x48e0860): Standard deviation is too small" Any suggestions for a convenient solution? Thanks, Jan -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/MutualInformationImageToImageMetric-without-transformation-tp7586081p7586118.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From gass at vision.ee.ethz.ch Tue Aug 26 09:22:33 2014 From: gass at vision.ee.ethz.ch (Tobias Gass) Date: Tue, 26 Aug 2014 15:22:33 +0200 Subject: [ITK-users] MutualInformationImageToImageMetric without transformation In-Reply-To: <1408375248616-7586081.post@n2.nabble.com> References: <1408375248616-7586081.post@n2.nabble.com> Message-ID: Hi Jan, ITK also offers a convenient identity transform for this: http://www.itk.org/Doxygen/html/classitk_1_1IdentityTransform.html Hope that helps, Tobias 2014-08-18 17:20 GMT+02:00 jan : > Hello, > > I want to perform a registration between two images without any > transformation or optimization. I like to use the > itk::MutualInformationImageToImageMetric. As I understand the itk metric, > you have to use a transformation, an optimizer, an interpolator and so on. > > I want to compare one image to a set of images with mutual information as > metric. > > So basically, I like to use the GetValue() method, without giving any > parameters to it. Is there a way to do that, or another way to get just one > mutual information value between two images? > > Thanks in advance, > > Jan > > > > -- > View this message in context: > http://itk-insight-users.2283740.n2.nabble.com/MutualInformationImageToImageMetric-without-transformation-tp7586081.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 jan.bergmeier at imes.uni-hannover.de Tue Aug 26 09:31:46 2014 From: jan.bergmeier at imes.uni-hannover.de (jan) Date: Tue, 26 Aug 2014 06:31:46 -0700 (PDT) Subject: [ITK-users] MutualInformationImageToImageMetric without transformation In-Reply-To: References: <1408375248616-7586081.post@n2.nabble.com> Message-ID: <1409059906690-7586120.post@n2.nabble.com> Hi, my attempt with the identity transform would be this: typedef itk::IdentityTransform< double, 2 > TransformType; typedef itk::MutualInformationImageToImageMetric< UChar2DImageType, UChar2DImageType > MetricType; TransformType::Pointer transform = TransformType::New(); MetricType::Pointer metric = MetricType::New(); metric->SetFixedImage( fixedImage ); metric->SetMovingImage( movingImage ); metric->GetValue( transform->GetParameters() ); For me it's the same problem. The program crashes when I use GetValue(). It seems to me as if the parameters need to be OptimizerParameters.... Thanks, Jan -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/MutualInformationImageToImageMetric-without-transformation-tp7586081p7586120.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From gass at vision.ee.ethz.ch Tue Aug 26 09:36:46 2014 From: gass at vision.ee.ethz.ch (Tobias Gass) Date: Tue, 26 Aug 2014 15:36:46 +0200 Subject: [ITK-users] MutualInformationImageToImageMetric without transformation In-Reply-To: <1409059906690-7586120.post@n2.nabble.com> References: <1408375248616-7586081.post@n2.nabble.com> <1409059906690-7586120.post@n2.nabble.com> Message-ID: Have you checked whether your images are physically overlapping? You could also try to change the number of MI samples to avoid accidentally sampling only from homogeneous regions. Best of luck, Tobias 2014-08-26 15:31 GMT+02:00 jan : > Hi, > > my attempt with the identity transform would be this: > > typedef itk::IdentityTransform< double, 2 > TransformType; > typedef itk::MutualInformationImageToImageMetric< UChar2DImageType, > UChar2DImageType > MetricType; > > TransformType::Pointer transform = TransformType::New(); > MetricType::Pointer metric = MetricType::New(); > > metric->SetFixedImage( fixedImage ); > metric->SetMovingImage( movingImage ); > metric->GetValue( transform->GetParameters() ); > > For me it's the same problem. The program crashes when I use GetValue(). It > seems to me as if the parameters need to be OptimizerParameters.... > > Thanks, > Jan > > > > -- > View this message in context: > http://itk-insight-users.2283740.n2.nabble.com/MutualInformationImageToImageMetric-without-transformation-tp7586081p7586120.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 joseignacio.prieto at gmail.com Tue Aug 26 09:38:16 2014 From: joseignacio.prieto at gmail.com (Jose Ignacio Prieto) Date: Tue, 26 Aug 2014 09:38:16 -0400 Subject: [ITK-users] Composite Filter with variable stdvector of filters inside In-Reply-To: References: Message-ID: Thanks Matt, my problem was that I didn't know when to call this methods. I finally put them into GenerateInputRequestedRegion and this way seems to be called before Update(). I don't know under what conditions GenerateInputRequestedRegion is called, for example if a parameter is changed after an update call, will it be called again or only GenerateData would be called. Is there a good developer manual? The ITK user manual seems a little short on this. Thanks Ignacio Prieto On Mon, Aug 25, 2014 at 11:46 PM, Matt McCormick wrote: > Hi Ignacio, > > If I understand corrections, this may do want is desired: > > void SetNumberOfZSlices( int slices ) > { > if( m_NumberOfZSlices != slices ) > { > this->m_NumberOfZSlices = slices; > this->UpdateNumberOfFilters(); > this->Modified(); > } > } > > and a similar implementation for SetNumberOfTimeFrames(). > > Hope this helps, > Matt > > On Wed, Aug 20, 2014 at 11:00 AM, Jose Ignacio Prieto > wrote: > > Hi all, > > I am trying to create a composite filter for a 4D dataset that will use > > different cascaded 2D filters on the inside. For this, I have created a > > double std vector that holds all the 2D filters. I have also set some > param > > setters for this filters (that perform a double for inside, setting the > > param to each filter and then calling modified() on the outside one). I > have > > another method called UpdateNumberofFilters, that depending on 2 ints > (num > > of Z slices, num of T timeframes) will push back more filters to the 2D > > array of filters. > > My problem is that I dont know which function should call the > > UpdateNumofFilters. It should be done before the setters but after the > > constructor and after setting those two ints. I want to design it so > that if > > I change a param after calling update I dont have to run the whole filter > > again, so I dont want it to be under the GenerateData() method. > > > > Thank you very much for your insights. > > > > Ignacio Prieto > > > > -- > > Ignacio Prieto > > Research Assistant > > Biomedical Imaging Center > > Pontificia Universida Catolica de Chile > > > > > > > > _____________________________________ > > 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 > > > -- Jos? Ignacio Prieto celular(nuevo): 94348182 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.bergmeier at imes.uni-hannover.de Tue Aug 26 10:17:05 2014 From: jan.bergmeier at imes.uni-hannover.de (jan) Date: Tue, 26 Aug 2014 07:17:05 -0700 (PDT) Subject: [ITK-users] MutualInformationImageToImageMetric without transformation In-Reply-To: References: <1408375248616-7586081.post@n2.nabble.com> <1409059906690-7586120.post@n2.nabble.com> Message-ID: <1409062625902-7586123.post@n2.nabble.com> Increasing the NumberOfSpatialSamples fixes the way with the one-iteration optimizer but unfortunately not the attempts without the optimizer (which I would prefer, since I like to keep it simple). -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/MutualInformationImageToImageMetric-without-transformation-tp7586081p7586123.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From joseignacio.prieto at gmail.com Tue Aug 26 11:35:50 2014 From: joseignacio.prieto at gmail.com (Jose Ignacio Prieto) Date: Tue, 26 Aug 2014 11:35:50 -0400 Subject: [ITK-users] Create PolygonToMeshFilter Message-ID: Hi all, I am trying to create a filter that receives many 2D polygons in the form of PolyLineParametricPath (which in turn has an itkImage as input) and returns an itkMesh for later visualization. I have completed the GenerateData() method by calling internally to itkAutomaticTopologyMeshSource. The problem seems to be that before GenerateData, the filter fails in itkPointSet::CopyInformation (because it tries to cast the polygon as a mesh). I discovered that the call stack comes from UpdateOutputInformation on my PolygonToMeshFilter and then GenerateOutputInformation, then itkMesh::CopyInformation and itkPointset::CopyInformation. I think I should edit my PolygonToMesh::GenerateOutputInformation() but I don't know how. Inside it I just called Superclass::GenerateOutputInformation. My filter PolygonToMeshFilter is a copy of MeshToMesh filter and inherits from MeshSource. Maybe I should inherit from anothe filter. Thank you very much Ignacio Prieto -- Ignacio Prieto Research Assistant Biomedical Imaging Center Pontificia Universidad Catolica de Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Tue Aug 26 11:38:34 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 26 Aug 2014 11:38:34 -0400 Subject: [ITK-users] Composite Filter with variable stdvector of filters inside In-Reply-To: References: Message-ID: Hi Ignacio, GenerateInputRequestedRegion() may be a good place, too. When an Update() is called, GenerateInputRequestedRegion() will get called during the pipeline update if the filter's Modified time indicates this is necessary. If the filter needs to be updated, the GenerateData will also get called as appropriate. The best manual I am aware of is the ITK Software Guide [1]. More information on this subject comes in Section 8.3.2 Details of Pipeline Execution and section 8.3 Streaming Large Data. HTH, Matt [1] http://sourceforge.net/projects/itk/files/itk/4.6/InsightSoftwareGuide-Book1-4.6.0.pdf/download On Tue, Aug 26, 2014 at 9:38 AM, Jose Ignacio Prieto wrote: > Thanks Matt, my problem was that I didn't know when to call this methods. I > finally put them into GenerateInputRequestedRegion and this way seems to be > called before Update(). I don't know under what conditions > GenerateInputRequestedRegion is called, for example if a parameter is > changed after an update call, will it be called again or only GenerateData > would be called. Is there a good developer manual? The ITK user manual seems > a little short on this. > > Thanks > > Ignacio Prieto > > > On Mon, Aug 25, 2014 at 11:46 PM, Matt McCormick > wrote: >> >> Hi Ignacio, >> >> If I understand corrections, this may do want is desired: >> >> void SetNumberOfZSlices( int slices ) >> { >> if( m_NumberOfZSlices != slices ) >> { >> this->m_NumberOfZSlices = slices; >> this->UpdateNumberOfFilters(); >> this->Modified(); >> } >> } >> >> and a similar implementation for SetNumberOfTimeFrames(). >> >> Hope this helps, >> Matt >> >> On Wed, Aug 20, 2014 at 11:00 AM, Jose Ignacio Prieto >> wrote: >> > Hi all, >> > I am trying to create a composite filter for a 4D dataset that will use >> > different cascaded 2D filters on the inside. For this, I have created a >> > double std vector that holds all the 2D filters. I have also set some >> > param >> > setters for this filters (that perform a double for inside, setting the >> > param to each filter and then calling modified() on the outside one). I >> > have >> > another method called UpdateNumberofFilters, that depending on 2 ints >> > (num >> > of Z slices, num of T timeframes) will push back more filters to the 2D >> > array of filters. >> > My problem is that I dont know which function should call the >> > UpdateNumofFilters. It should be done before the setters but after the >> > constructor and after setting those two ints. I want to design it so >> > that if >> > I change a param after calling update I dont have to run the whole >> > filter >> > again, so I dont want it to be under the GenerateData() method. >> > >> > Thank you very much for your insights. >> > >> > Ignacio Prieto >> > >> > -- >> > Ignacio Prieto >> > Research Assistant >> > Biomedical Imaging Center >> > Pontificia Universida Catolica de Chile >> > >> > >> > >> > _____________________________________ >> > 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 >> > > > > > > -- > Jos? Ignacio Prieto > celular(nuevo): 94348182 From joseignacio.prieto at gmail.com Tue Aug 26 11:56:27 2014 From: joseignacio.prieto at gmail.com (Jose Ignacio Prieto) Date: Tue, 26 Aug 2014 11:56:27 -0400 Subject: [ITK-users] Create PolygonToMeshFilter In-Reply-To: References: Message-ID: I solved it partially but don't know why it works. I just set GenerateOutputInformation(){} on my .h file as it is done on itkSpatialObjecToPointSetFilter so it goes straight to GenerateInputRequestedRegion. On Tue, Aug 26, 2014 at 11:35 AM, Jose Ignacio Prieto < joseignacio.prieto at gmail.com> wrote: > Hi all, > I am trying to create a filter that receives many 2D polygons in the form > of PolyLineParametricPath (which in turn has an itkImage as input) and > returns an itkMesh for later visualization. I have completed the > GenerateData() method by calling internally to > itkAutomaticTopologyMeshSource. The problem seems to be that before > GenerateData, the filter fails in itkPointSet::CopyInformation (because it > tries to cast the polygon as a mesh). I discovered that the call stack > comes from UpdateOutputInformation on my PolygonToMeshFilter and then > GenerateOutputInformation, then itkMesh::CopyInformation and > itkPointset::CopyInformation. > I think I should edit my PolygonToMesh::GenerateOutputInformation() but I > don't know how. Inside it I just called > Superclass::GenerateOutputInformation. > My filter PolygonToMeshFilter is a copy of MeshToMesh filter and inherits > from MeshSource. Maybe I should inherit from anothe filter. > Thank you very much > > Ignacio Prieto > > -- > Ignacio Prieto > Research Assistant > Biomedical Imaging Center > Pontificia Universidad Catolica de Chile > -- Jos? Ignacio Prieto celular(nuevo): 94348182 -------------- next part -------------- An HTML attachment was scrubbed... URL: From chernando at telespazio.es Wed Aug 27 04:55:38 2014 From: chernando at telespazio.es (carlos) Date: Wed, 27 Aug 2014 01:55:38 -0700 (PDT) Subject: [ITK-users] MutualInformationImageToImageMetric without transformation In-Reply-To: <1409062625902-7586123.post@n2.nabble.com> References: <1408375248616-7586081.post@n2.nabble.com> <1409059906690-7586120.post@n2.nabble.com> <1409062625902-7586123.post@n2.nabble.com> Message-ID: <1409129738759-7586127.post@n2.nabble.com> When the program crashes, no error appears? Take also into account, that having the same size does not mean always that they overlap. You have to check also their origin and spacing in case they have different physical locations. Regarding the standard deviation issue, if you previously normalize the image, then a standard deviation of 0.4 works, please see this example: http://www.itk.org/Doxygen/html/RegistrationITKv4_2ImageRegistration2_8cxx-example.html -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/MutualInformationImageToImageMetric-without-transformation-tp7586081p7586127.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From maximilian_oliver.mordig at roche.com Wed Aug 27 08:29:12 2014 From: maximilian_oliver.mordig at roche.com (maximilian) Date: Wed, 27 Aug 2014 05:29:12 -0700 (PDT) Subject: [ITK-users] Problem with itk::ImageToHistogramFilter Message-ID: <1409142552492-7586128.post@n2.nabble.com> I am having problems with the itk::ImageToHistogramFilter. I am generating ellipses that I want to add to an image that already contains some ellipses (in each iteration step, I add one ellipse to an image being the result of previous iterations). To see if the new ellipse overlaps by more than (let's say) 10%, I use the ImageToHistogramFilter. The previous image has objects that all have pixel values of 1. The newly added ellipse has value of 2. So, to get the number of overlapping pixels, I add up both images and I count the number of pixels = 3 in that image. I set the histogram bin minimum to 0 (background) and the histogram bin maximum to 3 (+ some constant c) and the number of bins such that the step is = 1 (here, it is 3 + c). However, when I output the average frequencies associated to each bin, I get values between 0 and 2 (number like 1.92) and not between 0 and 3 + c (see output of program of attached file). Why? GenerateCells.cxx -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Problem-with-itk-ImageToHistogramFilter-tp7586128.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From alaamegawer at yahoo.com Wed Aug 27 09:17:25 2014 From: alaamegawer at yahoo.com (alaamegawer) Date: Wed, 27 Aug 2014 06:17:25 -0700 (PDT) Subject: [ITK-users] itkConnectedThresholdImageFilter modification for airway segmentation module In-Reply-To: References: Message-ID: <1409145445368-7586129.post@n2.nabble.com> i wanna segment the airway tree from lung image so please if you segment it can you please send me the source code if that available. -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/itkConnectedThresholdImageFilter-modification-for-airway-segmentation-module-tp7584078p7586129.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From alaamegawer at yahoo.com Wed Aug 27 09:40:43 2014 From: alaamegawer at yahoo.com (alaamegawer) Date: Wed, 27 Aug 2014 06:40:43 -0700 (PDT) Subject: [ITK-users] Airway tree segmentation and segmentation dark object from an image Message-ID: <1409146843926-7586130.post@n2.nabble.com> Hi All I wanna segment the airway tree from Thoracic CT image. my algorithm depends on 1- segment the center of the trachea then 2 apply 3D region growing to segment the trachea the main bronchi . i start segmenting the center of the trachea by applying iterative threshold and after that i stopped because i don't know how to get the dark region from the bright region as found in the attachment file. so Please help me to segment this point and if you have another way to segment the airway please let me know . -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Airway-tree-segmentation-and-segmentation-dark-object-from-an-image-tp7586130.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From pattersonnp.work at gmail.com Wed Aug 27 12:28:19 2014 From: pattersonnp.work at gmail.com (Nick Patterson) Date: Wed, 27 Aug 2014 17:28:19 +0100 Subject: [ITK-users] ResampleDICOM example and DCMTK Message-ID: <95FBA78F-1DFC-4F33-9572-DA0DD9DE1E73@gmail.com> Hi, I have been trying to test the ResampledDICOM ITK example using DCMTK instead of GDCM. I have attached the code below. The code compiles and runs, but does not output the resultant files - which is strange, as all of the expected parameters are good (i.e. number of files, origin of image, image dimensions etc). Can anyone possibly comment on any possible reason why the code execute without error, but does not result in any output files? Regards, Nick #include "itkVersion.h" #include "itkImage.h" #include "itkMinimumMaximumImageFilter.h" #include "itkDCMTKImageIO.h" #include "itkDCMTKSeriesFileNames.h" #include "itkNumericSeriesFileNames.h" #include "itkImageSeriesReader.h" #include "itkImageSeriesWriter.h" #include "itkResampleImageFilter.h" #include "itkShiftScaleImageFilter.h" #include "itkIdentityTransform.h" #include "itkLinearInterpolateImageFunction.h" #include #include "dcmdata/dcuid.h" #include static void CopyDictionary (itk::MetaDataDictionary &fromDict, itk::MetaDataDictionary &toDict); int main( int argc, char* argv[] ) { // Validate input parameters if( argc < 4 ) { std::cerr << "Usage: " << argv[0] << " InputDicomDirectory OutputDicomDirectory spacing_x spacing_y spacing_z" << std::endl; return EXIT_FAILURE; } const unsigned int InputDimension = 3; const unsigned int OutputDimension = 2; typedef signed short PixelType; typedef itk::Image< PixelType, InputDimension > InputImageType; typedef itk::Image< PixelType, OutputDimension > OutputImageType; typedef itk::ImageSeriesReader< InputImageType >ReaderType; typedef itk::DCMTKImageIO ImageIOType; typedef itk::DCMTKSeriesFileNames InputNamesGeneratorType; typedef itk::NumericSeriesFileNames OutputNamesGeneratorType; typedef itk::IdentityTransform< double, InputDimension > TransformType; typedef itk::LinearInterpolateImageFunction< InputImageType, double > InterpolatorType; typedef itk::ResampleImageFilter< InputImageType, InputImageType > ResampleFilterType; typedef itk::ShiftScaleImageFilter< InputImageType, InputImageType > ShiftScaleType; typedef itk::ImageSeriesWriter< InputImageType, OutputImageType > SeriesWriterType; //////////////////////////////////////////////// // 1) Read the input series ImageIOType::Pointer gdcmIO = ImageIOType::New(); InputNamesGeneratorType::Pointer inputNames = InputNamesGeneratorType::New(); inputNames->SetInputDirectory( argv[1] ); const ReaderType::FileNamesContainer & filenames = inputNames->GetInputFileNames(); ReaderType::Pointer reader = ReaderType::New(); reader->SetImageIO( gdcmIO ); reader->SetFileNames( filenames ); try { reader->Update(); } catch (itk::ExceptionObject &excp) { std::cerr << "Exception thrown while reading the series" << std::endl; std::cerr << excp << std::endl; return EXIT_FAILURE; } //////////////////////////////////////////////// // 2) Resample the series InterpolatorType::Pointer interpolator = InterpolatorType::New(); TransformType::Pointer transform = TransformType::New(); transform->SetIdentity(); const InputImageType::SpacingType& inputSpacing = reader->GetOutput()->GetSpacing(); const InputImageType::RegionType& inputRegion = reader->GetOutput()->GetLargestPossibleRegion(); const InputImageType::SizeType& inputSize = inputRegion.GetSize(); std::cout << "The input series in directory " << argv[1] << " has " << filenames.size() << " files with spacing " << inputSpacing << std::endl; // Compute the size of the output. The user specifies a spacing on // the command line. If the spacing is 0, the input spacing will be // used. The size (# of pixels) in the output is recomputed using // the ratio of the input and output sizes. InputImageType::SpacingType outputSpacing; outputSpacing[0] = atof(argv[3]); outputSpacing[1] = atof(argv[4]); outputSpacing[2] = atof(argv[5]); bool changeInSpacing = false; for (unsigned int i = 0; i < 3; i++) { if (outputSpacing[i] == 0.0) { outputSpacing[i] = inputSpacing[i]; } else { changeInSpacing = true; } } InputImageType::SizeType outputSize; typedef InputImageType::SizeType::SizeValueType SizeValueType; outputSize[0] = static_cast(inputSize[0] * inputSpacing[0] / outputSpacing[0] + .5); outputSize[1] = static_cast(inputSize[1] * inputSpacing[1] / outputSpacing[1] + .5); outputSize[2] = static_cast(inputSize[2] * inputSpacing[2] / outputSpacing[2] + .5); ResampleFilterType::Pointer resampler = ResampleFilterType::New(); resampler->SetInput( reader->GetOutput() ); resampler->SetTransform( transform ); resampler->SetInterpolator( interpolator ); resampler->SetOutputOrigin ( reader->GetOutput()->GetOrigin()); resampler->SetOutputSpacing ( outputSpacing ); resampler->SetOutputDirection ( reader->GetOutput()->GetDirection()); resampler->SetSize ( outputSize ); resampler->Update (); //////////////////////////////////////////////// // 3) Create a MetaDataDictionary for each slice. // Copy the dictionary from the first image and override slice // specific fields ReaderType::DictionaryRawPointer inputDict = (*(reader->GetMetaDataDictionaryArray()))[0]; ReaderType::DictionaryArrayType outputArray; // To keep the new series in the same study as the original we need // to keep the same study UID. But we need new series and frame of // reference UID's. char seriesUID[100]; dcmGenerateUniqueIdentifier(seriesUID); char frameOfReferenceUID[100]; dcmGenerateUniqueIdentifier(frameOfReferenceUID); std::string studyUID; std::string sopClassUID; itk::ExposeMetaData(*inputDict, "0020|000d", studyUID); itk::ExposeMetaData(*inputDict, "0008|0016", sopClassUID); // gdcmIO->KeepOriginalUIDOn(); for (unsigned int f = 0; f < outputSize[2]; f++) { // Create a new dictionary for this slice ReaderType::DictionaryRawPointer dict = new ReaderType::DictionaryType; // Copy the dictionary from the first slice CopyDictionary (*inputDict, *dict); // Set the UID's for the study, series, SOP and frame of reference itk::EncapsulateMetaData(*dict,"0020|000d", studyUID); itk::EncapsulateMetaData(*dict,"0020|000e", seriesUID); itk::EncapsulateMetaData(*dict,"0020|0052", frameOfReferenceUID); char sopInstanceUID[100]; dcmGenerateUniqueIdentifier(sopInstanceUID); itk::EncapsulateMetaData(*dict,"0008|0018", sopInstanceUID); itk::EncapsulateMetaData(*dict,"0002|0003", sopInstanceUID); // Change fields that are slice specific itksys_ios::ostringstream value; value.str(""); value << f + 1; // Image Number itk::EncapsulateMetaData(*dict,"0020|0013", value.str()); // Series Description - Append new description to current series // description std::string oldSeriesDesc; itk::ExposeMetaData(*inputDict, "0008|103e", oldSeriesDesc); value.str(""); value << oldSeriesDesc << ": Resampled with pixel spacing " << outputSpacing[0] << ", "<< outputSpacing[1] << ", "<< outputSpacing[2]; // This is an long string and there is a 64 character limit in the // standard unsigned lengthDesc = value.str().length(); std::string seriesDesc( value.str(), 0,lengthDesc > 64 ? 64 : lengthDesc); itk::EncapsulateMetaData(*dict,"0008|103e", seriesDesc); // Series Number value.str(""); value << 1001; itk::EncapsulateMetaData(*dict,"0020|0011", value.str()); // Derivation Description - How this image was derived value.str(""); for (int i = 0; i < argc; i++) { value << argv[i] << " "; } value << ": " << ITK_SOURCE_VERSION; lengthDesc = value.str().length(); std::string derivationDesc( value.str(), 0, lengthDesc > 1024 ? 1024 : lengthDesc); itk::EncapsulateMetaData(*dict,"0008|2111", derivationDesc); // Image Position Patient: This is calculated by computing the // physical coordinate of the first pixel in each slice. InputImageType::PointType position; InputImageType::IndexType index; index[0] = 0; index[1] = 0; index[2] = f; resampler->GetOutput()->TransformIndexToPhysicalPoint(index, position); value.str(""); value << position[0] << "\\" << position[1] << "\\" << position[2]; itk::EncapsulateMetaData(*dict,"0020|0032", value.str()); // Slice Location: For now, we store the z component of the Image // Position Patient. value.str(""); value << position[2]; itk::EncapsulateMetaData(*dict,"0020|1041", value.str()); if (changeInSpacing) { // Slice Thickness: For now, we store the z spacing value.str(""); value << outputSpacing[2]; itk::EncapsulateMetaData(*dict,"0018|0050",value.str()); // Spacing Between Slices itk::EncapsulateMetaData(*dict,"0018|0088",value.str()); } // Save the dictionary outputArray.push_back(dict); } //////////////////////////////////////////////// // 4) Shift data to undo the effect of a rescale intercept by the // DICOM reader std::string interceptTag("0028|1052"); typedef itk::MetaDataObject< std::string > MetaDataStringType; itk::MetaDataObjectBase::Pointer entry = (*inputDict)[interceptTag]; MetaDataStringType::ConstPointer interceptValue = dynamic_cast( entry.GetPointer() ) ; int interceptShift = 0; if( interceptValue ) { std::string tagValue = interceptValue->GetMetaDataObjectValue(); interceptShift = -atoi ( tagValue.c_str() ); } ShiftScaleType::Pointer shiftScale = ShiftScaleType::New(); shiftScale->SetInput( resampler->GetOutput()); shiftScale->SetShift( interceptShift ); //////////////////////////////////////////////// // 5) Write the new DICOM series // Make the output directory and generate the file names. itksys::SystemTools::MakeDirectory( argv[2] ); // Generate the file names OutputNamesGeneratorType::Pointer outputNames = OutputNamesGeneratorType::New(); std::string seriesFormat(argv[2]); seriesFormat = seriesFormat + "IM%d.dcm"; outputNames->SetSeriesFormat (seriesFormat.c_str()); outputNames->SetStartIndex (1); outputNames->SetEndIndex (outputSize[2]); std::cout << "Output Size: " << outputSize[2] << std::endl; std::cout << outputNames->GetFileNames().at(0) << std::endl; SeriesWriterType::Pointer seriesWriter = SeriesWriterType::New(); seriesWriter->SetInput( shiftScale->GetOutput() ); seriesWriter->SetImageIO( gdcmIO ); seriesWriter->SetFileNames( outputNames->GetFileNames() ); seriesWriter->SetMetaDataDictionaryArray( &outputArray ); std::cout << seriesWriter->GetImageIO()->GetOrigin(0) << " " << seriesWriter->GetImageIO()->GetOrigin(1) << " " << seriesWriter->GetImageIO()->GetOrigin(2) << std::endl; try { seriesWriter->Update(); } catch( itk::ExceptionObject & excp ) { std::cerr << "Exception thrown while writing the series " << std::endl; std::cerr << excp << std::endl; return EXIT_FAILURE; } std::cout << "The output series in directory " << argv[2] << " has " << outputSize[2] << " files with spacing "<< outputSpacing << std::endl; return EXIT_SUCCESS; } void CopyDictionary (itk::MetaDataDictionary &fromDict, itk::MetaDataDictionary &toDict) { typedef itk::MetaDataDictionary DictionaryType; DictionaryType::ConstIterator itr = fromDict.Begin(); DictionaryType::ConstIterator end = fromDict.End(); typedef itk::MetaDataObject< std::string > MetaDataStringType; while( itr != end ) { itk::MetaDataObjectBase::Pointer entry = itr->second; MetaDataStringType::Pointer entryvalue = dynamic_cast( entry.GetPointer() ) ; if( entryvalue ) { std::string tagkey = itr->first; std::string tagvalue = entryvalue->GetMetaDataObjectValue(); itk::EncapsulateMetaData(toDict, tagkey, tagvalue); } ++itr; } } -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Wed Aug 27 13:30:56 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Wed, 27 Aug 2014 13:30:56 -0400 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 (tomorow), 9 AM Eastern USA time, there will be a Google+ Hangout where we will be doing code reviews: https://plus.google.com/u/0/events/cj4tf2heirsligiim1blh9j3498 On Friday, 10 AM Eastern USA time, an ITK development teleconference, (866) 546-4138 USA or +1 (404) 602-0798 International Access code 5687046# All are welcome. Hope to talk to you then! From jan.bergmeier at imes.uni-hannover.de Thu Aug 28 07:43:45 2014 From: jan.bergmeier at imes.uni-hannover.de (jan) Date: Thu, 28 Aug 2014 04:43:45 -0700 (PDT) Subject: [ITK-users] MutualInformationImageToImageMetric without transformation In-Reply-To: <1409129738759-7586127.post@n2.nabble.com> References: <1408375248616-7586081.post@n2.nabble.com> <1409059906690-7586120.post@n2.nabble.com> <1409062625902-7586123.post@n2.nabble.com> <1409129738759-7586127.post@n2.nabble.com> Message-ID: <1409226225974-7586133.post@n2.nabble.com> Hey, no error appears when the program crashes. i checked the origin and the spacing. Both are the same for both images. Thanks, Jan -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/MutualInformationImageToImageMetric-without-transformation-tp7586081p7586133.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From jan.bergmeier at imes.uni-hannover.de Thu Aug 28 09:24:40 2014 From: jan.bergmeier at imes.uni-hannover.de (jan) Date: Thu, 28 Aug 2014 06:24:40 -0700 (PDT) Subject: [ITK-users] MutualInformationImageToImageMetric without transformation In-Reply-To: <1409226225974-7586133.post@n2.nabble.com> References: <1408375248616-7586081.post@n2.nabble.com> <1409059906690-7586120.post@n2.nabble.com> <1409062625902-7586123.post@n2.nabble.com> <1409129738759-7586127.post@n2.nabble.com> <1409226225974-7586133.post@n2.nabble.com> Message-ID: <1409232280489-7586134.post@n2.nabble.com> Hi, I will use this way, because it's the most convenient that's working for me. //Typedefs typedef itk::IdentityTransform< double, 2 > TransformType; typedef itk::GradientDescentOptimizer OptimizerType; typedef itk::LinearInterpolateImageFunction< UChar2DImageType, double > InterpolatorType; typedef itk::MutualInformationImageToImageMetric< UChar2DImageType, UChar2DImageType > MiMetricType; typedef itk::ImageRegistrationMethod< UChar2DImageType, UChar2DImageType > RegistrationType; //Create registration components TransformType::Pointer transform = TransformType::New(); OptimizerType::Pointer optimizer = OptimizerType::New(); InterpolatorType::Pointer interpolator = InterpolatorType::New(); RegistrationType::Pointer registration = RegistrationType::New(); //Configure transform transform->SetIdentity(); //Configure optimizer optimizer->SetNumberOfIterations( 1 ); //Configure metric MetricType::Pointer metric = MetricType::New(); metric->SetNumberOfSpatialSamples( 1000 ); //Set up registration registration->SetOptimizer( optimizer ); registration->SetTransform( transform ); registration->SetInterpolator( interpolator ); registration->SetMetric( metric ); registration->SetFixedImage( fixedImageIn ); registration->SetMovingImage( movingImageIn ); registration->SetInitialTransformParameters( transform->GetParameters() ); //Perform registration try { registration->Update(); } catch( itk::ExceptionObject & err ) { std::cout << "ExceptionObject caught !" << std::endl; std::cout << err << std::endl; } //Get output double bestValue = optimizer->GetValue(); Thank you all for your help, Jan -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/MutualInformationImageToImageMetric-without-transformation-tp7586081p7586134.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From matt.mccormick at kitware.com Thu Aug 28 22:35:03 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 28 Aug 2014 22:35:03 -0400 Subject: [ITK-users] [ITK-dev] Create PolygonToMeshFilter In-Reply-To: References: Message-ID: Hi Ignacio, The default implementation of GenerateOutputInformation() in itk::ProcessObject is to call ::CopyInformation() on all the pipeline objects from the input to the output DataObjects. The information that is copied for itk::PointSet / itk::Mesh is related to Region's (see their implementations of ::CopyInformation()). You may write a GenerateOutputInformation() that sets these regions, or you could leave the default values given in the constructors, which is what the SpatialObjectToPointSetFilter does. Hope this helps, Matt On Tue, Aug 26, 2014 at 11:56 AM, Jose Ignacio Prieto wrote: > I solved it partially but don't know why it works. I just set > GenerateOutputInformation(){} on my .h file as it is done on > itkSpatialObjecToPointSetFilter so it goes straight to > GenerateInputRequestedRegion. > > > > On Tue, Aug 26, 2014 at 11:35 AM, Jose Ignacio Prieto > wrote: >> >> Hi all, >> I am trying to create a filter that receives many 2D polygons in the form >> of PolyLineParametricPath (which in turn has an itkImage as input) and >> returns an itkMesh for later visualization. I have completed the >> GenerateData() method by calling internally to >> itkAutomaticTopologyMeshSource. The problem seems to be that before >> GenerateData, the filter fails in itkPointSet::CopyInformation (because it >> tries to cast the polygon as a mesh). I discovered that the call stack comes >> from UpdateOutputInformation on my PolygonToMeshFilter and then >> GenerateOutputInformation, then itkMesh::CopyInformation and >> itkPointset::CopyInformation. >> I think I should edit my PolygonToMesh::GenerateOutputInformation() but I >> don't know how. Inside it I just called >> Superclass::GenerateOutputInformation. >> My filter PolygonToMeshFilter is a copy of MeshToMesh filter and inherits >> from MeshSource. Maybe I should inherit from anothe filter. >> Thank you very much >> >> Ignacio Prieto >> >> -- >> Ignacio Prieto >> Research Assistant >> Biomedical Imaging Center >> Pontificia Universidad Catolica de Chile > > > > > -- > Jos? Ignacio Prieto > celular(nuevo): 94348182 > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-developers > From matt.mccormick at kitware.com Thu Aug 28 22:39:54 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 28 Aug 2014 22:39:54 -0400 Subject: [ITK-users] MutualInformationImageToImageMetric without transformation In-Reply-To: <1409232280489-7586134.post@n2.nabble.com> References: <1408375248616-7586081.post@n2.nabble.com> <1409059906690-7586120.post@n2.nabble.com> <1409062625902-7586123.post@n2.nabble.com> <1409129738759-7586127.post@n2.nabble.com> <1409226225974-7586133.post@n2.nabble.com> <1409232280489-7586134.post@n2.nabble.com> Message-ID: Hi Jan, Make sure to call Initialize() [1]. See also the MeanSquareImageMetric1.cxx file from the Examples/ directory. Hope this helps, Matt [1] http://www.itk.org/Insight/Doxygen/html/classitk_1_1ImageToImageMetric.html#a2bd5955a3bedf31e701aed3ee1d4e473 On Thu, Aug 28, 2014 at 9:24 AM, jan wrote: > Hi, I will use this way, because it's the most convenient that's working for > me. > > //Typedefs > typedef itk::IdentityTransform< double, 2 > TransformType; > typedef itk::GradientDescentOptimizer OptimizerType; > typedef itk::LinearInterpolateImageFunction< UChar2DImageType, double > > InterpolatorType; > typedef itk::MutualInformationImageToImageMetric< UChar2DImageType, > UChar2DImageType > MiMetricType; > typedef itk::ImageRegistrationMethod< UChar2DImageType, UChar2DImageType >> RegistrationType; > > //Create registration components > TransformType::Pointer transform = TransformType::New(); > OptimizerType::Pointer optimizer = OptimizerType::New(); > InterpolatorType::Pointer interpolator = InterpolatorType::New(); > RegistrationType::Pointer registration = RegistrationType::New(); > > //Configure transform > transform->SetIdentity(); > > //Configure optimizer > optimizer->SetNumberOfIterations( 1 ); > > //Configure metric > MetricType::Pointer metric = MetricType::New(); > metric->SetNumberOfSpatialSamples( 1000 ); > > //Set up registration > registration->SetOptimizer( optimizer ); > registration->SetTransform( transform ); > registration->SetInterpolator( interpolator ); > registration->SetMetric( metric ); > > registration->SetFixedImage( fixedImageIn ); > registration->SetMovingImage( movingImageIn ); > registration->SetInitialTransformParameters( transform->GetParameters() > ); > > //Perform registration > try > { > registration->Update(); > } > catch( itk::ExceptionObject & err ) > { > std::cout << "ExceptionObject caught !" << std::endl; > std::cout << err << std::endl; > } > > //Get output > double bestValue = optimizer->GetValue(); > > Thank you all for your help, > > Jan > > > > -- > View this message in context: http://itk-insight-users.2283740.n2.nabble.com/MutualInformationImageToImageMetric-without-transformation-tp7586081p7586134.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 g.bogle at auckland.ac.nz Fri Aug 29 04:09:30 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Fri, 29 Aug 2014 08:09:30 +0000 Subject: [ITK-users] Strange Visual Studio 2012 problem Message-ID: I've been using Visual Studio 10 for a few years without any problems. Now I have a new machine with Visual Studio 11 (i.e. 2012) installed. I have built ITK 64-bit, and installed it in D:\ITK-VS11-x64. The ITK environment variable ITK_DIR = D:\ITK-VS11-x64. When I try to build my programs with the new libraries the build fails with (for example) this message: crop.cpp(18): fatal error C1083: Cannot open include file: 'itkImage.h': No such file or directory Looking at the Project Properties I see in Additional Include Directories: crop.cpp(18): \include\ITK-4.5 For some reason cmake has not used the ITK_DIR prefix. In addition I see in Linker > Additional Dependencies that all the ITK libraries are expected to be in D:\ITK-VS11-x64\lib\Release\ - another nonexistent directory, although in this case the ITK_DIR prefix has been used. This is a bit of a mess. I presume the problem lies with cmake. My version is 2.8.12.2, which I would have thought was recent enough - maybe it's too recent. Has anyone else run into this problem, and is there a solution? Thanks Gib -------------- next part -------------- An HTML attachment was scrubbed... URL: From indianzeppelin at gmail.com Fri Aug 29 04:29:47 2014 From: indianzeppelin at gmail.com (Girish Mallya Udupi) Date: Fri, 29 Aug 2014 09:29:47 +0100 Subject: [ITK-users] [ITK] Strange Visual Studio 2012 problem In-Reply-To: References: Message-ID: Could you paste the part of your CMakeLists.txt where you find/include/link ITK? On Fri, Aug 29, 2014 at 9:09 AM, Gib Bogle wrote: > I've been using Visual Studio 10 for a few years without any problems. > Now I have a new machine with Visual Studio 11 (i.e. 2012) installed. I > have built ITK 64-bit, and installed it in D:\ITK-VS11-x64. The ITK > environment variable ITK_DIR = D:\ITK-VS11-x64. When I try to build my > programs with the new libraries the build fails with (for example) this > message: > > crop.cpp(18): fatal error C1083: Cannot open include file: 'itkImage.h': > No such file or directory > > Looking at the Project Properties I see in Additional Include Directories: > crop.cpp(18): \include\ITK-4.5 > For some reason cmake has not used the ITK_DIR prefix. In addition I see > in Linker > Additional Dependencies that all the ITK libraries are expected > to be in D:\ITK-VS11-x64\lib\Release\ - another nonexistent directory, > although in this case the ITK_DIR prefix has been used. > > This is a bit of a mess. I presume the problem lies with cmake. My > version is 2.8.12.2, which I would have thought was recent enough - maybe > it's too recent. Has anyone else run into this problem, and is there a > solution? > > Thanks > Gib > > _____________________________________ > 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 > > -- Regards, Girish -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.bogle at auckland.ac.nz Fri Aug 29 05:10:05 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Fri, 29 Aug 2014 09:10:05 +0000 Subject: [ITK-users] [ITK] Strange Visual Studio 2012 problem In-Reply-To: References: , Message-ID: I just remembered that I forgot to paste that: cmake_minimum_required(VERSION 2.6) PROJECT(crop) FIND_PACKAGE(ITK) IF(ITK_FOUND) INCLUDE(${ITK_USE_FILE}) ELSE(ITK_FOUND) MESSAGE(FATAL_ERROR "ITK not found. Please set ITK_DIR.") ENDIF(ITK_FOUND) set(PROJECTNAME "crop") ADD_EXECUTABLE(${PROJECTNAME} crop.cpp) TARGET_LINK_LIBRARIES(${PROJECTNAME} ${ITK_LIBRARIES} ) ________________________________ From: Girish Mallya Udupi [indianzeppelin at gmail.com] Sent: Friday, 29 August 2014 8:25 p.m. To: Gib Bogle Cc: insight-users at itk.org Subject: Re: [ITK] [ITK-users] Strange Visual Studio 2012 problem Could you paste the part of your CMakeLists.txt where you find/include ITK? On Fri, Aug 29, 2014 at 9:09 AM, Gib Bogle > wrote: I've been using Visual Studio 10 for a few years without any problems. Now I have a new machine with Visual Studio 11 (i.e. 2012) installed. I have built ITK 64-bit, and installed it in D:\ITK-VS11-x64. The ITK environment variable ITK_DIR = D:\ITK-VS11-x64. When I try to build my programs with the new libraries the build fails with (for example) this message: crop.cpp(18): fatal error C1083: Cannot open include file: 'itkImage.h': No such file or directory Looking at the Project Properties I see in Additional Include Directories: crop.cpp(18): \include\ITK-4.5 For some reason cmake has not used the ITK_DIR prefix. In addition I see in Linker > Additional Dependencies that all the ITK libraries are expected to be in D:\ITK-VS11-x64\lib\Release\ - another nonexistent directory, although in this case the ITK_DIR prefix has been used. This is a bit of a mess. I presume the problem lies with cmake. My version is 2.8.12.2, which I would have thought was recent enough - maybe it's too recent. Has anyone else run into this problem, and is there a solution? Thanks Gib _____________________________________ 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 -- Regards, Girish -------------- next part -------------- An HTML attachment was scrubbed... URL: From indianzeppelin at gmail.com Fri Aug 29 05:29:51 2014 From: indianzeppelin at gmail.com (Girish Mallya Udupi) Date: Fri, 29 Aug 2014 10:29:51 +0100 Subject: [ITK-users] [ITK] Strange Visual Studio 2012 problem In-Reply-To: References: Message-ID: That looks alright. Did you try MESSAGE (${ITK_USE_FILE}) and MESSAGE (${ITK_INCLUDE_DIRS})? On Fri, Aug 29, 2014 at 10:10 AM, Gib Bogle wrote: > I just remembered that I forgot to paste that: > > > cmake_minimum_required(VERSION 2.6) > > PROJECT(crop) > FIND_PACKAGE(ITK) > IF(ITK_FOUND) > INCLUDE(${ITK_USE_FILE}) > ELSE(ITK_FOUND) > MESSAGE(FATAL_ERROR > "ITK not found. Please set ITK_DIR.") > ENDIF(ITK_FOUND) > > set(PROJECTNAME "crop") > ADD_EXECUTABLE(${PROJECTNAME} crop.cpp) > TARGET_LINK_LIBRARIES(${PROJECTNAME} ${ITK_LIBRARIES} ) > ------------------------------ > *From:* Girish Mallya Udupi [indianzeppelin at gmail.com] > *Sent:* Friday, 29 August 2014 8:25 p.m. > *To:* Gib Bogle > *Cc:* insight-users at itk.org > *Subject:* Re: [ITK] [ITK-users] Strange Visual Studio 2012 problem > > Could you paste the part of your CMakeLists.txt where you find/include > ITK? > > > On Fri, Aug 29, 2014 at 9:09 AM, Gib Bogle wrote: > >> I've been using Visual Studio 10 for a few years without any problems. >> Now I have a new machine with Visual Studio 11 (i.e. 2012) installed. I >> have built ITK 64-bit, and installed it in D:\ITK-VS11-x64. The ITK >> environment variable ITK_DIR = D:\ITK-VS11-x64. When I try to build my >> programs with the new libraries the build fails with (for example) this >> message: >> >> crop.cpp(18): fatal error C1083: Cannot open include file: 'itkImage.h': >> No such file or directory >> >> Looking at the Project Properties I see in Additional Include >> Directories: crop.cpp(18): \include\ITK-4.5 >> For some reason cmake has not used the ITK_DIR prefix. In addition I see >> in Linker > Additional Dependencies that all the ITK libraries are expected >> to be in D:\ITK-VS11-x64\lib\Release\ - another nonexistent directory, >> although in this case the ITK_DIR prefix has been used. >> >> This is a bit of a mess. I presume the problem lies with cmake. My >> version is 2.8.12.2, which I would have thought was recent enough - maybe >> it's too recent. Has anyone else run into this problem, and is there a >> solution? >> >> Thanks >> Gib >> >> _____________________________________ >> 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 >> >> > > > -- > Regards, > Girish > -- Regards, Girish -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.bogle at auckland.ac.nz Fri Aug 29 05:33:19 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Fri, 29 Aug 2014 09:33:19 +0000 Subject: [ITK-users] [ITK] Strange Visual Studio 2012 problem In-Reply-To: References: , Message-ID: OK, I just did that, and got: D:/InsightToolkit-4.5.2/CMake/UseITK.cmake /include/ITK-4.5 ________________________________ From: Girish Mallya Udupi [indianzeppelin at gmail.com] Sent: Friday, 29 August 2014 9:29 p.m. To: Gib Bogle Cc: insight-users at itk.org Subject: Re: [ITK] [ITK-users] Strange Visual Studio 2012 problem That looks alright. Did you try MESSAGE (${ITK_USE_FILE}) and MESSAGE (${ITK_INCLUDE_DIRS})? On Fri, Aug 29, 2014 at 10:10 AM, Gib Bogle > wrote: I just remembered that I forgot to paste that: cmake_minimum_required(VERSION 2.6) PROJECT(crop) FIND_PACKAGE(ITK) IF(ITK_FOUND) INCLUDE(${ITK_USE_FILE}) ELSE(ITK_FOUND) MESSAGE(FATAL_ERROR "ITK not found. Please set ITK_DIR.") ENDIF(ITK_FOUND) set(PROJECTNAME "crop") ADD_EXECUTABLE(${PROJECTNAME} crop.cpp) TARGET_LINK_LIBRARIES(${PROJECTNAME} ${ITK_LIBRARIES} ) ________________________________ From: Girish Mallya Udupi [indianzeppelin at gmail.com] Sent: Friday, 29 August 2014 8:25 p.m. To: Gib Bogle Cc: insight-users at itk.org Subject: Re: [ITK] [ITK-users] Strange Visual Studio 2012 problem Could you paste the part of your CMakeLists.txt where you find/include ITK? On Fri, Aug 29, 2014 at 9:09 AM, Gib Bogle > wrote: I've been using Visual Studio 10 for a few years without any problems. Now I have a new machine with Visual Studio 11 (i.e. 2012) installed. I have built ITK 64-bit, and installed it in D:\ITK-VS11-x64. The ITK environment variable ITK_DIR = D:\ITK-VS11-x64. When I try to build my programs with the new libraries the build fails with (for example) this message: crop.cpp(18): fatal error C1083: Cannot open include file: 'itkImage.h': No such file or directory Looking at the Project Properties I see in Additional Include Directories: crop.cpp(18): \include\ITK-4.5 For some reason cmake has not used the ITK_DIR prefix. In addition I see in Linker > Additional Dependencies that all the ITK libraries are expected to be in D:\ITK-VS11-x64\lib\Release\ - another nonexistent directory, although in this case the ITK_DIR prefix has been used. This is a bit of a mess. I presume the problem lies with cmake. My version is 2.8.12.2, which I would have thought was recent enough - maybe it's too recent. Has anyone else run into this problem, and is there a solution? Thanks Gib _____________________________________ 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 -- Regards, Girish -- Regards, Girish -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.bogle at auckland.ac.nz Fri Aug 29 05:47:46 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Fri, 29 Aug 2014 09:47:46 +0000 Subject: [ITK-users] [ITK] Strange Visual Studio 2012 problem In-Reply-To: References: , Message-ID: Hold everything, Girish! I see that D:\ITK-VS11-x64 does not have the directory structure of an ITK installation, from which I conclude that I did something wrong. I am now checking the build of ITK and will report back. ________________________________ From: Girish Mallya Udupi [indianzeppelin at gmail.com] Sent: Friday, 29 August 2014 9:29 p.m. To: Gib Bogle Cc: insight-users at itk.org Subject: Re: [ITK] [ITK-users] Strange Visual Studio 2012 problem That looks alright. Did you try MESSAGE (${ITK_USE_FILE}) and MESSAGE (${ITK_INCLUDE_DIRS})? On Fri, Aug 29, 2014 at 10:10 AM, Gib Bogle > wrote: I just remembered that I forgot to paste that: cmake_minimum_required(VERSION 2.6) PROJECT(crop) FIND_PACKAGE(ITK) IF(ITK_FOUND) INCLUDE(${ITK_USE_FILE}) ELSE(ITK_FOUND) MESSAGE(FATAL_ERROR "ITK not found. Please set ITK_DIR.") ENDIF(ITK_FOUND) set(PROJECTNAME "crop") ADD_EXECUTABLE(${PROJECTNAME} crop.cpp) TARGET_LINK_LIBRARIES(${PROJECTNAME} ${ITK_LIBRARIES} ) ________________________________ From: Girish Mallya Udupi [indianzeppelin at gmail.com] Sent: Friday, 29 August 2014 8:25 p.m. To: Gib Bogle Cc: insight-users at itk.org Subject: Re: [ITK] [ITK-users] Strange Visual Studio 2012 problem Could you paste the part of your CMakeLists.txt where you find/include ITK? On Fri, Aug 29, 2014 at 9:09 AM, Gib Bogle > wrote: I've been using Visual Studio 10 for a few years without any problems. Now I have a new machine with Visual Studio 11 (i.e. 2012) installed. I have built ITK 64-bit, and installed it in D:\ITK-VS11-x64. The ITK environment variable ITK_DIR = D:\ITK-VS11-x64. When I try to build my programs with the new libraries the build fails with (for example) this message: crop.cpp(18): fatal error C1083: Cannot open include file: 'itkImage.h': No such file or directory Looking at the Project Properties I see in Additional Include Directories: crop.cpp(18): \include\ITK-4.5 For some reason cmake has not used the ITK_DIR prefix. In addition I see in Linker > Additional Dependencies that all the ITK libraries are expected to be in D:\ITK-VS11-x64\lib\Release\ - another nonexistent directory, although in this case the ITK_DIR prefix has been used. This is a bit of a mess. I presume the problem lies with cmake. My version is 2.8.12.2, which I would have thought was recent enough - maybe it's too recent. Has anyone else run into this problem, and is there a solution? Thanks Gib _____________________________________ 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 -- Regards, Girish -- Regards, Girish -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.bogle at auckland.ac.nz Fri Aug 29 05:57:24 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Fri, 29 Aug 2014 09:57:24 +0000 Subject: [ITK-users] [ITK] Strange Visual Studio 2012 problem In-Reply-To: References: , Message-ID: Now I'm more confused. I thought that D:\ITK-VS11-x64 didn't look like an ITK installation directory because on my other machine there are only the subdirectories 'bin', 'include', 'lib', and 'share', while on the new machine I have those and many more, including 'CMakeFiles', 'config', 'ExternalData', 'Modules', 'Utilities'. But I did Build Install again and it left things unchanged. So it appears that the ITK install has changed from ITK-4.0 to ITK-4.5. Should I go back to 4.0? Life was simpler then... ________________________________ From: Girish Mallya Udupi [indianzeppelin at gmail.com] Sent: Friday, 29 August 2014 9:29 p.m. To: Gib Bogle Cc: insight-users at itk.org Subject: Re: [ITK] [ITK-users] Strange Visual Studio 2012 problem That looks alright. Did you try MESSAGE (${ITK_USE_FILE}) and MESSAGE (${ITK_INCLUDE_DIRS})? On Fri, Aug 29, 2014 at 10:10 AM, Gib Bogle > wrote: I just remembered that I forgot to paste that: cmake_minimum_required(VERSION 2.6) PROJECT(crop) FIND_PACKAGE(ITK) IF(ITK_FOUND) INCLUDE(${ITK_USE_FILE}) ELSE(ITK_FOUND) MESSAGE(FATAL_ERROR "ITK not found. Please set ITK_DIR.") ENDIF(ITK_FOUND) set(PROJECTNAME "crop") ADD_EXECUTABLE(${PROJECTNAME} crop.cpp) TARGET_LINK_LIBRARIES(${PROJECTNAME} ${ITK_LIBRARIES} ) ________________________________ From: Girish Mallya Udupi [indianzeppelin at gmail.com] Sent: Friday, 29 August 2014 8:25 p.m. To: Gib Bogle Cc: insight-users at itk.org Subject: Re: [ITK] [ITK-users] Strange Visual Studio 2012 problem Could you paste the part of your CMakeLists.txt where you find/include ITK? On Fri, Aug 29, 2014 at 9:09 AM, Gib Bogle > wrote: I've been using Visual Studio 10 for a few years without any problems. Now I have a new machine with Visual Studio 11 (i.e. 2012) installed. I have built ITK 64-bit, and installed it in D:\ITK-VS11-x64. The ITK environment variable ITK_DIR = D:\ITK-VS11-x64. When I try to build my programs with the new libraries the build fails with (for example) this message: crop.cpp(18): fatal error C1083: Cannot open include file: 'itkImage.h': No such file or directory Looking at the Project Properties I see in Additional Include Directories: crop.cpp(18): \include\ITK-4.5 For some reason cmake has not used the ITK_DIR prefix. In addition I see in Linker > Additional Dependencies that all the ITK libraries are expected to be in D:\ITK-VS11-x64\lib\Release\ - another nonexistent directory, although in this case the ITK_DIR prefix has been used. This is a bit of a mess. I presume the problem lies with cmake. My version is 2.8.12.2, which I would have thought was recent enough - maybe it's too recent. Has anyone else run into this problem, and is there a solution? Thanks Gib _____________________________________ 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 -- Regards, Girish -- Regards, Girish -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.bogle at auckland.ac.nz Fri Aug 29 06:16:14 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Fri, 29 Aug 2014 10:16:14 +0000 Subject: [ITK-users] [ITK] Strange Visual Studio 2012 problem In-Reply-To: References: , Message-ID: I just checked the build configuration in cmake and everything looks fine. ________________________________ From: Girish Mallya Udupi [indianzeppelin at gmail.com] Sent: Friday, 29 August 2014 9:29 p.m. To: Gib Bogle Cc: insight-users at itk.org Subject: Re: [ITK] [ITK-users] Strange Visual Studio 2012 problem That looks alright. Did you try MESSAGE (${ITK_USE_FILE}) and MESSAGE (${ITK_INCLUDE_DIRS})? On Fri, Aug 29, 2014 at 10:10 AM, Gib Bogle > wrote: I just remembered that I forgot to paste that: cmake_minimum_required(VERSION 2.6) PROJECT(crop) FIND_PACKAGE(ITK) IF(ITK_FOUND) INCLUDE(${ITK_USE_FILE}) ELSE(ITK_FOUND) MESSAGE(FATAL_ERROR "ITK not found. Please set ITK_DIR.") ENDIF(ITK_FOUND) set(PROJECTNAME "crop") ADD_EXECUTABLE(${PROJECTNAME} crop.cpp) TARGET_LINK_LIBRARIES(${PROJECTNAME} ${ITK_LIBRARIES} ) ________________________________ From: Girish Mallya Udupi [indianzeppelin at gmail.com] Sent: Friday, 29 August 2014 8:25 p.m. To: Gib Bogle Cc: insight-users at itk.org Subject: Re: [ITK] [ITK-users] Strange Visual Studio 2012 problem Could you paste the part of your CMakeLists.txt where you find/include ITK? On Fri, Aug 29, 2014 at 9:09 AM, Gib Bogle > wrote: I've been using Visual Studio 10 for a few years without any problems. Now I have a new machine with Visual Studio 11 (i.e. 2012) installed. I have built ITK 64-bit, and installed it in D:\ITK-VS11-x64. The ITK environment variable ITK_DIR = D:\ITK-VS11-x64. When I try to build my programs with the new libraries the build fails with (for example) this message: crop.cpp(18): fatal error C1083: Cannot open include file: 'itkImage.h': No such file or directory Looking at the Project Properties I see in Additional Include Directories: crop.cpp(18): \include\ITK-4.5 For some reason cmake has not used the ITK_DIR prefix. In addition I see in Linker > Additional Dependencies that all the ITK libraries are expected to be in D:\ITK-VS11-x64\lib\Release\ - another nonexistent directory, although in this case the ITK_DIR prefix has been used. This is a bit of a mess. I presume the problem lies with cmake. My version is 2.8.12.2, which I would have thought was recent enough - maybe it's too recent. Has anyone else run into this problem, and is there a solution? Thanks Gib _____________________________________ 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 -- Regards, Girish -- Regards, Girish -------------- next part -------------- An HTML attachment was scrubbed... URL: From indianzeppelin at gmail.com Fri Aug 29 06:35:44 2014 From: indianzeppelin at gmail.com (Girish Mallya Udupi) Date: Fri, 29 Aug 2014 11:35:44 +0100 Subject: [ITK-users] [ITK] Strange Visual Studio 2012 problem In-Reply-To: References: Message-ID: Ok, I've never actually built the "INSTALL" project and the oldest ITK version I have used is ITK-4.5.1. The folders you see ('CMakeFiles' etc) look normal to me since those are present in the build folder. Anyway, it might be worth trying to build ITK again using the following simple steps. (You might be aware of all the steps, but mentioning them all here just for the sake of completeness). 1) Create a root folder e.g., D:\ITK-4.5 2) Create two folders in the root folder "src" and "bin" 3) Put the ITK source tree in the src folder. So this folder would have the main ITK CMakeLists.txt. 4) Configure and generate using CMake with "D:\ITK-4.5\src" as source folder and "D:\ITK-4.5\bin" as binary directory 5) Then open the ITK.sln from "D:\ITK-4.5\bin" and build the solution. 6) Once built, edit the ITK environment variable ITK_DIR to point to " D:\ITK-4.5\bin" I've never faced any problem using ITK in my projects after building it this way. I am still a beginner, so someone more knowledgeable could point out what exactly the problem was with your build. On Fri, Aug 29, 2014 at 11:16 AM, Gib Bogle wrote: > I just checked the build configuration in cmake and everything looks > fine. > ------------------------------ > *From:* Girish Mallya Udupi [indianzeppelin at gmail.com] > *Sent:* Friday, 29 August 2014 9:29 p.m. > > *To:* Gib Bogle > *Cc:* insight-users at itk.org > *Subject:* Re: [ITK] [ITK-users] Strange Visual Studio 2012 problem > > That looks alright. Did you try MESSAGE (${ITK_USE_FILE}) and MESSAGE > (${ITK_INCLUDE_DIRS})? > > > On Fri, Aug 29, 2014 at 10:10 AM, Gib Bogle > wrote: > >> I just remembered that I forgot to paste that: >> >> >> cmake_minimum_required(VERSION 2.6) >> >> PROJECT(crop) >> FIND_PACKAGE(ITK) >> IF(ITK_FOUND) >> INCLUDE(${ITK_USE_FILE}) >> ELSE(ITK_FOUND) >> MESSAGE(FATAL_ERROR >> "ITK not found. Please set ITK_DIR.") >> ENDIF(ITK_FOUND) >> >> set(PROJECTNAME "crop") >> ADD_EXECUTABLE(${PROJECTNAME} crop.cpp) >> TARGET_LINK_LIBRARIES(${PROJECTNAME} ${ITK_LIBRARIES} ) >> ------------------------------ >> *From:* Girish Mallya Udupi [indianzeppelin at gmail.com] >> *Sent:* Friday, 29 August 2014 8:25 p.m. >> *To:* Gib Bogle >> *Cc:* insight-users at itk.org >> *Subject:* Re: [ITK] [ITK-users] Strange Visual Studio 2012 problem >> >> Could you paste the part of your CMakeLists.txt where you >> find/include ITK? >> >> >> On Fri, Aug 29, 2014 at 9:09 AM, Gib Bogle >> wrote: >> >>> I've been using Visual Studio 10 for a few years without any >>> problems. Now I have a new machine with Visual Studio 11 (i.e. 2012) >>> installed. I have built ITK 64-bit, and installed it in D:\ITK-VS11-x64. >>> The ITK environment variable ITK_DIR = D:\ITK-VS11-x64. When I try to >>> build my programs with the new libraries the build fails with (for example) >>> this message: >>> >>> crop.cpp(18): fatal error C1083: Cannot open include file: 'itkImage.h': >>> No such file or directory >>> >>> Looking at the Project Properties I see in Additional Include >>> Directories: crop.cpp(18): \include\ITK-4.5 >>> For some reason cmake has not used the ITK_DIR prefix. In addition I >>> see in Linker > Additional Dependencies that all the ITK libraries are >>> expected to be in D:\ITK-VS11-x64\lib\Release\ - another nonexistent >>> directory, although in this case the ITK_DIR prefix has been used. >>> >>> This is a bit of a mess. I presume the problem lies with cmake. My >>> version is 2.8.12.2, which I would have thought was recent enough - maybe >>> it's too recent. Has anyone else run into this problem, and is there a >>> solution? >>> >>> Thanks >>> Gib >>> >>> _____________________________________ >>> 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 >>> >>> >> >> >> -- >> Regards, >> Girish >> > > > > -- > Regards, > Girish > -- Regards, Girish -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.bergmeier at imes.uni-hannover.de Fri Aug 29 09:10:41 2014 From: jan.bergmeier at imes.uni-hannover.de (jan) Date: Fri, 29 Aug 2014 06:10:41 -0700 (PDT) Subject: [ITK-users] MutualInformationImageToImageMetric without transformation In-Reply-To: References: <1408375248616-7586081.post@n2.nabble.com> <1409059906690-7586120.post@n2.nabble.com> <1409062625902-7586123.post@n2.nabble.com> <1409129738759-7586127.post@n2.nabble.com> <1409226225974-7586133.post@n2.nabble.com> <1409232280489-7586134.post@n2.nabble.com> Message-ID: <1409317841331-7586146.post@n2.nabble.com> Thanks Matt, this example was exactly what I was searching in the first place. My new minimal version is now this: typedef itk::MutualInformationImageToImageMetric< UChar2DImageType, UChar2DImageType > MetricType; typedef itk::LinearInterpolateImageFunction< UChar2DImageType, double > InterpolatorType; typedef itk::IdentityTransform< double, 2 > TransformType; MetricType::Pointer metric = MetricType::New(); TransformType::Pointer transform = TransformType::New(); InterpolatorType::Pointer interpolator = InterpolatorType::New(); metric->SetFixedImage( fixedImage ); metric->SetMovingImage( movingImage ); metric->SetFixedImageRegion( fixedImage->GetLargestPossibleRegion() ); metric->SetTransform( transform ); metric->SetInterpolator( interpolator ); metric->SetNumberOfSpatialSamples( 1000 ); metric->Initialize(); double mutualInformation = metric->GetValue( transform->GetParameters() ); Regards, Jan -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/MutualInformationImageToImageMetric-without-transformation-tp7586081p7586146.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From matt.mccormick at kitware.com Fri Aug 29 12:24:39 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Fri, 29 Aug 2014 12:24:39 -0400 Subject: [ITK-users] Problem with itk::ImageToHistogramFilter In-Reply-To: <1409142552492-7586128.post@n2.nabble.com> References: <1409142552492-7586128.post@n2.nabble.com> Message-ID: Hi Maximilian, It is necessary to call imageToHistogramFilter->SetAutoMinimumMaximum( false ); http://www.itk.org/Doxygen/html/classitk_1_1Statistics_1_1ImageToHistogramFilter.html#ab0f2c568bbb0ec3ff22e27e10b6af295 Usually, the range of values are computed from the input image. HTH, Matt On Wed, Aug 27, 2014 at 8:29 AM, maximilian wrote: > I am having problems with the itk::ImageToHistogramFilter. > > I am generating ellipses that I want to add to an image that already > contains some ellipses (in each iteration step, I add one ellipse to an > image being the result of previous iterations). To see if the new ellipse > overlaps by more than (let's say) 10%, I use the ImageToHistogramFilter. > The previous image has objects that all have pixel values of 1. The newly > added ellipse has value of 2. So, to get the number of overlapping pixels, I > add up both images and I count the number of pixels = 3 in that image. > > I set the histogram bin minimum to 0 (background) and the histogram bin > maximum to 3 (+ some constant c) and the number of bins such that the step > is = 1 (here, it is 3 + c). However, when I output the average frequencies > associated to each bin, I get values between 0 and 2 (number like 1.92) and > not between 0 and 3 + c (see output of program of attached file). Why? > > GenerateCells.cxx > > > > > -- > View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Problem-with-itk-ImageToHistogramFilter-tp7586128.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 g.bogle at auckland.ac.nz Fri Aug 29 16:00:48 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Fri, 29 Aug 2014 20:00:48 +0000 Subject: [ITK-users] VS 2012 Message-ID: Has anyone built ITK-4.5 with Visual Studio 2012? -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.bogle at auckland.ac.nz Fri Aug 29 17:15:36 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Fri, 29 Aug 2014 21:15:36 +0000 Subject: [ITK-users] [ITK] VS 2012 In-Reply-To: References: , Message-ID: When I build ITK-4.0 with VS2010, Build INSTALL creates the directory that I specified, with four subdirectories: bin. include, lib, share. I set ITK_DIR to the install directory, and my programs build correctly. When I build ITK-4.5 with VS2012, Build INSTALL creates the install directory with a completely different structure, with many additional files and subdirectories, and if ITK_DIR is set to this install directory program builds fail. To build my programs successfully I need to set ITK_DIR to the name of the ITK build directory. What I'm trying to ascertain is whether this is the result of an ITK change or a VS change. When you build ITK-3.20 with VS2012 do you do Build INSTALL, and if so what does the install directory look like? ________________________________ From: ???'?? ?????? [nekto1989 at gmail.com] Sent: Saturday, 30 August 2014 8:52 a.m. To: Gib Bogle Cc: insight-users at itk.org Subject: Re: [ITK] [ITK-users] VS 2012 Hi, Same way as 3.20-vs2010 or 3.20-vs2012. 2014-08-29 23:00 GMT+03:00 Gib Bogle >: Has anyone built ITK-4.5 with Visual Studio 2012? _____________________________________ 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 drescherjm at gmail.com Fri Aug 29 20:46:16 2014 From: drescherjm at gmail.com (John Drescher) Date: Fri, 29 Aug 2014 20:46:16 -0400 Subject: [ITK-users] Fwd: VS 2012 In-Reply-To: References: Message-ID: ---------- Forwarded message ---------- From: John Drescher Date: Fri, Aug 29, 2014 at 8:45 PM Subject: Re: [ITK-users] VS 2012 To: Gib Bogle On Fri, Aug 29, 2014 at 4:00 PM, Gib Bogle wrote: > Has anyone built ITK-4.5 with Visual Studio 2012? Yes dozens of times with no issues at all.. John -- John M. Drescher From drescherjm at gmail.com Fri Aug 29 21:19:48 2014 From: drescherjm at gmail.com (John Drescher) Date: Fri, 29 Aug 2014 21:19:48 -0400 Subject: [ITK-users] VS 2012 In-Reply-To: References: Message-ID: > Do you do Build INSTALL in the VS IDE? If so, what does your install directory look like, i.e. what are the subdirectories? I do not build INSTALL ever because that prevents me from using both Release and Debug. I build itk using cmake --build from the command line. John From g.bogle at auckland.ac.nz Fri Aug 29 21:33:15 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Sat, 30 Aug 2014 01:33:15 +0000 Subject: [ITK-users] VS 2012 In-Reply-To: References: , Message-ID: It seems that there is a problem with Build INSTALL. The build itself is fine, and I can use it if I set ITK_DIR to the build directory, but the installation done with Build INSTALL is not usable. It's probably a cmake issue, since the wrong paths for include and library files are configured in the VS project file. I'm pursuing this issue because having different build procedures on different machines is a recipe for confusion down the line, when I've forgotten what I had to do to get things working. It's puzzling to me that Kitware now have a divergence between ITK and VTK build-install procedures - the Build INSTALL path works with VTK. ________________________________________ From: John Drescher [drescherjm at gmail.com] Sent: Saturday, 30 August 2014 1:19 p.m. To: Gib Bogle; Insight-Users Subject: Re: [ITK-users] VS 2012 > Do you do Build INSTALL in the VS IDE? If so, what does your install directory look like, i.e. what are the subdirectories? I do not build INSTALL ever because that prevents me from using both Release and Debug. I build itk using cmake --build from the command line. John From indianzeppelin at gmail.com Sat Aug 30 02:40:24 2014 From: indianzeppelin at gmail.com (Girish Mallya Udupi) Date: Sat, 30 Aug 2014 07:40:24 +0100 Subject: [ITK-users] VS 2012 In-Reply-To: References: Message-ID: I don't think this is an ITK version issue. I built INSTALL for ITK-4.5.1 and ITK-4.6.0 using VS2010 and the install directories have only those sub-directories that you mentioned (bin. include, lib, share). Also, did you try the latest CMake 3.0.1? Just a couple of weeks ago, I faced an issue (can't remember the specific details) when building my project using 2.8.12 while 3.0.1 worked without any problems. On Sat, Aug 30, 2014 at 2:33 AM, Gib Bogle wrote: > It seems that there is a problem with Build INSTALL. The build itself is > fine, and I can use it if I set ITK_DIR to the build directory, but the > installation done with Build INSTALL is not usable. It's probably a cmake > issue, since the wrong paths for include and library files are configured > in the VS project file. > > I'm pursuing this issue because having different build procedures on > different machines is a recipe for confusion down the line, when I've > forgotten what I had to do to get things working. It's puzzling to me that > Kitware now have a divergence between ITK and VTK build-install procedures > - the Build INSTALL path works with VTK. > ________________________________________ > From: John Drescher [drescherjm at gmail.com] > Sent: Saturday, 30 August 2014 1:19 p.m. > To: Gib Bogle; Insight-Users > Subject: Re: [ITK-users] VS 2012 > > > Do you do Build INSTALL in the VS IDE? If so, what does your install > directory look like, i.e. what are the subdirectories? > > I do not build INSTALL ever because that prevents me from using both > Release and Debug. I build itk using cmake --build from the command > line. > > John > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > -- Regards, Girish -------------- next part -------------- An HTML attachment was scrubbed... URL: From g.bogle at auckland.ac.nz Sat Aug 30 05:59:17 2014 From: g.bogle at auckland.ac.nz (Gib Bogle) Date: Sat, 30 Aug 2014 09:59:17 +0000 Subject: [ITK-users] VS 2012 In-Reply-To: References: , Message-ID: Thanks Girish! I installed cmake 3.0.1 and rebuilt ITK, and now it all works as expected. Whew! Gib ________________________________ From: Girish Mallya Udupi [indianzeppelin at gmail.com] Sent: Saturday, 30 August 2014 6:40 p.m. To: Gib Bogle Cc: John Drescher; Insight-Users Subject: Re: [ITK-users] VS 2012 I don't think this is an ITK version issue. I built INSTALL for ITK-4.5.1 and ITK-4.6.0 using VS2010 and the install directories have only those sub-directories that you mentioned (bin. include, lib, share). Also, did you try the latest CMake 3.0.1? Just a couple of weeks ago, I faced an issue (can't remember the specific details) when building my project using 2.8.12 while 3.0.1 worked without any problems. On Sat, Aug 30, 2014 at 2:33 AM, Gib Bogle > wrote: It seems that there is a problem with Build INSTALL. The build itself is fine, and I can use it if I set ITK_DIR to the build directory, but the installation done with Build INSTALL is not usable. It's probably a cmake issue, since the wrong paths for include and library files are configured in the VS project file. I'm pursuing this issue because having different build procedures on different machines is a recipe for confusion down the line, when I've forgotten what I had to do to get things working. It's puzzling to me that Kitware now have a divergence between ITK and VTK build-install procedures - the Build INSTALL path works with VTK. ________________________________________ From: John Drescher [drescherjm at gmail.com] Sent: Saturday, 30 August 2014 1:19 p.m. To: Gib Bogle; Insight-Users Subject: Re: [ITK-users] VS 2012 > Do you do Build INSTALL in the VS IDE? If so, what does your install directory look like, i.e. what are the subdirectories? I do not build INSTALL ever because that prevents me from using both Release and Debug. I build itk using cmake --build from the command line. John _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users -- Regards, Girish -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco.ulge at gmail.com Sat Aug 30 06:16:57 2014 From: marco.ulge at gmail.com (Marco Ulge) Date: Sat, 30 Aug 2014 03:16:57 -0700 (PDT) Subject: [ITK-users] Convert Matrix to itk::Image Message-ID: <1409393816990-34497.post@n7.nabble.com> Hello, I used the vnl_matrix_ref class to extract the matrix from the itk::Image and then perform some calculations. What i need to do now, is convert the matrix back to an itk::Image and i read that i should use the itkImportImageFilter class to achieve this. I am having difficulties understanding what should be my input to SetImportPointer method. Can anyone help me with this? Regards, Marco -- View this message in context: http://itk-users.7.n7.nabble.com/ITK-users-Convert-Matrix-to-itk-Image-tp34497.html Sent from the ITK - Users mailing list archive at Nabble.com. From millerjv at gmail.com Sat Aug 30 08:23:20 2014 From: millerjv at gmail.com (Jim Miller) Date: Sat, 30 Aug 2014 08:23:20 -0400 Subject: [ITK-users] Convert Matrix to itk::Image In-Reply-To: <1409393816990-34497.post@n7.nabble.com> References: <1409393816990-34497.post@n7.nabble.com> Message-ID: You pass the pointer to the pixels you want to ITK image to wrap. There is a Boolean in the methods to control whether ITK should manage the memory from that point forward (deleting the pixels when the ITK Image is destroyed) or whether you want your program to maintain control of that memory block and you will be carefule to ensure the buffer is freed at the appropriate time. Jim > On Aug 30, 2014, at 6:16 AM, Marco Ulge wrote: > > Hello, > > I used the vnl_matrix_ref class to extract the matrix from the itk::Image > and then perform some calculations. What i need to do now, is convert the > matrix back to an itk::Image and i read that i should use the > itkImportImageFilter class to achieve this. I am having difficulties > understanding what should be my input to SetImportPointer method. Can anyone > help me with this? > > Regards, > > Marco > > > > -- > View this message in context: http://itk-users.7.n7.nabble.com/ITK-users-Convert-Matrix-to-itk-Image-tp34497.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 wechen5 at vt.edu Sat Aug 30 18:36:29 2014 From: wechen5 at vt.edu (blueridge) Date: Sat, 30 Aug 2014 15:36:29 -0700 (PDT) Subject: [ITK-users] Using RGB file for GMM module Message-ID: <1409438189857-34499.post@n7.nabble.com> Is it possible to use ImageToListSampleAdaptor to convert RGB image to a list of samples and then use ExpectationMaximizationMixtureModelEstimator to estimate components of this RGB image? thanks -- View this message in context: http://itk-users.7.n7.nabble.com/Using-RGB-file-for-GMM-module-tp34499.html Sent from the ITK - Users mailing list archive at Nabble.com. From pattersonnp.work at gmail.com Sun Aug 31 16:06:53 2014 From: pattersonnp.work at gmail.com (NPatterson) Date: Sun, 31 Aug 2014 13:06:53 -0700 (PDT) Subject: [ITK-users] ResampleDICOM example and DCMTK In-Reply-To: <95FBA78F-1DFC-4F33-9572-DA0DD9DE1E73@gmail.com> References: <95FBA78F-1DFC-4F33-9572-DA0DD9DE1E73@gmail.com> Message-ID: <1409515613801-7586158.post@n2.nabble.com> Hi, I wondered if anyone could test the code attached in the thread header "ResampleDICOM example and DCMTK" regarding the use of DCMTK for DICOM reading writing in ITK. I adapted the ResampleDICOM example to work with DCMTK instead of GDCM, and although I get no errors, I also do not get any output dicom images. If someone has the time to test this code to see if they observe the same behaviour/or can suggest a fix, I would be very appreciative. Regards, Nick. -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-users-ResampleDICOM-example-and-DCMTK-tp7586131p7586158.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From wechen5 at vt.edu Sun Aug 31 16:40:52 2014 From: wechen5 at vt.edu (blueridge) Date: Sun, 31 Aug 2014 13:40:52 -0700 (PDT) Subject: [ITK-users] ExpectationMaximizationMixtureModelEstimator use of WeightedMeanSampleFilter In-Reply-To: References: Message-ID: <1409517652082-34501.post@n7.nabble.com> It's kind of late, but just for the record since I ran into same error message. My problem was that I did not initialize the component parameters correctly, ( I did not initialize it at all, use default constructor, with set all zeros), then the weights of first iteration are all zeros, which triggers the error message. -- View this message in context: http://itk-users.7.n7.nabble.com/ExpectationMaximizationMixtureModelEstimator-error-tp31798p34501.html Sent from the ITK - Users mailing list archive at Nabble.com. From matt.mccormick at kitware.com Sun Aug 31 17:38:39 2014 From: matt.mccormick at kitware.com (Matt McCormick) Date: Sun, 31 Aug 2014 17:38:39 -0400 Subject: [ITK-users] ResampleDICOM example and DCMTK In-Reply-To: <1409515613801-7586158.post@n2.nabble.com> References: <95FBA78F-1DFC-4F33-9572-DA0DD9DE1E73@gmail.com> <1409515613801-7586158.post@n2.nabble.com> Message-ID: Hi Nick, Nothing stands out from inspecting the code. Could you please send an example dataset? Thanks, Matt On Sun, Aug 31, 2014 at 4:06 PM, NPatterson wrote: > Hi, I wondered if anyone could test the code attached in the thread header > "ResampleDICOM example and DCMTK" regarding the use of DCMTK for DICOM > reading writing in ITK. I adapted the ResampleDICOM example to work with > DCMTK instead of GDCM, and although I get no errors, I also do not get any > output dicom images. If someone has the time to test this code to see if > they observe the same behaviour/or can suggest a fix, I would be very > appreciative. > > Regards, Nick. > > > > -- > View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-users-ResampleDICOM-example-and-DCMTK-tp7586131p7586158.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