From scapegoat.sarthak at gmail.com Tue Mar 1 15:38:46 2016 From: scapegoat.sarthak at gmail.com (Scapegoat Sarthak) Date: Tue, 1 Mar 2016 15:38:46 -0500 Subject: [ITK-users] Workshops on multithreading and GPU Message-ID: Hi All, I know the courses that Kitware takes (http://training.kitware.fr/browse/) but these are relatively basic. Does anyone know of any workshops/tutorials on ITK using multi-threading and GPU processing capabilities? Thanks, Sarthak -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Tue Mar 1 16:54:34 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 1 Mar 2016 16:54:34 -0500 Subject: [ITK-users] Compilation error when building ITK 4.9.0 with MinGW In-Reply-To: References: Message-ID: Hi Francisco, Please review this patch, which addresses this issue: http://review.source.kitware.com/#/c/20823/ Thanks, Matt On Mon, Feb 22, 2016 at 7:20 AM, Francisco Lopez de la Franca wrote: > I've achieved to compile ITK 4.9.0 through MS Visual Studio 2010, but not > with MinGW. > Thanks everybody. > Kind regards. > /Francisco > > 2016-02-19 23:56 GMT+01:00 Francisco Lopez de la Franca > : >> >> Hello Matt, >> I had already tested the -Wa,-mbig-obj options in CMAKE_CXX_FLAGS and in >> CMAKE_C_FLAGS and the answer was: >> >> >> C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/as.exe: >> unrecognized option `-mbig-obj' >> >> So, I'm stuck at this point, and I'm thinking to change from Mingw to >> Visual Studio or another one. But it is very strange that ITK wasn't be >> prepared to be compiled via MinGW. >> >> Thanks for answering and if you have any suggestion, it wiil be very well >> received. >> >> /Francisco >> >> >> 2016-02-19 18:00 GMT+01:00 Matt McCormick : >>> >>> Hi Franscisco, >>> >>> According to this thread: >>> >>> https://cmake.org/pipermail/insight-users/2015-September/052511.html >>> >>> adding the flags >>> >>> -Wa,-mbig-obj >>> >>> helps at least with the build error. Does it help in your case? >>> >>> Thanks, >>> Matt >>> >>> On Thu, Feb 18, 2016 at 6:22 PM, Francisco Lopez de la Franca >>> wrote: >>> > Hi, >>> > I've downloaded the last stable ITK version, 4.9.0, for Windows and >>> > compile >>> > it by using MinGW-64. >>> > When the compilation reaches almost the 100%, it gives the error: >>> > >>> > [ 98%] Building CXX object >>> > >>> > Modules/IO/TransformBase/src/CMakeFiles/ITKIOTransformBase.dir/itkTransformFactoryBase.cxx.obj >>> > >>> > C:/MINGW/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.2/../../../../x86_64-w64-mingw32/bin/as.exe: >>> > CMakeFiles\ITKIOTransformBase.dir\itkTransformFactoryBase.cxx.obj: too >>> > many >>> > sections (33106) >>> > C:\Users\User~1\AppData\Local\Temp\ccrJIGis.s: Assembler messages: >>> > C:\Users\User~1\AppData\Local\Temp\ccrJIGis.s: Fatal error: can't write >>> > CMakeFiles\ITKIOTransformBase.dir\itkTransformFactoryBase.cxx.obj: File >>> > too >>> > big >>> > >>> > I've been searching for a solution on the web for several hours and all >>> > the >>> > attempts to solve it have not fix it. >>> > >>> > Has anyone ever faced this problem and fix it? >>> > >>> > Thanks a lot. >>> > Best regards. >>> > /Francisco >>> > >>> > _____________________________________ >>> > Powered by www.kitware.com >>> > >>> > Visit other Kitware open-source projects at >>> > http://www.kitware.com/opensource/opensource.html >>> > >>> > Kitware offers ITK Training Courses, for more information visit: >>> > http://www.kitware.com/products/protraining.php >>> > >>> > Please keep messages on-topic and check the 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 noreply at insightsoftwareconsortium.org Wed Mar 2 04:10:06 2016 From: noreply at insightsoftwareconsortium.org (MIDAS Journal) Date: Wed, 2 Mar 2016 04:10:06 -0500 (EST) Subject: [ITK-users] New Submission: Automatic Segmentation of Structures in CT Head and Neck Images using a Coupled Shape Model Message-ID: <20160302091006.D58F53D620D4@insight-journal.org> Hello, A new submission has been added to the MIDAS Journal. Title: Automatic Segmentation of Structures in CT Head and Neck Images using a Coupled Shape Model Authors: Jung F., Knapp O., Wesarg S. Abstract: The common approach to do a fully automatic segmentation of multiple structures is an atlas or multi-atlas based solution. These already have proven to be suitable for the segmentation of structures in the head and neck area and provide very accurate segmentation results, but can struggle with challenging cases with unnatural postures, where the registration of the reference patient(s) is extremely difficult. Therefore, we propose an coupled shape model (CoSMo) algorithm for the segmentation relevant structures in parallel. The model adaptation to a test image is done with respect to the appearance of its items and the trained articulation space. Even on very challenging data sets with unnatural postures, which occur far more often than expected, the model adaptation algorithm succeeds. The approach is based on an articulated atlas cite{Steger2012a}, that is trained from a set of manually labeled training samples. Furthermore, we have combined the initial solution with statistical shape models cite{Kirschner2011} to represent structures with high shape variation. CoSMo is not tailored to specific structures or regions. It can be trained from any set of given gold standard segmentations and makes it thereby very generic. Download and review this publication at: http://hdl.handle.net/10380/3543 Generated by the MIDAS Journal You are receiving this email because you asked to be informed by the MIDAS Journal for new submissions. To change your email preference visit http://midasjournal.org/ . From lefebvre at imnc.in2p3.fr Wed Mar 2 05:00:16 2016 From: lefebvre at imnc.in2p3.fr (=?UTF-8?Q?Fran=c3=a7oise_Lefebvre?=) Date: Wed, 2 Mar 2016 11:00:16 +0100 Subject: [ITK-users] Neural network Message-ID: <56D6B9B0.5000504@imnc.in2p3.fr> Hi, Has someone any experience of ITK neural network implementation ? The last message I found dated from april 2012 and suggested to forget it : https://cmake.org/pipermail/insight-users/2012-April/044552.html What about now ? Thanks Fran?oise From noreply at insightsoftwareconsortium.org Thu Mar 3 02:57:09 2016 From: noreply at insightsoftwareconsortium.org (MIDAS Journal) Date: Thu, 3 Mar 2016 02:57:09 -0500 (EST) Subject: [ITK-users] New Submission: Head and Neck Segmentation Based on Anatomical Knowledge Message-ID: <20160303075709.22CBC3D620E5@insight-journal.org> Hello, A new submission has been added to the MIDAS Journal. Title: Head and Neck Segmentation Based on Anatomical Knowledge Authors: Aghdasi N., Li Y., Berens A., Moe K., Hannaford B. Abstract: We present a fully automatic method for segmenting the head and neck structures, such as optic nerve and mandible in CT images using anatomical landmarks and prior knowledge. The aim is to use spatial relationship of landmarks along with image processing techniques to detect these structures robustly and efficiently. Utilizing prior knowledge and reliable anatomical landmarks to define an optimal Region of Interest (ROI) which contains the optic nerve or mandible is an effective way for fast localization and successful segmentation. This approach is robust to CT data with variable voxel resolution and does not require large training data sets. Download and review this publication at: http://hdl.handle.net/10380/3545 Generated by the MIDAS Journal You are receiving this email because you asked to be informed by the MIDAS Journal for new submissions. To change your email preference visit http://midasjournal.org/ . From bakkari.abdelkhalek at hotmail.fr Thu Mar 3 03:18:52 2016 From: bakkari.abdelkhalek at hotmail.fr (Abdelkhalek Bakkari) Date: Thu, 3 Mar 2016 09:18:52 +0100 Subject: [ITK-users] Paint Brush Button Message-ID: Hi ! I would like to add a Paint brush button to my interface. Its functionalities are : - To select a region of interest using the mouse and to color it from a 2D slice.- To show the region of interest in a 3D view. My question is : Which ITK and VTK functions I have to adopt in this case. Best regards, Abdelkhalek BakkariPh.D candidate in Computer ScienceInstitute of Applied Computer ScienceLodz University of Technology, Poland -------------- next part -------------- An HTML attachment was scrubbed... URL: From jhlegarreta at vicomtech.org Thu Mar 3 04:21:47 2016 From: jhlegarreta at vicomtech.org (Jon Haitz Legarreta) Date: Thu, 3 Mar 2016 10:21:47 +0100 Subject: [ITK-users] Paint Brush Button In-Reply-To: References: Message-ID: Hi Abdelkhalek, in order to select a region of interest, you can have a look at itk::ExtractImageFilter [1] [2] and vtkExtractVOI [3]. If you do not wish to change the dimension of the output image, you can have a look at itk::RegionOfInterestImageFilter [4]. HTH, JON HAITZ [1] http://www.itk.org/Doxygen/html/classitk_1_1ExtractImageFilter.html [2] http://itk.org/Wiki/ITK/Examples/ImageProcessing/ExtractImageFilter [3] http://www.vtk.org/doc/nightly/html/classvtkExtractVOI.html [4] http://www.itk.org/Doxygen/html/classitk_1_1RegionOfInterestImageFilter.html On 3 March 2016 at 09:18, Abdelkhalek Bakkari < bakkari.abdelkhalek at hotmail.fr> wrote: > > Hi ! > > I would like to add a Paint brush button to my interface. Its > functionalities are : > > - To select a region of interest using the mouse and to color it from a 2D > slice. > - To show the region of interest in a 3D view. > > My question is : > > Which ITK and VTK functions I have to adopt in this case. > > Best regards, > > Abdelkhalek Bakkari > Ph.D candidate in Computer Science > Institute of Applied Computer Science > Lodz University of Technology, Poland > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 artioml at post.bgu.ac.il Fri Mar 4 00:51:17 2016 From: artioml at post.bgu.ac.il (artioml) Date: Thu, 3 Mar 2016 22:51:17 -0700 (MST) Subject: [ITK-users] BSpline transformation of Vector image In-Reply-To: References: <1456067851174-36816.post@n7.nabble.com> Message-ID: <1457070677221-36841.post@n7.nabble.com> Hello, Thanks for your answer! I have been trying to perform vector image BSplines registration. Is that possible as well? So far I tried to use the following metric: typedef itk::Image< float, ImageDimension> VirtualImageType; typedef itk::VectorImageToImageMetricTraitsv4< FixedImageType, MovingImageType, VirtualImageType, PixelType::Length> MetricTraitsType; typedef itk::MeanSquaresImageToImageMetricv4 < FixedImageType, MovingImageType, VirtualImageType, float, MetricTraitsType > MetricType; typedef MetricType::FixedSampledPointSetType PointSetType; I just replaced the MSE metric with this one at DeformableRegistration7 example (And the pixel type to vector as well). It won't compile and I got a really long error. Do you know if there is any code example that performs such a thing? Thank you very much!! -- View this message in context: http://itk-users.7.n7.nabble.com/BSpline-transformation-of-Vector-image-tp36816p36841.html Sent from the ITK - Users mailing list archive at Nabble.com. From colddiesun at gmail.com Fri Mar 4 08:35:35 2016 From: colddiesun at gmail.com (tao sun) Date: Fri, 4 Mar 2016 14:35:35 +0100 Subject: [ITK-users] transformation matrix from a dicom file Message-ID: Hi, I am trying to read the transform from a dicom image. I understand the tag "Image position" and "Image orientation" provides the information. Is there a way to read the transformation matrix from the header? Thanks, Julio -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexfd7 at gmail.com Fri Mar 4 08:20:32 2016 From: alexfd7 at gmail.com (alexfd7) Date: Fri, 4 Mar 2016 06:20:32 -0700 (MST) Subject: [ITK-users] Function "GetOpenCLSource (), I can not find it Message-ID: <1457097632603-36843.post@n7.nabble.com> Hi, how are you? Can anybody help me? Where do I find the implementation of the function "GetOpenCLSource ()" located within the file "itkMacro.h"? -- View this message in context: http://itk-users.7.n7.nabble.com/Function-GetOpenCLSource-I-can-not-find-it-tp36843.html Sent from the ITK - Users mailing list archive at Nabble.com. From matt.mccormick at kitware.com Fri Mar 4 10:23:42 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Fri, 4 Mar 2016 10:23:42 -0500 Subject: [ITK-users] transformation matrix from a dicom file In-Reply-To: References: Message-ID: Hi Julio, If you use ITK to read a DICOM image, the position information will be available in the itk::Image's Origin, Spacing, and Direction properties. HTH, Matt On Fri, Mar 4, 2016 at 8:35 AM, tao sun wrote: > Hi, > > I am trying to read the transform from a dicom image. > > I understand the tag "Image position" and "Image orientation" provides the > information. Is there a way to read the transformation matrix from the > header? > > Thanks, > Julio > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 Fri Mar 4 10:30:56 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Fri, 4 Mar 2016 10:30:56 -0500 Subject: [ITK-users] Function "GetOpenCLSource (), I can not find it In-Reply-To: <1457097632603-36843.post@n7.nabble.com> References: <1457097632603-36843.post@n7.nabble.com> Message-ID: Hello, The file "itkMacro.h" is located in the ITK source tree, which can be downloaded from: http://itk.org/ITK/resources/software.html It can also be cloned with Git: http://www.itk.org/Wiki/ITK/Git/Download which is easily searched with 'git grep': https://git-scm.com/docs/git-grep References to GetOpenCLSource in itkMacro.h are here: https://github.com/InsightSoftwareConsortium/ITK/blob/130f8a7cf81ed43b96b87a613fd7a7f5b25b06a0/Modules/Core/Common/include/itkMacro.h#L1190-L1214 HTH, Matt On Fri, Mar 4, 2016 at 8:20 AM, alexfd7 wrote: > Hi, how are you? Can anybody help me? > > Where do I find the implementation of the function "GetOpenCLSource ()" > located within the file "itkMacro.h"? > > > > -- > View this message in context: http://itk-users.7.n7.nabble.com/Function-GetOpenCLSource-I-can-not-find-it-tp36843.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 alexfd7 at gmail.com Fri Mar 4 11:54:47 2016 From: alexfd7 at gmail.com (alexfd7) Date: Fri, 4 Mar 2016 09:54:47 -0700 (MST) Subject: [ITK-users] Function "GetOpenCLSource (), I can not find it In-Reply-To: References: <1457097632603-36843.post@n7.nabble.com> Message-ID: <1457110487641-7588559.post@n2.nabble.com> Hello Matt, I downloaded the library 'InsightToolkit-4.5.2.tar.gz' and I found the 'itkMacro.h' file in the path "InsightToolkit-4.5.2 / Modules / Core / Common / include/". What I wanted to know is what the "GetOpenCLSource ()" does. I can not find the implementation of it. -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-users-Function-GetOpenCLSource-I-can-not-find-it-tp7588556p7588559.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From matt.mccormick at kitware.com Fri Mar 4 14:06:41 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Fri, 4 Mar 2016 14:06:41 -0500 Subject: [ITK-users] Function "GetOpenCLSource (), I can not find it In-Reply-To: <1457110487641-7588559.post@n2.nabble.com> References: <1457097632603-36843.post@n7.nabble.com> <1457110487641-7588559.post@n2.nabble.com> Message-ID: Hello Alex, Please try the 'git grep' tip. HTH, Matt On Fri, Mar 4, 2016 at 11:54 AM, alexfd7 wrote: > Hello Matt, I downloaded the library 'InsightToolkit-4.5.2.tar.gz' and I > found the 'itkMacro.h' file in the path "InsightToolkit-4.5.2 / Modules / > Core / Common / include/". > > What I wanted to know is what the "GetOpenCLSource ()" does. I can not find > the implementation of it. > > > > -- > View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-users-Function-GetOpenCLSource-I-can-not-find-it-tp7588556p7588559.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 alexfd7 at gmail.com Sun Mar 6 09:16:42 2016 From: alexfd7 at gmail.com (alexfd7) Date: Sun, 6 Mar 2016 07:16:42 -0700 (MST) Subject: [ITK-users] Function "GetOpenCLSource (), I can not find it In-Reply-To: References: <1457097632603-36843.post@n7.nabble.com> <1457110487641-7588559.post@n2.nabble.com> Message-ID: <1457273802044-36848.post@n7.nabble.com> Thank you Matt, I found with the help of 'git grep', a great search tool, thanks for the tip, I will use from now on. -- View this message in context: http://itk-users.7.n7.nabble.com/Function-GetOpenCLSource-I-can-not-find-it-tp36843p36848.html Sent from the ITK - Users mailing list archive at Nabble.com. From suneezahanif02 at gmail.com Sun Mar 6 12:13:23 2016 From: suneezahanif02 at gmail.com (suneeza hanif) Date: Sun, 6 Mar 2016 18:13:23 +0100 Subject: [ITK-users] Visualize Intermediate result of ITK registration in vtk In-Reply-To: <1453177087814-36661.post@n7.nabble.com> References: <1451277758067-36590.post@n7.nabble.com> <1451450098542-36592.post@n7.nabble.com> <1452781038666-7588354.post@n2.nabble.com> <1453177087814-36661.post@n7.nabble.com> Message-ID: Hello Bill, I have tried this example with images specified in the example. It worked great with them but when I used .dcm images, instead of showing pattern in the image it just showed white image. I have attached the screenshot for reference. Can you guide me why is it not working in this case and what I need to add. Thank you. Best Regards, Suneeza -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: example.PNG Type: image/png Size: 50303 bytes Desc: not available URL: From bill.lorensen at gmail.com Sun Mar 6 12:19:34 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Sun, 6 Mar 2016 12:19:34 -0500 Subject: [ITK-users] Visualize Intermediate result of ITK registration in vtk In-Reply-To: References: <1451277758067-36590.post@n7.nabble.com> <1451450098542-36592.post@n7.nabble.com> <1452781038666-7588354.post@n2.nabble.com> <1453177087814-36661.post@n7.nabble.com> Message-ID: For dicom data change typedef unsigned char PixelType; to typedef short PixelType; On Sun, Mar 6, 2016 at 12:13 PM, suneeza hanif wrote: > Hello Bill, > > I have tried this example with images specified in the example. It worked > great with them but when I used .dcm images, instead of showing pattern in > the image it just showed white image. > I have attached the screenshot for reference. > > Can you guide me why is it not working in this case and what I need to add. > > Thank you. > > Best Regards, > Suneeza > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 suneezahanif02 at gmail.com Sun Mar 6 12:30:05 2016 From: suneezahanif02 at gmail.com (suneeza hanif) Date: Sun, 6 Mar 2016 18:30:05 +0100 Subject: [ITK-users] Visualize Intermediate result of ITK registration in vtk In-Reply-To: References: <1451277758067-36590.post@n7.nabble.com> <1451450098542-36592.post@n7.nabble.com> <1452781038666-7588354.post@n2.nabble.com> <1453177087814-36661.post@n7.nabble.com> Message-ID: Hello Bill, Thanks a lot for your quick response. Yes I used the PixelType short but I am still getting the same result. Regards, Suneeza On Sun, Mar 6, 2016 at 6:19 PM, Bill Lorensen wrote: > For dicom data change > > typedef unsigned char PixelType; > to > > typedef short PixelType; > > > On Sun, Mar 6, 2016 at 12:13 PM, suneeza hanif > wrote: > > Hello Bill, > > > > I have tried this example with images specified in the example. It worked > > great with them but when I used .dcm images, instead of showing pattern > in > > the image it just showed white image. > > I have attached the screenshot for reference. > > > > Can you guide me why is it not working in this case and what I need to > add. > > > > Thank you. > > > > Best Regards, > > Suneeza > > > > _____________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Kitware offers ITK Training Courses, for more information visit: > > http://www.kitware.com/products/protraining.php > > > > Please keep messages on-topic and check the 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 Sun Mar 6 12:36:00 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Sun, 6 Mar 2016 12:36:00 -0500 Subject: [ITK-users] Visualize Intermediate result of ITK registration in vtk In-Reply-To: References: <1451277758067-36590.post@n7.nabble.com> <1451450098542-36592.post@n7.nabble.com> <1452781038666-7588354.post@n2.nabble.com> <1453177087814-36661.post@n7.nabble.com> Message-ID: Is it a 2D image? On Sun, Mar 6, 2016 at 12:30 PM, suneeza hanif wrote: > Hello Bill, > > Thanks a lot for your quick response. > > Yes I used the PixelType short but I am still getting the same result. > > Regards, > Suneeza > > On Sun, Mar 6, 2016 at 6:19 PM, Bill Lorensen > wrote: >> >> For dicom data change >> >> typedef unsigned char PixelType; >> to >> >> typedef short PixelType; >> >> >> On Sun, Mar 6, 2016 at 12:13 PM, suneeza hanif >> wrote: >> > Hello Bill, >> > >> > I have tried this example with images specified in the example. It >> > worked >> > great with them but when I used .dcm images, instead of showing pattern >> > in >> > the image it just showed white image. >> > I have attached the screenshot for reference. >> > >> > Can you guide me why is it not working in this case and what I need to >> > add. >> > >> > Thank you. >> > >> > Best Regards, >> > Suneeza >> > >> > _____________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Kitware offers ITK Training Courses, for more information visit: >> > http://www.kitware.com/products/protraining.php >> > >> > Please keep messages on-topic and check the 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 suneezahanif02 at gmail.com Sun Mar 6 12:36:41 2016 From: suneezahanif02 at gmail.com (suneeza hanif) Date: Sun, 6 Mar 2016 18:36:41 +0100 Subject: [ITK-users] Visualize Intermediate result of ITK registration in vtk In-Reply-To: References: <1451277758067-36590.post@n7.nabble.com> <1451450098542-36592.post@n7.nabble.com> <1452781038666-7588354.post@n2.nabble.com> <1453177087814-36661.post@n7.nabble.com> Message-ID: Yes It is 2D image. On Sun, Mar 6, 2016 at 6:36 PM, Bill Lorensen wrote: > Is it a 2D image? > > > On Sun, Mar 6, 2016 at 12:30 PM, suneeza hanif > wrote: > > Hello Bill, > > > > Thanks a lot for your quick response. > > > > Yes I used the PixelType short but I am still getting the same result. > > > > Regards, > > Suneeza > > > > On Sun, Mar 6, 2016 at 6:19 PM, Bill Lorensen > > wrote: > >> > >> For dicom data change > >> > >> typedef unsigned char PixelType; > >> to > >> > >> typedef short PixelType; > >> > >> > >> On Sun, Mar 6, 2016 at 12:13 PM, suneeza hanif < > suneezahanif02 at gmail.com> > >> wrote: > >> > Hello Bill, > >> > > >> > I have tried this example with images specified in the example. It > >> > worked > >> > great with them but when I used .dcm images, instead of showing > pattern > >> > in > >> > the image it just showed white image. > >> > I have attached the screenshot for reference. > >> > > >> > Can you guide me why is it not working in this case and what I need to > >> > add. > >> > > >> > Thank you. > >> > > >> > Best Regards, > >> > Suneeza > >> > > >> > _____________________________________ > >> > Powered by www.kitware.com > >> > > >> > Visit other Kitware open-source projects at > >> > http://www.kitware.com/opensource/opensource.html > >> > > >> > Kitware offers ITK Training Courses, for more information visit: > >> > http://www.kitware.com/products/protraining.php > >> > > >> > Please keep messages on-topic and check the ITK FAQ at: > >> > http://www.itk.org/Wiki/ITK_FAQ > >> > > >> > Follow this link to subscribe/unsubscribe: > >> > http://public.kitware.com/mailman/listinfo/insight-users > >> > > >> > >> > >> > >> -- > >> Unpaid intern in BillsBasement at noware dot com > > > > > > > > -- > Unpaid intern in BillsBasement at noware dot com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jose.de.paula at live.com Wed Mar 9 08:11:45 2016 From: jose.de.paula at live.com (JoseBarretoT) Date: Wed, 9 Mar 2016 06:11:45 -0700 (MST) Subject: [ITK-users] UnsharpMaskLevelSetImageFilter form .dcm Volume Message-ID: <1457529105788-7588568.post@n2.nabble.com> Hello, I'm trying to use itk :: UnsharpMaskLevelSetImageFilter for a volume type mhd (.dcm [DICOMS]). First I tried to use the type of images typedef itk :: Image ImageType, but I did not succeed, because the class had no templente for this type. created a typedef type itk :: Image ImageType2 image, but I believe that something is wrong, since the filter takes more than 1 hour processing, and from a 20mb file exceeds 2GB memories used. this is my code: void MyForm::LoadFilter() { typedef itk::Image ImageType; typedef itk::Image ImageType2; itk::GDCMImageIOFactory::RegisterOneFactory(); itk::MetaImageIOFactory::RegisterOneFactory(); typedef itk::ImageFileReader< ImageType2 > ReaderType; typedef itk::ImageToVTKImageFilter< ImageType2 > ConnectorType; typedef itk::UnsharpMaskLevelSetImageFilter Unsharp; Unsharp::Pointer unsharFilter = Unsharp::New(); ConnectorType::Pointer connectorvktitk = ConnectorType::New(); ReaderType::Pointer reader1 = ReaderType::New(); reader1->SetFileName("D:\\31panoramica.mhd"); reader1->Update(); unsharFilter->SetInput(reader1->GetOutput()); unsharFilter->SetMaxFilterIteration(99); unsharFilter->SetNormalProcessUnsharpWeight(0.4); unsharFilter->Update(); connectorvktitk->SetInput(unsharFilter->GetOutput()); connectorvktitk->Update(); imageViewer2->SetInputData(connectorvktitk->GetOutput()); vtkSmartPointer renderWindowInteractor = vtkSmartPointer::New(); imageViewer2->SetupInteractor(renderWindowInteractor); imageViewer2->SetSliceOrientationToXZ(); imageViewer2->Render(); imageViewer2->GetRenderer()->ResetCamera(); imageViewer2->Render(); } please can anyone tell me what am I doing wrong? -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/UnsharpMaskLevelSetImageFilter-form-dcm-Volume-tp7588568.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From suneezahanif02 at gmail.com Wed Mar 9 11:10:02 2016 From: suneezahanif02 at gmail.com (suneeza hanif) Date: Wed, 9 Mar 2016 17:10:02 +0100 Subject: [ITK-users] Registration with Spatial Masking Message-ID: Hello Everyone, I have problem while applying spatial masking. When I apply spatial mask I get this error. *"itk::ExceptionObject (0038D8CC)* *Location: "void __thiscall itk::ImageToImageMetricv4,class itk::Image,classitk::Image,double,class itk::DefaultImageToImageMetricTraitsv4,class itk::Image,class itk::Image,double>>::MapFixedSampledPointSetToVirtual(void)"* *File: c:\itk\src\modules\registration\metricsv4\include\itkImageToImageMetricv4.hxx* *Line: 532* *Description: itk::ERROR: MattesMutualInformationImageToImageMetricv4(060914C0):* *Fixed Sample point set is empty."* Does anyone know how to solve this? Best Regards, Suneeza -------------- next part -------------- An HTML attachment was scrubbed... URL: From dzenanz at gmail.com Wed Mar 9 12:39:09 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Wed, 9 Mar 2016 12:39:09 -0500 Subject: [ITK-users] Registration with Spatial Masking In-Reply-To: References: Message-ID: Hi Suneeza, I would say that your mask is too small, so the masked part does not contain sample points. It could be also that your initialization is not good, so there is no overlap between fixed and moving images. Regards On Wed, Mar 9, 2016 at 11:10 AM, suneeza hanif wrote: > Hello Everyone, > > I have problem while applying spatial masking. > > When I apply spatial mask I get this error. > > *"itk::ExceptionObject (0038D8CC)* > > *Location: "void __thiscall itk::ImageToImageMetricv4 itk::Image,class > itk::Image,classitk::Image,double,class > itk::DefaultImageToImageMetricTraitsv4,class > itk::Image,class > itk::Image,double>>::MapFixedSampledPointSetToVirtual(void)"* > > > *File: > c:\itk\src\modules\registration\metricsv4\include\itkImageToImageMetricv4.hxx* > > *Line: 532* > > *Description: itk::ERROR: > MattesMutualInformationImageToImageMetricv4(060914C0):* > *Fixed Sample point set is empty."* > > Does anyone know how to solve this? > > Best Regards, > Suneeza > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 suneezahanif02 at gmail.com Wed Mar 9 12:49:49 2016 From: suneezahanif02 at gmail.com (suneeza hanif) Date: Wed, 9 Mar 2016 18:49:49 +0100 Subject: [ITK-users] Registration with Spatial Masking In-Reply-To: References: Message-ID: Hello D?enan, Thank you for your response. I have tried with larger mask but I get same error. Secodly, when I use itk::ImageSpatialObject instead of itk::ImageMaskSpatialObject I do not get this error but then mask is not activated because even when I take mask of size (0,0) registration process still keeps on running. Best Regards, Suneeza On Wed, Mar 9, 2016 at 6:39 PM, D?enan Zuki? wrote: > Hi Suneeza, > > I would say that your mask is too small, so the masked part does not > contain sample points. It could be also that your initialization is not > good, so there is no overlap between fixed and moving images. > > Regards > > On Wed, Mar 9, 2016 at 11:10 AM, suneeza hanif > wrote: > >> Hello Everyone, >> >> I have problem while applying spatial masking. >> >> When I apply spatial mask I get this error. >> >> *"itk::ExceptionObject (0038D8CC)* >> >> *Location: "void __thiscall itk::ImageToImageMetricv4> itk::Image,class >> itk::Image,classitk::Image,double,class >> itk::DefaultImageToImageMetricTraitsv4,class >> itk::Image,class >> itk::Image,double>>::MapFixedSampledPointSetToVirtual(void)"* >> >> >> *File: >> c:\itk\src\modules\registration\metricsv4\include\itkImageToImageMetricv4.hxx* >> >> *Line: 532* >> >> *Description: itk::ERROR: >> MattesMutualInformationImageToImageMetricv4(060914C0):* >> *Fixed Sample point set is empty."* >> >> Does anyone know how to solve this? >> >> Best Regards, >> Suneeza >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Wed Mar 9 12:58:23 2016 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Wed, 9 Mar 2016 12:58:23 -0500 Subject: [ITK-users] Registration with Spatial Masking In-Reply-To: References: Message-ID: <41C8AC75-2CFB-4AAA-B51D-F55FF19C3469@mail.nih.gov> Hello, Does you registration work without utilizing the mask? Are you trying to use 2 or 1 mask? How did you initialize your transforms? When does this error occur? Do you have iteration callbacks? Brad > On Mar 9, 2016, at 12:49 PM, suneeza hanif wrote: > > Hello D?enan, > > Thank you for your response. > > I have tried with larger mask but I get same error. > > Secodly, when I use itk::ImageSpatialObject instead of itk::ImageMaskSpatialObject I do not get this error but then mask is not activated because even when I take mask of size (0,0) registration process still keeps on running. > > Best Regards, > Suneeza > > > On Wed, Mar 9, 2016 at 6:39 PM, D?enan Zuki? > wrote: > Hi Suneeza, > > I would say that your mask is too small, so the masked part does not contain sample points. It could be also that your initialization is not good, so there is no overlap between fixed and moving images. > > Regards > > On Wed, Mar 9, 2016 at 11:10 AM, suneeza hanif > wrote: > Hello Everyone, > > I have problem while applying spatial masking. > > When I apply spatial mask I get this error. > > "itk::ExceptionObject (0038D8CC) > <> > Location: "void __thiscall itk::ImageToImageMetricv4,class itk::Image,classitk::Image,double,class itk::DefaultImageToImageMetricTraitsv4,class itk::Image,class itk::Image,double>>::MapFixedSampledPointSetToVirtual(void)" > > > > File: c:\itk\src\modules\registration\metricsv4\include\itkImageToImageMetricv4.hxx > > Line: 532 > > Description: itk::ERROR: MattesMutualInformationImageToImageMetricv4(060914C0): > > Fixed Sample point set is empty." > > Does anyone know how to solve this? > > Best Regards, > Suneeza > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From suneezahanif02 at gmail.com Wed Mar 9 13:02:56 2016 From: suneezahanif02 at gmail.com (suneeza hanif) Date: Wed, 9 Mar 2016 19:02:56 +0100 Subject: [ITK-users] Registration with Spatial Masking In-Reply-To: <41C8AC75-2CFB-4AAA-B51D-F55FF19C3469@mail.nih.gov> References: <41C8AC75-2CFB-4AAA-B51D-F55FF19C3469@mail.nih.gov> Message-ID: Hello Brad, Yes Registration is working fine if I remove mask. Currently, I am using only one mask. I am using Centered Rigid2D Transform. Error occurs when registration->Update() is called and yes I am using iteration callbacks. Best Regards, Suneeza On Wed, Mar 9, 2016 at 6:58 PM, Bradley Lowekamp wrote: > Hello, > > Does you registration work without utilizing the mask? Are you trying to > use 2 or 1 mask? > > How did you initialize your transforms? > > When does this error occur? Do you have iteration callbacks? > > Brad > > > On Mar 9, 2016, at 12:49 PM, suneeza hanif > wrote: > > Hello D?enan, > > Thank you for your response. > > I have tried with larger mask but I get same error. > > Secodly, when I use itk::ImageSpatialObject instead of itk::ImageMaskSpatialObject > I do not get this error but then mask is not activated because even when I > take mask of size (0,0) registration process still keeps on running. > > Best Regards, > Suneeza > > > On Wed, Mar 9, 2016 at 6:39 PM, D?enan Zuki? wrote: > >> Hi Suneeza, >> >> I would say that your mask is too small, so the masked part does not >> contain sample points. It could be also that your initialization is not >> good, so there is no overlap between fixed and moving images. >> >> Regards >> >> On Wed, Mar 9, 2016 at 11:10 AM, suneeza hanif >> wrote: >> >>> Hello Everyone, >>> >>> I have problem while applying spatial masking. >>> >>> When I apply spatial mask I get this error. >>> >>> *"itk::ExceptionObject (0038D8CC)* >>> >>> *Location: "void __thiscall itk::ImageToImageMetricv4>> itk::Image,class >>> itk::Image,classitk::Image,double,class >>> itk::DefaultImageToImageMetricTraitsv4,class >>> itk::Image,class >>> itk::Image,double>>::MapFixedSampledPointSetToVirtual(void)"* >>> >>> >>> *File: >>> c:\itk\src\modules\registration\metricsv4\include\itkImageToImageMetricv4.hxx* >>> >>> *Line: 532* >>> >>> *Description: itk::ERROR: >>> MattesMutualInformationImageToImageMetricv4(060914C0):* >>> *Fixed Sample point set is empty."* >>> >>> Does anyone know how to solve this? >>> >>> Best Regards, >>> Suneeza >>> >>> _____________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://www.kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the ITK FAQ at: >>> http://www.itk.org/Wiki/ITK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/insight-users >>> >>> >> > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From artioml at post.bgu.ac.il Thu Mar 10 03:54:57 2016 From: artioml at post.bgu.ac.il (artioml) Date: Thu, 10 Mar 2016 01:54:57 -0700 (MST) Subject: [ITK-users] BSpline transformation of Vector image In-Reply-To: <1457070677221-36841.post@n7.nabble.com> References: <1456067851174-36816.post@n7.nabble.com> <1457070677221-36841.post@n7.nabble.com> Message-ID: <1457600097195-36860.post@n7.nabble.com> Hello Guys, Can you please let me know if you have never encountered such use of ITK. Maybe it is really complicated to achieve for ITK newbie as me. Because for now I had no progress and if it is very complicated and not standard thing to do in ITK I will probably give up on it. Thanks for your help! -- View this message in context: http://itk-users.7.n7.nabble.com/BSpline-transformation-of-Vector-image-tp36816p36860.html Sent from the ITK - Users mailing list archive at Nabble.com. From bakkari.abdelkhalek at hotmail.fr Thu Mar 10 09:40:09 2016 From: bakkari.abdelkhalek at hotmail.fr (Abdelkhalek Bakkari) Date: Thu, 10 Mar 2016 15:40:09 +0100 Subject: [ITK-users] Run ITK VTK and QT app Message-ID: Hi, I have developed a new application using ITK, VTK and QT. I would like to run it (.exe) using a PC without building and configuring ITK, VTK and QT.Any suggestion? Best regards, Abdelkhalek BakkariPh.D candidate in Computer ScienceInstitute of Applied Computer ScienceLodz University of Technology, Poland -------------- next part -------------- An HTML attachment was scrubbed... URL: From ljzijp at gmail.com Thu Mar 10 09:56:36 2016 From: ljzijp at gmail.com (Lambert Zijp) Date: Thu, 10 Mar 2016 15:56:36 +0100 Subject: [ITK-users] Conversion of itk::Image to other formats Message-ID: Dear itk users, I'm new to itk and also not very proficient in C++... I want to try some deformable registration methods implemented in itk, and need to convert my own format of images and volumes to itk, and back. For conversion to itk, I use 'ImportImageFilter', because I do not want to make a copy of the pixels/voxels. Converting itk images and volumes back to my own format, is giving me a headache; I'm confused about 'Image', SmartPointer and ConstPointer and template stuff. Could you get me started by suggesting me a function prototype? Something like: int ItkToMyFormat(MyFormat** ppMyFormat, itk::Image* pItkImage); The ItkImage can be any pixeltype, any dimension, and vector images should also be accepted by the conversion routine. In that conversion function, and need to be able to put a switch on pixeltype and number of dimensions. Greetings, Lambert -------------- next part -------------- An HTML attachment was scrubbed... URL: From scapegoat.sarthak at gmail.com Thu Mar 10 09:57:44 2016 From: scapegoat.sarthak at gmail.com (Scapegoat Sarthak) Date: Thu, 10 Mar 2016 09:57:44 -0500 Subject: [ITK-users] Run ITK VTK and QT app In-Reply-To: References: Message-ID: Compile it using static build for ITK, VTK and Qt and you should be able to run it on any Windows machine. On 10 March 2016 at 09:40, Abdelkhalek Bakkari < bakkari.abdelkhalek at hotmail.fr> wrote: > > Hi, > > I have developed a new application using ITK, VTK and QT. > I would like to run it (.exe) using a PC without building and configuring > ITK, VTK and QT. > Any suggestion? > > Best regards, > > Abdelkhalek Bakkari > Ph.D candidate in Computer Science > Institute of Applied Computer Science > Lodz University of Technology, Poland > > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 drescherjm at gmail.com Thu Mar 10 10:02:35 2016 From: drescherjm at gmail.com (John Drescher) Date: Thu, 10 Mar 2016 10:02:35 -0500 Subject: [ITK-users] Run ITK VTK and QT app In-Reply-To: References: Message-ID: > I have developed a new application using ITK, VTK and QT. > I would like to run it (.exe) using a PC without building and configuring > ITK, VTK and QT. > Any suggestion? > I have my application's CMakeLists.txt generate an NSIS based installer for each application I have developed. To simplify things I for the most part limit the usage of shared libraries so I have ITK and VTK compiled as static libraries. Qt is still built dynamically. I package that along with the visual studio runtime in my installer. John From matt.mccormick at kitware.com Thu Mar 10 10:28:27 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 10 Mar 2016 10:28:27 -0500 Subject: [ITK-users] Conversion of itk::Image to other formats In-Reply-To: References: Message-ID: Hi Lambert, This example shows how to read in an unknown image type. It demonstrates how to go between run-time type specification and the compile-image type specification of ITK. http://itk.org/ITKExamples/src/IO/ImageBase/ReadUnknownImageType/Documentation.html This approach could be used for your problem. HTH, Matt On Thu, Mar 10, 2016 at 9:56 AM, Lambert Zijp wrote: > Dear itk users, > I'm new to itk and also not very proficient in C++... > I want to try some deformable registration methods implemented in itk, and > need to convert my own format of images and volumes to itk, and back. > For conversion to itk, I use 'ImportImageFilter', because I do not want to > make a copy of the pixels/voxels. > Converting itk images and volumes back to my own format, is giving me a > headache; I'm confused about 'Image', SmartPointer and ConstPointer and > template stuff. > Could you get me started by suggesting me a function prototype? > > Something like: > int ItkToMyFormat(MyFormat** ppMyFormat, itk::Image* pItkImage); > > The ItkImage can be any pixeltype, any dimension, and vector images should > also be accepted by the conversion routine. In that conversion function, and > need to be able to put a switch on pixeltype and number of dimensions. > > Greetings, > Lambert > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > From scapegoat.sarthak at gmail.com Thu Mar 10 10:35:39 2016 From: scapegoat.sarthak at gmail.com (Scapegoat Sarthak) Date: Thu, 10 Mar 2016 10:35:39 -0500 Subject: [ITK-users] Conversion of itk::Image to other formats In-Reply-To: References: Message-ID: I would advice you to perform a check on the image dimensions (2 or 3) and keep the pixel type as float throughout. In any case you will be doing computation so the extra memory is going to be helpful. On 10 March 2016 at 10:28, Matt McCormick wrote: > Hi Lambert, > > This example shows how to read in an unknown image type. It > demonstrates how to go between run-time type specification and the > compile-image type specification of ITK. > > > http://itk.org/ITKExamples/src/IO/ImageBase/ReadUnknownImageType/Documentation.html > > This approach could be used for your problem. > > HTH, > Matt > > On Thu, Mar 10, 2016 at 9:56 AM, Lambert Zijp wrote: > > Dear itk users, > > I'm new to itk and also not very proficient in C++... > > I want to try some deformable registration methods implemented in itk, > and > > need to convert my own format of images and volumes to itk, and back. > > For conversion to itk, I use 'ImportImageFilter', because I do not want > to > > make a copy of the pixels/voxels. > > Converting itk images and volumes back to my own format, is giving me a > > headache; I'm confused about 'Image', SmartPointer and ConstPointer and > > template stuff. > > Could you get me started by suggesting me a function prototype? > > > > Something like: > > int ItkToMyFormat(MyFormat** ppMyFormat, itk::Image* pItkImage); > > > > The ItkImage can be any pixeltype, any dimension, and vector images > should > > also be accepted by the conversion routine. In that conversion function, > and > > need to be able to put a switch on pixeltype and number of dimensions. > > > > Greetings, > > Lambert > > > > _____________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Kitware offers ITK Training Courses, for more information visit: > > http://www.kitware.com/products/protraining.php > > > > Please keep messages on-topic and check the ITK FAQ at: > > http://www.itk.org/Wiki/ITK_FAQ > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/insight-users > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ljzijp at gmail.com Thu Mar 10 10:48:52 2016 From: ljzijp at gmail.com (Lambert Zijp) Date: Thu, 10 Mar 2016 16:48:52 +0100 Subject: [ITK-users] Conversion of itk::Image to other formats In-Reply-To: References: Message-ID: Hi Matt, Thank you for responding and for responding so quickly! I guess I did no make myself clear. I want to convert itk image* to* my own format in memory; fileformats are not involved. I have got the conversion to itk more or less working, but I need a function that accepts *any* kind of itk images, and converts it to my own datastructure. I'm asking about the function-prototype; preferably not templated, because as an old school C programmer, I prefer a switch statement on the pixeltype and number of dimensions... Greetings, Lambert On Thu, Mar 10, 2016 at 4:28 PM, Matt McCormick wrote: > Hi Lambert, > > This example shows how to read in an unknown image type. It > demonstrates how to go between run-time type specification and the > compile-image type specification of ITK. > > > http://itk.org/ITKExamples/src/IO/ImageBase/ReadUnknownImageType/Documentation.html > > This approach could be used for your problem. > > HTH, > Matt > > On Thu, Mar 10, 2016 at 9:56 AM, Lambert Zijp wrote: > > Dear itk users, > > I'm new to itk and also not very proficient in C++... > > I want to try some deformable registration methods implemented in itk, > and > > need to convert my own format of images and volumes to itk, and back. > > For conversion to itk, I use 'ImportImageFilter', because I do not want > to > > make a copy of the pixels/voxels. > > Converting itk images and volumes back to my own format, is giving me a > > headache; I'm confused about 'Image', SmartPointer and ConstPointer and > > template stuff. > > Could you get me started by suggesting me a function prototype? > > > > Something like: > > int ItkToMyFormat(MyFormat** ppMyFormat, itk::Image* pItkImage); > > > > The ItkImage can be any pixeltype, any dimension, and vector images > should > > also be accepted by the conversion routine. In that conversion function, > and > > need to be able to put a switch on pixeltype and number of dimensions. > > > > Greetings, > > Lambert > > > > _____________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Kitware offers ITK Training Courses, for more information visit: > > http://www.kitware.com/products/protraining.php > > > > Please keep messages on-topic and check the 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 ljzijp at gmail.com Thu Mar 10 10:55:25 2016 From: ljzijp at gmail.com (Lambert Zijp) Date: Thu, 10 Mar 2016 16:55:25 +0100 Subject: [ITK-users] Conversion of itk::Image to other formats In-Reply-To: References: Message-ID: Hi Scapegoat, Thank you for responding. What would the function prototype then be (of function that accepts any itk image. I mean, the syntax, preferably not templated)? Because I deal mostly with 3D or 4D signed short pixels (medical images), I keep them as they are: half the memory consumption and easier histogram computations. Greetings, Lambert On Thu, Mar 10, 2016 at 4:35 PM, Scapegoat Sarthak < scapegoat.sarthak at gmail.com> wrote: > I would advice you to perform a check on the image dimensions (2 or 3) and > keep the pixel type as float throughout. In any case you will be doing > computation so the extra memory is going to be helpful. > > > On 10 March 2016 at 10:28, Matt McCormick > wrote: > >> Hi Lambert, >> >> This example shows how to read in an unknown image type. It >> demonstrates how to go between run-time type specification and the >> compile-image type specification of ITK. >> >> >> http://itk.org/ITKExamples/src/IO/ImageBase/ReadUnknownImageType/Documentation.html >> >> This approach could be used for your problem. >> >> HTH, >> Matt >> >> On Thu, Mar 10, 2016 at 9:56 AM, Lambert Zijp wrote: >> > Dear itk users, >> > I'm new to itk and also not very proficient in C++... >> > I want to try some deformable registration methods implemented in itk, >> and >> > need to convert my own format of images and volumes to itk, and back. >> > For conversion to itk, I use 'ImportImageFilter', because I do not want >> to >> > make a copy of the pixels/voxels. >> > Converting itk images and volumes back to my own format, is giving me a >> > headache; I'm confused about 'Image', SmartPointer and ConstPointer and >> > template stuff. >> > Could you get me started by suggesting me a function prototype? >> > >> > Something like: >> > int ItkToMyFormat(MyFormat** ppMyFormat, itk::Image* pItkImage); >> > >> > The ItkImage can be any pixeltype, any dimension, and vector images >> should >> > also be accepted by the conversion routine. In that conversion >> function, and >> > need to be able to put a switch on pixeltype and number of dimensions. >> > >> > Greetings, >> > Lambert >> > >> > _____________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Kitware offers ITK Training Courses, for more information visit: >> > http://www.kitware.com/products/protraining.php >> > >> > Please keep messages on-topic and check the ITK FAQ at: >> > http://www.itk.org/Wiki/ITK_FAQ >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/insight-users >> > >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From scapegoat.sarthak at gmail.com Thu Mar 10 11:02:38 2016 From: scapegoat.sarthak at gmail.com (Scapegoat Sarthak) Date: Thu, 10 Mar 2016 11:02:38 -0500 Subject: [ITK-users] Conversion of itk::Image to other formats In-Reply-To: References: Message-ID: Hi Lambert, What you could do is to make a function what just takes in a file name as input and call the templated ITK function inside as an inline function. There is no way I know to do I/O in ITK without using templates. Best, Sarthak On 10 March 2016 at 10:55, Lambert Zijp wrote: > Hi Scapegoat, > Thank you for responding. What would the function prototype then be (of > function that accepts any itk image. I mean, the syntax, preferably not > templated)? > Because I deal mostly with 3D or 4D signed short pixels (medical images), > I keep them as they are: half the memory consumption and easier histogram > computations. > > Greetings, > Lambert > > On Thu, Mar 10, 2016 at 4:35 PM, Scapegoat Sarthak < > scapegoat.sarthak at gmail.com> wrote: > >> I would advice you to perform a check on the image dimensions (2 or 3) >> and keep the pixel type as float throughout. In any case you will be doing >> computation so the extra memory is going to be helpful. >> >> >> On 10 March 2016 at 10:28, Matt McCormick >> wrote: >> >>> Hi Lambert, >>> >>> This example shows how to read in an unknown image type. It >>> demonstrates how to go between run-time type specification and the >>> compile-image type specification of ITK. >>> >>> >>> http://itk.org/ITKExamples/src/IO/ImageBase/ReadUnknownImageType/Documentation.html >>> >>> This approach could be used for your problem. >>> >>> HTH, >>> Matt >>> >>> On Thu, Mar 10, 2016 at 9:56 AM, Lambert Zijp wrote: >>> > Dear itk users, >>> > I'm new to itk and also not very proficient in C++... >>> > I want to try some deformable registration methods implemented in itk, >>> and >>> > need to convert my own format of images and volumes to itk, and back. >>> > For conversion to itk, I use 'ImportImageFilter', because I do not >>> want to >>> > make a copy of the pixels/voxels. >>> > Converting itk images and volumes back to my own format, is giving me a >>> > headache; I'm confused about 'Image', SmartPointer and ConstPointer and >>> > template stuff. >>> > Could you get me started by suggesting me a function prototype? >>> > >>> > Something like: >>> > int ItkToMyFormat(MyFormat** ppMyFormat, itk::Image* pItkImage); >>> > >>> > The ItkImage can be any pixeltype, any dimension, and vector images >>> should >>> > also be accepted by the conversion routine. In that conversion >>> function, and >>> > need to be able to put a switch on pixeltype and number of dimensions. >>> > >>> > Greetings, >>> > Lambert >>> > >>> > _____________________________________ >>> > Powered by www.kitware.com >>> > >>> > Visit other Kitware open-source projects at >>> > http://www.kitware.com/opensource/opensource.html >>> > >>> > Kitware offers ITK Training Courses, for more information visit: >>> > http://www.kitware.com/products/protraining.php >>> > >>> > Please keep messages on-topic and check the ITK FAQ at: >>> > http://www.itk.org/Wiki/ITK_FAQ >>> > >>> > Follow this link to subscribe/unsubscribe: >>> > http://public.kitware.com/mailman/listinfo/insight-users >>> > >>> _____________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://www.kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the ITK FAQ at: >>> http://www.itk.org/Wiki/ITK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/insight-users >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Thu Mar 10 11:16:54 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 10 Mar 2016 11:16:54 -0500 Subject: [ITK-users] Run ITK VTK and QT app In-Reply-To: References: Message-ID: Hello, As mentioned, building ITK and VTK static helps. To handle the Qt dynamic libraries (and ITK and VTK dynamic libraries), the CTKAppLauncher is a useful tool: http://www.commontk.org/index.php/Tools:_Application_launcher This is used to allow your app to find its dynamic libraries when it starts up. HTH, Matt On Thu, Mar 10, 2016 at 10:02 AM, John Drescher wrote: >> I have developed a new application using ITK, VTK and QT. >> I would like to run it (.exe) using a PC without building and configuring >> ITK, VTK and QT. >> Any suggestion? >> > > I have my application's CMakeLists.txt generate an NSIS based > installer for each application I have developed. To simplify things I > for the most part limit the usage of shared libraries so I have ITK > and VTK compiled as static libraries. Qt is still built dynamically. I > package that along with the visual studio runtime in my installer. > > 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 From ljzijp at gmail.com Thu Mar 10 11:28:36 2016 From: ljzijp at gmail.com (Lambert Zijp) Date: Thu, 10 Mar 2016 17:28:36 +0100 Subject: [ITK-users] Conversion of itk::Image to other formats In-Reply-To: References: Message-ID: Hi Sarthak, There is no file I/O involved. It is about conversion in memory. In my original post, MyFormat is a struct containing things like pixeltype and number of dimensions and a couple of pointers to the pixels, the sizes of the dimensions, and the coordinates. Conversion *from* MyFormat to itk, I got more or less working. Now I want to convert from itk *to* MyFormat. A function prototype is needed... Greetings, Lambert On Thu, Mar 10, 2016 at 5:02 PM, Scapegoat Sarthak < scapegoat.sarthak at gmail.com> wrote: > Hi Lambert, > > What you could do is to make a function what just takes in a file name as > input and call the templated ITK function inside as an inline function. > There is no way I know to do I/O in ITK without using templates. > > Best, > Sarthak > > > On 10 March 2016 at 10:55, Lambert Zijp wrote: > >> Hi Scapegoat, >> Thank you for responding. What would the function prototype then be (of >> function that accepts any itk image. I mean, the syntax, preferably not >> templated)? >> Because I deal mostly with 3D or 4D signed short pixels (medical images), >> I keep them as they are: half the memory consumption and easier histogram >> computations. >> >> Greetings, >> Lambert >> >> On Thu, Mar 10, 2016 at 4:35 PM, Scapegoat Sarthak < >> scapegoat.sarthak at gmail.com> wrote: >> >>> I would advice you to perform a check on the image dimensions (2 or 3) >>> and keep the pixel type as float throughout. In any case you will be doing >>> computation so the extra memory is going to be helpful. >>> >>> >>> On 10 March 2016 at 10:28, Matt McCormick >>> wrote: >>> >>>> Hi Lambert, >>>> >>>> This example shows how to read in an unknown image type. It >>>> demonstrates how to go between run-time type specification and the >>>> compile-image type specification of ITK. >>>> >>>> >>>> http://itk.org/ITKExamples/src/IO/ImageBase/ReadUnknownImageType/Documentation.html >>>> >>>> This approach could be used for your problem. >>>> >>>> HTH, >>>> Matt >>>> >>>> On Thu, Mar 10, 2016 at 9:56 AM, Lambert Zijp wrote: >>>> > Dear itk users, >>>> > I'm new to itk and also not very proficient in C++... >>>> > I want to try some deformable registration methods implemented in >>>> itk, and >>>> > need to convert my own format of images and volumes to itk, and back. >>>> > For conversion to itk, I use 'ImportImageFilter', because I do not >>>> want to >>>> > make a copy of the pixels/voxels. >>>> > Converting itk images and volumes back to my own format, is giving me >>>> a >>>> > headache; I'm confused about 'Image', SmartPointer and ConstPointer >>>> and >>>> > template stuff. >>>> > Could you get me started by suggesting me a function prototype? >>>> > >>>> > Something like: >>>> > int ItkToMyFormat(MyFormat** ppMyFormat, itk::Image* pItkImage); >>>> > >>>> > The ItkImage can be any pixeltype, any dimension, and vector images >>>> should >>>> > also be accepted by the conversion routine. In that conversion >>>> function, and >>>> > need to be able to put a switch on pixeltype and number of dimensions. >>>> > >>>> > Greetings, >>>> > Lambert >>>> > >>>> > _____________________________________ >>>> > Powered by www.kitware.com >>>> > >>>> > Visit other Kitware open-source projects at >>>> > http://www.kitware.com/opensource/opensource.html >>>> > >>>> > Kitware offers ITK Training Courses, for more information visit: >>>> > http://www.kitware.com/products/protraining.php >>>> > >>>> > Please keep messages on-topic and check the ITK FAQ at: >>>> > http://www.itk.org/Wiki/ITK_FAQ >>>> > >>>> > Follow this link to subscribe/unsubscribe: >>>> > http://public.kitware.com/mailman/listinfo/insight-users >>>> > >>>> _____________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Kitware offers ITK Training Courses, for more information visit: >>>> http://www.kitware.com/products/protraining.php >>>> >>>> Please keep messages on-topic and check the ITK FAQ at: >>>> http://www.itk.org/Wiki/ITK_FAQ >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/insight-users >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Thu Mar 10 11:40:32 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 10 Mar 2016 11:40:32 -0500 Subject: [ITK-users] Conversion of itk::Image to other formats In-Reply-To: References: Message-ID: Hi Lambert, A function prototype without templates would be run-time to run-time type comparison and conversion. The example shows how to do run-time to compile-time comparison, and it is relevant to both in-memory and file conversion. HTH, Matt On Thu, Mar 10, 2016 at 11:28 AM, Lambert Zijp wrote: > Hi Sarthak, > There is no file I/O involved. It is about conversion in memory. In my > original post, MyFormat is a struct containing things like pixeltype and > number of dimensions and a couple of pointers to the pixels, the sizes of > the dimensions, and the coordinates. Conversion from MyFormat to itk, I got > more or less working. Now I want to convert from itk to MyFormat. A function > prototype is needed... > > Greetings, > Lambert > > On Thu, Mar 10, 2016 at 5:02 PM, Scapegoat Sarthak > wrote: >> >> Hi Lambert, >> >> What you could do is to make a function what just takes in a file name as >> input and call the templated ITK function inside as an inline function. >> There is no way I know to do I/O in ITK without using templates. >> >> Best, >> Sarthak >> >> >> On 10 March 2016 at 10:55, Lambert Zijp wrote: >>> >>> Hi Scapegoat, >>> Thank you for responding. What would the function prototype then be (of >>> function that accepts any itk image. I mean, the syntax, preferably not >>> templated)? >>> Because I deal mostly with 3D or 4D signed short pixels (medical images), >>> I keep them as they are: half the memory consumption and easier histogram >>> computations. >>> >>> Greetings, >>> Lambert >>> >>> On Thu, Mar 10, 2016 at 4:35 PM, Scapegoat Sarthak >>> wrote: >>>> >>>> I would advice you to perform a check on the image dimensions (2 or 3) >>>> and keep the pixel type as float throughout. In any case you will be doing >>>> computation so the extra memory is going to be helpful. >>>> >>>> >>>> On 10 March 2016 at 10:28, Matt McCormick >>>> wrote: >>>>> >>>>> Hi Lambert, >>>>> >>>>> This example shows how to read in an unknown image type. It >>>>> demonstrates how to go between run-time type specification and the >>>>> compile-image type specification of ITK. >>>>> >>>>> >>>>> http://itk.org/ITKExamples/src/IO/ImageBase/ReadUnknownImageType/Documentation.html >>>>> >>>>> This approach could be used for your problem. >>>>> >>>>> HTH, >>>>> Matt >>>>> >>>>> On Thu, Mar 10, 2016 at 9:56 AM, Lambert Zijp wrote: >>>>> > Dear itk users, >>>>> > I'm new to itk and also not very proficient in C++... >>>>> > I want to try some deformable registration methods implemented in >>>>> > itk, and >>>>> > need to convert my own format of images and volumes to itk, and back. >>>>> > For conversion to itk, I use 'ImportImageFilter', because I do not >>>>> > want to >>>>> > make a copy of the pixels/voxels. >>>>> > Converting itk images and volumes back to my own format, is giving me >>>>> > a >>>>> > headache; I'm confused about 'Image', SmartPointer and ConstPointer >>>>> > and >>>>> > template stuff. >>>>> > Could you get me started by suggesting me a function prototype? >>>>> > >>>>> > Something like: >>>>> > int ItkToMyFormat(MyFormat** ppMyFormat, itk::Image* pItkImage); >>>>> > >>>>> > The ItkImage can be any pixeltype, any dimension, and vector images >>>>> > should >>>>> > also be accepted by the conversion routine. In that conversion >>>>> > function, and >>>>> > need to be able to put a switch on pixeltype and number of >>>>> > dimensions. >>>>> > >>>>> > Greetings, >>>>> > Lambert >>>>> > >>>>> > _____________________________________ >>>>> > Powered by www.kitware.com >>>>> > >>>>> > Visit other Kitware open-source projects at >>>>> > http://www.kitware.com/opensource/opensource.html >>>>> > >>>>> > Kitware offers ITK Training Courses, for more information visit: >>>>> > http://www.kitware.com/products/protraining.php >>>>> > >>>>> > Please keep messages on-topic and check the ITK FAQ at: >>>>> > http://www.itk.org/Wiki/ITK_FAQ >>>>> > >>>>> > Follow this link to subscribe/unsubscribe: >>>>> > http://public.kitware.com/mailman/listinfo/insight-users >>>>> > >>>>> _____________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Kitware offers ITK Training Courses, for more information visit: >>>>> http://www.kitware.com/products/protraining.php >>>>> >>>>> Please keep messages on-topic and check the ITK FAQ at: >>>>> http://www.itk.org/Wiki/ITK_FAQ >>>>> >>>>> Follow this link to subscribe/unsubscribe: >>>>> http://public.kitware.com/mailman/listinfo/insight-users >>>> >>>> >>> >> > From lasso at queensu.ca Thu Mar 10 11:35:29 2016 From: lasso at queensu.ca (Andras Lasso) Date: Thu, 10 Mar 2016 16:35:29 +0000 Subject: [ITK-users] [ITK] Run ITK VTK and QT app In-Reply-To: References: Message-ID: On Windows you just need to copy all the required DLLs into the same directory as your executable file is. Andras -----Original Message----- From: Community [mailto:community-bounces at itk.org] On Behalf Of Matt McCormick Sent: Thursday, March 10, 2016 11:17 AM To: John Drescher Cc: insight-users Subject: Re: [ITK] [ITK-users] Run ITK VTK and QT app Hello, As mentioned, building ITK and VTK static helps. To handle the Qt dynamic libraries (and ITK and VTK dynamic libraries), the CTKAppLauncher is a useful tool: http://www.commontk.org/index.php/Tools:_Application_launcher This is used to allow your app to find its dynamic libraries when it starts up. HTH, Matt On Thu, Mar 10, 2016 at 10:02 AM, John Drescher wrote: >> I have developed a new application using ITK, VTK and QT. >> I would like to run it (.exe) using a PC without building and >> configuring ITK, VTK and QT. >> Any suggestion? >> > > I have my application's CMakeLists.txt generate an NSIS based > installer for each application I have developed. To simplify things I > for the most part limit the usage of shared libraries so I have ITK > and VTK compiled as static libraries. Qt is still built dynamically. I > package that along with the visual studio runtime in my installer. > > 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 _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 ljzijp at gmail.com Thu Mar 10 12:06:35 2016 From: ljzijp at gmail.com (Lambert Zijp) Date: Thu, 10 Mar 2016 18:06:35 +0100 Subject: [ITK-users] Conversion of itk::Image to other formats In-Reply-To: References: Message-ID: Hi Matt, Let me try it this way. I tried all the following prototypes, but none of them worked. Probably some C++ syntax problem... template extern int ItkToAvs(AVSfield** ppAvs, itk::Image pItkImage); template extern int ItkToAvs(AVSfield** ppAvs, itk::Image pItkImage); extern int ItkToAvs(AVSfield** ppAvs, itk::Image pItkImage); template< typename TImage> extern int ItkToAvs(AVSfield** ppAvs, TImage* pItkImage); template< typename TPixel, unsigned int VImageDimension> extern int ItkToAvs(AVSfield** ppAvs, const itk::Image pItkImage); template< typename TObjectType> extern int ItkToAvs(AVSfield** ppAvs, const itk::SmartPointer pItkImage); The first parameter is the output of the function. The second parameter is *any* itk image. As you can see, I don't know what I'm doing... Any idea what a good prototype would be? Greetings, Lambert On Thu, Mar 10, 2016 at 5:40 PM, Matt McCormick wrote: > Hi Lambert, > > A function prototype without templates would be run-time to run-time > type comparison and conversion. The example shows how to do run-time > to compile-time comparison, and it is relevant to both in-memory and > file conversion. > > HTH, > Matt > > On Thu, Mar 10, 2016 at 11:28 AM, Lambert Zijp wrote: > > Hi Sarthak, > > There is no file I/O involved. It is about conversion in memory. In my > > original post, MyFormat is a struct containing things like pixeltype and > > number of dimensions and a couple of pointers to the pixels, the sizes of > > the dimensions, and the coordinates. Conversion from MyFormat to itk, I > got > > more or less working. Now I want to convert from itk to MyFormat. A > function > > prototype is needed... > > > > Greetings, > > Lambert > > > > On Thu, Mar 10, 2016 at 5:02 PM, Scapegoat Sarthak > > wrote: > >> > >> Hi Lambert, > >> > >> What you could do is to make a function what just takes in a file name > as > >> input and call the templated ITK function inside as an inline function. > >> There is no way I know to do I/O in ITK without using templates. > >> > >> Best, > >> Sarthak > >> > >> > >> On 10 March 2016 at 10:55, Lambert Zijp wrote: > >>> > >>> Hi Scapegoat, > >>> Thank you for responding. What would the function prototype then be (of > >>> function that accepts any itk image. I mean, the syntax, preferably not > >>> templated)? > >>> Because I deal mostly with 3D or 4D signed short pixels (medical > images), > >>> I keep them as they are: half the memory consumption and easier > histogram > >>> computations. > >>> > >>> Greetings, > >>> Lambert > >>> > >>> On Thu, Mar 10, 2016 at 4:35 PM, Scapegoat Sarthak > >>> wrote: > >>>> > >>>> I would advice you to perform a check on the image dimensions (2 or 3) > >>>> and keep the pixel type as float throughout. In any case you will be > doing > >>>> computation so the extra memory is going to be helpful. > >>>> > >>>> > >>>> On 10 March 2016 at 10:28, Matt McCormick > > >>>> wrote: > >>>>> > >>>>> Hi Lambert, > >>>>> > >>>>> This example shows how to read in an unknown image type. It > >>>>> demonstrates how to go between run-time type specification and the > >>>>> compile-image type specification of ITK. > >>>>> > >>>>> > >>>>> > http://itk.org/ITKExamples/src/IO/ImageBase/ReadUnknownImageType/Documentation.html > >>>>> > >>>>> This approach could be used for your problem. > >>>>> > >>>>> HTH, > >>>>> Matt > >>>>> > >>>>> On Thu, Mar 10, 2016 at 9:56 AM, Lambert Zijp > wrote: > >>>>> > Dear itk users, > >>>>> > I'm new to itk and also not very proficient in C++... > >>>>> > I want to try some deformable registration methods implemented in > >>>>> > itk, and > >>>>> > need to convert my own format of images and volumes to itk, and > back. > >>>>> > For conversion to itk, I use 'ImportImageFilter', because I do not > >>>>> > want to > >>>>> > make a copy of the pixels/voxels. > >>>>> > Converting itk images and volumes back to my own format, is giving > me > >>>>> > a > >>>>> > headache; I'm confused about 'Image', SmartPointer and ConstPointer > >>>>> > and > >>>>> > template stuff. > >>>>> > Could you get me started by suggesting me a function prototype? > >>>>> > > >>>>> > Something like: > >>>>> > int ItkToMyFormat(MyFormat** ppMyFormat, itk::Image* pItkImage); > >>>>> > > >>>>> > The ItkImage can be any pixeltype, any dimension, and vector images > >>>>> > should > >>>>> > also be accepted by the conversion routine. In that conversion > >>>>> > function, and > >>>>> > need to be able to put a switch on pixeltype and number of > >>>>> > dimensions. > >>>>> > > >>>>> > Greetings, > >>>>> > Lambert > >>>>> > > >>>>> > _____________________________________ > >>>>> > Powered by www.kitware.com > >>>>> > > >>>>> > Visit other Kitware open-source projects at > >>>>> > http://www.kitware.com/opensource/opensource.html > >>>>> > > >>>>> > Kitware offers ITK Training Courses, for more information visit: > >>>>> > http://www.kitware.com/products/protraining.php > >>>>> > > >>>>> > Please keep messages on-topic and check the ITK FAQ at: > >>>>> > http://www.itk.org/Wiki/ITK_FAQ > >>>>> > > >>>>> > Follow this link to subscribe/unsubscribe: > >>>>> > http://public.kitware.com/mailman/listinfo/insight-users > >>>>> > > >>>>> _____________________________________ > >>>>> Powered by www.kitware.com > >>>>> > >>>>> Visit other Kitware open-source projects at > >>>>> http://www.kitware.com/opensource/opensource.html > >>>>> > >>>>> Kitware offers ITK Training Courses, for more information visit: > >>>>> http://www.kitware.com/products/protraining.php > >>>>> > >>>>> Please keep messages on-topic and check the ITK FAQ at: > >>>>> http://www.itk.org/Wiki/ITK_FAQ > >>>>> > >>>>> Follow this link to subscribe/unsubscribe: > >>>>> http://public.kitware.com/mailman/listinfo/insight-users > >>>> > >>>> > >>> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tevain at telecom-paristech.fr Fri Mar 11 05:35:53 2016 From: tevain at telecom-paristech.fr (Timothee Evain) Date: Fri, 11 Mar 2016 11:35:53 +0100 (CET) Subject: [ITK-users] [ITK] Conversion of itk::Image to other formats In-Reply-To: References: Message-ID: <486676809.12594224.1457692553098.JavaMail.zimbra@enst.fr> Hello Lambert, Try something like this : template extern int ItkToAvs(AVSfield** ppAvs, typename itk::Image::Pointer InputImage); This way you should be able to use the function for any itkImage type, given that you provide the ValueType and the Dimension to the function at compile time like : [...]=ItkToAvs([...]); But I cannot guarantee that this is the best way to do it, since I'm quite a beginner with templates. HTH, Tim ----- Mail original ----- De: "Lambert Zijp" ?: "Matt McCormick" Cc: insight-users at itk.org Envoy?: Jeudi 10 Mars 2016 18:06:35 Objet: Re: [ITK] [ITK-users] Conversion of itk::Image to other formats Hi Matt, Let me try it this way. I tried all the following prototypes, but none of them worked. Probably some C++ syntax problem... template extern int ItkToAvs(AVSfield** ppAvs, itk::Image pItkImage); template extern int ItkToAvs(AVSfield** ppAvs, itk::Image pItkImage); extern int ItkToAvs(AVSfield** ppAvs, itk::Image pItkImage); template< typename TImage> extern int ItkToAvs(AVSfield** ppAvs, TImage* pItkImage); template< typename TPixel, unsigned int VImageDimension> extern int ItkToAvs(AVSfield** ppAvs, const itk::Image pItkImage); template< typename TObjectType> extern int ItkToAvs(AVSfield** ppAvs, const itk::SmartPointer pItkImage); The first parameter is the output of the function. The second parameter is any itk image. As you can see, I don't know what I'm doing... Any idea what a good prototype would be? Greetings, Lambert On Thu, Mar 10, 2016 at 5:40 PM, Matt McCormick < matt.mccormick at kitware.com > wrote: Hi Lambert, A function prototype without templates would be run-time to run-time type comparison and conversion. The example shows how to do run-time to compile-time comparison, and it is relevant to both in-memory and file conversion. HTH, Matt On Thu, Mar 10, 2016 at 11:28 AM, Lambert Zijp < ljzijp at gmail.com > wrote: > Hi Sarthak, > There is no file I/O involved. It is about conversion in memory. In my > original post, MyFormat is a struct containing things like pixeltype and > number of dimensions and a couple of pointers to the pixels, the sizes of > the dimensions, and the coordinates. Conversion from MyFormat to itk, I got > more or less working. Now I want to convert from itk to MyFormat. A function > prototype is needed... > > Greetings, > Lambert > > On Thu, Mar 10, 2016 at 5:02 PM, Scapegoat Sarthak > < scapegoat.sarthak at gmail.com > wrote: >> >> Hi Lambert, >> >> What you could do is to make a function what just takes in a file name as >> input and call the templated ITK function inside as an inline function. >> There is no way I know to do I/O in ITK without using templates. >> >> Best, >> Sarthak >> >> >> On 10 March 2016 at 10:55, Lambert Zijp < ljzijp at gmail.com > wrote: >>> >>> Hi Scapegoat, >>> Thank you for responding. What would the function prototype then be (of >>> function that accepts any itk image. I mean, the syntax, preferably not >>> templated)? >>> Because I deal mostly with 3D or 4D signed short pixels (medical images), >>> I keep them as they are: half the memory consumption and easier histogram >>> computations. >>> >>> Greetings, >>> Lambert >>> >>> On Thu, Mar 10, 2016 at 4:35 PM, Scapegoat Sarthak >>> < scapegoat.sarthak at gmail.com > wrote: >>>> >>>> I would advice you to perform a check on the image dimensions (2 or 3) >>>> and keep the pixel type as float throughout. In any case you will be doing >>>> computation so the extra memory is going to be helpful. >>>> >>>> >>>> On 10 March 2016 at 10:28, Matt McCormick < matt.mccormick at kitware.com > >>>> wrote: >>>>> >>>>> Hi Lambert, >>>>> >>>>> This example shows how to read in an unknown image type. It >>>>> demonstrates how to go between run-time type specification and the >>>>> compile-image type specification of ITK. >>>>> >>>>> >>>>> http://itk.org/ITKExamples/src/IO/ImageBase/ReadUnknownImageType/Documentation.html >>>>> >>>>> This approach could be used for your problem. >>>>> >>>>> HTH, >>>>> Matt >>>>> >>>>> On Thu, Mar 10, 2016 at 9:56 AM, Lambert Zijp < ljzijp at gmail.com > wrote: >>>>> > Dear itk users, >>>>> > I'm new to itk and also not very proficient in C++... >>>>> > I want to try some deformable registration methods implemented in >>>>> > itk, and >>>>> > need to convert my own format of images and volumes to itk, and back. >>>>> > For conversion to itk, I use 'ImportImageFilter', because I do not >>>>> > want to >>>>> > make a copy of the pixels/voxels. >>>>> > Converting itk images and volumes back to my own format, is giving me >>>>> > a >>>>> > headache; I'm confused about 'Image', SmartPointer and ConstPointer >>>>> > and >>>>> > template stuff. >>>>> > Could you get me started by suggesting me a function prototype? >>>>> > >>>>> > Something like: >>>>> > int ItkToMyFormat(MyFormat** ppMyFormat, itk::Image* pItkImage); >>>>> > >>>>> > The ItkImage can be any pixeltype, any dimension, and vector images >>>>> > should >>>>> > also be accepted by the conversion routine. In that conversion >>>>> > function, and >>>>> > need to be able to put a switch on pixeltype and number of >>>>> > dimensions. >>>>> > >>>>> > Greetings, >>>>> > Lambert >>>>> > >>>>> > _____________________________________ >>>>> > Powered by www.kitware.com >>>>> > >>>>> > Visit other Kitware open-source projects at >>>>> > http://www.kitware.com/opensource/opensource.html >>>>> > >>>>> > Kitware offers ITK Training Courses, for more information visit: >>>>> > http://www.kitware.com/products/protraining.php >>>>> > >>>>> > Please keep messages on-topic and check the ITK FAQ at: >>>>> > http://www.itk.org/Wiki/ITK_FAQ >>>>> > >>>>> > Follow this link to subscribe/unsubscribe: >>>>> > http://public.kitware.com/mailman/listinfo/insight-users >>>>> > >>>>> _____________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Kitware offers ITK Training Courses, for more information visit: >>>>> http://www.kitware.com/products/protraining.php >>>>> >>>>> Please keep messages on-topic and check the ITK FAQ at: >>>>> http://www.itk.org/Wiki/ITK_FAQ >>>>> >>>>> Follow this link to subscribe/unsubscribe: >>>>> http://public.kitware.com/mailman/listinfo/insight-users >>>> >>>> >>> >> > _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users _______________________________________________ Community mailing list Community at itk.org http://public.kitware.com/mailman/listinfo/community From ljzijp at gmail.com Fri Mar 11 07:14:06 2016 From: ljzijp at gmail.com (Lambert Zijp) Date: Fri, 11 Mar 2016 13:14:06 +0100 Subject: [ITK-users] [ITK] Conversion of itk::Image to other formats In-Reply-To: <486676809.12594224.1457692553098.JavaMail.zimbra@enst.fr> References: <486676809.12594224.1457692553098.JavaMail.zimbra@enst.fr> Message-ID: Hi Timothee, Thank you for responding. That was the kind of help I hoped to get! Following code snippet compiles and links OK: *template* *int ItkToAvs(AVSfield** ppAvs, typename itk::Image::Pointer InputImage)* *{ * * return 0;* *}* *main()* *{* * typedef short sPixelType;* * typedef itk::Image sVolume;* * AVSfield *pAvs = NULL;* * sVolume::Pointer itkShortVolume;* * rc = ItkToAvs(&pAvs, itkShortVolume);* *}* However, if I put that function in another file (included in the project of course) and add 'extern' before the 'int' return type, it compiles, but the linker complains with: *error LNK2019: unresolved external symbol "int __cdecl ItkToAvs(struct AVSfield * *,class itk::SmartPointer >)* I am pretty sure that all code in that file is being linked because there are other functions in it that are used... Any idea what is going on? Also, it would be nice if the conversion function ItkToAvs could figure out what the pixeltype is and what the number of dimensions are, instead of providing them when calling the function. How can that be done? Greetings, Lambert On Fri, Mar 11, 2016 at 11:35 AM, Timothee Evain < tevain at telecom-paristech.fr> wrote: > Hello Lambert, > > Try something like this : > > template > extern int ItkToAvs(AVSfield** ppAvs, typename > itk::Image::Pointer InputImage); > > This way you should be able to use the function for any itkImage type, > given that you provide the ValueType and the Dimension to the function at > compile time like : > > [...]=ItkToAvs([...]); > > But I cannot guarantee that this is the best way to do it, since I'm quite > a beginner with templates. > > HTH, > > Tim > > ----- Mail original ----- > De: "Lambert Zijp" > ?: "Matt McCormick" > Cc: insight-users at itk.org > Envoy?: Jeudi 10 Mars 2016 18:06:35 > Objet: Re: [ITK] [ITK-users] Conversion of itk::Image to other formats > > Hi Matt, > > Let me try it this way. I tried all the following prototypes, but none of > them worked. Probably some C++ syntax problem... > > template > extern int ItkToAvs(AVSfield** ppAvs, itk::Image pItkImage); > > template > extern int ItkToAvs(AVSfield** ppAvs, itk::Image > pItkImage); > > extern int ItkToAvs(AVSfield** ppAvs, itk::Image pItkImage); > > template< typename TImage> > extern int ItkToAvs(AVSfield** ppAvs, TImage* pItkImage); > > template< typename TPixel, unsigned int VImageDimension> > extern int ItkToAvs(AVSfield** ppAvs, const itk::Image VImageDimension> pItkImage); > > template< typename TObjectType> > extern int ItkToAvs(AVSfield** ppAvs, const itk::SmartPointer > pItkImage); > > The first parameter is the output of the function. The second parameter is > any itk image. > As you can see, I don't know what I'm doing... Any idea what a good > prototype would be? > > Greetings, > Lambert > > > On Thu, Mar 10, 2016 at 5:40 PM, Matt McCormick < > matt.mccormick at kitware.com > wrote: > > > Hi Lambert, > > A function prototype without templates would be run-time to run-time > type comparison and conversion. The example shows how to do run-time > to compile-time comparison, and it is relevant to both in-memory and > file conversion. > > HTH, > Matt > > On Thu, Mar 10, 2016 at 11:28 AM, Lambert Zijp < ljzijp at gmail.com > wrote: > > Hi Sarthak, > > There is no file I/O involved. It is about conversion in memory. In my > > original post, MyFormat is a struct containing things like pixeltype and > > number of dimensions and a couple of pointers to the pixels, the sizes of > > the dimensions, and the coordinates. Conversion from MyFormat to itk, I > got > > more or less working. Now I want to convert from itk to MyFormat. A > function > > prototype is needed... > > > > Greetings, > > Lambert > > > > On Thu, Mar 10, 2016 at 5:02 PM, Scapegoat Sarthak > > < scapegoat.sarthak at gmail.com > wrote: > >> > >> Hi Lambert, > >> > >> What you could do is to make a function what just takes in a file name > as > >> input and call the templated ITK function inside as an inline function. > >> There is no way I know to do I/O in ITK without using templates. > >> > >> Best, > >> Sarthak > >> > >> > >> On 10 March 2016 at 10:55, Lambert Zijp < ljzijp at gmail.com > wrote: > >>> > >>> Hi Scapegoat, > >>> Thank you for responding. What would the function prototype then be (of > >>> function that accepts any itk image. I mean, the syntax, preferably not > >>> templated)? > >>> Because I deal mostly with 3D or 4D signed short pixels (medical > images), > >>> I keep them as they are: half the memory consumption and easier > histogram > >>> computations. > >>> > >>> Greetings, > >>> Lambert > >>> > >>> On Thu, Mar 10, 2016 at 4:35 PM, Scapegoat Sarthak > >>> < scapegoat.sarthak at gmail.com > wrote: > >>>> > >>>> I would advice you to perform a check on the image dimensions (2 or 3) > >>>> and keep the pixel type as float throughout. In any case you will be > doing > >>>> computation so the extra memory is going to be helpful. > >>>> > >>>> > >>>> On 10 March 2016 at 10:28, Matt McCormick < > matt.mccormick at kitware.com > > >>>> wrote: > >>>>> > >>>>> Hi Lambert, > >>>>> > >>>>> This example shows how to read in an unknown image type. It > >>>>> demonstrates how to go between run-time type specification and the > >>>>> compile-image type specification of ITK. > >>>>> > >>>>> > >>>>> > http://itk.org/ITKExamples/src/IO/ImageBase/ReadUnknownImageType/Documentation.html > >>>>> > >>>>> This approach could be used for your problem. > >>>>> > >>>>> HTH, > >>>>> Matt > >>>>> > >>>>> On Thu, Mar 10, 2016 at 9:56 AM, Lambert Zijp < ljzijp at gmail.com > > wrote: > >>>>> > Dear itk users, > >>>>> > I'm new to itk and also not very proficient in C++... > >>>>> > I want to try some deformable registration methods implemented in > >>>>> > itk, and > >>>>> > need to convert my own format of images and volumes to itk, and > back. > >>>>> > For conversion to itk, I use 'ImportImageFilter', because I do not > >>>>> > want to > >>>>> > make a copy of the pixels/voxels. > >>>>> > Converting itk images and volumes back to my own format, is giving > me > >>>>> > a > >>>>> > headache; I'm confused about 'Image', SmartPointer and ConstPointer > >>>>> > and > >>>>> > template stuff. > >>>>> > Could you get me started by suggesting me a function prototype? > >>>>> > > >>>>> > Something like: > >>>>> > int ItkToMyFormat(MyFormat** ppMyFormat, itk::Image* pItkImage); > >>>>> > > >>>>> > The ItkImage can be any pixeltype, any dimension, and vector images > >>>>> > should > >>>>> > also be accepted by the conversion routine. In that conversion > >>>>> > function, and > >>>>> > need to be able to put a switch on pixeltype and number of > >>>>> > dimensions. > >>>>> > > >>>>> > Greetings, > >>>>> > Lambert > >>>>> > > >>>>> > _____________________________________ > >>>>> > Powered by www.kitware.com > >>>>> > > >>>>> > Visit other Kitware open-source projects at > >>>>> > http://www.kitware.com/opensource/opensource.html > >>>>> > > >>>>> > Kitware offers ITK Training Courses, for more information visit: > >>>>> > http://www.kitware.com/products/protraining.php > >>>>> > > >>>>> > Please keep messages on-topic and check the ITK FAQ at: > >>>>> > http://www.itk.org/Wiki/ITK_FAQ > >>>>> > > >>>>> > Follow this link to subscribe/unsubscribe: > >>>>> > http://public.kitware.com/mailman/listinfo/insight-users > >>>>> > > >>>>> _____________________________________ > >>>>> Powered by www.kitware.com > >>>>> > >>>>> Visit other Kitware open-source projects at > >>>>> http://www.kitware.com/opensource/opensource.html > >>>>> > >>>>> Kitware offers ITK Training Courses, for more information visit: > >>>>> http://www.kitware.com/products/protraining.php > >>>>> > >>>>> Please keep messages on-topic and check the ITK FAQ at: > >>>>> http://www.itk.org/Wiki/ITK_FAQ > >>>>> > >>>>> Follow this link to subscribe/unsubscribe: > >>>>> http://public.kitware.com/mailman/listinfo/insight-users > >>>> > >>>> > >>> > >> > > > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tevain at telecom-paristech.fr Fri Mar 11 08:38:29 2016 From: tevain at telecom-paristech.fr (Timothee Evain) Date: Fri, 11 Mar 2016 14:38:29 +0100 (CET) Subject: [ITK-users] [ITK] Conversion of itk::Image to other formats In-Reply-To: References: <486676809.12594224.1457692553098.JavaMail.zimbra@enst.fr> Message-ID: <731489938.12765518.1457703509090.JavaMail.zimbra@enst.fr> It seems to me that using extern with functions is redundant in C/C++ since the compiler already treat functions as extern. So no need to put extern. Regarding the link error, I don't know, just ensure the part of the code where you use the function have access to the function (is it included ?). Also if you have split the declaration and the definition, remember that template need to see definition to do instanciation so you have to include the source in the header, or both in your main code. About the function figuring out the parameter, I'm not sure it's possible for the compiler to do template argument deduction from a templated template parameter. Someone with more knowledge about it should be able to help you more than I can. HTH, Tim ----- Mail original ----- De: "Lambert Zijp" ?: "Timothee Evain" Cc: "Matt McCormick" , insight-users at itk.org Envoy?: Vendredi 11 Mars 2016 13:14:06 Objet: Re: [ITK] [ITK-users] Conversion of itk::Image to other formats Hi Timothee, Thank you for responding. That was the kind of help I hoped to get! Following code snippet compiles and links OK: *template* *int ItkToAvs(AVSfield** ppAvs, typename itk::Image::Pointer InputImage)* *{ * * return 0;* *}* *main()* *{* * typedef short sPixelType;* * typedef itk::Image sVolume;* * AVSfield *pAvs = NULL;* * sVolume::Pointer itkShortVolume;* * rc = ItkToAvs(&pAvs, itkShortVolume);* *}* However, if I put that function in another file (included in the project of course) and add 'extern' before the 'int' return type, it compiles, but the linker complains with: *error LNK2019: unresolved external symbol "int __cdecl ItkToAvs(struct AVSfield * *,class itk::SmartPointer >)* I am pretty sure that all code in that file is being linked because there are other functions in it that are used... Any idea what is going on? Also, it would be nice if the conversion function ItkToAvs could figure out what the pixeltype is and what the number of dimensions are, instead of providing them when calling the function. How can that be done? Greetings, Lambert On Fri, Mar 11, 2016 at 11:35 AM, Timothee Evain < tevain at telecom-paristech.fr> wrote: > Hello Lambert, > > Try something like this : > > template > extern int ItkToAvs(AVSfield** ppAvs, typename > itk::Image::Pointer InputImage); > > This way you should be able to use the function for any itkImage type, > given that you provide the ValueType and the Dimension to the function at > compile time like : > > [...]=ItkToAvs([...]); > > But I cannot guarantee that this is the best way to do it, since I'm quite > a beginner with templates. > > HTH, > > Tim > > ----- Mail original ----- > De: "Lambert Zijp" > ?: "Matt McCormick" > Cc: insight-users at itk.org > Envoy?: Jeudi 10 Mars 2016 18:06:35 > Objet: Re: [ITK] [ITK-users] Conversion of itk::Image to other formats > > Hi Matt, > > Let me try it this way. I tried all the following prototypes, but none of > them worked. Probably some C++ syntax problem... > > template > extern int ItkToAvs(AVSfield** ppAvs, itk::Image pItkImage); > > template > extern int ItkToAvs(AVSfield** ppAvs, itk::Image > pItkImage); > > extern int ItkToAvs(AVSfield** ppAvs, itk::Image pItkImage); > > template< typename TImage> > extern int ItkToAvs(AVSfield** ppAvs, TImage* pItkImage); > > template< typename TPixel, unsigned int VImageDimension> > extern int ItkToAvs(AVSfield** ppAvs, const itk::Image VImageDimension> pItkImage); > > template< typename TObjectType> > extern int ItkToAvs(AVSfield** ppAvs, const itk::SmartPointer > pItkImage); > > The first parameter is the output of the function. The second parameter is > any itk image. > As you can see, I don't know what I'm doing... Any idea what a good > prototype would be? > > Greetings, > Lambert > > > On Thu, Mar 10, 2016 at 5:40 PM, Matt McCormick < > matt.mccormick at kitware.com > wrote: > > > Hi Lambert, > > A function prototype without templates would be run-time to run-time > type comparison and conversion. The example shows how to do run-time > to compile-time comparison, and it is relevant to both in-memory and > file conversion. > > HTH, > Matt > > On Thu, Mar 10, 2016 at 11:28 AM, Lambert Zijp < ljzijp at gmail.com > wrote: > > Hi Sarthak, > > There is no file I/O involved. It is about conversion in memory. In my > > original post, MyFormat is a struct containing things like pixeltype and > > number of dimensions and a couple of pointers to the pixels, the sizes of > > the dimensions, and the coordinates. Conversion from MyFormat to itk, I > got > > more or less working. Now I want to convert from itk to MyFormat. A > function > > prototype is needed... > > > > Greetings, > > Lambert > > > > On Thu, Mar 10, 2016 at 5:02 PM, Scapegoat Sarthak > > < scapegoat.sarthak at gmail.com > wrote: > >> > >> Hi Lambert, > >> > >> What you could do is to make a function what just takes in a file name > as > >> input and call the templated ITK function inside as an inline function. > >> There is no way I know to do I/O in ITK without using templates. > >> > >> Best, > >> Sarthak > >> > >> > >> On 10 March 2016 at 10:55, Lambert Zijp < ljzijp at gmail.com > wrote: > >>> > >>> Hi Scapegoat, > >>> Thank you for responding. What would the function prototype then be (of > >>> function that accepts any itk image. I mean, the syntax, preferably not > >>> templated)? > >>> Because I deal mostly with 3D or 4D signed short pixels (medical > images), > >>> I keep them as they are: half the memory consumption and easier > histogram > >>> computations. > >>> > >>> Greetings, > >>> Lambert > >>> > >>> On Thu, Mar 10, 2016 at 4:35 PM, Scapegoat Sarthak > >>> < scapegoat.sarthak at gmail.com > wrote: > >>>> > >>>> I would advice you to perform a check on the image dimensions (2 or 3) > >>>> and keep the pixel type as float throughout. In any case you will be > doing > >>>> computation so the extra memory is going to be helpful. > >>>> > >>>> > >>>> On 10 March 2016 at 10:28, Matt McCormick < > matt.mccormick at kitware.com > > >>>> wrote: > >>>>> > >>>>> Hi Lambert, > >>>>> > >>>>> This example shows how to read in an unknown image type. It > >>>>> demonstrates how to go between run-time type specification and the > >>>>> compile-image type specification of ITK. > >>>>> > >>>>> > >>>>> > http://itk.org/ITKExamples/src/IO/ImageBase/ReadUnknownImageType/Documentation.html > >>>>> > >>>>> This approach could be used for your problem. > >>>>> > >>>>> HTH, > >>>>> Matt > >>>>> > >>>>> On Thu, Mar 10, 2016 at 9:56 AM, Lambert Zijp < ljzijp at gmail.com > > wrote: > >>>>> > Dear itk users, > >>>>> > I'm new to itk and also not very proficient in C++... > >>>>> > I want to try some deformable registration methods implemented in > >>>>> > itk, and > >>>>> > need to convert my own format of images and volumes to itk, and > back. > >>>>> > For conversion to itk, I use 'ImportImageFilter', because I do not > >>>>> > want to > >>>>> > make a copy of the pixels/voxels. > >>>>> > Converting itk images and volumes back to my own format, is giving > me > >>>>> > a > >>>>> > headache; I'm confused about 'Image', SmartPointer and ConstPointer > >>>>> > and > >>>>> > template stuff. > >>>>> > Could you get me started by suggesting me a function prototype? > >>>>> > > >>>>> > Something like: > >>>>> > int ItkToMyFormat(MyFormat** ppMyFormat, itk::Image* pItkImage); > >>>>> > > >>>>> > The ItkImage can be any pixeltype, any dimension, and vector images > >>>>> > should > >>>>> > also be accepted by the conversion routine. In that conversion > >>>>> > function, and > >>>>> > need to be able to put a switch on pixeltype and number of > >>>>> > dimensions. > >>>>> > > >>>>> > Greetings, > >>>>> > Lambert > >>>>> > > >>>>> > _____________________________________ > >>>>> > Powered by www.kitware.com > >>>>> > > >>>>> > Visit other Kitware open-source projects at > >>>>> > http://www.kitware.com/opensource/opensource.html > >>>>> > > >>>>> > Kitware offers ITK Training Courses, for more information visit: > >>>>> > http://www.kitware.com/products/protraining.php > >>>>> > > >>>>> > Please keep messages on-topic and check the ITK FAQ at: > >>>>> > http://www.itk.org/Wiki/ITK_FAQ > >>>>> > > >>>>> > Follow this link to subscribe/unsubscribe: > >>>>> > http://public.kitware.com/mailman/listinfo/insight-users > >>>>> > > >>>>> _____________________________________ > >>>>> Powered by www.kitware.com > >>>>> > >>>>> Visit other Kitware open-source projects at > >>>>> http://www.kitware.com/opensource/opensource.html > >>>>> > >>>>> Kitware offers ITK Training Courses, for more information visit: > >>>>> http://www.kitware.com/products/protraining.php > >>>>> > >>>>> Please keep messages on-topic and check the ITK FAQ at: > >>>>> http://www.itk.org/Wiki/ITK_FAQ > >>>>> > >>>>> Follow this link to subscribe/unsubscribe: > >>>>> http://public.kitware.com/mailman/listinfo/insight-users > >>>> > >>>> > >>> > >> > > > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > From ljzijp at gmail.com Fri Mar 11 09:42:21 2016 From: ljzijp at gmail.com (Lambert Zijp) Date: Fri, 11 Mar 2016 15:42:21 +0100 Subject: [ITK-users] [ITK] Conversion of itk::Image to other formats In-Reply-To: <731489938.12765518.1457703509090.JavaMail.zimbra@enst.fr> References: <486676809.12594224.1457692553098.JavaMail.zimbra@enst.fr> <731489938.12765518.1457703509090.JavaMail.zimbra@enst.fr> Message-ID: Including the source of ItkToAvs in the header solved the problem, thank you!! I tried to fool the compiler by calling the conversion function with 1 instead of 3: rc = ItkToAvs(&pAvs, itkShortVolume); The compiler however was not fooled: *error C2664: 'ItkToAvs' : cannot convert parameter 2 from 'itk::SmartPointer' to 'itk::SmartPointer'* * with* * [* * TObjectType=itk::Image* * ]* * and* * [* * TObjectType=itk::Image* * ]* * No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called* So the compiler *knows* what kind of image TObjectType is. Why does it insist that you specify those parameters when it already knows them? On Fri, Mar 11, 2016 at 2:38 PM, Timothee Evain wrote: > It seems to me that using extern with functions is redundant in C/C++ > since the compiler already treat functions as extern. > So no need to put extern. > Regarding the link error, I don't know, just ensure the part of the code > where you use the function have access to the function (is it included ?). > Also if you have split the declaration and the definition, remember that > template need to see definition to do instanciation so you have to include > the source in the header, or both in your main code. > > About the function figuring out the parameter, I'm not sure it's possible > for the compiler to do template argument deduction from a templated > template parameter. > Someone with more knowledge about it should be able to help you more than > I can. > > HTH, > > Tim > > > > > > ----- Mail original ----- > De: "Lambert Zijp" > ?: "Timothee Evain" > Cc: "Matt McCormick" , insight-users at itk.org > Envoy?: Vendredi 11 Mars 2016 13:14:06 > Objet: Re: [ITK] [ITK-users] Conversion of itk::Image to other formats > > Hi Timothee, > > Thank you for responding. That was the kind of help I hoped to get! > > Following code snippet compiles and links OK: > > *template* > *int ItkToAvs(AVSfield** ppAvs, typename > itk::Image::Pointer InputImage)* > *{ * > * return 0;* > *}* > > *main()* > *{* > * typedef short sPixelType;* > * typedef itk::Image sVolume;* > > * AVSfield *pAvs = NULL;* > * sVolume::Pointer itkShortVolume;* > > > > * rc = ItkToAvs(&pAvs, itkShortVolume);* > *}* > > However, if I put that function in another file (included in the project of > course) and add 'extern' before the 'int' return type, it compiles, but the > linker complains with: > *error LNK2019: unresolved external symbol "int __cdecl > ItkToAvs(struct AVSfield * *,class itk::SmartPointer itk::Image >)* > I am pretty sure that all code in that file is being linked because there > are other functions in it that are used... > Any idea what is going on? > > Also, it would be nice if the conversion function ItkToAvs could figure out > what the pixeltype is and what the number of dimensions are, instead of > providing them when calling the function. How can that be done? > > Greetings, > Lambert > > > > > > On Fri, Mar 11, 2016 at 11:35 AM, Timothee Evain < > tevain at telecom-paristech.fr> wrote: > > > Hello Lambert, > > > > Try something like this : > > > > template > > extern int ItkToAvs(AVSfield** ppAvs, typename > > itk::Image::Pointer InputImage); > > > > This way you should be able to use the function for any itkImage type, > > given that you provide the ValueType and the Dimension to the function at > > compile time like : > > > > [...]=ItkToAvs([...]); > > > > But I cannot guarantee that this is the best way to do it, since I'm > quite > > a beginner with templates. > > > > HTH, > > > > Tim > > > > ----- Mail original ----- > > De: "Lambert Zijp" > > ?: "Matt McCormick" > > Cc: insight-users at itk.org > > Envoy?: Jeudi 10 Mars 2016 18:06:35 > > Objet: Re: [ITK] [ITK-users] Conversion of itk::Image to other formats > > > > Hi Matt, > > > > Let me try it this way. I tried all the following prototypes, but none of > > them worked. Probably some C++ syntax problem... > > > > template > > extern int ItkToAvs(AVSfield** ppAvs, itk::Image pItkImage); > > > > template > > extern int ItkToAvs(AVSfield** ppAvs, itk::Image > > pItkImage); > > > > extern int ItkToAvs(AVSfield** ppAvs, itk::Image > pItkImage); > > > > template< typename TImage> > > extern int ItkToAvs(AVSfield** ppAvs, TImage* pItkImage); > > > > template< typename TPixel, unsigned int VImageDimension> > > extern int ItkToAvs(AVSfield** ppAvs, const itk::Image > VImageDimension> pItkImage); > > > > template< typename TObjectType> > > extern int ItkToAvs(AVSfield** ppAvs, const > itk::SmartPointer > > pItkImage); > > > > The first parameter is the output of the function. The second parameter > is > > any itk image. > > As you can see, I don't know what I'm doing... Any idea what a good > > prototype would be? > > > > Greetings, > > Lambert > > > > > > On Thu, Mar 10, 2016 at 5:40 PM, Matt McCormick < > > matt.mccormick at kitware.com > wrote: > > > > > > Hi Lambert, > > > > A function prototype without templates would be run-time to run-time > > type comparison and conversion. The example shows how to do run-time > > to compile-time comparison, and it is relevant to both in-memory and > > file conversion. > > > > HTH, > > Matt > > > > On Thu, Mar 10, 2016 at 11:28 AM, Lambert Zijp < ljzijp at gmail.com > > wrote: > > > Hi Sarthak, > > > There is no file I/O involved. It is about conversion in memory. In my > > > original post, MyFormat is a struct containing things like pixeltype > and > > > number of dimensions and a couple of pointers to the pixels, the sizes > of > > > the dimensions, and the coordinates. Conversion from MyFormat to itk, I > > got > > > more or less working. Now I want to convert from itk to MyFormat. A > > function > > > prototype is needed... > > > > > > Greetings, > > > Lambert > > > > > > On Thu, Mar 10, 2016 at 5:02 PM, Scapegoat Sarthak > > > < scapegoat.sarthak at gmail.com > wrote: > > >> > > >> Hi Lambert, > > >> > > >> What you could do is to make a function what just takes in a file name > > as > > >> input and call the templated ITK function inside as an inline > function. > > >> There is no way I know to do I/O in ITK without using templates. > > >> > > >> Best, > > >> Sarthak > > >> > > >> > > >> On 10 March 2016 at 10:55, Lambert Zijp < ljzijp at gmail.com > wrote: > > >>> > > >>> Hi Scapegoat, > > >>> Thank you for responding. What would the function prototype then be > (of > > >>> function that accepts any itk image. I mean, the syntax, preferably > not > > >>> templated)? > > >>> Because I deal mostly with 3D or 4D signed short pixels (medical > > images), > > >>> I keep them as they are: half the memory consumption and easier > > histogram > > >>> computations. > > >>> > > >>> Greetings, > > >>> Lambert > > >>> > > >>> On Thu, Mar 10, 2016 at 4:35 PM, Scapegoat Sarthak > > >>> < scapegoat.sarthak at gmail.com > wrote: > > >>>> > > >>>> I would advice you to perform a check on the image dimensions (2 or > 3) > > >>>> and keep the pixel type as float throughout. In any case you will be > > doing > > >>>> computation so the extra memory is going to be helpful. > > >>>> > > >>>> > > >>>> On 10 March 2016 at 10:28, Matt McCormick < > > matt.mccormick at kitware.com > > > >>>> wrote: > > >>>>> > > >>>>> Hi Lambert, > > >>>>> > > >>>>> This example shows how to read in an unknown image type. It > > >>>>> demonstrates how to go between run-time type specification and the > > >>>>> compile-image type specification of ITK. > > >>>>> > > >>>>> > > >>>>> > > > http://itk.org/ITKExamples/src/IO/ImageBase/ReadUnknownImageType/Documentation.html > > >>>>> > > >>>>> This approach could be used for your problem. > > >>>>> > > >>>>> HTH, > > >>>>> Matt > > >>>>> > > >>>>> On Thu, Mar 10, 2016 at 9:56 AM, Lambert Zijp < ljzijp at gmail.com > > > wrote: > > >>>>> > Dear itk users, > > >>>>> > I'm new to itk and also not very proficient in C++... > > >>>>> > I want to try some deformable registration methods implemented in > > >>>>> > itk, and > > >>>>> > need to convert my own format of images and volumes to itk, and > > back. > > >>>>> > For conversion to itk, I use 'ImportImageFilter', because I do > not > > >>>>> > want to > > >>>>> > make a copy of the pixels/voxels. > > >>>>> > Converting itk images and volumes back to my own format, is > giving > > me > > >>>>> > a > > >>>>> > headache; I'm confused about 'Image', SmartPointer and > ConstPointer > > >>>>> > and > > >>>>> > template stuff. > > >>>>> > Could you get me started by suggesting me a function prototype? > > >>>>> > > > >>>>> > Something like: > > >>>>> > int ItkToMyFormat(MyFormat** ppMyFormat, itk::Image* pItkImage); > > >>>>> > > > >>>>> > The ItkImage can be any pixeltype, any dimension, and vector > images > > >>>>> > should > > >>>>> > also be accepted by the conversion routine. In that conversion > > >>>>> > function, and > > >>>>> > need to be able to put a switch on pixeltype and number of > > >>>>> > dimensions. > > >>>>> > > > >>>>> > Greetings, > > >>>>> > Lambert > > >>>>> > > > >>>>> > _____________________________________ > > >>>>> > Powered by www.kitware.com > > >>>>> > > > >>>>> > Visit other Kitware open-source projects at > > >>>>> > http://www.kitware.com/opensource/opensource.html > > >>>>> > > > >>>>> > Kitware offers ITK Training Courses, for more information visit: > > >>>>> > http://www.kitware.com/products/protraining.php > > >>>>> > > > >>>>> > Please keep messages on-topic and check the ITK FAQ at: > > >>>>> > http://www.itk.org/Wiki/ITK_FAQ > > >>>>> > > > >>>>> > Follow this link to subscribe/unsubscribe: > > >>>>> > http://public.kitware.com/mailman/listinfo/insight-users > > >>>>> > > > >>>>> _____________________________________ > > >>>>> Powered by www.kitware.com > > >>>>> > > >>>>> Visit other Kitware open-source projects at > > >>>>> http://www.kitware.com/opensource/opensource.html > > >>>>> > > >>>>> Kitware offers ITK Training Courses, for more information visit: > > >>>>> http://www.kitware.com/products/protraining.php > > >>>>> > > >>>>> Please keep messages on-topic and check the ITK FAQ at: > > >>>>> http://www.itk.org/Wiki/ITK_FAQ > > >>>>> > > >>>>> Follow this link to subscribe/unsubscribe: > > >>>>> http://public.kitware.com/mailman/listinfo/insight-users > > >>>> > > >>>> > > >>> > > >> > > > > > > > > > _____________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Kitware offers ITK Training Courses, for more information visit: > > http://www.kitware.com/products/protraining.php > > > > Please keep messages on-topic and check the ITK FAQ at: > > http://www.itk.org/Wiki/ITK_FAQ > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/insight-users > > > > _______________________________________________ > > Community mailing list > > Community at itk.org > > http://public.kitware.com/mailman/listinfo/community > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From otb.salbert at gmail.com Mon Mar 14 10:40:49 2016 From: otb.salbert at gmail.com (=?UTF-8?Q?St=C3=A9phane_ALBERT?=) Date: Mon, 14 Mar 2016 15:40:49 +0100 Subject: [ITK-users] Fwd: Watching ProcessObject::UpdateProgress() In-Reply-To: References: Message-ID: Hello, How can I watch progress events from a class deriving from ProcessObject which calls ::UpdateProgress() when called back by some internal processing to display a progress bar ? The Doxygen document mentions ProgressEvent and Observers but I've not found code samples or way to do it in the documentation. Regards, http://orfeo-toolbox.org St?phane ALBERT Ing?nieur d'?tudes et d?veloppement Business Unit E-SPACE & Geo Information, D?partement APPLICATIONS CS Syst?mes d'Information Parc de la Grande Plaine - 5, Rue Brindejonc des Moulinais - BP 15872 31506 Toulouse Cedex 05 - France -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhuangming.shen at sphic.org.cn Mon Mar 14 23:00:43 2016 From: zhuangming.shen at sphic.org.cn (=?utf-8?B?5rKI5bqE5piO?=) Date: Tue, 15 Mar 2016 03:00:43 +0000 Subject: [ITK-users] Strange coordinates output by itk::ContourExtractor2DImageFilter Message-ID: <1458010841302.45020@sphic.org.cn> Hi all, I used itk::ContourExtractor2DImageFilter to extract contours from a binary image (i.e. only 0 or 255 for pixel intensity). Mostly, the code can work correctly. However, the code sometimes outputs very strange coordinates (e.g. (194.0, 5.36011819173e-320) ), which should represent the path of the contour. When I change the contour value from 0 to other number no less than 255 (i.e. 250), I got more strange coordinates. My code and results are listed as below. Has anyone met the same situation?? Regards, Zhuangming Shen Here is my code ======================================================================================= import itk reader = itk.ImageFileReader[itk.Image.UC2].New() reader.SetFileName("test.nii") reader.Update() contour_extractor = itk.ContourExtractor2DImageFilter[itk.Image.UC2].New() contour_extractor.SetInput(reader.GetOutput()) contour_extractor.SetContourValue(0) contour_extractor.Update() contour_number = contour_extractor.GetNumberOfOutputs() print("There are "+str(contour_number)+" contours") for k in xrange(contour_number): print("================ Contour "+str(k)+" ================") point_number = contour_extractor.GetOutput(k).GetVertexList().Size() print("Point number: "+str(point_number)) for i in xrange(point_number): print("("+str(contour_extractor.GetOutput(k).GetVertexList().GetElement(i)[0])+","+str(contour_extractor.GetOutput(0).GetVertexList().GetElement(i)[1])+")") Here is my results ========================================================================================= There are 2 contours ================ Contour 0 ================ Point number: 670 (373.0,380.0) (372.0,380.0) (371.0,380.0) (370.0,380.0) (369.0,380.0) (368.0,380.0) (367.0,380.0) ... (375.0,379.0) (374.0,379.0) (373.0,380.0) ================ Contour 1 ================ Point number: 677 (188.0,380.0) (187.0,380.0) (186.0,380.0) (185.0,380.0) ... (198.0,379.0) (197.0,379.0) (196.0,379.0) (195.0,380.0) (194.0,5.36011819173e-320) (193.0,382.0) (192.0,382.0) (191.0,382.0) (190.0,382.0) (189.0,382.0) (188.0,382.0) Here is the input test.nii ============================================================================================= [cid:beaa107f-9827-40b6-aac6-cdb30092e744]? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pastedImage.png Type: image/png Size: 8798 bytes Desc: pastedImage.png URL: From ljzijp at gmail.com Tue Mar 15 05:48:34 2016 From: ljzijp at gmail.com (Lambert Zijp) Date: Tue, 15 Mar 2016 10:48:34 +0100 Subject: [ITK-users] How to determine PixelType of itk::Image Message-ID: I want to write a function that converts an arbitrary ITK image to another format (AVS in my case). It has been suggested that following functionprototype could de the job: template int ItkToAvs(AVSfield** ppAvs, typename itk::Image::Pointer pItkImage); Now I want to know whether ValueType equals unsigned char or short or int etc. Also whether the pixels are single numbers or vectors. How does one do that? Greetings, Lambert -------------- next part -------------- An HTML attachment was scrubbed... URL: From dzenanz at gmail.com Tue Mar 15 09:31:29 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Tue, 15 Mar 2016 09:31:29 -0400 Subject: [ITK-users] Fwd: Watching ProcessObject::UpdateProgress() In-Reply-To: References: Message-ID: Hi St?phane, some of the earlier examples in this tutorial deal with progress observation and reporting. Regards, D?enan On Mon, Mar 14, 2016 at 10:40 AM, St?phane ALBERT wrote: > Hello, > > How can I watch progress events from a class deriving from ProcessObject > which calls ::UpdateProgress() when called back by some internal processing > to display a progress bar ? > > The Doxygen document mentions ProgressEvent and Observers but I've not > found code samples or way to do it in the documentation. > > Regards, > > http://orfeo-toolbox.org > > St?phane ALBERT > Ing?nieur d'?tudes et d?veloppement > Business Unit E-SPACE & Geo Information, D?partement APPLICATIONS > > CS Syst?mes d'Information > Parc de la Grande Plaine - 5, Rue Brindejonc des Moulinais - BP 15872 > 31506 Toulouse Cedex 05 - France > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 dzenanz at gmail.com Tue Mar 15 09:47:56 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Tue, 15 Mar 2016 09:47:56 -0400 Subject: [ITK-users] How to determine PixelType of itk::Image In-Reply-To: References: Message-ID: Hi Lambert, the classic way is using a bunch of if-else's. if (decltype(ValueType)==decltype(int)) { //int specific processing } else if (decltype(ValueType)==decltype(itk::RGB)) { //RGB specific processing } ?else if ...? ?If you can't use C++11's decltype then use typeid from ? header. Regards, D?enan On Tue, Mar 15, 2016 at 5:48 AM, Lambert Zijp wrote: > I want to write a function that converts an arbitrary ITK image to another > format (AVS in my case). > It has been suggested that following functionprototype could de the job: > template > int ItkToAvs(AVSfield** ppAvs, typename > itk::Image::Pointer pItkImage); > > Now I want to know whether ValueType equals unsigned char or short or int > etc. Also whether the pixels are single numbers or vectors. How does one do > that? > > Greetings, > Lambert > > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 ljzijp at gmail.com Tue Mar 15 11:39:55 2016 From: ljzijp at gmail.com (Lambert Zijp) Date: Tue, 15 Mar 2016 16:39:55 +0100 Subject: [ITK-users] How to determine PixelType of itk::Image In-Reply-To: References: Message-ID: Hi D?enan, Thank you very much! Visual Studio 9 does not recognize decltype(), but typeid() worked fine. At least, when you make separate if statements, like you did in your example. When tried to use it in a switch statement, the compiler complained. Greetings, Lambert On Tue, Mar 15, 2016 at 2:47 PM, D?enan Zuki? wrote: > Hi Lambert, > > the classic way is using a bunch of if-else's. > > if (decltype(ValueType)==decltype(int)) > { > //int specific processing > } > else if (decltype(ValueType)==decltype(itk::RGB)) > { > //RGB specific processing > } > ?else if ...? > > ?If you can't use C++11's decltype then use typeid from ? header. > > Regards, > D?enan > > On Tue, Mar 15, 2016 at 5:48 AM, Lambert Zijp wrote: > >> I want to write a function that converts an arbitrary ITK image to >> another format (AVS in my case). >> It has been suggested that following functionprototype could de the job: >> template >> int ItkToAvs(AVSfield** ppAvs, typename >> itk::Image::Pointer pItkImage); >> >> Now I want to know whether ValueType equals unsigned char or short or int >> etc. Also whether the pixels are single numbers or vectors. How does one do >> that? >> >> Greetings, >> Lambert >> >> >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the 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 dzenanz at gmail.com Tue Mar 15 11:43:47 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Tue, 15 Mar 2016 11:43:47 -0400 Subject: [ITK-users] How to determine PixelType of itk::Image In-Reply-To: References: Message-ID: Of course it complained, switch statement is for integral types (if I remember correctly). Regards On Tue, Mar 15, 2016 at 11:39 AM, Lambert Zijp wrote: > Hi D?enan, > > Thank you very much! > Visual Studio 9 does not recognize decltype(), but typeid() worked fine. > At least, when you make separate if statements, like you did in your > example. When tried to use it in a switch statement, the compiler > complained. > > Greetings, > Lambert > > > On Tue, Mar 15, 2016 at 2:47 PM, D?enan Zuki? wrote: > >> Hi Lambert, >> >> the classic way is using a bunch of if-else's. >> >> if (decltype(ValueType)==decltype(int)) >> { >> //int specific processing >> } >> else if (decltype(ValueType)==decltype(itk::RGB)) >> { >> //RGB specific processing >> } >> ?else if ...? >> >> ?If you can't use C++11's decltype then use typeid from ? >> header. >> >> Regards, >> D?enan >> >> On Tue, Mar 15, 2016 at 5:48 AM, Lambert Zijp wrote: >> >>> I want to write a function that converts an arbitrary ITK image to >>> another format (AVS in my case). >>> It has been suggested that following functionprototype could de the job: >>> template >>> int ItkToAvs(AVSfield** ppAvs, typename >>> itk::Image::Pointer pItkImage); >>> >>> Now I want to know whether ValueType equals unsigned char or short or >>> int etc. Also whether the pixels are single numbers or vectors. How does >>> one do that? >>> >>> Greetings, >>> Lambert >>> >>> >>> >>> _____________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://www.kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the 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 Mar 15 12:22:46 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Tue, 15 Mar 2016 09:22:46 -0700 Subject: [ITK-users] How to determine PixelType of itk::Image In-Reply-To: References: Message-ID: This example may help http://www.vtk.org/Wiki/ITK/Examples/IO/ReadUnknownImageType On Mar 15, 2016 8:44 AM, "D?enan Zuki?" wrote: > Of course it complained, switch statement is for integral types (if I > remember correctly). > > Regards > > On Tue, Mar 15, 2016 at 11:39 AM, Lambert Zijp wrote: > >> Hi D?enan, >> >> Thank you very much! >> Visual Studio 9 does not recognize decltype(), but typeid() worked fine. >> At least, when you make separate if statements, like you did in your >> example. When tried to use it in a switch statement, the compiler >> complained. >> >> Greetings, >> Lambert >> >> >> On Tue, Mar 15, 2016 at 2:47 PM, D?enan Zuki? wrote: >> >>> Hi Lambert, >>> >>> the classic way is using a bunch of if-else's. >>> >>> if (decltype(ValueType)==decltype(int)) >>> { >>> //int specific processing >>> } >>> else if (decltype(ValueType)==decltype(itk::RGB)) >>> { >>> //RGB specific processing >>> } >>> ?else if ...? >>> >>> ?If you can't use C++11's decltype then use typeid from ? >>> header. >>> >>> Regards, >>> D?enan >>> >>> On Tue, Mar 15, 2016 at 5:48 AM, Lambert Zijp wrote: >>> >>>> I want to write a function that converts an arbitrary ITK image to >>>> another format (AVS in my case). >>>> It has been suggested that following functionprototype could de the job: >>>> template >>>> int ItkToAvs(AVSfield** ppAvs, typename >>>> itk::Image::Pointer pItkImage); >>>> >>>> Now I want to know whether ValueType equals unsigned char or short or >>>> int etc. Also whether the pixels are single numbers or vectors. How does >>>> one do that? >>>> >>>> Greetings, >>>> Lambert >>>> >>>> >>>> >>>> _____________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Kitware offers ITK Training Courses, for more information visit: >>>> http://www.kitware.com/products/protraining.php >>>> >>>> Please keep messages on-topic and check the ITK FAQ at: >>>> http://www.itk.org/Wiki/ITK_FAQ >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/insight-users >>>> >>>> >>> >> > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ljzijp at gmail.com Tue Mar 15 13:09:08 2016 From: ljzijp at gmail.com (Lambert Zijp) Date: Tue, 15 Mar 2016 18:09:08 +0100 Subject: [ITK-users] How to determine PixelType of itk::Image In-Reply-To: References: Message-ID: I'm still not sure how to handle vector images. D?enan gave an example of an RGB image. That would be a 3-vector unsigned char pixeltype. Would I have to write out in those *'if **(**typeid(ValueType) == ???)'* statements all permutations of the number of vectors and the type? Or is there a way to separate the number of vectors and the pixeltype? How are vector images stored in memory in ITK. In an RGB image for example, are the pixels consecutive triplets, or is the image stored as three consecutive color planes? I'm particular interested in 3D displacement vector fields, that are the result of deformable registration. On Tue, Mar 15, 2016 at 5:22 PM, Bill Lorensen wrote: > This example may help > http://www.vtk.org/Wiki/ITK/Examples/IO/ReadUnknownImageType > On Mar 15, 2016 8:44 AM, "D?enan Zuki?" wrote: > >> Of course it complained, switch statement is for integral types (if I >> remember correctly). >> >> Regards >> >> On Tue, Mar 15, 2016 at 11:39 AM, Lambert Zijp wrote: >> >>> Hi D?enan, >>> >>> Thank you very much! >>> Visual Studio 9 does not recognize decltype(), but typeid() worked >>> fine. At least, when you make separate if statements, like you did in your >>> example. When tried to use it in a switch statement, the compiler >>> complained. >>> >>> Greetings, >>> Lambert >>> >>> >>> On Tue, Mar 15, 2016 at 2:47 PM, D?enan Zuki? wrote: >>> >>>> Hi Lambert, >>>> >>>> the classic way is using a bunch of if-else's. >>>> >>>> if (decltype(ValueType)==decltype(int)) >>>> { >>>> //int specific processing >>>> } >>>> else if (decltype(ValueType)==decltype(itk::RGB)) >>>> { >>>> //RGB specific processing >>>> } >>>> ?else if ...? >>>> >>>> ?If you can't use C++11's decltype then use typeid from ? >>>> header. >>>> >>>> Regards, >>>> D?enan >>>> >>>> On Tue, Mar 15, 2016 at 5:48 AM, Lambert Zijp wrote: >>>> >>>>> I want to write a function that converts an arbitrary ITK image to >>>>> another format (AVS in my case). >>>>> It has been suggested that following functionprototype could de the >>>>> job: >>>>> template >>>>> int ItkToAvs(AVSfield** ppAvs, typename >>>>> itk::Image::Pointer pItkImage); >>>>> >>>>> Now I want to know whether ValueType equals unsigned char or short or >>>>> int etc. Also whether the pixels are single numbers or vectors. How does >>>>> one do that? >>>>> >>>>> Greetings, >>>>> Lambert >>>>> >>>>> >>>>> >>>>> _____________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Kitware offers ITK Training Courses, for more information visit: >>>>> http://www.kitware.com/products/protraining.php >>>>> >>>>> Please keep messages on-topic and check the ITK FAQ at: >>>>> http://www.itk.org/Wiki/ITK_FAQ >>>>> >>>>> Follow this link to subscribe/unsubscribe: >>>>> http://public.kitware.com/mailman/listinfo/insight-users >>>>> >>>>> >>>> >>> >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From dzenanz at gmail.com Tue Mar 15 14:07:57 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Tue, 15 Mar 2016 14:07:57 -0400 Subject: [ITK-users] How to determine PixelType of itk::Image In-Reply-To: References: Message-ID: If I remember correctly, using this approach you can also get number of components with something like: imageIO->GetNumberOfComponents(); You can take a look at class documentation for more details. On Tue, Mar 15, 2016 at 1:09 PM, Lambert Zijp wrote: > I'm still not sure how to handle vector images. D?enan gave an example of > an RGB image. That would be a 3-vector unsigned char pixeltype. > Would I have to write out in those *'if **(**typeid(ValueType) == ???)'* > statements all permutations of the number of vectors and the type? Or is > there a way to separate the number of vectors and the pixeltype? > How are vector images stored in memory in ITK. In an RGB image for > example, are the pixels consecutive triplets, or is the image stored as > three consecutive color planes? > I'm particular interested in 3D displacement vector fields, that are the > result of deformable registration. > > > On Tue, Mar 15, 2016 at 5:22 PM, Bill Lorensen > wrote: > >> This example may help >> http://www.vtk.org/Wiki/ITK/Examples/IO/ReadUnknownImageType >> On Mar 15, 2016 8:44 AM, "D?enan Zuki?" wrote: >> >>> Of course it complained, switch statement is for integral types (if I >>> remember correctly). >>> >>> Regards >>> >>> On Tue, Mar 15, 2016 at 11:39 AM, Lambert Zijp wrote: >>> >>>> Hi D?enan, >>>> >>>> Thank you very much! >>>> Visual Studio 9 does not recognize decltype(), but typeid() worked >>>> fine. At least, when you make separate if statements, like you did in your >>>> example. When tried to use it in a switch statement, the compiler >>>> complained. >>>> >>>> Greetings, >>>> Lambert >>>> >>>> >>>> On Tue, Mar 15, 2016 at 2:47 PM, D?enan Zuki? >>>> wrote: >>>> >>>>> Hi Lambert, >>>>> >>>>> the classic way is using a bunch of if-else's. >>>>> >>>>> if (decltype(ValueType)==decltype(int)) >>>>> { >>>>> //int specific processing >>>>> } >>>>> else if (decltype(ValueType)==decltype(itk::RGB)) >>>>> { >>>>> //RGB specific processing >>>>> } >>>>> ?else if ...? >>>>> >>>>> ?If you can't use C++11's decltype then use typeid from ? >>>>> header. >>>>> >>>>> Regards, >>>>> D?enan >>>>> >>>>> On Tue, Mar 15, 2016 at 5:48 AM, Lambert Zijp >>>>> wrote: >>>>> >>>>>> I want to write a function that converts an arbitrary ITK image to >>>>>> another format (AVS in my case). >>>>>> It has been suggested that following functionprototype could de the >>>>>> job: >>>>>> template >>>>>> int ItkToAvs(AVSfield** ppAvs, typename >>>>>> itk::Image::Pointer pItkImage); >>>>>> >>>>>> Now I want to know whether ValueType equals unsigned char or short or >>>>>> int etc. Also whether the pixels are single numbers or vectors. How does >>>>>> one do that? >>>>>> >>>>>> Greetings, >>>>>> Lambert >>>>>> >>>>>> >>>>>> >>>>>> _____________________________________ >>>>>> Powered by www.kitware.com >>>>>> >>>>>> Visit other Kitware open-source projects at >>>>>> http://www.kitware.com/opensource/opensource.html >>>>>> >>>>>> Kitware offers ITK Training Courses, for more information visit: >>>>>> http://www.kitware.com/products/protraining.php >>>>>> >>>>>> Please keep messages on-topic and check the ITK FAQ at: >>>>>> http://www.itk.org/Wiki/ITK_FAQ >>>>>> >>>>>> Follow this link to subscribe/unsubscribe: >>>>>> http://public.kitware.com/mailman/listinfo/insight-users >>>>>> >>>>>> >>>>> >>>> >>> >>> _____________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://www.kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the ITK FAQ at: >>> http://www.itk.org/Wiki/ITK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/insight-users >>> >>> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dzenanz at gmail.com Tue Mar 15 14:41:59 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Tue, 15 Mar 2016 14:41:59 -0400 Subject: [ITK-users] Strange coordinates output by itk::ContourExtractor2DImageFilter In-Reply-To: <1458010841302.45020@sphic.org.cn> References: <1458010841302.45020@sphic.org.cn> Message-ID: Hi Shen, using a recent version of ITK (and using the attached C++ version of your code) I could not reproduce this problem. For me the output is: [197, 378] [196, 378] [195, 379] [194, 379] [193, 379] [192, 380] [191, 380] [190, 380] [189, 380] [188, 380] [187, 381] Regards, D?enan On Mon, Mar 14, 2016 at 11:00 PM, ??? wrote: > Hi all, > > > I used itk::ContourExtractor2DImageFilter to extract contours from a > binary image (i.e. only 0 or 255 for pixel intensity). Mostly, the code can > work correctly. However, the code sometimes outputs very strange > coordinates (e.g. (194.0, 5.36011819173e-320) ), which should represent the > path of the contour. When I change the contour value from 0 to other number > no less than 255 (i.e. 250), I got more strange coordinates. My code and > results are listed as below. Has anyone met the same situation?? > > > > Regards, > > > Zhuangming Shen > > > > > Here is my code > > > ======================================================================================= > import itk > > reader = itk.ImageFileReader[itk.Image.UC2].New() > reader.SetFileName("test.nii") > reader.Update() > > contour_extractor = itk.ContourExtractor2DImageFilter[itk.Image.UC2].New() > contour_extractor.SetInput(reader.GetOutput()) > contour_extractor.SetContourValue(0) > contour_extractor.Update() > > contour_number = contour_extractor.GetNumberOfOutputs() > > print("There are "+str(contour_number)+" contours") > > for k in xrange(contour_number): > print("================ Contour "+str(k)+" ================") > > point_number = contour_extractor.GetOutput(k).GetVertexList().Size() > print("Point number: "+str(point_number)) > > for i in xrange(point_number): > > print("("+str(contour_extractor.GetOutput(k).GetVertexList().GetElement(i)[0])+","+str(contour_extractor.GetOutput(0).GetVertexList().GetElement(i)[1])+")") > > > > > Here is my results > > > ========================================================================================= > There are 2 contours > ================ Contour 0 ================ > Point number: 670 > (373.0,380.0) > (372.0,380.0) > (371.0,380.0) > (370.0,380.0) > (369.0,380.0) > (368.0,380.0) > (367.0,380.0) > ... > (375.0,379.0) > (374.0,379.0) > (373.0,380.0) > ================ Contour 1 ================ > Point number: 677 > (188.0,380.0) > (187.0,380.0) > (186.0,380.0) > (185.0,380.0) > ... > (198.0,379.0) > (197.0,379.0) > (196.0,379.0) > (195.0,380.0) > (194.0,5.36011819173e-320) > (193.0,382.0) > (192.0,382.0) > (191.0,382.0) > (190.0,382.0) > (189.0,382.0) > (188.0,382.0) > > > > > Here is the input test.nii > > ============================================================================================= > ? > > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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: pastedImage.png Type: image/png Size: 8798 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pastedImage.png Type: image/png Size: 3730 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: tester.cpp Type: text/x-c++src Size: 1240 bytes Desc: not available URL: From ljzijp at gmail.com Tue Mar 15 14:53:58 2016 From: ljzijp at gmail.com (Lambert Zijp) Date: Tue, 15 Mar 2016 19:53:58 +0100 Subject: [ITK-users] How to determine PixelType of itk::Image In-Reply-To: References: Message-ID: This is all very confusing to me. In the FileWriter example, the caller *already knows* what the IOComponentType and what the IOPixelType of the itk::Image is (it is hard-coded; not retrieved from the itk::Image). The same holds for the reader: it gets that information from the file. I want to make a general function that takes *ANY* itk::Image as input, and converts it to an AVS datasructure (which supports all of them). So I need to get the information from itk::Image. Is there a way to get it from itk::Image? Or is it true that an itk::Image does not know what it actually is/represents? On Tue, Mar 15, 2016 at 7:07 PM, D?enan Zuki? wrote: > If I remember correctly, using this > approach > you can also get number of components with something like: > imageIO->GetNumberOfComponents(); > You can take a look at class documentation > for more > details. > > On Tue, Mar 15, 2016 at 1:09 PM, Lambert Zijp wrote: > >> I'm still not sure how to handle vector images. D?enan gave an example >> of an RGB image. That would be a 3-vector unsigned char pixeltype. >> Would I have to write out in those *'if **(**typeid(ValueType) == ???)'* >> statements all permutations of the number of vectors and the type? Or is >> there a way to separate the number of vectors and the pixeltype? >> How are vector images stored in memory in ITK. In an RGB image for >> example, are the pixels consecutive triplets, or is the image stored as >> three consecutive color planes? >> I'm particular interested in 3D displacement vector fields, that are the >> result of deformable registration. >> >> >> On Tue, Mar 15, 2016 at 5:22 PM, Bill Lorensen >> wrote: >> >>> This example may help >>> http://www.vtk.org/Wiki/ITK/Examples/IO/ReadUnknownImageType >>> On Mar 15, 2016 8:44 AM, "D?enan Zuki?" wrote: >>> >>>> Of course it complained, switch statement is for integral types (if I >>>> remember correctly). >>>> >>>> Regards >>>> >>>> On Tue, Mar 15, 2016 at 11:39 AM, Lambert Zijp >>>> wrote: >>>> >>>>> Hi D?enan, >>>>> >>>>> Thank you very much! >>>>> Visual Studio 9 does not recognize decltype(), but typeid() worked >>>>> fine. At least, when you make separate if statements, like you did in your >>>>> example. When tried to use it in a switch statement, the compiler >>>>> complained. >>>>> >>>>> Greetings, >>>>> Lambert >>>>> >>>>> >>>>> On Tue, Mar 15, 2016 at 2:47 PM, D?enan Zuki? >>>>> wrote: >>>>> >>>>>> Hi Lambert, >>>>>> >>>>>> the classic way is using a bunch of if-else's. >>>>>> >>>>>> if (decltype(ValueType)==decltype(int)) >>>>>> { >>>>>> //int specific processing >>>>>> } >>>>>> else if (decltype(ValueType)==decltype(itk::RGB)) >>>>>> { >>>>>> //RGB specific processing >>>>>> } >>>>>> ?else if ...? >>>>>> >>>>>> ?If you can't use C++11's decltype then use typeid from ? >>>>>> header. >>>>>> >>>>>> Regards, >>>>>> D?enan >>>>>> >>>>>> On Tue, Mar 15, 2016 at 5:48 AM, Lambert Zijp >>>>>> wrote: >>>>>> >>>>>>> I want to write a function that converts an arbitrary ITK image to >>>>>>> another format (AVS in my case). >>>>>>> It has been suggested that following functionprototype could de the >>>>>>> job: >>>>>>> template >>>>>>> int ItkToAvs(AVSfield** ppAvs, typename >>>>>>> itk::Image::Pointer pItkImage); >>>>>>> >>>>>>> Now I want to know whether ValueType equals unsigned char or short >>>>>>> or int etc. Also whether the pixels are single numbers or vectors. How does >>>>>>> one do that? >>>>>>> >>>>>>> Greetings, >>>>>>> Lambert >>>>>>> >>>>>>> >>>>>>> >>>>>>> _____________________________________ >>>>>>> Powered by www.kitware.com >>>>>>> >>>>>>> Visit other Kitware open-source projects at >>>>>>> http://www.kitware.com/opensource/opensource.html >>>>>>> >>>>>>> Kitware offers ITK Training Courses, for more information visit: >>>>>>> http://www.kitware.com/products/protraining.php >>>>>>> >>>>>>> Please keep messages on-topic and check the ITK FAQ at: >>>>>>> http://www.itk.org/Wiki/ITK_FAQ >>>>>>> >>>>>>> Follow this link to subscribe/unsubscribe: >>>>>>> http://public.kitware.com/mailman/listinfo/insight-users >>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>>> _____________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Kitware offers ITK Training Courses, for more information visit: >>>> http://www.kitware.com/products/protraining.php >>>> >>>> Please keep messages on-topic and check the ITK FAQ at: >>>> http://www.itk.org/Wiki/ITK_FAQ >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/insight-users >>>> >>>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dzenanz at gmail.com Tue Mar 15 14:57:09 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Tue, 15 Mar 2016 14:57:09 -0400 Subject: [ITK-users] How to determine PixelType of itk::Image In-Reply-To: References: Message-ID: Yes, it knows. Using something like this: template void ItkToAvs(AVSfield** ppAvs, typename ImageType::Pointer image) { typename ImageType::PixelType *pixelPointer=image->GetBufferPointer(); unsigned int dimension=ImageType::ImageDimension; //the rest of conversion code } However, ImageType::PixelType can be arbitrary type. Consider this: class myClass {int a; complex c; string sRep;}; typedef itk::Image ImageType; ItkToAvs(ppAvs, image); What do you expect ItkToAvs to do? Regards, D?enan On Tue, Mar 15, 2016 at 2:53 PM, Lambert Zijp wrote: > This is all very confusing to me. In the FileWriter example, the caller *already > knows* what the IOComponentType > and > what the IOPixelType > of > the itk::Image is (it is hard-coded; not retrieved from the itk::Image). > The same holds for the reader: it gets that information from the file. > I want to make a general function that takes *ANY* itk::Image as input, > and converts it to an AVS datasructure (which supports all of them). So I > need to get the information from itk::Image. > Is there a way to get it from itk::Image? Or is it true that an > itk::Image does not know what it actually is/represents? > > On Tue, Mar 15, 2016 at 7:07 PM, D?enan Zuki? wrote: > >> If I remember correctly, using this >> approach >> you can also get number of components with something like: >> imageIO->GetNumberOfComponents(); >> You can take a look at class documentation >> for more >> details. >> >> On Tue, Mar 15, 2016 at 1:09 PM, Lambert Zijp wrote: >> >>> I'm still not sure how to handle vector images. D?enan gave an example >>> of an RGB image. That would be a 3-vector unsigned char pixeltype. >>> Would I have to write out in those *'if **(**typeid(ValueType) == >>> ???)'* statements all permutations of the number of vectors and the >>> type? Or is there a way to separate the number of vectors and the pixeltype? >>> How are vector images stored in memory in ITK. In an RGB image for >>> example, are the pixels consecutive triplets, or is the image stored as >>> three consecutive color planes? >>> I'm particular interested in 3D displacement vector fields, that are the >>> result of deformable registration. >>> >>> >>> On Tue, Mar 15, 2016 at 5:22 PM, Bill Lorensen >>> wrote: >>> >>>> This example may help >>>> http://www.vtk.org/Wiki/ITK/Examples/IO/ReadUnknownImageType >>>> On Mar 15, 2016 8:44 AM, "D?enan Zuki?" wrote: >>>> >>>>> Of course it complained, switch statement is for integral types (if I >>>>> remember correctly). >>>>> >>>>> Regards >>>>> >>>>> On Tue, Mar 15, 2016 at 11:39 AM, Lambert Zijp >>>>> wrote: >>>>> >>>>>> Hi D?enan, >>>>>> >>>>>> Thank you very much! >>>>>> Visual Studio 9 does not recognize decltype(), but typeid() worked >>>>>> fine. At least, when you make separate if statements, like you did in your >>>>>> example. When tried to use it in a switch statement, the compiler >>>>>> complained. >>>>>> >>>>>> Greetings, >>>>>> Lambert >>>>>> >>>>>> >>>>>> On Tue, Mar 15, 2016 at 2:47 PM, D?enan Zuki? >>>>>> wrote: >>>>>> >>>>>>> Hi Lambert, >>>>>>> >>>>>>> the classic way is using a bunch of if-else's. >>>>>>> >>>>>>> if (decltype(ValueType)==decltype(int)) >>>>>>> { >>>>>>> //int specific processing >>>>>>> } >>>>>>> else if (decltype(ValueType)==decltype(itk::RGB)) >>>>>>> { >>>>>>> //RGB specific processing >>>>>>> } >>>>>>> ?else if ...? >>>>>>> >>>>>>> ?If you can't use C++11's decltype then use typeid from ? >>>>>>> header. >>>>>>> >>>>>>> Regards, >>>>>>> D?enan >>>>>>> >>>>>>> On Tue, Mar 15, 2016 at 5:48 AM, Lambert Zijp >>>>>>> wrote: >>>>>>> >>>>>>>> I want to write a function that converts an arbitrary ITK image to >>>>>>>> another format (AVS in my case). >>>>>>>> It has been suggested that following functionprototype could de the >>>>>>>> job: >>>>>>>> template >>>>>>>> int ItkToAvs(AVSfield** ppAvs, typename >>>>>>>> itk::Image::Pointer pItkImage); >>>>>>>> >>>>>>>> Now I want to know whether ValueType equals unsigned char or short >>>>>>>> or int etc. Also whether the pixels are single numbers or vectors. How does >>>>>>>> one do that? >>>>>>>> >>>>>>>> Greetings, >>>>>>>> Lambert >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> _____________________________________ >>>>>>>> Powered by www.kitware.com >>>>>>>> >>>>>>>> Visit other Kitware open-source projects at >>>>>>>> http://www.kitware.com/opensource/opensource.html >>>>>>>> >>>>>>>> Kitware offers ITK Training Courses, for more information visit: >>>>>>>> http://www.kitware.com/products/protraining.php >>>>>>>> >>>>>>>> Please keep messages on-topic and check the ITK FAQ at: >>>>>>>> http://www.itk.org/Wiki/ITK_FAQ >>>>>>>> >>>>>>>> Follow this link to subscribe/unsubscribe: >>>>>>>> http://public.kitware.com/mailman/listinfo/insight-users >>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>>> _____________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Kitware offers ITK Training Courses, for more information visit: >>>>> http://www.kitware.com/products/protraining.php >>>>> >>>>> Please keep messages on-topic and check the ITK FAQ at: >>>>> http://www.itk.org/Wiki/ITK_FAQ >>>>> >>>>> Follow this link to subscribe/unsubscribe: >>>>> http://public.kitware.com/mailman/listinfo/insight-users >>>>> >>>>> >>> >> > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ljzijp at gmail.com Tue Mar 15 15:39:02 2016 From: ljzijp at gmail.com (Lambert Zijp) Date: Tue, 15 Mar 2016 20:39:02 +0100 Subject: [ITK-users] How to determine PixelType of itk::Image In-Reply-To: References: Message-ID: Hi D?enan, Haha, true enough, ItkToAvs would have to return an errorcode 'unsupported'. Yes, pixelspacing and origin can be retrieved. Also the size of each dimension, though that took me a while: it was well hidden. Still, it is very frustrating that it cannot be determined from itk::image whether it is an ordinary, commonly occurring image like an BGR ARGB or a 3-vector float image. At least, that is what I gather from your answer: a 'general' interface to other image processing libraries cannot be made! Am I the first person having problems with this? How is an RGB image stored in itk, as consecutive triplets or as consecutive color-planes. Greetings, Lambert On Tue, Mar 15, 2016 at 7:57 PM, D?enan Zuki? wrote: > Yes, it knows. Using something like this: > > template > void ItkToAvs(AVSfield** ppAvs, typename ImageType::Pointer image) > { > typename ImageType::PixelType *pixelPointer=image->GetBufferPointer(); > unsigned int dimension=ImageType::ImageDimension; > //the rest of conversion code > } > > However, ImageType::PixelType can be arbitrary type. Consider this: > class myClass {int a; complex c; string sRep;}; > typedef itk::Image ImageType; > ItkToAvs(ppAvs, image); > > What do you expect ItkToAvs to do? > > Regards, > D?enan > > On Tue, Mar 15, 2016 at 2:53 PM, Lambert Zijp wrote: > >> This is all very confusing to me. In the FileWriter example, the caller *already >> knows* what the IOComponentType >> and >> what the IOPixelType >> of >> the itk::Image is (it is hard-coded; not retrieved from the itk::Image). >> The same holds for the reader: it gets that information from the file. >> I want to make a general function that takes *ANY* itk::Image as input, >> and converts it to an AVS datasructure (which supports all of them). So I >> need to get the information from itk::Image. >> Is there a way to get it from itk::Image? Or is it true that an >> itk::Image does not know what it actually is/represents? >> >> On Tue, Mar 15, 2016 at 7:07 PM, D?enan Zuki? wrote: >> >>> If I remember correctly, using this >>> approach >>> you can also get number of components with something like: >>> imageIO->GetNumberOfComponents(); >>> You can take a look at class documentation >>> for more >>> details. >>> >>> On Tue, Mar 15, 2016 at 1:09 PM, Lambert Zijp wrote: >>> >>>> I'm still not sure how to handle vector images. D?enan gave an example >>>> of an RGB image. That would be a 3-vector unsigned char pixeltype. >>>> Would I have to write out in those *'if **(**typeid(ValueType) == >>>> ???)'* statements all permutations of the number of vectors and the >>>> type? Or is there a way to separate the number of vectors and the pixeltype? >>>> How are vector images stored in memory in ITK. In an RGB image for >>>> example, are the pixels consecutive triplets, or is the image stored as >>>> three consecutive color planes? >>>> I'm particular interested in 3D displacement vector fields, that are >>>> the result of deformable registration. >>>> >>>> >>>> On Tue, Mar 15, 2016 at 5:22 PM, Bill Lorensen >>> > wrote: >>>> >>>>> This example may help >>>>> http://www.vtk.org/Wiki/ITK/Examples/IO/ReadUnknownImageType >>>>> On Mar 15, 2016 8:44 AM, "D?enan Zuki?" wrote: >>>>> >>>>>> Of course it complained, switch statement is for integral types (if I >>>>>> remember correctly). >>>>>> >>>>>> Regards >>>>>> >>>>>> On Tue, Mar 15, 2016 at 11:39 AM, Lambert Zijp >>>>>> wrote: >>>>>> >>>>>>> Hi D?enan, >>>>>>> >>>>>>> Thank you very much! >>>>>>> Visual Studio 9 does not recognize decltype(), but typeid() worked >>>>>>> fine. At least, when you make separate if statements, like you did in your >>>>>>> example. When tried to use it in a switch statement, the compiler >>>>>>> complained. >>>>>>> >>>>>>> Greetings, >>>>>>> Lambert >>>>>>> >>>>>>> >>>>>>> On Tue, Mar 15, 2016 at 2:47 PM, D?enan Zuki? >>>>>>> wrote: >>>>>>> >>>>>>>> Hi Lambert, >>>>>>>> >>>>>>>> the classic way is using a bunch of if-else's. >>>>>>>> >>>>>>>> if (decltype(ValueType)==decltype(int)) >>>>>>>> { >>>>>>>> //int specific processing >>>>>>>> } >>>>>>>> else if (decltype(ValueType)==decltype(itk::RGB)) >>>>>>>> { >>>>>>>> //RGB specific processing >>>>>>>> } >>>>>>>> ?else if ...? >>>>>>>> >>>>>>>> ?If you can't use C++11's decltype then use typeid from ? >>>>>>>> header. >>>>>>>> >>>>>>>> Regards, >>>>>>>> D?enan >>>>>>>> >>>>>>>> On Tue, Mar 15, 2016 at 5:48 AM, Lambert Zijp >>>>>>>> wrote: >>>>>>>> >>>>>>>>> I want to write a function that converts an arbitrary ITK image to >>>>>>>>> another format (AVS in my case). >>>>>>>>> It has been suggested that following functionprototype could de >>>>>>>>> the job: >>>>>>>>> template >>>>>>>>> int ItkToAvs(AVSfield** ppAvs, typename >>>>>>>>> itk::Image::Pointer pItkImage); >>>>>>>>> >>>>>>>>> Now I want to know whether ValueType equals unsigned char or short >>>>>>>>> or int etc. Also whether the pixels are single numbers or vectors. How does >>>>>>>>> one do that? >>>>>>>>> >>>>>>>>> Greetings, >>>>>>>>> Lambert >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> _____________________________________ >>>>>>>>> Powered by www.kitware.com >>>>>>>>> >>>>>>>>> Visit other Kitware open-source projects at >>>>>>>>> http://www.kitware.com/opensource/opensource.html >>>>>>>>> >>>>>>>>> Kitware offers ITK Training Courses, for more information visit: >>>>>>>>> http://www.kitware.com/products/protraining.php >>>>>>>>> >>>>>>>>> Please keep messages on-topic and check the ITK FAQ at: >>>>>>>>> http://www.itk.org/Wiki/ITK_FAQ >>>>>>>>> >>>>>>>>> Follow this link to subscribe/unsubscribe: >>>>>>>>> http://public.kitware.com/mailman/listinfo/insight-users >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>>> _____________________________________ >>>>>> Powered by www.kitware.com >>>>>> >>>>>> Visit other Kitware open-source projects at >>>>>> http://www.kitware.com/opensource/opensource.html >>>>>> >>>>>> Kitware offers ITK Training Courses, for more information visit: >>>>>> http://www.kitware.com/products/protraining.php >>>>>> >>>>>> Please keep messages on-topic and check the ITK FAQ at: >>>>>> http://www.itk.org/Wiki/ITK_FAQ >>>>>> >>>>>> Follow this link to subscribe/unsubscribe: >>>>>> http://public.kitware.com/mailman/listinfo/insight-users >>>>>> >>>>>> >>>> >>> >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dzenanz at gmail.com Tue Mar 15 15:49:01 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Tue, 15 Mar 2016 15:49:01 -0400 Subject: [ITK-users] How to determine PixelType of itk::Image In-Reply-To: References: Message-ID: Hi Lambert, a 'general' interface cannot be made. You are not the first to face this issue. One way is to do if/else for all the supported cases. Another way is to define some template function or helper class, and then let compiler take care of type matching. But indeed, the code is either bloated (version one) or somewhat exotic (version two). RGB image can be stored either way. You can have itk::Image with 3 dimensions x,y,color (consecutive color planes) or itk::Image, 2> (consecutive triplets). It depends on your treatment. I believe that consecutive triplets is more common. Regards, D?enan On Tue, Mar 15, 2016 at 3:39 PM, Lambert Zijp wrote: > Hi D?enan, > > Haha, true enough, ItkToAvs would have to return an errorcode > 'unsupported'. Yes, pixelspacing and origin can be retrieved. Also the > size of each dimension, though that took me a while: it was well hidden. > Still, it is very frustrating that it cannot be determined from itk::image > whether it is an ordinary, commonly occurring image like an BGR ARGB or a > 3-vector float image. > At least, that is what I gather from your answer: a 'general' interface to > other image processing libraries cannot be made! > > Am I the first person having problems with this? > How is an RGB image stored in itk, as consecutive triplets or as > consecutive color-planes. > > Greetings, > Lambert > > On Tue, Mar 15, 2016 at 7:57 PM, D?enan Zuki? wrote: > >> Yes, it knows. Using something like this: >> >> template >> void ItkToAvs(AVSfield** ppAvs, typename ImageType::Pointer image) >> { >> typename ImageType::PixelType *pixelPointer=image->GetBufferPointer(); >> unsigned int dimension=ImageType::ImageDimension; >> //the rest of conversion code >> } >> >> However, ImageType::PixelType can be arbitrary type. Consider this: >> class myClass {int a; complex c; string sRep;}; >> typedef itk::Image ImageType; >> ItkToAvs(ppAvs, image); >> >> What do you expect ItkToAvs to do? >> >> Regards, >> D?enan >> >> On Tue, Mar 15, 2016 at 2:53 PM, Lambert Zijp wrote: >> >>> This is all very confusing to me. In the FileWriter example, the caller *already >>> knows* what the IOComponentType >>> and >>> what the IOPixelType >>> of >>> the itk::Image is (it is hard-coded; not retrieved from the itk::Image). >>> The same holds for the reader: it gets that information from the file. >>> I want to make a general function that takes *ANY* itk::Image as input, >>> and converts it to an AVS datasructure (which supports all of them). So I >>> need to get the information from itk::Image. >>> Is there a way to get it from itk::Image? Or is it true that an >>> itk::Image does not know what it actually is/represents? >>> >>> On Tue, Mar 15, 2016 at 7:07 PM, D?enan Zuki? wrote: >>> >>>> If I remember correctly, using this >>>> >>>> approach you can also get number of components with something like: >>>> imageIO->GetNumberOfComponents(); >>>> You can take a look at class documentation >>>> for >>>> more details. >>>> >>>> On Tue, Mar 15, 2016 at 1:09 PM, Lambert Zijp wrote: >>>> >>>>> I'm still not sure how to handle vector images. D?enan gave an >>>>> example of an RGB image. That would be a 3-vector unsigned char pixeltype. >>>>> Would I have to write out in those *'if **(**typeid(ValueType) == >>>>> ???)'* statements all permutations of the number of vectors and the >>>>> type? Or is there a way to separate the number of vectors and the pixeltype? >>>>> How are vector images stored in memory in ITK. In an RGB image for >>>>> example, are the pixels consecutive triplets, or is the image stored as >>>>> three consecutive color planes? >>>>> I'm particular interested in 3D displacement vector fields, that are >>>>> the result of deformable registration. >>>>> >>>>> >>>>> On Tue, Mar 15, 2016 at 5:22 PM, Bill Lorensen < >>>>> bill.lorensen at gmail.com> wrote: >>>>> >>>>>> This example may help >>>>>> http://www.vtk.org/Wiki/ITK/Examples/IO/ReadUnknownImageType >>>>>> On Mar 15, 2016 8:44 AM, "D?enan Zuki?" wrote: >>>>>> >>>>>>> Of course it complained, switch statement is for integral types (if >>>>>>> I remember correctly). >>>>>>> >>>>>>> Regards >>>>>>> >>>>>>> On Tue, Mar 15, 2016 at 11:39 AM, Lambert Zijp >>>>>>> wrote: >>>>>>> >>>>>>>> Hi D?enan, >>>>>>>> >>>>>>>> Thank you very much! >>>>>>>> Visual Studio 9 does not recognize decltype(), but typeid() worked >>>>>>>> fine. At least, when you make separate if statements, like you did in your >>>>>>>> example. When tried to use it in a switch statement, the compiler >>>>>>>> complained. >>>>>>>> >>>>>>>> Greetings, >>>>>>>> Lambert >>>>>>>> >>>>>>>> >>>>>>>> On Tue, Mar 15, 2016 at 2:47 PM, D?enan Zuki? >>>>>>>> wrote: >>>>>>>> >>>>>>>>> Hi Lambert, >>>>>>>>> >>>>>>>>> the classic way is using a bunch of if-else's. >>>>>>>>> >>>>>>>>> if (decltype(ValueType)==decltype(int)) >>>>>>>>> { >>>>>>>>> //int specific processing >>>>>>>>> } >>>>>>>>> else if (decltype(ValueType)==decltype(itk::RGB)) >>>>>>>>> { >>>>>>>>> //RGB specific processing >>>>>>>>> } >>>>>>>>> ?else if ...? >>>>>>>>> >>>>>>>>> ?If you can't use C++11's decltype then use typeid from >>>>>>>>> ? header. >>>>>>>>> >>>>>>>>> Regards, >>>>>>>>> D?enan >>>>>>>>> >>>>>>>>> On Tue, Mar 15, 2016 at 5:48 AM, Lambert Zijp >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> I want to write a function that converts an arbitrary ITK image >>>>>>>>>> to another format (AVS in my case). >>>>>>>>>> It has been suggested that following functionprototype could de >>>>>>>>>> the job: >>>>>>>>>> template >>>>>>>>>> int ItkToAvs(AVSfield** ppAvs, typename >>>>>>>>>> itk::Image::Pointer pItkImage); >>>>>>>>>> >>>>>>>>>> Now I want to know whether ValueType equals unsigned char or >>>>>>>>>> short or int etc. Also whether the pixels are single numbers or vectors. >>>>>>>>>> How does one do that? >>>>>>>>>> >>>>>>>>>> Greetings, >>>>>>>>>> Lambert >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> _____________________________________ >>>>>>>>>> Powered by www.kitware.com >>>>>>>>>> >>>>>>>>>> Visit other Kitware open-source projects at >>>>>>>>>> http://www.kitware.com/opensource/opensource.html >>>>>>>>>> >>>>>>>>>> Kitware offers ITK Training Courses, for more information visit: >>>>>>>>>> http://www.kitware.com/products/protraining.php >>>>>>>>>> >>>>>>>>>> Please keep messages on-topic and check the ITK FAQ at: >>>>>>>>>> http://www.itk.org/Wiki/ITK_FAQ >>>>>>>>>> >>>>>>>>>> Follow this link to subscribe/unsubscribe: >>>>>>>>>> http://public.kitware.com/mailman/listinfo/insight-users >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>>> _____________________________________ >>>>>>> Powered by www.kitware.com >>>>>>> >>>>>>> Visit other Kitware open-source projects at >>>>>>> http://www.kitware.com/opensource/opensource.html >>>>>>> >>>>>>> Kitware offers ITK Training Courses, for more information visit: >>>>>>> http://www.kitware.com/products/protraining.php >>>>>>> >>>>>>> Please keep messages on-topic and check the ITK FAQ at: >>>>>>> http://www.itk.org/Wiki/ITK_FAQ >>>>>>> >>>>>>> Follow this link to subscribe/unsubscribe: >>>>>>> http://public.kitware.com/mailman/listinfo/insight-users >>>>>>> >>>>>>> >>>>> >>>> >>> >>> _____________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://www.kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the ITK FAQ at: >>> http://www.itk.org/Wiki/ITK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/insight-users >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhuangming.shen at sphic.org.cn Tue Mar 15 20:45:56 2016 From: zhuangming.shen at sphic.org.cn (=?utf-8?B?5rKI5bqE5piO?=) Date: Wed, 16 Mar 2016 00:45:56 +0000 Subject: [ITK-users] Strange coordinates output by itk::ContourExtractor2DImageFilter In-Reply-To: References: <1458010841302.45020@sphic.org.cn>, Message-ID: <1458089154068.81178@sphic.org.cn> Hi D?enan, Thank you for your prompt response. I found I made a mistake in my code. It works correctly now. Thanks again. Regards, Zhuangming Shen ________________________________ From: D?enan Zuki? Sent: Wednesday, March 16, 2016 2:41 AM To: ??? Cc: insight-users at itk.org Subject: Re: [ITK-users] Strange coordinates output by itk::ContourExtractor2DImageFilter Hi Shen, using a recent version of ITK (and using the attached C++ version of your code) I could not reproduce this problem. For me the output is: [197, 378] [196, 378] [195, 379] [194, 379] [193, 379] [192, 380] [191, 380] [190, 380] [189, 380] [188, 380] [187, 381] Regards, D?enan On Mon, Mar 14, 2016 at 11:00 PM, ??? > wrote: Hi all, I used itk::ContourExtractor2DImageFilter to extract contours from a binary image (i.e. only 0 or 255 for pixel intensity). Mostly, the code can work correctly. However, the code sometimes outputs very strange coordinates (e.g. (194.0, 5.36011819173e-320) ), which should represent the path of the contour. When I change the contour value from 0 to other number no less than 255 (i.e. 250), I got more strange coordinates. My code and results are listed as below. Has anyone met the same situation?? Regards, Zhuangming Shen Here is my code ======================================================================================= import itk reader = itk.ImageFileReader[itk.Image.UC2].New() reader.SetFileName("test.nii") reader.Update() contour_extractor = itk.ContourExtractor2DImageFilter[itk.Image.UC2].New() contour_extractor.SetInput(reader.GetOutput()) contour_extractor.SetContourValue(0) contour_extractor.Update() contour_number = contour_extractor.GetNumberOfOutputs() print("There are "+str(contour_number)+" contours") for k in xrange(contour_number): print("================ Contour "+str(k)+" ================") point_number = contour_extractor.GetOutput(k).GetVertexList().Size() print("Point number: "+str(point_number)) for i in xrange(point_number): print("("+str(contour_extractor.GetOutput(k).GetVertexList().GetElement(i)[0])+","+str(contour_extractor.GetOutput(0).GetVertexList().GetElement(i)[1])+")") Here is my results ========================================================================================= There are 2 contours ================ Contour 0 ================ Point number: 670 (373.0,380.0) (372.0,380.0) (371.0,380.0) (370.0,380.0) (369.0,380.0) (368.0,380.0) (367.0,380.0) ... (375.0,379.0) (374.0,379.0) (373.0,380.0) ================ Contour 1 ================ Point number: 677 (188.0,380.0) (187.0,380.0) (186.0,380.0) (185.0,380.0) ... (198.0,379.0) (197.0,379.0) (196.0,379.0) (195.0,380.0) (194.0,5.36011819173e-320) (193.0,382.0) (192.0,382.0) (191.0,382.0) (190.0,382.0) (189.0,382.0) (188.0,382.0) Here is the input test.nii ============================================================================================= [cid:beaa107f-9827-40b6-aac6-cdb30092e744]? _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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: pastedImage.png Type: image/png Size: 8798 bytes Desc: pastedImage.png URL: From bakkari.abdelkhalek at hotmail.fr Wed Mar 16 06:18:57 2016 From: bakkari.abdelkhalek at hotmail.fr (Abdelkhalek Bakkari) Date: Wed, 16 Mar 2016 11:18:57 +0100 Subject: [ITK-users] Saving results .dcm files Message-ID: Hi ! I am looking for saving the results of ITK as .dcm files for a 3D image.Any help ! Any suggestion ! please. Best regards, Abdelkhalek BakkariPh.D candidate in Computer ScienceInstitute of Applied Computer ScienceLodz University of Technology, Poland -------------- next part -------------- An HTML attachment was scrubbed... URL: From kiran.j88 at gmail.com Wed Mar 16 06:27:51 2016 From: kiran.j88 at gmail.com (Kiran Joshi) Date: Wed, 16 Mar 2016 10:27:51 +0000 Subject: [ITK-users] Saving results .dcm files In-Reply-To: References: Message-ID: Hi Abdelkhalek, Examples can be found in Chapter 1 of Book 2 of the ITK Software guide: http://www.itk.org/ItkSoftwareGuide.pdf See page 340 of the pdf. You can find the full source code for the examples on the ITK Doxygen pages, e.g.: http://www.itk.org/Doxygen/html/Examples_2IO_2DicomSeriesReadSeriesWrite_8cxx-example.html And there are more examples on the ITK wiki, e.g.: http://itk.org/Wiki/ITK/Examples/DICOM/ResampleDICOM Regards, Kiran On Wed, 16 Mar 2016 at 10:19 Abdelkhalek Bakkari < bakkari.abdelkhalek at hotmail.fr> wrote: > > Hi ! > > I am looking for saving the results of ITK as .dcm files for a 3D image. > Any help ! Any suggestion ! please. > > Best regards, > > Abdelkhalek Bakkari > Ph.D candidate in Computer Science > Institute of Applied Computer Science > Lodz University of Technology, Poland > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 bakkari.abdelkhalek at hotmail.fr Wed Mar 16 08:33:07 2016 From: bakkari.abdelkhalek at hotmail.fr (Abdelkhalek Bakkari) Date: Wed, 16 Mar 2016 13:33:07 +0100 Subject: [ITK-users] Saving results .dcm files In-Reply-To: References: , Message-ID: I tried to write the following code : /////////////////// Begin Dicom Writer ReaderType::Pointer reader = ReaderType::New(); ImageIOType::Pointer gdcmIO = ImageIOType::New(); NamesGeneratorType::Pointer namesGenerator = NamesGeneratorType::New(); itksys::SystemTools::MakeDirectory( "slic" ); SeriesWriterType::Pointer seriesWriter = SeriesWriterType::New(); seriesWriter->SetInput( reader->GetOutput() ); seriesWriter->SetImageIO( gdcmIO ); namesGenerator->SetOutputDirectory("slic"); seriesWriter->SetFileNames( namesGenerator->GetOutputFileNames()); seriesWriter->SetMetaDataDictionaryArray( reader->GetMetaDataDictionaryArray() ); ////////////////// End Dicom Writer Some errors appear : c:\itk 4.8.1\source\modules\core\common\include\itkImportImageContainer.hxx(184): error C2248: 'itk::Image::~Image' : cannot access protected member declared in class 'itk::Image'2> with2> [2> TPixel=InputPixelType,2> VImageDimension=22> ]2> C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(279) : see declaration of 'itk::Image::~Image'2> with2> [2> TPixel=InputPixelType,2> VImageDimension=22> ]2>c:\itk 4.8.1\source\modules\core\common\include\itkImportImageContainer.hxx(188): error C2248: 'itk::Image::Image' : cannot access protected member declared in class 'itk::Image'2> with2> [2> TPixel=InputPixelType,2> VImageDimension=22> ]2> C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(276) : see declaration of 'itk::Image::Image'2> with2> [2> TPixel=InputPixelType,2> VImageDimension=22> ]2>c:\itk 4.8.1\source\modules\core\common\include\itkImportImageContainer.hxx(188): error C2248: 'itk::Image::~Image' : cannot access protected member declared in class 'itk::Image'2> with2> [2> TPixel=InputPixelType,2> VImageDimension=22> ]2> C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(279) : see declaration of 'itk::Image::~Image'2> with2> [2> TPixel=InputPixelType,2> VImageDimension=22> ]2>c:\itk 4.8.1\source\modules\core\common\include\itkImportImageContainer.hxx(213): error C2248: 'itk::Image::~Image' : cannot access protected member declared in class 'itk::Image'2> with2> [2> TPixel=InputPixelType,2> VImageDimension=22> ]2> C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(294) : compiler has generated 'itk::Image::~Image' here2> with2> [2> TPixel=InputPixelType,2> VImageDimension=22> ]2> c:\itk 4.8.1\source\modules\core\common\include\itkImportImageContainer.hxx(209) : while compiling class template member function 'void itk::ImportImageContainer::DeallocateManagedMemory(void)'2> with2> [2> TElementIdentifier=unsigned long,2> TElement=itk::Image2> ]2>c:\itk 4.8.1\source\modules\core\common\include\itkImage.hxx(151): error C2248: 'itk::Image::Image' : cannot access protected member declared in class 'itk::Image'2> with2> [2> TPixel=InputPixelType,2> VImageDimension=22> ]2> C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(276) : see declaration of 'itk::Image::Image'2> with2> [2> TPixel=InputPixelType,2> VImageDimension=22> ]2> c:\itk 4.8.1\source\modules\core\common\include\itkImage.hxx(148) : while compiling class template member function 'unsigned int itk::Image::GetNumberOfComponentsPerPixel(void) const'2> with2> [2> TPixel=OutputImageType,2> VImageDimension=22> ]2>c:\itk 4.8.1\source\modules\core\common\include\itkImage.hxx(151): error C2248: 'itk::Image::~Image' : cannot access protected member declared in class 'itk::Image'2> with2> [2> TPixel=InputPixelType,2> VImageDimension=22> ]2> C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(279) : see declaration of 'itk::Image::~Image'2> with2> [2> TPixel=InputPixelType,2> VImageDimension=22> ] Abdelkhalek BakkariPh.D candidate in Computer ScienceInstitute of Applied Computer ScienceLodz University of Technology, Poland From: kiran.j88 at gmail.com Date: Wed, 16 Mar 2016 10:27:51 +0000 Subject: Re: [ITK-users] Saving results .dcm files To: bakkari.abdelkhalek at hotmail.fr; insight-users at itk.org Hi Abdelkhalek, Examples can be found in Chapter 1 of Book 2 of the ITK Software guide:http://www.itk.org/ItkSoftwareGuide.pdf See page 340 of the pdf. You can find the full source code for the examples on the ITK Doxygen pages, e.g.:http://www.itk.org/Doxygen/html/Examples_2IO_2DicomSeriesReadSeriesWrite_8cxx-example.html And there are more examples on the ITK wiki, e.g.: http://itk.org/Wiki/ITK/Examples/DICOM/ResampleDICOM Regards,Kiran On Wed, 16 Mar 2016 at 10:19 Abdelkhalek Bakkari wrote: Hi ! I am looking for saving the results of ITK as .dcm files for a 3D image.Any help ! Any suggestion ! please. Best regards, Abdelkhalek BakkariPh.D candidate in Computer ScienceInstitute of Applied Computer ScienceLodz University of Technology, Poland _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 dzenanz at gmail.com Wed Mar 16 15:26:53 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Wed, 16 Mar 2016 15:26:53 -0400 Subject: [ITK-users] Saving results .dcm files In-Reply-To: References: Message-ID: Hi Abdelkhalek, the problem does not seem to be there. The attached example compiles fine for me. Regards, D?enan On Wed, Mar 16, 2016 at 8:33 AM, Abdelkhalek Bakkari wrote: > I tried to write the following code : > > > /////////////////// Begin Dicom Writer > > ReaderType::Pointer reader = ReaderType::New(); > ImageIOType::Pointer gdcmIO = ImageIOType::New(); > NamesGeneratorType::Pointer namesGenerator = NamesGeneratorType::New(); > > itksys::SystemTools::MakeDirectory( "slic" ); > SeriesWriterType::Pointer seriesWriter = SeriesWriterType::New(); > seriesWriter->SetInput( reader->GetOutput() ); > seriesWriter->SetImageIO( gdcmIO ); > namesGenerator->SetOutputDirectory("slic"); > seriesWriter->SetFileNames( namesGenerator->GetOutputFileNames()); > seriesWriter->SetMetaDataDictionaryArray( > reader->GetMetaDataDictionaryArray() ); > > ////////////////// End Dicom Writer > > Some errors appear : > > c:\itk > 4.8.1\source\modules\core\common\include\itkImportImageContainer.hxx(184): > error C2248: 'itk::Image::~Image' : cannot access > protected member declared in class 'itk::Image' > 2> with > 2> [ > 2> TPixel=InputPixelType, > 2> VImageDimension=2 > 2> ] > 2> C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(279) > : see declaration of 'itk::Image::~Image' > 2> with > 2> [ > 2> TPixel=InputPixelType, > 2> VImageDimension=2 > 2> ] > 2>c:\itk > 4.8.1\source\modules\core\common\include\itkImportImageContainer.hxx(188): > error C2248: 'itk::Image::Image' : cannot access > protected member declared in class 'itk::Image' > 2> with > 2> [ > 2> TPixel=InputPixelType, > 2> VImageDimension=2 > 2> ] > 2> C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(276) > : see declaration of 'itk::Image::Image' > 2> with > 2> [ > 2> TPixel=InputPixelType, > 2> VImageDimension=2 > 2> ] > 2>c:\itk > 4.8.1\source\modules\core\common\include\itkImportImageContainer.hxx(188): > error C2248: 'itk::Image::~Image' : cannot access > protected member declared in class 'itk::Image' > 2> with > 2> [ > 2> TPixel=InputPixelType, > 2> VImageDimension=2 > 2> ] > 2> C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(279) > : see declaration of 'itk::Image::~Image' > 2> with > 2> [ > 2> TPixel=InputPixelType, > 2> VImageDimension=2 > 2> ] > 2>c:\itk > 4.8.1\source\modules\core\common\include\itkImportImageContainer.hxx(213): > error C2248: 'itk::Image::~Image' : cannot access > protected member declared in class 'itk::Image' > 2> with > 2> [ > 2> TPixel=InputPixelType, > 2> VImageDimension=2 > 2> ] > 2> C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(294) > : compiler has generated 'itk::Image::~Image' here > 2> with > 2> [ > 2> TPixel=InputPixelType, > 2> VImageDimension=2 > 2> ] > 2> c:\itk > 4.8.1\source\modules\core\common\include\itkImportImageContainer.hxx(209) : > while compiling class template member function 'void > itk::ImportImageContainer::DeallocateManagedMemory(void)' > 2> with > 2> [ > 2> TElementIdentifier=unsigned long, > 2> TElement=itk::Image > 2> ] > 2>c:\itk 4.8.1\source\modules\core\common\include\itkImage.hxx(151): error > C2248: 'itk::Image::Image' : cannot access protected > member declared in class 'itk::Image' > 2> with > 2> [ > 2> TPixel=InputPixelType, > 2> VImageDimension=2 > 2> ] > 2> C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(276) > : see declaration of 'itk::Image::Image' > 2> with > 2> [ > 2> TPixel=InputPixelType, > 2> VImageDimension=2 > 2> ] > 2> c:\itk > 4.8.1\source\modules\core\common\include\itkImage.hxx(148) : while compiling > class template member function 'unsigned int > itk::Image::GetNumberOfComponentsPerPixel(void) > const' > 2> with > 2> [ > 2> TPixel=OutputImageType, > 2> VImageDimension=2 > 2> ] > 2>c:\itk 4.8.1\source\modules\core\common\include\itkImage.hxx(151): error > C2248: 'itk::Image::~Image' : cannot access > protected member declared in class 'itk::Image' > 2> with > 2> [ > 2> TPixel=InputPixelType, > 2> VImageDimension=2 > 2> ] > 2> C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(279) > : see declaration of 'itk::Image::~Image' > 2> with > 2> [ > 2> TPixel=InputPixelType, > 2> VImageDimension=2 > 2> ] > > Abdelkhalek Bakkari > Ph.D candidate in Computer Science > Institute of Applied Computer Science > Lodz University of Technology, Poland > > > > > ________________________________ > From: kiran.j88 at gmail.com > Date: Wed, 16 Mar 2016 10:27:51 +0000 > Subject: Re: [ITK-users] Saving results .dcm files > To: bakkari.abdelkhalek at hotmail.fr; insight-users at itk.org > > > Hi Abdelkhalek, > > Examples can be found in Chapter 1 of Book 2 of the ITK Software guide: > http://www.itk.org/ItkSoftwareGuide.pdf > See page 340 of the pdf. > > You can find the full source code for the examples on the ITK Doxygen pages, > e.g.: > http://www.itk.org/Doxygen/html/Examples_2IO_2DicomSeriesReadSeriesWrite_8cxx-example.html > > And there are more examples on the ITK wiki, e.g.: > http://itk.org/Wiki/ITK/Examples/DICOM/ResampleDICOM > > Regards, > Kiran > > > On Wed, 16 Mar 2016 at 10:19 Abdelkhalek Bakkari > wrote: > > > Hi ! > > I am looking for saving the results of ITK as .dcm files for a 3D image. > Any help ! Any suggestion ! please. > > Best regards, > > Abdelkhalek Bakkari > Ph.D candidate in Computer Science > Institute of Applied Computer Science > Lodz University of Technology, Poland > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 -------------- A non-text attachment was scrubbed... Name: tester.cpp Type: text/x-c++src Size: 1024 bytes Desc: not available URL: From maudette at odu.edu Wed Mar 16 14:56:36 2016 From: maudette at odu.edu (Audette, Michel A.) Date: Wed, 16 Mar 2016 18:56:36 +0000 Subject: [ITK-users] =?windows-1252?q?Research_Topic_=96_Frontiers_in_Comp?= =?windows-1252?q?uter-aided_therapy_of_the_central_and_peripheral_nervous?= =?windows-1252?q?_systems?= In-Reply-To: References: , Message-ID: Dear ITK users and community, please consider submitting to the upcoming Frontiers Research Topic below. Research Topic ? Frontiers in Computer-aided therapy of the central and peripheral nervous systems Submission Deadlines 29 April 2016 Abstract 28 October 2016 Manuscript Topic Editors Justin Schultz Cetas, M.D. Oregon Health & Science University Michel Audette, Ph.D., Old Dominion University Norfolk, USA Computer assistance technologies have revolutionized neurosurgical practice by building on advances in medical imaging, medical image analysis, surgical navigation, robotics and simulation. Moreover, computer-aided neurological surgery and therapy, defined in a broad sense, are continuing to make great strides, which has an impact on the outcome of patients afflicted with myriad disorders of the central nervous system (CNS) and peripheral nervous system (PNS). This research topic will address clinically transformative neurological therapies that center on the CNS and PNS. In a manner that befits the multidisciplinary challenges that characterize these innovations, the editors and contributors to this online publication will be both physicians and engineers. While there may be overlap with other online publications, including Frontiers journals, the emphasis will be on the practical improvement on patient outcome through technological advances on therapies targeting the CNS and PNS. These research topics will include the following areas: ? Descriptive surgery planning and navigation, which in particular improve on commercially available technologies. ? Surgical robotics that center on stable, accurate delivery of therapies to the CNS or PNS. ? Medical simulation for training and device development, with an emphasis on therapies of the CNS and PNS. ? Innovations in medical imaging that promise to transform how we visualize neuroanatomy, with a particular impact on neurological treatment. ? Medical image analysis algorithms with a transformative impact on neurological surgery and therapy. ? Computer-assisted radiation therapy targeting the nervous system. While these topics may seem diverse, in reality they are all facets of a similar thrust in Neurosurgery to combine rapidly improving imaging modalities with powerful and expanding computing power to model, plan and treat neurological disease through smaller surgical corridors and less morbidity to surrounding structures such as blood vessels, functional brain, fiber tracts cranial nerves and so forth. Another way to phrase the overarching theme is that the application of computers to neurosurgery will allow us to plan and treat individual patients based on their unique functional anatomy and thereby reduce surgical morbidity and improve outcomes. Combining these different applications of computer assistance technologies in one place will, hopefully, allow for cross-fertilization across disciplines. Best wishes, Michel Michel Audette, Ph.D. Assistant Professor, Department of Modeling, Simulation and Visualization Engineering, Old Dominion University, Norfolk, VA. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ljzijp at gmail.com Wed Mar 16 16:32:03 2016 From: ljzijp at gmail.com (Lambert Zijp) Date: Wed, 16 Mar 2016 21:32:03 +0100 Subject: [ITK-users] How to determine PixelType of itk::Image In-Reply-To: References: Message-ID: Hi D?enan, Thank you, you have been very helpful. I opted for the 'bloated' version, and it works. It's just a pity that the caller of the conversion function needs to know what type of image is to be converted. In order to convert a 3D deformation vector field, the caller needs to say: rc = ItkToAvs, 3>(ppAvsVectorField, pItkVectorField); (The prototype of ItkToAvs is given in the first post of this thread) On other words, the caller needs to know that such an image is 3D and contains float triplet pixels. Is there a way that the compiler works this out? Greetings, Lambert On Tue, Mar 15, 2016 at 8:49 PM, D?enan Zuki? wrote: > Hi Lambert, > > a 'general' interface cannot be made. You are not the first to face this > issue. One way is to do if/else for all the supported cases. Another way is > to define some template function or helper class, and then let compiler > take care of type matching. But indeed, the code is either bloated (version > one) or somewhat exotic (version two). > > RGB image can be stored either way. You can have itk::Image with 3 > dimensions x,y,color (consecutive color planes) or > itk::Image, 2> (consecutive triplets). It depends on > your treatment. I believe that consecutive triplets is more common. > > Regards, > D?enan > > On Tue, Mar 15, 2016 at 3:39 PM, Lambert Zijp wrote: > >> Hi D?enan, >> >> Haha, true enough, ItkToAvs would have to return an errorcode >> 'unsupported'. Yes, pixelspacing and origin can be retrieved. Also the >> size of each dimension, though that took me a while: it was well hidden. >> Still, it is very frustrating that it cannot be determined from >> itk::image whether it is an ordinary, commonly occurring image like an BGR >> ARGB or a 3-vector float image. >> At least, that is what I gather from your answer: a 'general' interface >> to other image processing libraries cannot be made! >> >> Am I the first person having problems with this? >> How is an RGB image stored in itk, as consecutive triplets or as >> consecutive color-planes. >> >> Greetings, >> Lambert >> >> On Tue, Mar 15, 2016 at 7:57 PM, D?enan Zuki? wrote: >> >>> Yes, it knows. Using something like this: >>> >>> template >>> void ItkToAvs(AVSfield** ppAvs, typename ImageType::Pointer image) >>> { >>> typename ImageType::PixelType *pixelPointer=image->GetBufferPointer(); >>> unsigned int dimension=ImageType::ImageDimension; >>> //the rest of conversion code >>> } >>> >>> However, ImageType::PixelType can be arbitrary type. Consider this: >>> class myClass {int a; complex c; string sRep;}; >>> typedef itk::Image ImageType; >>> ItkToAvs(ppAvs, image); >>> >>> What do you expect ItkToAvs to do? >>> >>> Regards, >>> D?enan >>> >>> On Tue, Mar 15, 2016 at 2:53 PM, Lambert Zijp wrote: >>> >>>> This is all very confusing to me. In the FileWriter example, the caller *already >>>> knows* what the IOComponentType >>>> and >>>> what the IOPixelType >>>> of >>>> the itk::Image is (it is hard-coded; not retrieved from the itk::Image). >>>> The same holds for the reader: it gets that information from the file. >>>> I want to make a general function that takes *ANY* itk::Image as >>>> input, and converts it to an AVS datasructure (which supports all of them). >>>> So I need to get the information from itk::Image. >>>> Is there a way to get it from itk::Image? Or is it true that an >>>> itk::Image does not know what it actually is/represents? >>>> >>>> On Tue, Mar 15, 2016 at 7:07 PM, D?enan Zuki? >>>> wrote: >>>> >>>>> If I remember correctly, using this >>>>> >>>>> approach you can also get number of components with something like: >>>>> imageIO->GetNumberOfComponents(); >>>>> You can take a look at class documentation >>>>> for >>>>> more details. >>>>> >>>>> On Tue, Mar 15, 2016 at 1:09 PM, Lambert Zijp >>>>> wrote: >>>>> >>>>>> I'm still not sure how to handle vector images. D?enan gave an >>>>>> example of an RGB image. That would be a 3-vector unsigned char pixeltype. >>>>>> Would I have to write out in those *'if **(**typeid(ValueType) == >>>>>> ???)'* statements all permutations of the number of vectors and the >>>>>> type? Or is there a way to separate the number of vectors and the pixeltype? >>>>>> How are vector images stored in memory in ITK. In an RGB image for >>>>>> example, are the pixels consecutive triplets, or is the image stored as >>>>>> three consecutive color planes? >>>>>> I'm particular interested in 3D displacement vector fields, that are >>>>>> the result of deformable registration. >>>>>> >>>>>> >>>>>> On Tue, Mar 15, 2016 at 5:22 PM, Bill Lorensen < >>>>>> bill.lorensen at gmail.com> wrote: >>>>>> >>>>>>> This example may help >>>>>>> http://www.vtk.org/Wiki/ITK/Examples/IO/ReadUnknownImageType >>>>>>> On Mar 15, 2016 8:44 AM, "D?enan Zuki?" wrote: >>>>>>> >>>>>>>> Of course it complained, switch statement is for integral types (if >>>>>>>> I remember correctly). >>>>>>>> >>>>>>>> Regards >>>>>>>> >>>>>>>> On Tue, Mar 15, 2016 at 11:39 AM, Lambert Zijp >>>>>>>> wrote: >>>>>>>> >>>>>>>>> Hi D?enan, >>>>>>>>> >>>>>>>>> Thank you very much! >>>>>>>>> Visual Studio 9 does not recognize decltype(), but typeid() >>>>>>>>> worked fine. At least, when you make separate if statements, like you did >>>>>>>>> in your example. When tried to use it in a switch statement, the compiler >>>>>>>>> complained. >>>>>>>>> >>>>>>>>> Greetings, >>>>>>>>> Lambert >>>>>>>>> >>>>>>>>> >>>>>>>>> On Tue, Mar 15, 2016 at 2:47 PM, D?enan Zuki? >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> Hi Lambert, >>>>>>>>>> >>>>>>>>>> the classic way is using a bunch of if-else's. >>>>>>>>>> >>>>>>>>>> if (decltype(ValueType)==decltype(int)) >>>>>>>>>> { >>>>>>>>>> //int specific processing >>>>>>>>>> } >>>>>>>>>> else if (decltype(ValueType)==decltype(itk::RGB)) >>>>>>>>>> { >>>>>>>>>> //RGB specific processing >>>>>>>>>> } >>>>>>>>>> ?else if ...? >>>>>>>>>> >>>>>>>>>> ?If you can't use C++11's decltype then use typeid from >>>>>>>>>> ? header. >>>>>>>>>> >>>>>>>>>> Regards, >>>>>>>>>> D?enan >>>>>>>>>> >>>>>>>>>> On Tue, Mar 15, 2016 at 5:48 AM, Lambert Zijp >>>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>>> I want to write a function that converts an arbitrary ITK image >>>>>>>>>>> to another format (AVS in my case). >>>>>>>>>>> It has been suggested that following functionprototype could de >>>>>>>>>>> the job: >>>>>>>>>>> template >>>>>>>>>>> int ItkToAvs(AVSfield** ppAvs, typename >>>>>>>>>>> itk::Image::Pointer pItkImage); >>>>>>>>>>> >>>>>>>>>>> Now I want to know whether ValueType equals unsigned char or >>>>>>>>>>> short or int etc. Also whether the pixels are single numbers or vectors. >>>>>>>>>>> How does one do that? >>>>>>>>>>> >>>>>>>>>>> Greetings, >>>>>>>>>>> Lambert >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> _____________________________________ >>>>>>>>>>> Powered by www.kitware.com >>>>>>>>>>> >>>>>>>>>>> Visit other Kitware open-source projects at >>>>>>>>>>> http://www.kitware.com/opensource/opensource.html >>>>>>>>>>> >>>>>>>>>>> Kitware offers ITK Training Courses, for more information visit: >>>>>>>>>>> http://www.kitware.com/products/protraining.php >>>>>>>>>>> >>>>>>>>>>> Please keep messages on-topic and check the ITK FAQ at: >>>>>>>>>>> http://www.itk.org/Wiki/ITK_FAQ >>>>>>>>>>> >>>>>>>>>>> Follow this link to subscribe/unsubscribe: >>>>>>>>>>> http://public.kitware.com/mailman/listinfo/insight-users >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> _____________________________________ >>>>>>>> Powered by www.kitware.com >>>>>>>> >>>>>>>> Visit other Kitware open-source projects at >>>>>>>> http://www.kitware.com/opensource/opensource.html >>>>>>>> >>>>>>>> Kitware offers ITK Training Courses, for more information visit: >>>>>>>> http://www.kitware.com/products/protraining.php >>>>>>>> >>>>>>>> Please keep messages on-topic and check the ITK FAQ at: >>>>>>>> http://www.itk.org/Wiki/ITK_FAQ >>>>>>>> >>>>>>>> Follow this link to subscribe/unsubscribe: >>>>>>>> http://public.kitware.com/mailman/listinfo/insight-users >>>>>>>> >>>>>>>> >>>>>> >>>>> >>>> >>>> _____________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Kitware offers ITK Training Courses, for more information visit: >>>> http://www.kitware.com/products/protraining.php >>>> >>>> Please keep messages on-topic and check the ITK FAQ at: >>>> http://www.itk.org/Wiki/ITK_FAQ >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/insight-users >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dzenanz at gmail.com Wed Mar 16 16:44:39 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Wed, 16 Mar 2016 16:44:39 -0400 Subject: [ITK-users] How to determine PixelType of itk::Image In-Reply-To: References: Message-ID: Hi Lambert, that is a limitation which has annoyed me for quite some time. I frequently have: template< typename TImage > void WriteDebug(typename TImage::Pointer out, const char *filename) { typedef ImageFileWriter WriterType; typename WriterType::Pointer w = WriterType::New(); w->SetInput(out); w->SetFileName(filename); try { w->Update(); } catch (ExceptionObject & error) { std::cerr << "Error: " << error << std::endl; } } I have not figured out a better way to invoke this function than this: typedef itk::Image ImageType; //defined somewhere, once WriteDebug(step3, "C:\\step3.nrrd"); //ImageType used many times over Regards, D?enan On Wed, Mar 16, 2016 at 4:32 PM, Lambert Zijp wrote: > Hi D?enan, > > Thank you, you have been very helpful. I opted for the 'bloated' version, > and it works. It's just a pity that the caller of the conversion function > needs to know what type of image is to be converted. In order to convert a > 3D deformation vector field, the caller needs to say: > rc = ItkToAvs, 3>(ppAvsVectorField, > pItkVectorField); > (The prototype of ItkToAvs is given in the first post of this thread) > On other words, the caller needs to know that such an image is 3D and > contains float triplet pixels. Is there a way that the compiler works this > out? > > Greetings, > Lambert > > > On Tue, Mar 15, 2016 at 8:49 PM, D?enan Zuki? wrote: >> >> Hi Lambert, >> >> a 'general' interface cannot be made. You are not the first to face this >> issue. One way is to do if/else for all the supported cases. Another way is >> to define some template function or helper class, and then let compiler take >> care of type matching. But indeed, the code is either bloated (version one) >> or somewhat exotic (version two). >> >> RGB image can be stored either way. You can have itk::Image with 3 >> dimensions x,y,color (consecutive color planes) or >> itk::Image, 2> (consecutive triplets). It depends on >> your treatment. I believe that consecutive triplets is more common. >> >> Regards, >> D?enan >> >> On Tue, Mar 15, 2016 at 3:39 PM, Lambert Zijp wrote: >>> >>> Hi D?enan, >>> >>> Haha, true enough, ItkToAvs would have to return an errorcode >>> 'unsupported'. Yes, pixelspacing and origin can be retrieved. Also the size >>> of each dimension, though that took me a while: it was well hidden. >>> Still, it is very frustrating that it cannot be determined from >>> itk::image whether it is an ordinary, commonly occurring image like an BGR >>> ARGB or a 3-vector float image. >>> At least, that is what I gather from your answer: a 'general' interface >>> to other image processing libraries cannot be made! >>> >>> Am I the first person having problems with this? >>> How is an RGB image stored in itk, as consecutive triplets or as >>> consecutive color-planes. >>> >>> Greetings, >>> Lambert >>> >>> On Tue, Mar 15, 2016 at 7:57 PM, D?enan Zuki? wrote: >>>> >>>> Yes, it knows. Using something like this: >>>> >>>> template >>>> void ItkToAvs(AVSfield** ppAvs, typename ImageType::Pointer image) >>>> { >>>> typename ImageType::PixelType *pixelPointer=image->GetBufferPointer(); >>>> unsigned int dimension=ImageType::ImageDimension; >>>> //the rest of conversion code >>>> } >>>> >>>> However, ImageType::PixelType can be arbitrary type. Consider this: >>>> class myClass {int a; complex c; string sRep;}; >>>> typedef itk::Image ImageType; >>>> ItkToAvs(ppAvs, image); >>>> >>>> What do you expect ItkToAvs to do? >>>> >>>> Regards, >>>> D?enan >>>> >>>> On Tue, Mar 15, 2016 at 2:53 PM, Lambert Zijp wrote: >>>>> >>>>> This is all very confusing to me. In the FileWriter example, the caller >>>>> already knows what the IOComponentType and what the IOPixelType of the >>>>> itk::Image is (it is hard-coded; not retrieved from the itk::Image). The >>>>> same holds for the reader: it gets that information from the file. >>>>> I want to make a general function that takes ANY itk::Image as input, >>>>> and converts it to an AVS datasructure (which supports all of them). So I >>>>> need to get the information from itk::Image. >>>>> Is there a way to get it from itk::Image? Or is it true that an >>>>> itk::Image does not know what it actually is/represents? >>>>> >>>>> On Tue, Mar 15, 2016 at 7:07 PM, D?enan Zuki? >>>>> wrote: >>>>>> >>>>>> If I remember correctly, using this approach you can also get number >>>>>> of components with something like: >>>>>> imageIO->GetNumberOfComponents(); >>>>>> You can take a look at class documentation for more details. >>>>>> >>>>>> On Tue, Mar 15, 2016 at 1:09 PM, Lambert Zijp >>>>>> wrote: >>>>>>> >>>>>>> I'm still not sure how to handle vector images. D?enan gave an >>>>>>> example of an RGB image. That would be a 3-vector unsigned char pixeltype. >>>>>>> Would I have to write out in those 'if (typeid(ValueType) == ???)' >>>>>>> statements all permutations of the number of vectors and the type? Or is >>>>>>> there a way to separate the number of vectors and the pixeltype? >>>>>>> How are vector images stored in memory in ITK. In an RGB image for >>>>>>> example, are the pixels consecutive triplets, or is the image stored as >>>>>>> three consecutive color planes? >>>>>>> I'm particular interested in 3D displacement vector fields, that are >>>>>>> the result of deformable registration. >>>>>>> >>>>>>> >>>>>>> On Tue, Mar 15, 2016 at 5:22 PM, Bill Lorensen >>>>>>> wrote: >>>>>>>> >>>>>>>> This example may help >>>>>>>> http://www.vtk.org/Wiki/ITK/Examples/IO/ReadUnknownImageType >>>>>>>> >>>>>>>> On Mar 15, 2016 8:44 AM, "D?enan Zuki?" wrote: >>>>>>>>> >>>>>>>>> Of course it complained, switch statement is for integral types (if >>>>>>>>> I remember correctly). >>>>>>>>> >>>>>>>>> Regards >>>>>>>>> >>>>>>>>> On Tue, Mar 15, 2016 at 11:39 AM, Lambert Zijp >>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>> Hi D?enan, >>>>>>>>>> >>>>>>>>>> Thank you very much! >>>>>>>>>> Visual Studio 9 does not recognize decltype(), but typeid() worked >>>>>>>>>> fine. At least, when you make separate if statements, like you did in your >>>>>>>>>> example. When tried to use it in a switch statement, the compiler >>>>>>>>>> complained. >>>>>>>>>> >>>>>>>>>> Greetings, >>>>>>>>>> Lambert >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Tue, Mar 15, 2016 at 2:47 PM, D?enan Zuki? >>>>>>>>>> wrote: >>>>>>>>>>> >>>>>>>>>>> Hi Lambert, >>>>>>>>>>> >>>>>>>>>>> the classic way is using a bunch of if-else's. >>>>>>>>>>> >>>>>>>>>>> if (decltype(ValueType)==decltype(int)) >>>>>>>>>>> { >>>>>>>>>>> //int specific processing >>>>>>>>>>> } >>>>>>>>>>> else if (decltype(ValueType)==decltype(itk::RGB)) >>>>>>>>>>> { >>>>>>>>>>> //RGB specific processing >>>>>>>>>>> } >>>>>>>>>>> else if ... >>>>>>>>>>> >>>>>>>>>>> If you can't use C++11's decltype then use typeid from >>>>>>>>>>> header. >>>>>>>>>>> >>>>>>>>>>> Regards, >>>>>>>>>>> D?enan >>>>>>>>>>> >>>>>>>>>>> On Tue, Mar 15, 2016 at 5:48 AM, Lambert Zijp >>>>>>>>>>> wrote: >>>>>>>>>>>> >>>>>>>>>>>> I want to write a function that converts an arbitrary ITK image >>>>>>>>>>>> to another format (AVS in my case). >>>>>>>>>>>> It has been suggested that following functionprototype could de >>>>>>>>>>>> the job: >>>>>>>>>>>> template >>>>>>>>>>>> int ItkToAvs(AVSfield** ppAvs, typename >>>>>>>>>>>> itk::Image::Pointer pItkImage); >>>>>>>>>>>> >>>>>>>>>>>> Now I want to know whether ValueType equals unsigned char or >>>>>>>>>>>> short or int etc. Also whether the pixels are single numbers or vectors. How >>>>>>>>>>>> does one do that? >>>>>>>>>>>> >>>>>>>>>>>> Greetings, >>>>>>>>>>>> Lambert >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> _____________________________________ >>>>>>>>>>>> Powered by www.kitware.com >>>>>>>>>>>> >>>>>>>>>>>> Visit other Kitware open-source projects at >>>>>>>>>>>> http://www.kitware.com/opensource/opensource.html >>>>>>>>>>>> >>>>>>>>>>>> Kitware offers ITK Training Courses, for more information visit: >>>>>>>>>>>> http://www.kitware.com/products/protraining.php >>>>>>>>>>>> >>>>>>>>>>>> Please keep messages on-topic and check the ITK FAQ at: >>>>>>>>>>>> http://www.itk.org/Wiki/ITK_FAQ >>>>>>>>>>>> >>>>>>>>>>>> Follow this link to subscribe/unsubscribe: >>>>>>>>>>>> http://public.kitware.com/mailman/listinfo/insight-users >>>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> _____________________________________ >>>>>>>>> Powered by www.kitware.com >>>>>>>>> >>>>>>>>> Visit other Kitware open-source projects at >>>>>>>>> http://www.kitware.com/opensource/opensource.html >>>>>>>>> >>>>>>>>> Kitware offers ITK Training Courses, for more information visit: >>>>>>>>> http://www.kitware.com/products/protraining.php >>>>>>>>> >>>>>>>>> Please keep messages on-topic and check the ITK FAQ at: >>>>>>>>> http://www.itk.org/Wiki/ITK_FAQ >>>>>>>>> >>>>>>>>> Follow this link to subscribe/unsubscribe: >>>>>>>>> http://public.kitware.com/mailman/listinfo/insight-users >>>>>>>>> >>>>>>> >>>>>> >>>>> >>>>> >>>>> _____________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Kitware offers ITK Training Courses, for more information visit: >>>>> http://www.kitware.com/products/protraining.php >>>>> >>>>> Please keep messages on-topic and check the ITK FAQ at: >>>>> http://www.itk.org/Wiki/ITK_FAQ >>>>> >>>>> Follow this link to subscribe/unsubscribe: >>>>> http://public.kitware.com/mailman/listinfo/insight-users >>>>> >>>> >>> >> > From matimontg at gmail.com Wed Mar 16 20:10:18 2016 From: matimontg at gmail.com (Matias Montroull) Date: Thu, 17 Mar 2016 00:10:18 +0000 Subject: [ITK-users] Saving results .dcm files In-Reply-To: References: Message-ID: try this: /*========================================================================= * * Copyright Insight Software Consortium * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * *=========================================================================*/ #include "itkGDCMImageIO.h" #include "itkNumericSeriesFileNames.h" #include "itkImageFileReader.h" #include "itkImageSeriesWriter.h" #include "itkMetaDataObject.h" #include #include "itksys/SystemTools.hxx" // Software Guide : BeginLatex // // This example illustrates how to read a 3D image from a non DICOM file and write it as a series of DICOM slices. // with some changed header information. Header // // Please note that modifying the content of a DICOM header is a very risky // operation. The Header contains fundamental information about the patient // and therefore its consistency must be protected from any data corruption. // Before attempting to modify the DICOM headers of your files, you must make // sure that you have a very good reason for doing so, and that you can ensure // that this information change will not result in a lower quality of health // care to be delivered to the patient. // // \index{DICOM!Writing Series} // // Software Guide : EndLatex int main( int argc, char* argv[] ) { if( argc < 3 ) { std::cerr << "Usage: " << argv[0]; std::cerr << " InputImage OutputDicomDirectory" << std::endl; return EXIT_FAILURE; } typedef signed short PixelType; const unsigned int Dimension = 3; typedef itk::Image< PixelType, Dimension > ImageType; typedef itk::ImageFileReader< ImageType > ReaderType; ReaderType::Pointer reader = ReaderType::New(); reader->SetFileName( argv[1] ); try { reader->Update(); } catch (itk::ExceptionObject &excp) { std::cerr << "Exception thrown while writing the image" << std::endl; std::cerr << excp << std::endl; return EXIT_FAILURE; } typedef itk::GDCMImageIO ImageIOType; typedef itk::NumericSeriesFileNames NamesGeneratorType; ImageIOType::Pointer gdcmIO = ImageIOType::New(); const char * outputDirectory = argv[2]; itksys::SystemTools::MakeDirectory( outputDirectory ); typedef signed short OutputPixelType; const unsigned int OutputDimension = 2; typedef itk::Image< OutputPixelType, OutputDimension > Image2DType; typedef itk::ImageSeriesWriter< ImageType, Image2DType > SeriesWriterType; NamesGeneratorType::Pointer namesGenerator = NamesGeneratorType::New(); itk::MetaDataDictionary & dict = gdcmIO->GetMetaDataDictionary(); std::string tagkey, value; tagkey = "0008|0060"; // Modality value = "MR"; itk::EncapsulateMetaData(dict, tagkey, value ); tagkey = "0008|0008"; // Image Type value = "DERIVED\\SECONDARY"; itk::EncapsulateMetaData(dict, tagkey, value); tagkey = "0008|0064"; // Conversion Type value = "DV"; itk::EncapsulateMetaData(dict, tagkey, value); SeriesWriterType::Pointer seriesWriter = SeriesWriterType::New(); seriesWriter->SetInput( reader->GetOutput() ); seriesWriter->SetImageIO( gdcmIO ); ImageType::RegionType region = reader->GetOutput()->GetLargestPossibleRegion(); ImageType::IndexType start = region.GetIndex(); ImageType::SizeType size = region.GetSize(); std::string format = outputDirectory; format += "/imagen%03d.dcm"; namesGenerator->SetSeriesFormat( format.c_str() ); namesGenerator->SetStartIndex( start[2] ); namesGenerator->SetEndIndex( start[2] + size[2] - 1 ); namesGenerator->SetIncrementIndex( 1 ); seriesWriter->SetFileNames( namesGenerator->GetFileNames() ); 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; } return EXIT_SUCCESS; } El mi?., 16 de mar. de 2016 a la(s) 16:27, D?enan Zuki? escribi?: > Hi Abdelkhalek, > > the problem does not seem to be there. The attached example compiles > fine for me. > > Regards, > D?enan > > On Wed, Mar 16, 2016 at 8:33 AM, Abdelkhalek Bakkari > wrote: > > I tried to write the following code : > > > > > > /////////////////// Begin Dicom Writer > > > > ReaderType::Pointer reader = ReaderType::New(); > > ImageIOType::Pointer gdcmIO = ImageIOType::New(); > > NamesGeneratorType::Pointer namesGenerator = NamesGeneratorType::New(); > > > > itksys::SystemTools::MakeDirectory( "slic" ); > > SeriesWriterType::Pointer seriesWriter = SeriesWriterType::New(); > > seriesWriter->SetInput( reader->GetOutput() ); > > seriesWriter->SetImageIO( gdcmIO ); > > namesGenerator->SetOutputDirectory("slic"); > > seriesWriter->SetFileNames( namesGenerator->GetOutputFileNames()); > > seriesWriter->SetMetaDataDictionaryArray( > > reader->GetMetaDataDictionaryArray() ); > > > > ////////////////// End Dicom Writer > > > > Some errors appear : > > > > c:\itk > > > 4.8.1\source\modules\core\common\include\itkImportImageContainer.hxx(184): > > error C2248: 'itk::Image::~Image' : cannot access > > protected member declared in class 'itk::Image' > > 2> with > > 2> [ > > 2> TPixel=InputPixelType, > > 2> VImageDimension=2 > > 2> ] > > 2> C:/ITK > 4.8.1/Source/Modules/Core/Common/include\itkImage.h(279) > > : see declaration of 'itk::Image::~Image' > > 2> with > > 2> [ > > 2> TPixel=InputPixelType, > > 2> VImageDimension=2 > > 2> ] > > 2>c:\itk > > > 4.8.1\source\modules\core\common\include\itkImportImageContainer.hxx(188): > > error C2248: 'itk::Image::Image' : cannot access > > protected member declared in class 'itk::Image' > > 2> with > > 2> [ > > 2> TPixel=InputPixelType, > > 2> VImageDimension=2 > > 2> ] > > 2> C:/ITK > 4.8.1/Source/Modules/Core/Common/include\itkImage.h(276) > > : see declaration of 'itk::Image::Image' > > 2> with > > 2> [ > > 2> TPixel=InputPixelType, > > 2> VImageDimension=2 > > 2> ] > > 2>c:\itk > > > 4.8.1\source\modules\core\common\include\itkImportImageContainer.hxx(188): > > error C2248: 'itk::Image::~Image' : cannot access > > protected member declared in class 'itk::Image' > > 2> with > > 2> [ > > 2> TPixel=InputPixelType, > > 2> VImageDimension=2 > > 2> ] > > 2> C:/ITK > 4.8.1/Source/Modules/Core/Common/include\itkImage.h(279) > > : see declaration of 'itk::Image::~Image' > > 2> with > > 2> [ > > 2> TPixel=InputPixelType, > > 2> VImageDimension=2 > > 2> ] > > 2>c:\itk > > > 4.8.1\source\modules\core\common\include\itkImportImageContainer.hxx(213): > > error C2248: 'itk::Image::~Image' : cannot access > > protected member declared in class 'itk::Image' > > 2> with > > 2> [ > > 2> TPixel=InputPixelType, > > 2> VImageDimension=2 > > 2> ] > > 2> C:/ITK > 4.8.1/Source/Modules/Core/Common/include\itkImage.h(294) > > : compiler has generated 'itk::Image::~Image' > here > > 2> with > > 2> [ > > 2> TPixel=InputPixelType, > > 2> VImageDimension=2 > > 2> ] > > 2> c:\itk > > > 4.8.1\source\modules\core\common\include\itkImportImageContainer.hxx(209) : > > while compiling class template member function 'void > > > itk::ImportImageContainer::DeallocateManagedMemory(void)' > > 2> with > > 2> [ > > 2> TElementIdentifier=unsigned long, > > 2> TElement=itk::Image > > 2> ] > > 2>c:\itk 4.8.1\source\modules\core\common\include\itkImage.hxx(151): > error > > C2248: 'itk::Image::Image' : cannot access > protected > > member declared in class 'itk::Image' > > 2> with > > 2> [ > > 2> TPixel=InputPixelType, > > 2> VImageDimension=2 > > 2> ] > > 2> C:/ITK > 4.8.1/Source/Modules/Core/Common/include\itkImage.h(276) > > : see declaration of 'itk::Image::Image' > > 2> with > > 2> [ > > 2> TPixel=InputPixelType, > > 2> VImageDimension=2 > > 2> ] > > 2> c:\itk > > 4.8.1\source\modules\core\common\include\itkImage.hxx(148) : while > compiling > > class template member function 'unsigned int > > itk::Image::GetNumberOfComponentsPerPixel(void) > > const' > > 2> with > > 2> [ > > 2> TPixel=OutputImageType, > > 2> VImageDimension=2 > > 2> ] > > 2>c:\itk 4.8.1\source\modules\core\common\include\itkImage.hxx(151): > error > > C2248: 'itk::Image::~Image' : cannot access > > protected member declared in class 'itk::Image' > > 2> with > > 2> [ > > 2> TPixel=InputPixelType, > > 2> VImageDimension=2 > > 2> ] > > 2> C:/ITK > 4.8.1/Source/Modules/Core/Common/include\itkImage.h(279) > > : see declaration of 'itk::Image::~Image' > > 2> with > > 2> [ > > 2> TPixel=InputPixelType, > > 2> VImageDimension=2 > > 2> ] > > > > Abdelkhalek Bakkari > > Ph.D candidate in Computer Science > > Institute of Applied Computer Science > > Lodz University of Technology, Poland > > > > > > > > > > ________________________________ > > From: kiran.j88 at gmail.com > > Date: Wed, 16 Mar 2016 10:27:51 +0000 > > Subject: Re: [ITK-users] Saving results .dcm files > > To: bakkari.abdelkhalek at hotmail.fr; insight-users at itk.org > > > > > > Hi Abdelkhalek, > > > > Examples can be found in Chapter 1 of Book 2 of the ITK Software guide: > > http://www.itk.org/ItkSoftwareGuide.pdf > > See page 340 of the pdf. > > > > You can find the full source code for the examples on the ITK Doxygen > pages, > > e.g.: > > > http://www.itk.org/Doxygen/html/Examples_2IO_2DicomSeriesReadSeriesWrite_8cxx-example.html > > > > And there are more examples on the ITK wiki, e.g.: > > http://itk.org/Wiki/ITK/Examples/DICOM/ResampleDICOM > > > > Regards, > > Kiran > > > > > > On Wed, 16 Mar 2016 at 10:19 Abdelkhalek Bakkari > > wrote: > > > > > > Hi ! > > > > I am looking for saving the results of ITK as .dcm files for a 3D image. > > Any help ! Any suggestion ! please. > > > > Best regards, > > > > Abdelkhalek Bakkari > > Ph.D candidate in Computer Science > > Institute of Applied Computer Science > > Lodz University of Technology, Poland > > > > > > _____________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Kitware offers ITK Training Courses, for more information visit: > > http://www.kitware.com/products/protraining.php > > > > Please keep messages on-topic and check the 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 > -- Matias -------------- next part -------------- An HTML attachment was scrubbed... URL: From bakkari.abdelkhalek at hotmail.fr Thu Mar 17 07:47:34 2016 From: bakkari.abdelkhalek at hotmail.fr (Abdelkhalek Bakkari) Date: Thu, 17 Mar 2016 12:47:34 +0100 Subject: [ITK-users] Comparaison metric using ITK 2D and 3D images Message-ID: Hi ! I would like to compare two images ((2D and 3D) results of two different approaches ) using accuracy and execution time. Any help ! please Kind regards, Abdelkhalek BakkariPh.D candidate in Computer ScienceInstitute of Applied Computer ScienceLodz University of Technology, Poland -------------- next part -------------- An HTML attachment was scrubbed... URL: From dzenanz at gmail.com Thu Mar 17 08:56:21 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Thu, 17 Mar 2016 08:56:21 -0400 Subject: [ITK-users] [ITK] Comparaison metric using ITK 2D and 3D images In-Reply-To: References: Message-ID: You can try testing::comparison or ?subtract and view the result to see the differences.? HTH, D?enan On Thu, Mar 17, 2016 at 7:47 AM, Abdelkhalek Bakkari < bakkari.abdelkhalek at hotmail.fr> wrote: > > Hi ! > > I would like to compare two images ((2D and 3D) results of two different > approaches ) using accuracy and execution time. > > Any help ! please > > > Kind regards, > > Abdelkhalek Bakkari > Ph.D candidate in Computer Science > Institute of Applied Computer Science > Lodz University of Technology, Poland > > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 lasso at queensu.ca Thu Mar 17 08:58:00 2016 From: lasso at queensu.ca (Andras Lasso) Date: Thu, 17 Mar 2016 12:58:00 +0000 Subject: [ITK-users] [ITK] BSpline transformation of Vector image In-Reply-To: <1457600097195-36860.post@n7.nabble.com> References: <1456067851174-36816.post@n7.nabble.com> <1457070677221-36841.post@n7.nabble.com> <1457600097195-36860.post@n7.nabble.com> Message-ID: I guess you haven't received response because the answer was too simple: resampling works exactly the same way for vector images as for scalar images. If you are not familiar with ITK enough to do it then you can just do it with a few clicks in 3D Slicer (www.slicer.org): drag-and-drop your vector image and displacement field (for the displacement field: choose to load is as Transform) into Slicer and use the Transforms module to apply the transform to the vector image. https://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Modules/Transforms Andras -----Original Message----- From: Community [mailto:community-bounces at itk.org] On Behalf Of artioml Sent: March 10, 2016 3:55 AM To: insight-users at itk.org Subject: Re: [ITK] [ITK-users] BSpline transformation of Vector image Hello Guys, Can you please let me know if you have never encountered such use of ITK. Maybe it is really complicated to achieve for ITK newbie as me. Because for now I had no progress and if it is very complicated and not standard thing to do in ITK I will probably give up on it. Thanks for your help! -- View this message in context: http://itk-users.7.n7.nabble.com/BSpline-transformation-of-Vector-image-tp36816p36860.html Sent from the ITK - Users mailing list archive at Nabble.com. _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users _______________________________________________ Community mailing list Community at itk.org http://public.kitware.com/mailman/listinfo/community From davis.vigneault at gmail.com Thu Mar 17 18:42:08 2016 From: davis.vigneault at gmail.com (DVigneault) Date: Thu, 17 Mar 2016 15:42:08 -0700 (MST) Subject: [ITK-users] Linker error when using Loop subdivision on Mac Message-ID: <1458254528724-7588625.post@n2.nabble.com> All-- I'm getting a linker error (undefined symbols for itk::NumericTraits::Zero) when compiling a simple program against the development branch of ITK on OS X 10.10.5 (Yosemite) with Module_SubdivisionQuadEdgeMesh ON. (I'm using the XCode toolchain compiler with c++11.) I only get this error on Mac--the same program compiles without a problem on Ubuntu 14.04. I tried a clean build of ITK but without luck. I went poking around itkNumericTraits.h, and the template specialization (including ::Zero) is defined right in the header, which is confusing. Any ideas what I might have done wrong? Best, --Davis ######### ## Source ## ######### #include #include typedef itk::QuadEdgeMesh< float, 3 > TMesh; typedef itk::LoopTriangleCellSubdivisionQuadEdgeMeshFilter< TMesh, TMesh > TLoop; int main() { TLoop::Pointer loop = TLoop::New(); return EXIT_SUCCESS; } ############## ## CMakeLists.txt ## ############## cmake_minimum_required(VERSION 2.8.12) project(dv-linker) set(ITK_DIR "~/Developer/ITK/bin") set(CMAKE_CXX_FLAGS "-std=c++11" CACHE STRING "cxx compiler flags" FORCE) set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -Wextra" CACHE STRING "cxx debug compiler flags" FORCE) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "build type" FORCE) find_package(ITK REQUIRED) include(${ITK_USE_FILE}) add_executable(dv-linker dv-linker.cxx) target_link_libraries(dv-linker ${ITK_LIBRARIES}) ############# ## Linker Error ## ############# $ make -- Configuring done -- Generating done -- Build files have been written to: /Users/Davis/Developer/BitBucket/oxford/examples/ITK/dv-linker/bin [ 50%] Linking CXX executable dv-linker Undefined symbols for architecture x86_64: "itk::NumericTraits::Zero", referenced from: itk::LoopTriangleCellSubdivisionQuadEdgeMeshFilter >, itk::QuadEdgeMesh > >::AddNewCellPoints(itk::CellInterface >, itk::MapContainer > >, std::__1::set, std::__1::allocator >, itk::GeometricalQuadEdge > >*) in dv-linker.cxx.o itk::LoopTriangleCellSubdivisionQuadEdgeMeshFilter >, itk::QuadEdgeMesh > >::SmoothingPoint(itk::QuadEdgeMeshPoint > const&, itk::MapContainer > > const*) in dv-linker.cxx.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [dv-linker] Error 1 make[1]: *** [CMakeFiles/dv-linker.dir/all] Error 2 make: *** [all] Error 2 -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Linker-error-when-using-Loop-subdivision-on-Mac-tp7588625.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From matt.mccormick at kitware.com Fri Mar 18 12:00:11 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Fri, 18 Mar 2016 12:00:11 -0400 Subject: [ITK-users] Linker error when using Loop subdivision on Mac In-Reply-To: <1458254528724-7588625.post@n2.nabble.com> References: <1458254528724-7588625.post@n2.nabble.com> Message-ID: Hi Davis, Please review this patch: http://review.source.kitware.com/#/c/20923 Thanks, Matt On Thu, Mar 17, 2016 at 6:42 PM, DVigneault wrote: > All-- > > I'm getting a linker error (undefined symbols for > itk::NumericTraits::Zero) when compiling a simple program against the > development branch of ITK on OS X 10.10.5 (Yosemite) with > Module_SubdivisionQuadEdgeMesh ON. (I'm using the XCode toolchain compiler > with c++11.) I only get this error on Mac--the same program compiles > without a problem on Ubuntu 14.04. I tried a clean build of ITK but without > luck. I went poking around itkNumericTraits.h, and the template > specialization (including ::Zero) is defined right in the header, which is > confusing. Any ideas what I might have done wrong? > > Best, > > --Davis > > ######### > ## Source ## > ######### > > #include > #include > > typedef itk::QuadEdgeMesh< float, 3 > TMesh; > typedef itk::LoopTriangleCellSubdivisionQuadEdgeMeshFilter< TMesh, TMesh > > TLoop; > > int main() > { > TLoop::Pointer loop = TLoop::New(); > return EXIT_SUCCESS; > } > > ############## > ## CMakeLists.txt ## > ############## > > cmake_minimum_required(VERSION 2.8.12) > > project(dv-linker) > > set(ITK_DIR "~/Developer/ITK/bin") > set(CMAKE_CXX_FLAGS "-std=c++11" CACHE STRING "cxx compiler flags" FORCE) > set(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -Wextra" CACHE STRING "cxx debug > compiler flags" FORCE) > set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "build type" FORCE) > > find_package(ITK REQUIRED) > include(${ITK_USE_FILE}) > > add_executable(dv-linker dv-linker.cxx) > target_link_libraries(dv-linker ${ITK_LIBRARIES}) > > ############# > ## Linker Error ## > ############# > > $ make > -- Configuring done > -- Generating done > -- Build files have been written to: > /Users/Davis/Developer/BitBucket/oxford/examples/ITK/dv-linker/bin > [ 50%] Linking CXX executable dv-linker > Undefined symbols for architecture x86_64: > "itk::NumericTraits::Zero", referenced from: > > itk::LoopTriangleCellSubdivisionQuadEdgeMeshFilter 3u, itk::QuadEdgeMeshTraits<float, 3u, bool, bool, float, float> >, > itk::QuadEdgeMesh bool, float, float> > >::AddNewCellPoints(itk::CellInterface itk::QuadEdgeMeshCellTraitsInfo<3, float, float, unsigned long, unsigned > long, unsigned char, itk::QuadEdgeMeshPoint<float, 3u, > itk::GeometricalQuadEdge<unsigned long, unsigned long, bool, bool, true> >>, itk::MapContainer itk::GeometricalQuadEdge<unsigned long, unsigned long, bool, bool, true> >> >, std::__1::set, > std::__1::allocator >, itk::GeometricalQuadEdge long, unsigned long, bool, bool, true> > >*) in dv-linker.cxx.o > > itk::LoopTriangleCellSubdivisionQuadEdgeMeshFilter 3u, itk::QuadEdgeMeshTraits<float, 3u, bool, bool, float, float> >, > itk::QuadEdgeMesh bool, float, float> > >::SmoothingPoint(itk::QuadEdgeMeshPoint itk::GeometricalQuadEdge<unsigned long, unsigned long, bool, bool, true> >> const&, itk::MapContainer 3u, itk::GeometricalQuadEdge<unsigned long, unsigned long, bool, bool, > true> > > const*) in dv-linker.cxx.o > ld: symbol(s) not found for architecture x86_64 > clang: error: linker command failed with exit code 1 (use -v to see > invocation) > make[2]: *** [dv-linker] Error 1 > make[1]: *** [CMakeFiles/dv-linker.dir/all] Error 2 > make: *** [all] Error 2 > > > > > > -- > View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Linker-error-when-using-Loop-subdivision-on-Mac-tp7588625.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 sebast.ulloa at gmail.com Sun Mar 20 15:00:55 2016 From: sebast.ulloa at gmail.com (=?UTF-8?Q?Sebasti=C3=A1n_Ulloa?=) Date: Sun, 20 Mar 2016 14:00:55 -0500 Subject: [ITK-users] Fwd: How to reuse a filter called from a function In-Reply-To: References: Message-ID: Hello, I'm trying to deform a simplex mesh with the itkDeformableSimplexMesh3DBalloonForceFilter. All the deformation process is called in a method of a class. typedef itk::SimplexMesh TSimplex; typedef itk::DeformableSimplexMesh3DBalloonForceFilter TDeform; void* Deformation::inflate() { TDeform::Pointer balloon = TDeform::New(); balloon->SetInput(simplex); balloon->SetKappa(0.01); balloon->Update(); simplex = balloon->GetOutput(); simplex->DisconnectPipeline(); } I got an execution error when I call the function twice, specifically on the Update() method. Here is the debug result: Thread #1 [DeformacionPulm] 6328 [core: 3] (Suspended : Signal : SIGSEGV:Segmentation fault) itk::Point::operator=() at itkPoint.hxx:35 0x4b6929 itk::DeformableSimplexMesh3DFilter >, itk::SimplexMesh > >::Initialize() at itkDeformableSimplexMesh3DFilter.hxx:200 0x4aaa38 itk::DeformableSimplexMesh3DFilter >, itk::SimplexMesh > >::GenerateData() at itkDeformableSimplexMesh3DFilter.hxx:122 0x4a90d5 itk::ProcessObject::UpdateOutputData() at 0x509fbd itk::DataObject::Update() at 0x514410 Deformation::inflate() at Deformation.cpp:89 0x49d9f7 Best regards, Sebastian. -------------- next part -------------- An HTML attachment was scrubbed... URL: From agarwalrichi13 at gmail.com Mon Mar 21 10:48:58 2016 From: agarwalrichi13 at gmail.com (Richa Agarwal) Date: Mon, 21 Mar 2016 15:48:58 +0100 Subject: [ITK-users] Regarding implementation on Non local means in ITK:: PatchBasedDenoisingBaseImageFilter Message-ID: Daar Users, I am using ITK filters to perform volume segmentation. I need some help regarding the implementation of PatchBasedDenoisingBaseImageFilter. As i am not able to find a specific example implementing the filter i had a look on the filter implantation provided in the test folder. ITK\Modules\Filtering\Denoising\test\itkPatchBasedDenoisingImageFilterTest.cxx, but its still not clear to use what parameters and description of all. If somebody has used this filter for de noising it will be great help. I am trying to de-noise 3D volumes of ABUS images. Thanks and Regards Richa Agarwal -------------- next part -------------- An HTML attachment was scrubbed... URL: From Robert.Atwood at diamond.ac.uk Mon Mar 21 12:50:45 2016 From: Robert.Atwood at diamond.ac.uk (Robert.Atwood at diamond.ac.uk) Date: Mon, 21 Mar 2016 16:50:45 +0000 Subject: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib Message-ID: <6CCDD8FC6578314C902BBF87D511D9D8EA6C924A@EXCHMBX01.fed.cclrc.ac.uk> Hi, This example, ITKApps/ITKFilterLib, appears to be an example of what I want to do , bundle or encapsulate a specific ITK-based filter into a library so that another program may just call it without having to have the ITK source installation available. However, a basic test for me is not working. I just tried to compile the test example from command line after building the library with Cmake as usual. I get hundreds of 'undefined reference', as if I have to link with all the ITK libs anyways. Am I missing something? Thanks g++ -o testcomp ../ITKFilterLib/ITKFilterLibTest.cxx -I ../ITKFilterLib/ -L . -l Example_ITKFilterLib First few lines of output: ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string, std::allocator > const&, unsigned int, std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&)': ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): undefined reference to `itk::ExceptionObject::ExceptionObject(std::basic_string, std::allocator > const&, unsigned int, std::basic_string, std::allocator > const&, std::basic_string References: Message-ID: Hi Richa, you should not use the base class, but rather the class which derives from it and fully implements the algorithm. Judging by the code in itkPatchBasedDenoisingImageFilterDefaultTest.cxx, the filter can run with default parameters too. So why don't you start with default parameters and once that is working start tuning it with by specifying parameters? Regards, D?enan On Mon, Mar 21, 2016 at 10:48 AM, Richa Agarwal wrote: > Daar Users, > > I am using ITK filters to perform volume segmentation. I need some help > regarding the implementation of PatchBasedDenoisingBaseImageFilter. As i am > not able to find a specific example implementing the filter i had a look on > the filter implantation provided in the test folder. > ITK\Modules\Filtering\Denoising\test\itkPatchBasedDenoisingImageFilterTest.cxx, > but its still not clear to use what parameters and description of all. > > If somebody has used this filter for de noising it will be great help. I > am trying to de-noise 3D volumes of ABUS images. > > Thanks and Regards > Richa Agarwal > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 dzenanz at gmail.com Mon Mar 21 16:20:32 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Mon, 21 Mar 2016 16:20:32 -0400 Subject: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib In-Reply-To: <6CCDD8FC6578314C902BBF87D511D9D8EA6C924A@EXCHMBX01.fed.cclrc.ac.uk> References: <6CCDD8FC6578314C902BBF87D511D9D8EA6C924A@EXCHMBX01.fed.cclrc.ac.uk> Message-ID: Hi Robert, maybe you need to link to ITK statically? To accomplish this you probably need to build ITK as static libraries (it is a configuration option in CMake). Regards, D?enan On Mon, Mar 21, 2016 at 12:50 PM, wrote: > Hi, > This example, ITKApps/ITKFilterLib, appears to be an example of what I > want to do , bundle or encapsulate a specific ITK-based filter into a > library so that another program may just call it without having to have the > ITK source installation available. > However, a basic test for me is not working. > > I just tried to compile the test example from command line after building > the library with Cmake as usual. I get hundreds of 'undefined reference', > as if I have to link with all the ITK libs anyways. > Am I missing something? > Thanks > > > > > g++ -o testcomp ../ITKFilterLib/ITKFilterLibTest.cxx -I ../ITKFilterLib/ > -L . -l Example_ITKFilterLib > > > First few lines of output: > > ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function > `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string std::char_traits, std::allocator > const&, unsigned int, > std::basic_string, std::allocator > > const&, std::basic_string, > std::allocator > const&)': > ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): > undefined reference to > `itk::ExceptionObject::ExceptionObject(std::basic_string std::char_traits, std::allocator > const&, unsigned int, > std::basic_string, std::allocator > > const&, std::basic_string ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x44): > undefined reference to `vtable for itk::MemoryAllocationError' > ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function > `itk::ProcessAborted::ProcessAborted(char const*, unsigned int)': > ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAbortedC5EPKcj]+0x33): > undefined reference to `itk::ExceptionObject::ExceptionObject(char const*, > unsigned int, char const*, char const*)' > ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAbortedC5EPKcj]+0x3e): > undefined reference to `vtable for itk::ProcessAborted' > ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAbortedC5EPKcj]+0x4f): > undefined reference to `itk::ExceptionObject::SetDescription(char const*)' > ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAbortedC5EPKcj]+0x62): > undefined reference to `itk::ExceptionObject::~ExceptionObject()' > > > > This is on a Linux Red Hat with ITK git master today (March 21 2016) > > cmake --version > cmake version 2.8.12.2 > > /proc/version: > > Linux version 2.6.32-573.18.1.el6.x86_64 ( > mockbuild at x86-010.build.bos.redhat.com) (gcc version 4.4.7 20120313 (Red > Hat 4.4.7-16) (GCC) ) #1 SMP Wed Jan 6 11:20:49 EST 2016 > > > > -- > This e-mail and any attachments may contain confidential, copyright and or > privileged material, and are for the use of the intended addressee only. If > you are not the intended addressee or an authorised recipient of the > addressee please notify us of receipt by returning the e-mail and do not > use, copy, retain, distribute or disclose the information in or attached to > the e-mail. > Any opinions expressed within this e-mail are those of the individual and > not necessarily of Diamond Light Source Ltd. > Diamond Light Source Ltd. cannot guarantee that this e-mail or any > attachments are free from viruses and we cannot accept liability for any > damage which you may sustain as a result of software viruses which may be > transmitted in or with the message. > Diamond Light Source Limited (company no. 4375679). Registered in England > and Wales with its registered office at Diamond House, Harwell Science and > Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 Robert.Atwood at diamond.ac.uk Tue Mar 22 06:25:33 2016 From: Robert.Atwood at diamond.ac.uk (Robert.Atwood at diamond.ac.uk) Date: Tue, 22 Mar 2016 10:25:33 +0000 Subject: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib In-Reply-To: References: <6CCDD8FC6578314C902BBF87D511D9D8EA6C924A@EXCHMBX01.fed.cclrc.ac.uk> Message-ID: <6CCDD8FC6578314C902BBF87D511D9D8EA6C9380@EXCHMBX01.fed.cclrc.ac.uk> Hi, Thanks, D?enan, for the hint. But, does anyone have specific information on exactly which options to set in each of: the ITK cmake options; and the project cmake options, or the plain g++ for building an external program to link to the library, for this to work ? There appear to be a few that might be related to this. Because, so far, simply changing the build options of the ITK installation didn?t work. See below for even more details . Thanks Robert Options selected in the project: ITK_DIR /dls_sw/apps/itk/itk-master-static/lib/cmake/ITK-4.10 In the ITK with installation to itk-master-static: I have tried some combinations of these options but, you know, it takes a while to rebuild ITK even though the computer is pretty good. BUILD_POSITION_DEPENDENT_CODE OFF (I don?t think this should be ON because that really wouldn?t work? ) BUILD_SHARED_LIBS OFF (or ON) CMAKE_CXX_FLAGS -fPIC (or default) CMAKE_EXE_LINKER_FLAGS -fPIC (or default) CMAKE_STATIC_LINKER_FLAGS (should this be set too? ) The CMakeLists in the project file ? only small modification from the original to ?BUILD_OUTSIDE_INSIGHT_APPICATIONS?. The project builds using the Cmake makefile, producing the library and the executable But trying to build either the ?main? procedure provided with linking to that library, or even simplifying the ?main? to do virtually nothing except instantiate the object, results in 1000 error messages of ?undefined symbols? 1 PROJECT(Example_ITKFilterLib) 2 3 #REMOVED 'IF (BUILD_OUTSIDE_INSIGHT_APPLICATIONS)' 4 5 FIND_PACKAGE(ITK) 6 IF(ITK_FOUND) 7 INCLUDE(${ITK_USE_FILE}) 8 ELSE(ITK_FOUND) 9 MESSAGE(FATAL_ERROR 10 "Cannot build ITKApps without ITK. Please set ITK_DIR.") 11 ENDIF(ITK_FOUND) 12 13 #REMOVED 'ENDIF(BUILD_OUTSIDE_INSIGHT_APPLICATIONS)' 14 15 ADD_LIBRARY(Example_ITKFilterLib ITKFilterLib.cxx ) 16 INSTALL_TARGETS(/lib Example_ITKFilterLib) 17 TARGET_LINK_LIBRARIES(Example_ITKFilterLib ${ITK_LIBRARIES}) 18 19 ADD_EXECUTABLE(Example_ITKFilterLibTest ITKFilterLibTest.cxx ) 20 INSTALL_TARGETS(/bin Example_ITKFilterLibTest) 21 TARGET_LINK_LIBRARIES(Example_ITKFilterLibTest Example_ITKFilterLib) build]$ ls -l total 2508 -rw-rw-r-- 1 kny48981 kny48981 14393 Mar 22 10:02 CMakeCache.txt drwxrwxr-x 6 kny48981 kny48981 4096 Mar 22 10:05 CMakeFiles -rwxrwxr-x 1 kny48981 kny48981 1417263 Mar 22 10:05 Example_ITKFilterLibTest drwxrwxr-x 2 kny48981 kny48981 4096 Mar 22 10:02 ITKIOFactoryRegistration -rw-rw-r-- 1 kny48981 kny48981 7933 Mar 22 10:02 Makefile -rw-rw-r-- 1 kny48981 kny48981 1092874 Mar 22 10:05 libExample_ITKFilterLib.a build]$ g++ -o testcomp ../ITKFilterLib/ITKFilterLibTest.cxx -I ../ITKFilterLib -L . -l Example_ITKFilterLib >& out & ? generates 1100 messages ? 1 ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string, std::allocat 2 ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): undefined reference to `itk::ExceptionObject: ? 1106 ITKFilterLib.cxx:(.text._ZNK3itk12NeighborhoodIPfLj3ENS_21NeighborhoodAllocatorIS1_EEE9PrintSelfERSoNS_6IndentE[itk::Neighborhood& out Same output AFAICT: 1 ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string, std::alloca 2 ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): undefined reference to `itk::ExceptionObject: ?. From: D?enan Zuki? [mailto:dzenanz at gmail.com] Sent: 21 March 2016 20:21 To: Atwood, Robert (DLSLtd,RAL,SCI) Cc: Insight-users Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib Hi Robert, maybe you need to link to ITK statically? To accomplish this you probably need to build ITK as static libraries (it is a configuration option in CMake). Regards, D?enan On Mon, Mar 21, 2016 at 12:50 PM, > wrote: Hi, This example, ITKApps/ITKFilterLib, appears to be an example of what I want to do , bundle or encapsulate a specific ITK-based filter into a library so that another program may just call it without having to have the ITK source installation available. However, a basic test for me is not working. I just tried to compile the test example from command line after building the library with Cmake as usual. I get hundreds of 'undefined reference', as if I have to link with all the ITK libs anyways. Am I missing something? Thanks g++ -o testcomp ../ITKFilterLib/ITKFilterLibTest.cxx -I ../ITKFilterLib/ -L . -l Example_ITKFilterLib First few lines of output: ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string, std::allocator > const&, unsigned int, std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&)': ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): undefined reference to `itk::ExceptionObject::ExceptionObject(std::basic_string, std::allocator > const&, unsigned int, std::basic_string, std::allocator > const&, std::basic_string) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ) #1 SMP Wed Jan 6 11:20:49 EST 2016 -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 maya.abi_akl at qatar.tamu.edu Wed Mar 23 05:43:35 2016 From: maya.abi_akl at qatar.tamu.edu (Maya) Date: Wed, 23 Mar 2016 02:43:35 -0700 (MST) Subject: [ITK-users] MRI brain data Message-ID: <1458726215466-7588633.post@n2.nabble.com> Hello, I started using itk to do Bias Field correction on MRI brain data. I would like to ask if there is any brain MRI data available with significant bias field that I can use?\ Thanks, Maya -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/MRI-brain-data-tp7588633.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From suneezahanif02 at gmail.com Wed Mar 23 08:15:45 2016 From: suneezahanif02 at gmail.com (suneeza hanif) Date: Wed, 23 Mar 2016 13:15:45 +0100 Subject: [ITK-users] itk::GradientDescentLineSearchOptimizerv4 Message-ID: Hello Everyone, I am little confused about few of optimizer's parameters such as SetMinimumConvergenceValue() and SetConvergenceWindowSize(). Can someone tell me the meaning behind these parameters? Thanks a lot. Best Regards, Suneeza -------------- next part -------------- An HTML attachment was scrubbed... URL: From dzenanz at gmail.com Wed Mar 23 10:39:25 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Wed, 23 Mar 2016 10:39:25 -0400 Subject: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib In-Reply-To: <6CCDD8FC6578314C902BBF87D511D9D8EA6C9380@EXCHMBX01.fed.cclrc.ac.uk> References: <6CCDD8FC6578314C902BBF87D511D9D8EA6C924A@EXCHMBX01.fed.cclrc.ac.uk> <6CCDD8FC6578314C902BBF87D511D9D8EA6C9380@EXCHMBX01.fed.cclrc.ac.uk> Message-ID: Hi Robert, BUILD_SHARED_LIBS OFF is the crucial setting. You can keep the rest of options on defaults. Your CMake code looks OK. You should execute the following from your folder: cmake . make During CMake step you should configure options (point to the itk-build folder which was configured with BUILD_SHARED_LIBS OFF). Afterwards, do not invoke g++ directly - invoke make, which supplies correct include directories and link libraries so you don't run into a thousand errors. Regards, D?enan On Tue, Mar 22, 2016 at 6:25 AM, wrote: > Hi, > Thanks, D?enan, for the hint. But, does anyone have specific information > on exactly which options to set in each of: the ITK cmake options; and the > project cmake options, or the plain g++ for building an external program to > link to the library, for this to work ? There appear to be a few that might > be related to this. Because, so far, simply changing the build options of > the ITK installation didn?t work. See below for even more details . > > Thanks > > Robert > > > > > > > > Options selected in the project: > > ITK_DIR > /dls_sw/apps/itk/itk-master-static/lib/cmake/ITK-4.10 > > > > > > > > In the ITK with installation to itk-master-static: > > I have tried some combinations of these options but, you know, it takes a > while to rebuild ITK even though the computer is pretty good. > > > > BUILD_POSITION_DEPENDENT_CODE OFF (I don?t think this should be ON > because that really wouldn?t work? ) > > BUILD_SHARED_LIBS OFF (or ON) > > CMAKE_CXX_FLAGS -fPIC (or default) > > CMAKE_EXE_LINKER_FLAGS -fPIC (or default) > > CMAKE_STATIC_LINKER_FLAGS (should this be set too? ) > > > > > > > > The CMakeLists in the project file ? only small modification from the > original to ?BUILD_OUTSIDE_INSIGHT_APPICATIONS?. The project builds using > the Cmake makefile, producing the library and the executable > > But trying to build either the ?main? procedure provided with linking to > that library, or even simplifying the ?main? to do virtually nothing except > instantiate the object, results in 1000 error messages of ?undefined > symbols? > > > > 1 PROJECT(Example_ITKFilterLib) > > 2 > > 3 #REMOVED 'IF (BUILD_OUTSIDE_INSIGHT_APPLICATIONS)' > > 4 > > 5 FIND_PACKAGE(ITK) > > 6 IF(ITK_FOUND) > > 7 INCLUDE(${ITK_USE_FILE}) > > 8 ELSE(ITK_FOUND) > > 9 MESSAGE(FATAL_ERROR > > 10 "Cannot build ITKApps without ITK. Please set ITK_DIR.") > > 11 ENDIF(ITK_FOUND) > > 12 > > 13 #REMOVED 'ENDIF(BUILD_OUTSIDE_INSIGHT_APPLICATIONS)' > > 14 > > 15 ADD_LIBRARY(Example_ITKFilterLib ITKFilterLib.cxx ) > > 16 INSTALL_TARGETS(/lib Example_ITKFilterLib) > > 17 TARGET_LINK_LIBRARIES(Example_ITKFilterLib ${ITK_LIBRARIES}) > > 18 > > 19 ADD_EXECUTABLE(Example_ITKFilterLibTest ITKFilterLibTest.cxx ) > > 20 INSTALL_TARGETS(/bin Example_ITKFilterLibTest) > > 21 TARGET_LINK_LIBRARIES(Example_ITKFilterLibTest Example_ITKFilterLib) > > > > > > build]$ ls -l > > total 2508 > > -rw-rw-r-- 1 kny48981 kny48981 14393 Mar 22 10:02 CMakeCache.txt > > drwxrwxr-x 6 kny48981 kny48981 4096 Mar 22 10:05 CMakeFiles > > -rwxrwxr-x 1 kny48981 kny48981 1417263 Mar 22 10:05 > Example_ITKFilterLibTest > > drwxrwxr-x 2 kny48981 kny48981 4096 Mar 22 10:02 > ITKIOFactoryRegistration > > -rw-rw-r-- 1 kny48981 kny48981 7933 Mar 22 10:02 Makefile > > -rw-rw-r-- 1 kny48981 kny48981 1092874 Mar 22 10:05 > libExample_ITKFilterLib.a > > > > > > > > build]$ g++ -o testcomp ../ITKFilterLib/ITKFilterLibTest.cxx -I > ../ITKFilterLib -L . -l Example_ITKFilterLib >& out & > > > > ? generates 1100 messages ? > > > > > > 1 ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function > `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string std::char_traits, std::allocat > > 2 > ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): > undefined reference to `itk::ExceptionObject: > > ? > > 1106 > ITKFilterLib.cxx:(.text._ZNK3itk12NeighborhoodIPfLj3ENS_21NeighborhoodAllocatorIS1_EEE9PrintSelfERSoNS_6IndentE[itk::Neighborhood 3u, itk::NeighborhoodAllocato > > 1107 collect2: ld returned 1 exit status > > > > > > Minimal example main: > > > > 1 #include "ITKFilterLib.h" > > 2 int main(int, char **) { > > 3 int inputDimSize[3]; > > 4 float inputOrigin[3]; > > 5 float inputSpacing[3]; > > 6 inputDimSize[0] = 5; > > 7 inputDimSize[1] = 5; > > 8 inputDimSize[2] = 5; > > 9 inputOrigin[0] = 0; > > 10 inputOrigin[1] = 0; > > 11 inputOrigin[2] = 0; > > 12 inputSpacing[0] = 1; > > 13 inputSpacing[1] = 1; > > 14 inputSpacing[2] = 1; > > 15 > > 16 itkFilterLib filter(inputDimSize, inputOrigin, inputSpacing); > > 17 return (true); > > 18 } > > > > g++ -o testmin minimal_example.cxx -I ../ITKFilterLib -L . -l > Example_ITKFilterLib >& out > > > > > > Same output AFAICT: > > > > > > 1 ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function > `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string std::char_traits, std::alloca > > 2 > ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): > undefined reference to `itk::ExceptionObject: > > ?. > > > > *From:* D?enan Zuki? [mailto:dzenanz at gmail.com] > *Sent:* 21 March 2016 20:21 > *To:* Atwood, Robert (DLSLtd,RAL,SCI) > *Cc:* Insight-users > *Subject:* Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib > > > > Hi Robert, > > > > maybe you need to link to ITK statically? To accomplish this you probably > need to build ITK as static libraries (it is a configuration option in > CMake). > > > > Regards, > > D?enan > > > > On Mon, Mar 21, 2016 at 12:50 PM, wrote: > > Hi, > This example, ITKApps/ITKFilterLib, appears to be an example of what I > want to do , bundle or encapsulate a specific ITK-based filter into a > library so that another program may just call it without having to have the > ITK source installation available. > However, a basic test for me is not working. > > I just tried to compile the test example from command line after building > the library with Cmake as usual. I get hundreds of 'undefined reference', > as if I have to link with all the ITK libs anyways. > Am I missing something? > Thanks > > > > > g++ -o testcomp ../ITKFilterLib/ITKFilterLibTest.cxx -I ../ITKFilterLib/ > -L . -l Example_ITKFilterLib > > > First few lines of output: > > ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function > `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string std::char_traits, std::allocator > const&, unsigned int, > std::basic_string, std::allocator > > const&, std::basic_string, > std::allocator > const&)': > ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): > undefined reference to > `itk::ExceptionObject::ExceptionObject(std::basic_string std::char_traits, std::allocator > const&, unsigned int, > std::basic_string, std::allocator > > const&, std::basic_string ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x44): > undefined reference to `vtable for itk::MemoryAllocationError' > ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function > `itk::ProcessAborted::ProcessAborted(char const*, unsigned int)': > ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAbortedC5EPKcj]+0x33): > undefined reference to `itk::ExceptionObject::ExceptionObject(char const*, > unsigned int, char const*, char const*)' > ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAbortedC5EPKcj]+0x3e): > undefined reference to `vtable for itk::ProcessAborted' > ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAbortedC5EPKcj]+0x4f): > undefined reference to `itk::ExceptionObject::SetDescription(char const*)' > ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAbortedC5EPKcj]+0x62): > undefined reference to `itk::ExceptionObject::~ExceptionObject()' > > > > This is on a Linux Red Hat with ITK git master today (March 21 2016) > > cmake --version > cmake version 2.8.12.2 > > /proc/version: > > Linux version 2.6.32-573.18.1.el6.x86_64 ( > mockbuild at x86-010.build.bos.redhat.com) (gcc version 4.4.7 20120313 (Red > Hat 4.4.7-16) (GCC) ) #1 SMP Wed Jan 6 11:20:49 EST 2016 > > > > -- > This e-mail and any attachments may contain confidential, copyright and or > privileged material, and are for the use of the intended addressee only. If > you are not the intended addressee or an authorised recipient of the > addressee please notify us of receipt by returning the e-mail and do not > use, copy, retain, distribute or disclose the information in or attached to > the e-mail. > Any opinions expressed within this e-mail are those of the individual and > not necessarily of Diamond Light Source Ltd. > Diamond Light Source Ltd. cannot guarantee that this e-mail or any > attachments are free from viruses and we cannot accept liability for any > damage which you may sustain as a result of software viruses which may be > transmitted in or with the message. > Diamond Light Source Limited (company no. 4375679). Registered in England > and Wales with its registered office at Diamond House, Harwell Science and > Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > > > > > -- > > This e-mail and any attachments may contain confidential, copyright and or > privileged material, and are for the use of the intended addressee only. If > you are not the intended addressee or an authorised recipient of the > addressee please notify us of receipt by returning the e-mail and do not > use, copy, retain, distribute or disclose the information in or attached to > the e-mail. > Any opinions expressed within this e-mail are those of the individual and > not necessarily of Diamond Light Source Ltd. > Diamond Light Source Ltd. cannot guarantee that this e-mail or any > attachments are free from viruses and we cannot accept liability for any > damage which you may sustain as a result of software viruses which may be > transmitted in or with the message. > Diamond Light Source Limited (company no. 4375679). Registered in England > and Wales with its registered office at Diamond House, Harwell Science and > Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dzenanz at gmail.com Wed Mar 23 10:44:55 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Wed, 23 Mar 2016 10:44:55 -0400 Subject: [ITK-users] MRI brain data In-Reply-To: <1458726215466-7588633.post@n2.nabble.com> References: <1458726215466-7588633.post@n2.nabble.com> Message-ID: Hi Maya, I don't know how much of a bias field this has (it seems to be weaker inferiorly), but you can use my brain scan: https://dl.dropboxusercontent.com/u/48665006/tmj_DZ.nrrd Tell me if you find it useful. Regards, D?enan On Wed, Mar 23, 2016 at 5:43 AM, Maya wrote: > Hello, > > I started using itk to do Bias Field correction on MRI brain data. > I would like to ask if there is any brain MRI data available with > significant bias field that I can use?\ > > Thanks, > Maya > > > > -- > View this message in context: > http://itk-insight-users.2283740.n2.nabble.com/MRI-brain-data-tp7588633.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 dzenanz at gmail.com Wed Mar 23 10:46:59 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Wed, 23 Mar 2016 10:46:59 -0400 Subject: [ITK-users] itk::GradientDescentLineSearchOptimizerv4 In-Reply-To: References: Message-ID: Hi Suneeza, have you taken a look at the docs ? That should contain answers about meaning of parameters. HTH, D?enan On Wed, Mar 23, 2016 at 8:15 AM, suneeza hanif wrote: > Hello Everyone, > > I am little confused about few of optimizer's parameters such as > > SetMinimumConvergenceValue() and SetConvergenceWindowSize(). > > Can someone tell me the meaning behind these parameters? > > Thanks a lot. > > Best Regards, > Suneeza > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 Robert.Atwood at diamond.ac.uk Wed Mar 23 11:58:45 2016 From: Robert.Atwood at diamond.ac.uk (Robert.Atwood at diamond.ac.uk) Date: Wed, 23 Mar 2016 15:58:45 +0000 Subject: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib -- Solved (maybe) Message-ID: <6CCDD8FC6578314C902BBF87D511D9D8EA6CA999@EXCHMBX01.fed.cclrc.ac.uk> Hi, D?enan, and List : Thanks for the tips, but, building the executable by pointing to the itk-build folder for linking is exactly what I did not want to do. I want the compiled instances of the specific templated objects to be put into a stand-alone library that could then be linked , in an environment where the ITK build directory may not be available, and within a project that?s not using cmake (yet? ? ) just for a small single-data-type-specific filter chain that would be a bit nontrivial to just re-implement myself! I had some success with the following, for the example ITKFilterLib: Using the itk-master-git-static as built before, (BUILD_SHARED_LIBS OFF) In CMakeLists.txt for the project, add SHARED keyword to the library defninition: 15 ADD_LIBRARY(Example_ITKFilterLib SHARED ITKFilterLib.cxx ) Then use cmake + make to build the libExample_ITKFilterLib.so library. Then I can invoke g++ as follows build]$ g++ ../ITKFilterLib/ITKFilterLibTest.cxx -o testcomp -L . -l Example_ITKFilterLib -I ../ITKFilterLib/ Even if the itk-master-static is not available in that environment, this succeeds, and I believe this is what I want. I don?t want to have a statically linked final executable, but rather a .so library. However ? I encountered another hitch trying to apply this to my actual project. If there were any FileWriter and FileReader present in the library, it would not build, complaining about position-dependent symbols in several IO libraries , most of which I was not actually wanting to use at all. This happened at the step of trying to build the .so library using the makefile created by cmake: /usr/bin/ld: /dls_sw/apps/itk/itk-master-static/lib/libitkgdcmjpeg8-4.10.a(jerror.c.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC /dls_sw/apps/itk/itk-master-static/lib/libitkgdcmjpeg8-4.10.a: could not read symbols: Bad value Removing any reference to FileReader and FileWriter gets rid of this problem. Thanks! As a further note: There are also some directions in the comments of the ITKFilterLib example that did not turn out to be necessary in my project. I did not have to create global objects for poitners or image containiers outside the scope of the class and still did not have to #include itkImage.h in the main program. I placed the typedef?s inside the class and the instantiations of the smart poitners in the class constructor. I don?t see that this extra complication in the example is necessary unless it is platform dependent? ITKFilterLib.cxx from ItkApps example: 23 #include "ITKFilterLib.h" 24 25 // Nasty local globals inside .cxx file to hide itk from the real world. 26 // Can't put this variable in the class definition otherwise we'd have to 27 // include itkImage.h in every program using this class. 28 // The typedef h_itkFilterLibeDataType is in itkFilterLib.h to hide 29 // templates 30 typedef itk::Image g_ImageType; 31 g_ImageType::Pointer g_InputImage; 32 g_ImageType::Pointer g_OutputImage; I did not find this to be necessary in my project. 33 34 35 // 36 // 37 // The first filter in the .lib 38 // 39 // 40 41 /** The next lines are used to include the definition of the filter 42 * we want to install in the .lib, define a typedef for it, and create 43 * a "smart" pointer to hold it. 44 * CHANGE HERE: The filter to be instantiated. 45 **/ 46 #include "itkCurvatureAnisotropicDiffusionImageFilter.h" 47 typedef itk::CurvatureAnisotropicDiffusionImageFilter g_AnisoFilterType; 49 g_AnisoFilterType::Pointer g_anisoFilter; 50 I also did not find it to be necessary to have this sort of typedef and instantiation of the object at global scope in my project. From: D?enan Zuki? [mailto:dzenanz at gmail.com] Sent: 23 March 2016 14:39 To: Atwood, Robert (DLSLtd,RAL,SCI) Cc: Insight-users Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib Hi Robert, BUILD_SHARED_LIBS OFF is the crucial setting. You can keep the rest of options on defaults. Your CMake code looks OK. You should execute the following from your folder: cmake . make During CMake step you should configure options (point to the itk-build folder which was configured with BUILD_SHARED_LIBS OFF). Afterwards, do not invoke g++ directly - invoke make, which supplies correct include directories and link libraries so you don't run into a thousand errors. Regards, D?enan On Tue, Mar 22, 2016 at 6:25 AM, > wrote: Hi, Thanks, D?enan, for the hint. But, does anyone have specific information on exactly which options to set in each of: the ITK cmake options; and the project cmake options, or the plain g++ for building an external program to link to the library, for this to work ? There appear to be a few that might be related to this. Because, so far, simply changing the build options of the ITK installation didn?t work. See below for even more details . Thanks Robert Options selected in the project: ITK_DIR /dls_sw/apps/itk/itk-master-static/lib/cmake/ITK-4.10 In the ITK with installation to itk-master-static: I have tried some combinations of these options but, you know, it takes a while to rebuild ITK even though the computer is pretty good. BUILD_POSITION_DEPENDENT_CODE OFF (I don?t think this should be ON because that really wouldn?t work? ) BUILD_SHARED_LIBS OFF (or ON) CMAKE_CXX_FLAGS -fPIC (or default) CMAKE_EXE_LINKER_FLAGS -fPIC (or default) CMAKE_STATIC_LINKER_FLAGS (should this be set too? ) The CMakeLists in the project file ? only small modification from the original to ?BUILD_OUTSIDE_INSIGHT_APPICATIONS?. The project builds using the Cmake makefile, producing the library and the executable But trying to build either the ?main? procedure provided with linking to that library, or even simplifying the ?main? to do virtually nothing except instantiate the object, results in 1000 error messages of ?undefined symbols? 1 PROJECT(Example_ITKFilterLib) 2 3 #REMOVED 'IF (BUILD_OUTSIDE_INSIGHT_APPLICATIONS)' 4 5 FIND_PACKAGE(ITK) 6 IF(ITK_FOUND) 7 INCLUDE(${ITK_USE_FILE}) 8 ELSE(ITK_FOUND) 9 MESSAGE(FATAL_ERROR 10 "Cannot build ITKApps without ITK. Please set ITK_DIR.") 11 ENDIF(ITK_FOUND) 12 13 #REMOVED 'ENDIF(BUILD_OUTSIDE_INSIGHT_APPLICATIONS)' 14 15 ADD_LIBRARY(Example_ITKFilterLib ITKFilterLib.cxx ) 16 INSTALL_TARGETS(/lib Example_ITKFilterLib) 17 TARGET_LINK_LIBRARIES(Example_ITKFilterLib ${ITK_LIBRARIES}) 18 19 ADD_EXECUTABLE(Example_ITKFilterLibTest ITKFilterLibTest.cxx ) 20 INSTALL_TARGETS(/bin Example_ITKFilterLibTest) 21 TARGET_LINK_LIBRARIES(Example_ITKFilterLibTest Example_ITKFilterLib) build]$ ls -l total 2508 -rw-rw-r-- 1 kny48981 kny48981 14393 Mar 22 10:02 CMakeCache.txt drwxrwxr-x 6 kny48981 kny48981 4096 Mar 22 10:05 CMakeFiles -rwxrwxr-x 1 kny48981 kny48981 1417263 Mar 22 10:05 Example_ITKFilterLibTest drwxrwxr-x 2 kny48981 kny48981 4096 Mar 22 10:02 ITKIOFactoryRegistration -rw-rw-r-- 1 kny48981 kny48981 7933 Mar 22 10:02 Makefile -rw-rw-r-- 1 kny48981 kny48981 1092874 Mar 22 10:05 libExample_ITKFilterLib.a build]$ g++ -o testcomp ../ITKFilterLib/ITKFilterLibTest.cxx -I ../ITKFilterLib -L . -l Example_ITKFilterLib >& out & ? generates 1100 messages ? 1 ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string, std::allocat 2 ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): undefined reference to `itk::ExceptionObject: ? 1106 ITKFilterLib.cxx:(.text._ZNK3itk12NeighborhoodIPfLj3ENS_21NeighborhoodAllocatorIS1_EEE9PrintSelfERSoNS_6IndentE[itk::Neighborhood& out Same output AFAICT: 1 ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string, std::alloca 2 ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): undefined reference to `itk::ExceptionObject: ?. From: D?enan Zuki? [mailto:dzenanz at gmail.com] Sent: 21 March 2016 20:21 To: Atwood, Robert (DLSLtd,RAL,SCI) Cc: Insight-users Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib Hi Robert, maybe you need to link to ITK statically? To accomplish this you probably need to build ITK as static libraries (it is a configuration option in CMake). Regards, D?enan On Mon, Mar 21, 2016 at 12:50 PM, > wrote: Hi, This example, ITKApps/ITKFilterLib, appears to be an example of what I want to do , bundle or encapsulate a specific ITK-based filter into a library so that another program may just call it without having to have the ITK source installation available. However, a basic test for me is not working. I just tried to compile the test example from command line after building the library with Cmake as usual. I get hundreds of 'undefined reference', as if I have to link with all the ITK libs anyways. Am I missing something? Thanks g++ -o testcomp ../ITKFilterLib/ITKFilterLibTest.cxx -I ../ITKFilterLib/ -L . -l Example_ITKFilterLib First few lines of output: ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string, std::allocator > const&, unsigned int, std::basic_string, std::allocator > const&, std::basic_string, std::allocator > const&)': ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): undefined reference to `itk::ExceptionObject::ExceptionObject(std::basic_string, std::allocator > const&, unsigned int, std::basic_string, std::allocator > const&, std::basic_string) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ) #1 SMP Wed Jan 6 11:20:49 EST 2016 -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Wed Mar 23 12:29:01 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Wed, 23 Mar 2016 12:29:01 -0400 Subject: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib -- Solved (maybe) In-Reply-To: <6CCDD8FC6578314C902BBF87D511D9D8EA6CA999@EXCHMBX01.fed.cclrc.ac.uk> References: <6CCDD8FC6578314C902BBF87D511D9D8EA6CA999@EXCHMBX01.fed.cclrc.ac.uk> Message-ID: Hi Robert, > /usr/bin/ld: /dls_sw/apps/itk/itk-master-static/lib/libitkgdcmjpeg8-4.10.a(jerror.c.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC This means that "-fPIC" should be added to the CMAKE_CXX_FLAGS for ITK. HTH, Matt On Wed, Mar 23, 2016 at 11:58 AM, wrote: > Hi, D?enan, and List : > > > > Thanks for the tips, but, building the executable by pointing to the > itk-build folder for linking is exactly what I did not want to do. I want > the compiled instances of the specific templated objects to be put into a > stand-alone library that could then be linked , in an environment where the > ITK build directory may not be available, and within a project that?s not > using cmake (yet? J ) just for a small single-data-type-specific filter > chain that would be a bit nontrivial to just re-implement myself! > > > > I had some success with the following, for the example ITKFilterLib: > > > > Using the itk-master-git-static as built before, (BUILD_SHARED_LIBS OFF) > > > > > > In CMakeLists.txt for the project, add SHARED keyword to the library > defninition: > > > > 15 ADD_LIBRARY(Example_ITKFilterLib SHARED ITKFilterLib.cxx ) > > Then use cmake + make to build the libExample_ITKFilterLib.so library. > > > > > > Then I can invoke g++ as follows > > > > > > > > build]$ g++ ../ITKFilterLib/ITKFilterLibTest.cxx -o testcomp -L . -l > Example_ITKFilterLib -I ../ITKFilterLib/ > > > > Even if the itk-master-static is not available in that environment, this > succeeds, and I believe this is what I want. I don?t want to have a > statically linked final executable, but rather a .so library. > > > > > > However ? > > > > I encountered another hitch trying to apply this to my actual project. If > there were any FileWriter and FileReader present in the library, it would > not build, complaining about position-dependent symbols in several IO > libraries , most of which I was not actually wanting to use at all. This > happened at the step of trying to build the .so library using the makefile > created by cmake: > > > > /usr/bin/ld: > /dls_sw/apps/itk/itk-master-static/lib/libitkgdcmjpeg8-4.10.a(jerror.c.o): > relocation R_X86_64_32S against `.text' can not be used when making a shared > object; recompile with -fPIC > > /dls_sw/apps/itk/itk-master-static/lib/libitkgdcmjpeg8-4.10.a: could not > read symbols: Bad value > > > > > > Removing any reference to FileReader and FileWriter gets rid of this > problem. > > > > Thanks! > > > > > > As a further note: > > > > There are also some directions in the comments of the ITKFilterLib example > that did not turn out to be necessary in my project. I did not have to > create global objects for poitners or image containiers outside the scope of > the class and still did not have to #include itkImage.h in the main program. > I placed the typedef?s inside the class and the instantiations of the smart > poitners in the class constructor. I don?t see that this extra complication > in the example is necessary unless it is platform dependent? > > > > ITKFilterLib.cxx from ItkApps example: > > > > > > 23 #include "ITKFilterLib.h" > > 24 > > 25 // Nasty local globals inside .cxx file to hide itk from the real world. > > 26 // Can't put this variable in the class definition otherwise we'd have > to > > 27 // include itkImage.h in every program using this class. > > 28 // The typedef h_itkFilterLibeDataType is in itkFilterLib.h to hide > > 29 // templates > > 30 typedef itk::Image g_ImageType; > > 31 g_ImageType::Pointer g_InputImage; > > 32 g_ImageType::Pointer g_OutputImage; > > > > I did not find this to be necessary in my project. > > > > > > 33 > > 34 > > 35 // > > 36 // > > 37 // The first filter in the .lib > > 38 // > > 39 // > > 40 > > 41 /** The next lines are used to include the definition of the filter > > 42 * we want to install in the .lib, define a typedef for it, and create > > 43 * a "smart" pointer to hold it. > > 44 * CHANGE HERE: The filter to be instantiated. > > 45 **/ > > 46 #include "itkCurvatureAnisotropicDiffusionImageFilter.h" > > 47 typedef itk::CurvatureAnisotropicDiffusionImageFilter > 48 g_ImageType> g_AnisoFilterType; > > 49 g_AnisoFilterType::Pointer g_anisoFilter; > > 50 > > > > I also did not find it to be necessary to have this sort of typedef and > instantiation of the object at global scope in my project. > > > > > > > > > > > > > > From: D?enan Zuki? [mailto:dzenanz at gmail.com] > Sent: 23 March 2016 14:39 > To: Atwood, Robert (DLSLtd,RAL,SCI) > Cc: Insight-users > Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib > > > > Hi Robert, > > > > BUILD_SHARED_LIBS OFF is the crucial setting. You can keep the rest of > options on defaults. > > > > Your CMake code looks OK. You should execute the following from your folder: > > cmake . > > make > > > > During CMake step you should configure options (point to the itk-build > folder which was configured with BUILD_SHARED_LIBS OFF). Afterwards, do not > invoke g++ directly - invoke make, which supplies correct include > directories and link libraries so you don't run into a thousand errors. > > > > Regards, > > D?enan > > > > On Tue, Mar 22, 2016 at 6:25 AM, wrote: > > Hi, > Thanks, D?enan, for the hint. But, does anyone have specific information on > exactly which options to set in each of: the ITK cmake options; and the > project cmake options, or the plain g++ for building an external program to > link to the library, for this to work ? There appear to be a few that might > be related to this. Because, so far, simply changing the build options of > the ITK installation didn?t work. See below for even more details . > > Thanks > > Robert > > > > > > > > Options selected in the project: > > ITK_DIR > /dls_sw/apps/itk/itk-master-static/lib/cmake/ITK-4.10 > > > > > > > > In the ITK with installation to itk-master-static: > > I have tried some combinations of these options but, you know, it takes a > while to rebuild ITK even though the computer is pretty good. > > > > BUILD_POSITION_DEPENDENT_CODE OFF (I don?t think this should be ON > because that really wouldn?t work? ) > > BUILD_SHARED_LIBS OFF (or ON) > > CMAKE_CXX_FLAGS -fPIC (or default) > > CMAKE_EXE_LINKER_FLAGS -fPIC (or default) > > CMAKE_STATIC_LINKER_FLAGS (should this be set too? ) > > > > > > > > The CMakeLists in the project file ? only small modification from the > original to ?BUILD_OUTSIDE_INSIGHT_APPICATIONS?. The project builds using > the Cmake makefile, producing the library and the executable > > But trying to build either the ?main? procedure provided with linking to > that library, or even simplifying the ?main? to do virtually nothing except > instantiate the object, results in 1000 error messages of ?undefined > symbols? > > > > 1 PROJECT(Example_ITKFilterLib) > > 2 > > 3 #REMOVED 'IF (BUILD_OUTSIDE_INSIGHT_APPLICATIONS)' > > 4 > > 5 FIND_PACKAGE(ITK) > > 6 IF(ITK_FOUND) > > 7 INCLUDE(${ITK_USE_FILE}) > > 8 ELSE(ITK_FOUND) > > 9 MESSAGE(FATAL_ERROR > > 10 "Cannot build ITKApps without ITK. Please set ITK_DIR.") > > 11 ENDIF(ITK_FOUND) > > 12 > > 13 #REMOVED 'ENDIF(BUILD_OUTSIDE_INSIGHT_APPLICATIONS)' > > 14 > > 15 ADD_LIBRARY(Example_ITKFilterLib ITKFilterLib.cxx ) > > 16 INSTALL_TARGETS(/lib Example_ITKFilterLib) > > 17 TARGET_LINK_LIBRARIES(Example_ITKFilterLib ${ITK_LIBRARIES}) > > 18 > > 19 ADD_EXECUTABLE(Example_ITKFilterLibTest ITKFilterLibTest.cxx ) > > 20 INSTALL_TARGETS(/bin Example_ITKFilterLibTest) > > 21 TARGET_LINK_LIBRARIES(Example_ITKFilterLibTest Example_ITKFilterLib) > > > > > > build]$ ls -l > > total 2508 > > -rw-rw-r-- 1 kny48981 kny48981 14393 Mar 22 10:02 CMakeCache.txt > > drwxrwxr-x 6 kny48981 kny48981 4096 Mar 22 10:05 CMakeFiles > > -rwxrwxr-x 1 kny48981 kny48981 1417263 Mar 22 10:05 Example_ITKFilterLibTest > > drwxrwxr-x 2 kny48981 kny48981 4096 Mar 22 10:02 ITKIOFactoryRegistration > > -rw-rw-r-- 1 kny48981 kny48981 7933 Mar 22 10:02 Makefile > > -rw-rw-r-- 1 kny48981 kny48981 1092874 Mar 22 10:05 > libExample_ITKFilterLib.a > > > > > > > > build]$ g++ -o testcomp ../ITKFilterLib/ITKFilterLibTest.cxx -I > ../ITKFilterLib -L . -l Example_ITKFilterLib >& out & > > > > ? generates 1100 messages ? > > > > > > 1 ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function > `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string std::char_traits, std::allocat > > 2 > ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): > undefined reference to `itk::ExceptionObject: > > ? > > 1106 > ITKFilterLib.cxx:(.text._ZNK3itk12NeighborhoodIPfLj3ENS_21NeighborhoodAllocatorIS1_EEE9PrintSelfERSoNS_6IndentE[itk::Neighborhood 3u, itk::NeighborhoodAllocato > > 1107 collect2: ld returned 1 exit status > > > > > > Minimal example main: > > > > 1 #include "ITKFilterLib.h" > > 2 int main(int, char **) { > > 3 int inputDimSize[3]; > > 4 float inputOrigin[3]; > > 5 float inputSpacing[3]; > > 6 inputDimSize[0] = 5; > > 7 inputDimSize[1] = 5; > > 8 inputDimSize[2] = 5; > > 9 inputOrigin[0] = 0; > > 10 inputOrigin[1] = 0; > > 11 inputOrigin[2] = 0; > > 12 inputSpacing[0] = 1; > > 13 inputSpacing[1] = 1; > > 14 inputSpacing[2] = 1; > > 15 > > 16 itkFilterLib filter(inputDimSize, inputOrigin, inputSpacing); > > 17 return (true); > > 18 } > > > > g++ -o testmin minimal_example.cxx -I ../ITKFilterLib -L . -l > Example_ITKFilterLib >& out > > > > > > Same output AFAICT: > > > > > > 1 ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function > `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string std::char_traits, std::alloca > > 2 > ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): > undefined reference to `itk::ExceptionObject: > > ?. > > > > From: D?enan Zuki? [mailto:dzenanz at gmail.com] > Sent: 21 March 2016 20:21 > To: Atwood, Robert (DLSLtd,RAL,SCI) > Cc: Insight-users > Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib > > > > Hi Robert, > > > > maybe you need to link to ITK statically? To accomplish this you probably > need to build ITK as static libraries (it is a configuration option in > CMake). > > > > Regards, > > D?enan > > > > On Mon, Mar 21, 2016 at 12:50 PM, wrote: > > Hi, > This example, ITKApps/ITKFilterLib, appears to be an example of what I want > to do , bundle or encapsulate a specific ITK-based filter into a library so > that another program may just call it without having to have the ITK source > installation available. > However, a basic test for me is not working. > > I just tried to compile the test example from command line after building > the library with Cmake as usual. I get hundreds of 'undefined reference', as > if I have to link with all the ITK libs anyways. > Am I missing something? > Thanks > > > > > g++ -o testcomp ../ITKFilterLib/ITKFilterLibTest.cxx -I ../ITKFilterLib/ -L > . -l Example_ITKFilterLib > > > First few lines of output: > > ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function > `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string std::char_traits, std::allocator > const&, unsigned int, > std::basic_string, std::allocator > > const&, std::basic_string, std::allocator >> const&)': > ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): > undefined reference to > `itk::ExceptionObject::ExceptionObject(std::basic_string std::char_traits, std::allocator > const&, unsigned int, > std::basic_string, std::allocator > > const&, std::basic_string ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x44): > undefined reference to `vtable for itk::MemoryAllocationError' > ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function > `itk::ProcessAborted::ProcessAborted(char const*, unsigned int)': > ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAbortedC5EPKcj]+0x33): > undefined reference to `itk::ExceptionObject::ExceptionObject(char const*, > unsigned int, char const*, char const*)' > ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAbortedC5EPKcj]+0x3e): > undefined reference to `vtable for itk::ProcessAborted' > ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAbortedC5EPKcj]+0x4f): > undefined reference to `itk::ExceptionObject::SetDescription(char const*)' > ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAbortedC5EPKcj]+0x62): > undefined reference to `itk::ExceptionObject::~ExceptionObject()' > > > > This is on a Linux Red Hat with ITK git master today (March 21 2016) > > cmake --version > cmake version 2.8.12.2 > > /proc/version: > > Linux version 2.6.32-573.18.1.el6.x86_64 > (mockbuild at x86-010.build.bos.redhat.com) (gcc version 4.4.7 20120313 (Red > Hat 4.4.7-16) (GCC) ) #1 SMP Wed Jan 6 11:20:49 EST 2016 > > > > -- > This e-mail and any attachments may contain confidential, copyright and or > privileged material, and are for the use of the intended addressee only. If > you are not the intended addressee or an authorised recipient of the > addressee please notify us of receipt by returning the e-mail and do not > use, copy, retain, distribute or disclose the information in or attached to > the e-mail. > Any opinions expressed within this e-mail are those of the individual and > not necessarily of Diamond Light Source Ltd. > Diamond Light Source Ltd. cannot guarantee that this e-mail or any > attachments are free from viruses and we cannot accept liability for any > damage which you may sustain as a result of software viruses which may be > transmitted in or with the message. > Diamond Light Source Limited (company no. 4375679). Registered in England > and Wales with its registered office at Diamond House, Harwell Science and > Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > > > > > -- > > This e-mail and any attachments may contain confidential, copyright and or > privileged material, and are for the use of the intended addressee only. If > you are not the intended addressee or an authorised recipient of the > addressee please notify us of receipt by returning the e-mail and do not > use, copy, retain, distribute or disclose the information in or attached to > the e-mail. > Any opinions expressed within this e-mail are those of the individual and > not necessarily of Diamond Light Source Ltd. > Diamond Light Source Ltd. cannot guarantee that this e-mail or any > attachments are free from viruses and we cannot accept liability for any > damage which you may sustain as a result of software viruses which may be > transmitted in or with the message. > Diamond Light Source Limited (company no. 4375679). Registered in England > and Wales with its registered office at Diamond House, Harwell Science and > Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom > > > > > > > -- > > This e-mail and any attachments may contain confidential, copyright and or > privileged material, and are for the use of the intended addressee only. If > you are not the intended addressee or an authorised recipient of the > addressee please notify us of receipt by returning the e-mail and do not > use, copy, retain, distribute or disclose the information in or attached to > the e-mail. > Any opinions expressed within this e-mail are those of the individual and > not necessarily of Diamond Light Source Ltd. > Diamond Light Source Ltd. cannot guarantee that this e-mail or any > attachments are free from viruses and we cannot accept liability for any > damage which you may sustain as a result of software viruses which may be > transmitted in or with the message. > Diamond Light Source Limited (company no. 4375679). Registered in England > and Wales with its registered office at Diamond House, Harwell Science and > Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom > > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 Robert.Atwood at diamond.ac.uk Wed Mar 23 13:04:19 2016 From: Robert.Atwood at diamond.ac.uk (Robert.Atwood at diamond.ac.uk) Date: Wed, 23 Mar 2016 17:04:19 +0000 Subject: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib -- Solved (maybe) In-Reply-To: References: <6CCDD8FC6578314C902BBF87D511D9D8EA6CA999@EXCHMBX01.fed.cclrc.ac.uk> Message-ID: <6CCDD8FC6578314C902BBF87D511D9D8EA6CA9E5@EXCHMBX01.fed.cclrc.ac.uk> Hi, Matt I did that but it didn't work. Exactly the same error. See a little further back in the thread: That's where I lost patience with 'combinatorial trial and error approach' , I added -fPIC everywhere I could think of The position-independent-code seems to be generated for all libs except a small selction of i/o libs ; gdcm* ,Nrrd , and a couple of others (trial-and-error) If I don't include these in the final link, then the link is successful. All other libraries appear to have PIC generated. But, the final library isn't usable. I wonder what these ones have in common?? Is there a 'glitch' in the makefile generation that omits -fPIC in these cases somehow? libitkgdcmjpeg8-4.10.a libitkgdcmjpeg12-4.10.a libitkgdcmjpeg16-4.10.a libitkgdcmopenjpeg-4.10.a libitkgdcmuuid-4.10.a libITKEXPAT-4.10.a libITKniftiio-4.10.a libITKNrrdIO-4.10.a libitkhdf5-4.10.a libitksys-4.10.a (using system jpeg, tiff, zlib and png) Ironically , it's only .mhd I actually want to use and it is not on the problem list. But the io-objects need all these to be available just in case they get used, I suppose. > > I have tried some combinations of these options but, you know, it > > takes a while to rebuild ITK even though the computer is pretty good. > > BUILD_POSITION_DEPENDENT_CODE OFF (I don?t think this should be ON > > because that really wouldn?t work? ) > > BUILD_SHARED_LIBS OFF (or ON) > > CMAKE_CXX_FLAGS -fPIC (or default) > > CMAKE_EXE_LINKER_FLAGS -fPIC (or default) > > CMAKE_STATIC_LINKER_FLAGS (should this be set too? ) Regards, Robert > -----Original Message----- > From: Matt McCormick [mailto:matt.mccormick at kitware.com] > Sent: 23 March 2016 16:29 > To: Atwood, Robert (DLSLtd,RAL,SCI) > Cc: D?enan Zuki?; insight-users at itk.org > Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib -- Solved > (maybe) > > Hi Robert, > > > /usr/bin/ld: > > /dls_sw/apps/itk/itk-master-static/lib/libitkgdcmjpeg8-4.10.a(jerror.c > > .o): relocation R_X86_64_32S against `.text' can not be used when > > making a shared object; recompile with -fPIC > > This means that "-fPIC" should be added to the CMAKE_CXX_FLAGS for ITK. > > HTH, > Matt > > On Wed, Mar 23, 2016 at 11:58 AM, > wrote: > > Hi, D?enan, and List : > > > > > > > > Thanks for the tips, but, building the executable by pointing to the > > itk-build folder for linking is exactly what I did not want to do. I > > want the compiled instances of the specific templated objects to be > > put into a stand-alone library that could then be linked , in an > > environment where the ITK build directory may not be available, and > > within a project that?s not using cmake (yet? J ) just for a small > > single-data-type-specific filter chain that would be a bit nontrivial to just re- > implement myself! > > > > > > > > I had some success with the following, for the example ITKFilterLib: > > > > > > > > Using the itk-master-git-static as built before, (BUILD_SHARED_LIBS > > OFF) > > > > > > > > > > > > In CMakeLists.txt for the project, add SHARED keyword to the library > > defninition: > > > > > > > > 15 ADD_LIBRARY(Example_ITKFilterLib SHARED ITKFilterLib.cxx ) > > > > Then use cmake + make to build the libExample_ITKFilterLib.so library. > > > > > > > > > > > > Then I can invoke g++ as follows > > > > > > > > > > > > > > > > build]$ g++ ../ITKFilterLib/ITKFilterLibTest.cxx -o testcomp -L . -l > > Example_ITKFilterLib -I ../ITKFilterLib/ > > > > > > > > Even if the itk-master-static is not available in that environment, > > this succeeds, and I believe this is what I want. I don?t want to have > > a statically linked final executable, but rather a .so library. > > > > > > > > > > > > However ? > > > > > > > > I encountered another hitch trying to apply this to my actual project. > > If there were any FileWriter and FileReader present in the library, it > > would not build, complaining about position-dependent symbols in > > several IO libraries , most of which I was not actually wanting to use > > at all. This happened at the step of trying to build the .so library > > using the makefile created by cmake: > > > > > > > > /usr/bin/ld: > > /dls_sw/apps/itk/itk-master-static/lib/libitkgdcmjpeg8-4.10.a(jerror.c.o): > > relocation R_X86_64_32S against `.text' can not be used when making a > > shared object; recompile with -fPIC > > > > /dls_sw/apps/itk/itk-master-static/lib/libitkgdcmjpeg8-4.10.a: could > > not read symbols: Bad value > > > > > > > > > > > > Removing any reference to FileReader and FileWriter gets rid of this > > problem. > > > > > > > > Thanks! > > > > > > > > > > > > As a further note: > > > > > > > > There are also some directions in the comments of the ITKFilterLib > > example that did not turn out to be necessary in my project. I did not > > have to create global objects for poitners or image containiers > > outside the scope of the class and still did not have to #include itkImage.h in > the main program. > > I placed the typedef?s inside the class and the instantiations of the > > smart poitners in the class constructor. I don?t see that this extra > > complication in the example is necessary unless it is platform dependent? > > > > > > > > ITKFilterLib.cxx from ItkApps example: > > > > > > > > > > > > 23 #include "ITKFilterLib.h" > > > > 24 > > > > 25 // Nasty local globals inside .cxx file to hide itk from the real world. > > > > 26 // Can't put this variable in the class definition otherwise we'd have > > to > > > > 27 // include itkImage.h in every program using this class. > > > > 28 // The typedef h_itkFilterLibeDataType is in itkFilterLib.h to hide > > > > 29 // templates > > > > 30 typedef itk::Image g_ImageType; > > > > 31 g_ImageType::Pointer g_InputImage; > > > > 32 g_ImageType::Pointer g_OutputImage; > > > > > > > > I did not find this to be necessary in my project. > > > > > > > > > > > > 33 > > > > 34 > > > > 35 // > > > > 36 // > > > > 37 // The first filter in the .lib > > > > 38 // > > > > 39 // > > > > 40 > > > > 41 /** The next lines are used to include the definition of the filter > > > > 42 * we want to install in the .lib, define a typedef for it, and create > > > > 43 * a "smart" pointer to hold it. > > > > 44 * CHANGE HERE: The filter to be instantiated. > > > > 45 **/ > > > > 46 #include "itkCurvatureAnisotropicDiffusionImageFilter.h" > > > > 47 typedef itk::CurvatureAnisotropicDiffusionImageFilter > > > 48 g_ImageType> g_AnisoFilterType; > > > > 49 g_AnisoFilterType::Pointer g_anisoFilter; > > > > 50 > > > > > > > > I also did not find it to be necessary to have this sort of typedef > > and instantiation of the object at global scope in my project. > > > > > > > > > > > > > > > > > > > > > > > > > > > > From: D?enan Zuki? [mailto:dzenanz at gmail.com] > > Sent: 23 March 2016 14:39 > > To: Atwood, Robert (DLSLtd,RAL,SCI) > > Cc: Insight-users > > Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib > > > > > > > > Hi Robert, > > > > > > > > BUILD_SHARED_LIBS OFF is the crucial setting. You can keep the rest of > > options on defaults. > > > > > > > > Your CMake code looks OK. You should execute the following from your > folder: > > > > cmake . > > > > make > > > > > > > > During CMake step you should configure options (point to the itk-build > > folder which was configured with BUILD_SHARED_LIBS OFF). Afterwards, > > do not invoke g++ directly - invoke make, which supplies correct > > include directories and link libraries so you don't run into a thousand errors. > > > > > > > > Regards, > > > > D?enan > > > > > > > > On Tue, Mar 22, 2016 at 6:25 AM, > wrote: > > > > Hi, > > Thanks, D?enan, for the hint. But, does anyone have specific > > information on exactly which options to set in each of: the ITK cmake > > options; and the project cmake options, or the plain g++ for building > > an external program to link to the library, for this to work ? There > > appear to be a few that might be related to this. Because, so far, > > simply changing the build options of the ITK installation didn?t work. See > below for even more details . > > > > Thanks > > > > Robert > > > > > > > > > > > > > > > > Options selected in the project: > > > > ITK_DIR > > /dls_sw/apps/itk/itk-master-static/lib/cmake/ITK-4.10 > > > > > > > > > > > > > > > > In the ITK with installation to itk-master-static: > > > > I have tried some combinations of these options but, you know, it > > takes a while to rebuild ITK even though the computer is pretty good. > > > > > > > > BUILD_POSITION_DEPENDENT_CODE OFF (I don?t think this should be ON > > because that really wouldn?t work? ) > > > > BUILD_SHARED_LIBS OFF (or ON) > > > > CMAKE_CXX_FLAGS -fPIC (or default) > > > > CMAKE_EXE_LINKER_FLAGS -fPIC (or default) > > > > CMAKE_STATIC_LINKER_FLAGS (should this be set too? ) > > > > > > > > > > > > > > > > The CMakeLists in the project file ? only small modification from the > > original to ?BUILD_OUTSIDE_INSIGHT_APPICATIONS?. The project builds > > using the Cmake makefile, producing the library and the executable > > > > But trying to build either the ?main? procedure provided with linking > > to that library, or even simplifying the ?main? to do virtually > > nothing except instantiate the object, results in 1000 error messages > > of ?undefined symbols? > > > > > > > > 1 PROJECT(Example_ITKFilterLib) > > > > 2 > > > > 3 #REMOVED 'IF (BUILD_OUTSIDE_INSIGHT_APPLICATIONS)' > > > > 4 > > > > 5 FIND_PACKAGE(ITK) > > > > 6 IF(ITK_FOUND) > > > > 7 INCLUDE(${ITK_USE_FILE}) > > > > 8 ELSE(ITK_FOUND) > > > > 9 MESSAGE(FATAL_ERROR > > > > 10 "Cannot build ITKApps without ITK. Please set ITK_DIR.") > > > > 11 ENDIF(ITK_FOUND) > > > > 12 > > > > 13 #REMOVED 'ENDIF(BUILD_OUTSIDE_INSIGHT_APPLICATIONS)' > > > > 14 > > > > 15 ADD_LIBRARY(Example_ITKFilterLib ITKFilterLib.cxx ) > > > > 16 INSTALL_TARGETS(/lib Example_ITKFilterLib) > > > > 17 TARGET_LINK_LIBRARIES(Example_ITKFilterLib ${ITK_LIBRARIES}) > > > > 18 > > > > 19 ADD_EXECUTABLE(Example_ITKFilterLibTest ITKFilterLibTest.cxx ) > > > > 20 INSTALL_TARGETS(/bin Example_ITKFilterLibTest) > > > > 21 TARGET_LINK_LIBRARIES(Example_ITKFilterLibTest > > Example_ITKFilterLib) > > > > > > > > > > > > build]$ ls -l > > > > total 2508 > > > > -rw-rw-r-- 1 kny48981 kny48981 14393 Mar 22 10:02 CMakeCache.txt > > > > drwxrwxr-x 6 kny48981 kny48981 4096 Mar 22 10:05 CMakeFiles > > > > -rwxrwxr-x 1 kny48981 kny48981 1417263 Mar 22 10:05 > > Example_ITKFilterLibTest > > > > drwxrwxr-x 2 kny48981 kny48981 4096 Mar 22 10:02 > ITKIOFactoryRegistration > > > > -rw-rw-r-- 1 kny48981 kny48981 7933 Mar 22 10:02 Makefile > > > > -rw-rw-r-- 1 kny48981 kny48981 1092874 Mar 22 10:05 > > libExample_ITKFilterLib.a > > > > > > > > > > > > > > > > build]$ g++ -o testcomp ../ITKFilterLib/ITKFilterLibTest.cxx -I > > ../ITKFilterLib -L . -l Example_ITKFilterLib >& out & > > > > > > > > ? generates 1100 messages ? > > > > > > > > > > > > 1 ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function > > `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string > har, > > std::char_traits, std::allocat > > > > 2 > > > ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3 > itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): > > undefined reference to `itk::ExceptionObject: > > > > ? > > > > 1106 > > ITKFilterLib.cxx:(.text._ZNK3itk12NeighborhoodIPfLj3ENS_21Neighborhood > > AllocatorIS1_EEE9PrintSelfERSoNS_6IndentE[itk::Neighborhood > 3u, itk::NeighborhoodAllocato > > > > 1107 collect2: ld returned 1 exit status > > > > > > > > > > > > Minimal example main: > > > > > > > > 1 #include "ITKFilterLib.h" > > > > 2 int main(int, char **) { > > > > 3 int inputDimSize[3]; > > > > 4 float inputOrigin[3]; > > > > 5 float inputSpacing[3]; > > > > 6 inputDimSize[0] = 5; > > > > 7 inputDimSize[1] = 5; > > > > 8 inputDimSize[2] = 5; > > > > 9 inputOrigin[0] = 0; > > > > 10 inputOrigin[1] = 0; > > > > 11 inputOrigin[2] = 0; > > > > 12 inputSpacing[0] = 1; > > > > 13 inputSpacing[1] = 1; > > > > 14 inputSpacing[2] = 1; > > > > 15 > > > > 16 itkFilterLib filter(inputDimSize, inputOrigin, inputSpacing); > > > > 17 return (true); > > > > 18 } > > > > > > > > g++ -o testmin minimal_example.cxx -I ../ITKFilterLib -L . -l > > Example_ITKFilterLib >& out > > > > > > > > > > > > Same output AFAICT: > > > > > > > > > > > > 1 ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function > > `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string > har, > > std::char_traits, std::alloca > > > > 2 > > > ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3 > itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): > > undefined reference to `itk::ExceptionObject: > > > > ?. > > > > > > > > From: D?enan Zuki? [mailto:dzenanz at gmail.com] > > Sent: 21 March 2016 20:21 > > To: Atwood, Robert (DLSLtd,RAL,SCI) > > Cc: Insight-users > > Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib > > > > > > > > Hi Robert, > > > > > > > > maybe you need to link to ITK statically? To accomplish this you > > probably need to build ITK as static libraries (it is a configuration > > option in CMake). > > > > > > > > Regards, > > > > D?enan > > > > > > > > On Mon, Mar 21, 2016 at 12:50 PM, > wrote: > > > > Hi, > > This example, ITKApps/ITKFilterLib, appears to be an example of what I > > want to do , bundle or encapsulate a specific ITK-based filter into a > > library so that another program may just call it without having to > > have the ITK source installation available. > > However, a basic test for me is not working. > > > > I just tried to compile the test example from command line after > > building the library with Cmake as usual. I get hundreds of 'undefined > > reference', as if I have to link with all the ITK libs anyways. > > Am I missing something? > > Thanks > > > > > > > > > > g++ -o testcomp ../ITKFilterLib/ITKFilterLibTest.cxx -I > > g++ ../ITKFilterLib/ -L > > . -l Example_ITKFilterLib > > > > > > First few lines of output: > > > > ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function > > `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string > har, std::char_traits, std::allocator > const&, unsigned > > int, std::basic_string, > > std::allocator > const&, std::basic_string > std::char_traits, std::allocator > >> const&)': > > > ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3 > itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): > > undefined reference to > > `itk::ExceptionObject::ExceptionObject(std::basic_string > std::char_traits, std::allocator > const&, unsigned int, > > std::basic_string, std::allocator > > > const&, std::basic_string > > ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3 > itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x44): > > undefined reference to `vtable for itk::MemoryAllocationError' > > ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function > > `itk::ProcessAborted::ProcessAborted(char const*, unsigned int)': > > > ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAb > ortedC5EPKcj]+0x33): > > undefined reference to `itk::ExceptionObject::ExceptionObject(char > > const*, unsigned int, char const*, char const*)' > > > ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAb > ortedC5EPKcj]+0x3e): > > undefined reference to `vtable for itk::ProcessAborted' > > > ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAb > ortedC5EPKcj]+0x4f): > > undefined reference to `itk::ExceptionObject::SetDescription(char const*)' > > > ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAb > ortedC5EPKcj]+0x62): > > undefined reference to `itk::ExceptionObject::~ExceptionObject()' > > > > > > > > This is on a Linux Red Hat with ITK git master today (March 21 2016) > > > > cmake --version > > cmake version 2.8.12.2 > > > > /proc/version: > > > > Linux version 2.6.32-573.18.1.el6.x86_64 > > (mockbuild at x86-010.build.bos.redhat.com) (gcc version 4.4.7 20120313 > > (Red Hat 4.4.7-16) (GCC) ) #1 SMP Wed Jan 6 11:20:49 EST 2016 > > > > > > > > -- > > This e-mail and any attachments may contain confidential, copyright > > and or privileged material, and are for the use of the intended > > addressee only. If you are not the intended addressee or an authorised > > recipient of the addressee please notify us of receipt by returning > > the e-mail and do not use, copy, retain, distribute or disclose the > > information in or attached to the e-mail. > > Any opinions expressed within this e-mail are those of the individual > > and not necessarily of Diamond Light Source Ltd. > > Diamond Light Source Ltd. cannot guarantee that this e-mail or any > > attachments are free from viruses and we cannot accept liability for > > any damage which you may sustain as a result of software viruses which > > may be transmitted in or with the message. > > Diamond Light Source Limited (company no. 4375679). Registered in > > England and Wales with its registered office at Diamond House, Harwell > > Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United > > Kingdom > > > > _____________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Kitware offers ITK Training Courses, for more information visit: > > http://www.kitware.com/products/protraining.php > > > > Please keep messages on-topic and check the ITK FAQ at: > > http://www.itk.org/Wiki/ITK_FAQ > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/insight-users > > > > > > > > > > > > -- > > > > This e-mail and any attachments may contain confidential, copyright > > and or privileged material, and are for the use of the intended > > addressee only. If you are not the intended addressee or an authorised > > recipient of the addressee please notify us of receipt by returning > > the e-mail and do not use, copy, retain, distribute or disclose the > > information in or attached to the e-mail. > > Any opinions expressed within this e-mail are those of the individual > > and not necessarily of Diamond Light Source Ltd. > > Diamond Light Source Ltd. cannot guarantee that this e-mail or any > > attachments are free from viruses and we cannot accept liability for > > any damage which you may sustain as a result of software viruses which > > may be transmitted in or with the message. > > Diamond Light Source Limited (company no. 4375679). Registered in > > England and Wales with its registered office at Diamond House, Harwell > > Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United > > Kingdom > > > > > > > > > > > > > > -- > > > > This e-mail and any attachments may contain confidential, copyright > > and or privileged material, and are for the use of the intended > > addressee only. If you are not the intended addressee or an authorised > > recipient of the addressee please notify us of receipt by returning > > the e-mail and do not use, copy, retain, distribute or disclose the > > information in or attached to the e-mail. > > Any opinions expressed within this e-mail are those of the individual > > and not necessarily of Diamond Light Source Ltd. > > Diamond Light Source Ltd. cannot guarantee that this e-mail or any > > attachments are free from viruses and we cannot accept liability for > > any damage which you may sustain as a result of software viruses which > > may be transmitted in or with the message. > > Diamond Light Source Limited (company no. 4375679). Registered in > > England and Wales with its registered office at Diamond House, Harwell > > Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United > > Kingdom > > > > > > > > _____________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Kitware offers ITK Training Courses, for more information visit: > > http://www.kitware.com/products/protraining.php > > > > Please keep messages on-topic and check the ITK FAQ at: > > http://www.itk.org/Wiki/ITK_FAQ > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/insight-users > > -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom From matt.mccormick at kitware.com Wed Mar 23 13:21:07 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Wed, 23 Mar 2016 13:21:07 -0400 Subject: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib -- Solved (maybe) In-Reply-To: <6CCDD8FC6578314C902BBF87D511D9D8EA6CA9E5@EXCHMBX01.fed.cclrc.ac.uk> References: <6CCDD8FC6578314C902BBF87D511D9D8EA6CA999@EXCHMBX01.fed.cclrc.ac.uk> <6CCDD8FC6578314C902BBF87D511D9D8EA6CA9E5@EXCHMBX01.fed.cclrc.ac.uk> Message-ID: Hi Robert, If CMake is new enough, just set CMAKE_POSITION_INDEPENDENT_CODE to ON. This automatically add -fPIC to the build flags. Otherwise, add -fPIC to the build flags. Those libraries were still causing issues likely because they contain both C and C++ code; add the flag to both CMAKE_C_FLAGS and CMAKE_CXX_FLAGS if CMAKE_POSITION_INDEPENDENT_CODE is not used. HTH, Matt On Wed, Mar 23, 2016 at 1:04 PM, wrote: > Hi, Matt > I did that but it didn't work. Exactly the same error. See a little further back in the thread: > > That's where I lost patience with 'combinatorial trial and error approach' , I added -fPIC everywhere I could think of > The position-independent-code seems to be generated for all libs except a small selction of i/o libs ; gdcm* ,Nrrd , and a couple of others (trial-and-error) > > If I don't include these in the final link, then the link is successful. All other libraries appear to have PIC generated. > > But, the final library isn't usable. I wonder what these ones have in common?? Is there a 'glitch' in the makefile generation that omits -fPIC in these cases somehow? > > > libitkgdcmjpeg8-4.10.a > libitkgdcmjpeg12-4.10.a > libitkgdcmjpeg16-4.10.a > libitkgdcmopenjpeg-4.10.a > libitkgdcmuuid-4.10.a > libITKEXPAT-4.10.a > libITKniftiio-4.10.a > libITKNrrdIO-4.10.a > libitkhdf5-4.10.a > libitksys-4.10.a > > (using system jpeg, tiff, zlib and png) > > Ironically , it's only .mhd I actually want to use and it is not on the problem list. But the io-objects need all these to be available just in case they get used, I suppose. > > > > >> > I have tried some combinations of these options but, you know, it >> > takes a while to rebuild ITK even though the computer is pretty good. >> > BUILD_POSITION_DEPENDENT_CODE OFF (I don?t think this should be ON >> > because that really wouldn?t work? ) >> > BUILD_SHARED_LIBS OFF (or ON) >> > CMAKE_CXX_FLAGS -fPIC (or default) >> > CMAKE_EXE_LINKER_FLAGS -fPIC (or default) >> > CMAKE_STATIC_LINKER_FLAGS (should this be set too? ) > > Regards, Robert > > > > > >> -----Original Message----- >> From: Matt McCormick [mailto:matt.mccormick at kitware.com] >> Sent: 23 March 2016 16:29 >> To: Atwood, Robert (DLSLtd,RAL,SCI) >> Cc: D?enan Zuki?; insight-users at itk.org >> Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib -- Solved >> (maybe) >> >> Hi Robert, >> >> > /usr/bin/ld: >> > /dls_sw/apps/itk/itk-master-static/lib/libitkgdcmjpeg8-4.10.a(jerror.c >> > .o): relocation R_X86_64_32S against `.text' can not be used when >> > making a shared object; recompile with -fPIC >> >> This means that "-fPIC" should be added to the CMAKE_CXX_FLAGS for ITK. >> >> HTH, >> Matt >> >> On Wed, Mar 23, 2016 at 11:58 AM, >> wrote: >> > Hi, D?enan, and List : >> > >> > >> > >> > Thanks for the tips, but, building the executable by pointing to the >> > itk-build folder for linking is exactly what I did not want to do. I >> > want the compiled instances of the specific templated objects to be >> > put into a stand-alone library that could then be linked , in an >> > environment where the ITK build directory may not be available, and >> > within a project that?s not using cmake (yet? J ) just for a small >> > single-data-type-specific filter chain that would be a bit nontrivial to just re- >> implement myself! >> > >> > >> > >> > I had some success with the following, for the example ITKFilterLib: >> > >> > >> > >> > Using the itk-master-git-static as built before, (BUILD_SHARED_LIBS >> > OFF) >> > >> > >> > >> > >> > >> > In CMakeLists.txt for the project, add SHARED keyword to the library >> > defninition: >> > >> > >> > >> > 15 ADD_LIBRARY(Example_ITKFilterLib SHARED ITKFilterLib.cxx ) >> > >> > Then use cmake + make to build the libExample_ITKFilterLib.so library. >> > >> > >> > >> > >> > >> > Then I can invoke g++ as follows >> > >> > >> > >> > >> > >> > >> > >> > build]$ g++ ../ITKFilterLib/ITKFilterLibTest.cxx -o testcomp -L . -l >> > Example_ITKFilterLib -I ../ITKFilterLib/ >> > >> > >> > >> > Even if the itk-master-static is not available in that environment, >> > this succeeds, and I believe this is what I want. I don?t want to have >> > a statically linked final executable, but rather a .so library. >> > >> > >> > >> > >> > >> > However ? >> > >> > >> > >> > I encountered another hitch trying to apply this to my actual project. >> > If there were any FileWriter and FileReader present in the library, it >> > would not build, complaining about position-dependent symbols in >> > several IO libraries , most of which I was not actually wanting to use >> > at all. This happened at the step of trying to build the .so library >> > using the makefile created by cmake: >> > >> > >> > >> > /usr/bin/ld: >> > /dls_sw/apps/itk/itk-master-static/lib/libitkgdcmjpeg8-4.10.a(jerror.c.o): >> > relocation R_X86_64_32S against `.text' can not be used when making a >> > shared object; recompile with -fPIC >> > >> > /dls_sw/apps/itk/itk-master-static/lib/libitkgdcmjpeg8-4.10.a: could >> > not read symbols: Bad value >> > >> > >> > >> > >> > >> > Removing any reference to FileReader and FileWriter gets rid of this >> > problem. >> > >> > >> > >> > Thanks! >> > >> > >> > >> > >> > >> > As a further note: >> > >> > >> > >> > There are also some directions in the comments of the ITKFilterLib >> > example that did not turn out to be necessary in my project. I did not >> > have to create global objects for poitners or image containiers >> > outside the scope of the class and still did not have to #include itkImage.h in >> the main program. >> > I placed the typedef?s inside the class and the instantiations of the >> > smart poitners in the class constructor. I don?t see that this extra >> > complication in the example is necessary unless it is platform dependent? >> > >> > >> > >> > ITKFilterLib.cxx from ItkApps example: >> > >> > >> > >> > >> > >> > 23 #include "ITKFilterLib.h" >> > >> > 24 >> > >> > 25 // Nasty local globals inside .cxx file to hide itk from the real world. >> > >> > 26 // Can't put this variable in the class definition otherwise we'd have >> > to >> > >> > 27 // include itkImage.h in every program using this class. >> > >> > 28 // The typedef h_itkFilterLibeDataType is in itkFilterLib.h to hide >> > >> > 29 // templates >> > >> > 30 typedef itk::Image g_ImageType; >> > >> > 31 g_ImageType::Pointer g_InputImage; >> > >> > 32 g_ImageType::Pointer g_OutputImage; >> > >> > >> > >> > I did not find this to be necessary in my project. >> > >> > >> > >> > >> > >> > 33 >> > >> > 34 >> > >> > 35 // >> > >> > 36 // >> > >> > 37 // The first filter in the .lib >> > >> > 38 // >> > >> > 39 // >> > >> > 40 >> > >> > 41 /** The next lines are used to include the definition of the filter >> > >> > 42 * we want to install in the .lib, define a typedef for it, and create >> > >> > 43 * a "smart" pointer to hold it. >> > >> > 44 * CHANGE HERE: The filter to be instantiated. >> > >> > 45 **/ >> > >> > 46 #include "itkCurvatureAnisotropicDiffusionImageFilter.h" >> > >> > 47 typedef itk::CurvatureAnisotropicDiffusionImageFilter> > >> > 48 g_ImageType> g_AnisoFilterType; >> > >> > 49 g_AnisoFilterType::Pointer g_anisoFilter; >> > >> > 50 >> > >> > >> > >> > I also did not find it to be necessary to have this sort of typedef >> > and instantiation of the object at global scope in my project. >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > From: D?enan Zuki? [mailto:dzenanz at gmail.com] >> > Sent: 23 March 2016 14:39 >> > To: Atwood, Robert (DLSLtd,RAL,SCI) >> > Cc: Insight-users >> > Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib >> > >> > >> > >> > Hi Robert, >> > >> > >> > >> > BUILD_SHARED_LIBS OFF is the crucial setting. You can keep the rest of >> > options on defaults. >> > >> > >> > >> > Your CMake code looks OK. You should execute the following from your >> folder: >> > >> > cmake . >> > >> > make >> > >> > >> > >> > During CMake step you should configure options (point to the itk-build >> > folder which was configured with BUILD_SHARED_LIBS OFF). Afterwards, >> > do not invoke g++ directly - invoke make, which supplies correct >> > include directories and link libraries so you don't run into a thousand errors. >> > >> > >> > >> > Regards, >> > >> > D?enan >> > >> > >> > >> > On Tue, Mar 22, 2016 at 6:25 AM, >> wrote: >> > >> > Hi, >> > Thanks, D?enan, for the hint. But, does anyone have specific >> > information on exactly which options to set in each of: the ITK cmake >> > options; and the project cmake options, or the plain g++ for building >> > an external program to link to the library, for this to work ? There >> > appear to be a few that might be related to this. Because, so far, >> > simply changing the build options of the ITK installation didn?t work. See >> below for even more details . >> > >> > Thanks >> > >> > Robert >> > >> > >> > >> > >> > >> > >> > >> > Options selected in the project: >> > >> > ITK_DIR >> > /dls_sw/apps/itk/itk-master-static/lib/cmake/ITK-4.10 >> > >> > >> > >> > >> > >> > >> > >> > In the ITK with installation to itk-master-static: >> > >> > I have tried some combinations of these options but, you know, it >> > takes a while to rebuild ITK even though the computer is pretty good. >> > >> > >> > >> > BUILD_POSITION_DEPENDENT_CODE OFF (I don?t think this should be ON >> > because that really wouldn?t work? ) >> > >> > BUILD_SHARED_LIBS OFF (or ON) >> > >> > CMAKE_CXX_FLAGS -fPIC (or default) >> > >> > CMAKE_EXE_LINKER_FLAGS -fPIC (or default) >> > >> > CMAKE_STATIC_LINKER_FLAGS (should this be set too? ) >> > >> > >> > >> > >> > >> > >> > >> > The CMakeLists in the project file ? only small modification from the >> > original to ?BUILD_OUTSIDE_INSIGHT_APPICATIONS?. The project builds >> > using the Cmake makefile, producing the library and the executable >> > >> > But trying to build either the ?main? procedure provided with linking >> > to that library, or even simplifying the ?main? to do virtually >> > nothing except instantiate the object, results in 1000 error messages >> > of ?undefined symbols? >> > >> > >> > >> > 1 PROJECT(Example_ITKFilterLib) >> > >> > 2 >> > >> > 3 #REMOVED 'IF (BUILD_OUTSIDE_INSIGHT_APPLICATIONS)' >> > >> > 4 >> > >> > 5 FIND_PACKAGE(ITK) >> > >> > 6 IF(ITK_FOUND) >> > >> > 7 INCLUDE(${ITK_USE_FILE}) >> > >> > 8 ELSE(ITK_FOUND) >> > >> > 9 MESSAGE(FATAL_ERROR >> > >> > 10 "Cannot build ITKApps without ITK. Please set ITK_DIR.") >> > >> > 11 ENDIF(ITK_FOUND) >> > >> > 12 >> > >> > 13 #REMOVED 'ENDIF(BUILD_OUTSIDE_INSIGHT_APPLICATIONS)' >> > >> > 14 >> > >> > 15 ADD_LIBRARY(Example_ITKFilterLib ITKFilterLib.cxx ) >> > >> > 16 INSTALL_TARGETS(/lib Example_ITKFilterLib) >> > >> > 17 TARGET_LINK_LIBRARIES(Example_ITKFilterLib ${ITK_LIBRARIES}) >> > >> > 18 >> > >> > 19 ADD_EXECUTABLE(Example_ITKFilterLibTest ITKFilterLibTest.cxx ) >> > >> > 20 INSTALL_TARGETS(/bin Example_ITKFilterLibTest) >> > >> > 21 TARGET_LINK_LIBRARIES(Example_ITKFilterLibTest >> > Example_ITKFilterLib) >> > >> > >> > >> > >> > >> > build]$ ls -l >> > >> > total 2508 >> > >> > -rw-rw-r-- 1 kny48981 kny48981 14393 Mar 22 10:02 CMakeCache.txt >> > >> > drwxrwxr-x 6 kny48981 kny48981 4096 Mar 22 10:05 CMakeFiles >> > >> > -rwxrwxr-x 1 kny48981 kny48981 1417263 Mar 22 10:05 >> > Example_ITKFilterLibTest >> > >> > drwxrwxr-x 2 kny48981 kny48981 4096 Mar 22 10:02 >> ITKIOFactoryRegistration >> > >> > -rw-rw-r-- 1 kny48981 kny48981 7933 Mar 22 10:02 Makefile >> > >> > -rw-rw-r-- 1 kny48981 kny48981 1092874 Mar 22 10:05 >> > libExample_ITKFilterLib.a >> > >> > >> > >> > >> > >> > >> > >> > build]$ g++ -o testcomp ../ITKFilterLib/ITKFilterLibTest.cxx -I >> > ../ITKFilterLib -L . -l Example_ITKFilterLib >& out & >> > >> > >> > >> > ? generates 1100 messages ? >> > >> > >> > >> > >> > >> > 1 ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function >> > `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string> > har, >> > std::char_traits, std::allocat >> > >> > 2 >> > >> ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3 >> itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): >> > undefined reference to `itk::ExceptionObject: >> > >> > ? >> > >> > 1106 >> > ITKFilterLib.cxx:(.text._ZNK3itk12NeighborhoodIPfLj3ENS_21Neighborhood >> > AllocatorIS1_EEE9PrintSelfERSoNS_6IndentE[itk::Neighborhood> > 3u, itk::NeighborhoodAllocato >> > >> > 1107 collect2: ld returned 1 exit status >> > >> > >> > >> > >> > >> > Minimal example main: >> > >> > >> > >> > 1 #include "ITKFilterLib.h" >> > >> > 2 int main(int, char **) { >> > >> > 3 int inputDimSize[3]; >> > >> > 4 float inputOrigin[3]; >> > >> > 5 float inputSpacing[3]; >> > >> > 6 inputDimSize[0] = 5; >> > >> > 7 inputDimSize[1] = 5; >> > >> > 8 inputDimSize[2] = 5; >> > >> > 9 inputOrigin[0] = 0; >> > >> > 10 inputOrigin[1] = 0; >> > >> > 11 inputOrigin[2] = 0; >> > >> > 12 inputSpacing[0] = 1; >> > >> > 13 inputSpacing[1] = 1; >> > >> > 14 inputSpacing[2] = 1; >> > >> > 15 >> > >> > 16 itkFilterLib filter(inputDimSize, inputOrigin, inputSpacing); >> > >> > 17 return (true); >> > >> > 18 } >> > >> > >> > >> > g++ -o testmin minimal_example.cxx -I ../ITKFilterLib -L . -l >> > Example_ITKFilterLib >& out >> > >> > >> > >> > >> > >> > Same output AFAICT: >> > >> > >> > >> > >> > >> > 1 ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function >> > `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string> > har, >> > std::char_traits, std::alloca >> > >> > 2 >> > >> ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3 >> itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): >> > undefined reference to `itk::ExceptionObject: >> > >> > ?. >> > >> > >> > >> > From: D?enan Zuki? [mailto:dzenanz at gmail.com] >> > Sent: 21 March 2016 20:21 >> > To: Atwood, Robert (DLSLtd,RAL,SCI) >> > Cc: Insight-users >> > Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib >> > >> > >> > >> > Hi Robert, >> > >> > >> > >> > maybe you need to link to ITK statically? To accomplish this you >> > probably need to build ITK as static libraries (it is a configuration >> > option in CMake). >> > >> > >> > >> > Regards, >> > >> > D?enan >> > >> > >> > >> > On Mon, Mar 21, 2016 at 12:50 PM, >> wrote: >> > >> > Hi, >> > This example, ITKApps/ITKFilterLib, appears to be an example of what I >> > want to do , bundle or encapsulate a specific ITK-based filter into a >> > library so that another program may just call it without having to >> > have the ITK source installation available. >> > However, a basic test for me is not working. >> > >> > I just tried to compile the test example from command line after >> > building the library with Cmake as usual. I get hundreds of 'undefined >> > reference', as if I have to link with all the ITK libs anyways. >> > Am I missing something? >> > Thanks >> > >> > >> > >> > >> > g++ -o testcomp ../ITKFilterLib/ITKFilterLibTest.cxx -I >> > g++ ../ITKFilterLib/ -L >> > . -l Example_ITKFilterLib >> > >> > >> > First few lines of output: >> > >> > ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function >> > `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string> > har, std::char_traits, std::allocator > const&, unsigned >> > int, std::basic_string, >> > std::allocator > const&, std::basic_string> > std::char_traits, std::allocator >> >> const&)': >> > >> ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3 >> itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): >> > undefined reference to >> > `itk::ExceptionObject::ExceptionObject(std::basic_string> > std::char_traits, std::allocator > const&, unsigned int, >> > std::basic_string, std::allocator > >> > const&, std::basic_string> > >> ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3 >> itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x44): >> > undefined reference to `vtable for itk::MemoryAllocationError' >> > ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function >> > `itk::ProcessAborted::ProcessAborted(char const*, unsigned int)': >> > >> ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAb >> ortedC5EPKcj]+0x33): >> > undefined reference to `itk::ExceptionObject::ExceptionObject(char >> > const*, unsigned int, char const*, char const*)' >> > >> ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAb >> ortedC5EPKcj]+0x3e): >> > undefined reference to `vtable for itk::ProcessAborted' >> > >> ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAb >> ortedC5EPKcj]+0x4f): >> > undefined reference to `itk::ExceptionObject::SetDescription(char const*)' >> > >> ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAb >> ortedC5EPKcj]+0x62): >> > undefined reference to `itk::ExceptionObject::~ExceptionObject()' >> > >> > >> > >> > This is on a Linux Red Hat with ITK git master today (March 21 2016) >> > >> > cmake --version >> > cmake version 2.8.12.2 >> > >> > /proc/version: >> > >> > Linux version 2.6.32-573.18.1.el6.x86_64 >> > (mockbuild at x86-010.build.bos.redhat.com) (gcc version 4.4.7 20120313 >> > (Red Hat 4.4.7-16) (GCC) ) #1 SMP Wed Jan 6 11:20:49 EST 2016 >> > >> > >> > >> > -- >> > This e-mail and any attachments may contain confidential, copyright >> > and or privileged material, and are for the use of the intended >> > addressee only. If you are not the intended addressee or an authorised >> > recipient of the addressee please notify us of receipt by returning >> > the e-mail and do not use, copy, retain, distribute or disclose the >> > information in or attached to the e-mail. >> > Any opinions expressed within this e-mail are those of the individual >> > and not necessarily of Diamond Light Source Ltd. >> > Diamond Light Source Ltd. cannot guarantee that this e-mail or any >> > attachments are free from viruses and we cannot accept liability for >> > any damage which you may sustain as a result of software viruses which >> > may be transmitted in or with the message. >> > Diamond Light Source Limited (company no. 4375679). Registered in >> > England and Wales with its registered office at Diamond House, Harwell >> > Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United >> > Kingdom >> > >> > _____________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Kitware offers ITK Training Courses, for more information visit: >> > http://www.kitware.com/products/protraining.php >> > >> > Please keep messages on-topic and check the ITK FAQ at: >> > http://www.itk.org/Wiki/ITK_FAQ >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/insight-users >> > >> > >> > >> > >> > >> > -- >> > >> > This e-mail and any attachments may contain confidential, copyright >> > and or privileged material, and are for the use of the intended >> > addressee only. If you are not the intended addressee or an authorised >> > recipient of the addressee please notify us of receipt by returning >> > the e-mail and do not use, copy, retain, distribute or disclose the >> > information in or attached to the e-mail. >> > Any opinions expressed within this e-mail are those of the individual >> > and not necessarily of Diamond Light Source Ltd. >> > Diamond Light Source Ltd. cannot guarantee that this e-mail or any >> > attachments are free from viruses and we cannot accept liability for >> > any damage which you may sustain as a result of software viruses which >> > may be transmitted in or with the message. >> > Diamond Light Source Limited (company no. 4375679). Registered in >> > England and Wales with its registered office at Diamond House, Harwell >> > Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United >> > Kingdom >> > >> > >> > >> > >> > >> > >> > -- >> > >> > This e-mail and any attachments may contain confidential, copyright >> > and or privileged material, and are for the use of the intended >> > addressee only. If you are not the intended addressee or an authorised >> > recipient of the addressee please notify us of receipt by returning >> > the e-mail and do not use, copy, retain, distribute or disclose the >> > information in or attached to the e-mail. >> > Any opinions expressed within this e-mail are those of the individual >> > and not necessarily of Diamond Light Source Ltd. >> > Diamond Light Source Ltd. cannot guarantee that this e-mail or any >> > attachments are free from viruses and we cannot accept liability for >> > any damage which you may sustain as a result of software viruses which >> > may be transmitted in or with the message. >> > Diamond Light Source Limited (company no. 4375679). Registered in >> > England and Wales with its registered office at Diamond House, Harwell >> > Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United >> > Kingdom >> > >> > >> > >> > _____________________________________ >> > Powered by www.kitware.com >> > >> > Visit other Kitware open-source projects at >> > http://www.kitware.com/opensource/opensource.html >> > >> > Kitware offers ITK Training Courses, for more information visit: >> > http://www.kitware.com/products/protraining.php >> > >> > Please keep messages on-topic and check the ITK FAQ at: >> > http://www.itk.org/Wiki/ITK_FAQ >> > >> > Follow this link to subscribe/unsubscribe: >> > http://public.kitware.com/mailman/listinfo/insight-users >> > > > -- > This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. > Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. > Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. > Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom From blowekamp at mail.nih.gov Wed Mar 23 13:23:00 2016 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Wed, 23 Mar 2016 13:23:00 -0400 Subject: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib -- Solved (maybe) In-Reply-To: <6CCDD8FC6578314C902BBF87D511D9D8EA6CA9E5@EXCHMBX01.fed.cclrc.ac.uk> References: <6CCDD8FC6578314C902BBF87D511D9D8EA6CA999@EXCHMBX01.fed.cclrc.ac.uk> <6CCDD8FC6578314C902BBF87D511D9D8EA6CA9E5@EXCHMBX01.fed.cclrc.ac.uk> Message-ID: Hello, I think there are some plan old C file too. I just add the following to the cmake command line: -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON You could also add ?-fPIC? to the CFLAGS too. Brad > On Mar 23, 2016, at 1:04 PM, wrote: > > Hi, Matt > I did that but it didn't work. Exactly the same error. See a little further back in the thread: > > That's where I lost patience with 'combinatorial trial and error approach' , I added -fPIC everywhere I could think of > The position-independent-code seems to be generated for all libs except a small selction of i/o libs ; gdcm* ,Nrrd , and a couple of others (trial-and-error) > > If I don't include these in the final link, then the link is successful. All other libraries appear to have PIC generated. > > But, the final library isn't usable. I wonder what these ones have in common?? Is there a 'glitch' in the makefile generation that omits -fPIC in these cases somehow? > > > libitkgdcmjpeg8-4.10.a > libitkgdcmjpeg12-4.10.a > libitkgdcmjpeg16-4.10.a > libitkgdcmopenjpeg-4.10.a > libitkgdcmuuid-4.10.a > libITKEXPAT-4.10.a > libITKniftiio-4.10.a > libITKNrrdIO-4.10.a > libitkhdf5-4.10.a > libitksys-4.10.a > > (using system jpeg, tiff, zlib and png) > > Ironically , it's only .mhd I actually want to use and it is not on the problem list. But the io-objects need all these to be available just in case they get used, I suppose. > > > > >>> I have tried some combinations of these options but, you know, it >>> takes a while to rebuild ITK even though the computer is pretty good. >>> BUILD_POSITION_DEPENDENT_CODE OFF (I don?t think this should be ON >>> because that really wouldn?t work? ) >>> BUILD_SHARED_LIBS OFF (or ON) >>> CMAKE_CXX_FLAGS -fPIC (or default) >>> CMAKE_EXE_LINKER_FLAGS -fPIC (or default) >>> CMAKE_STATIC_LINKER_FLAGS (should this be set too? ) > > Regards, Robert > > > > > >> -----Original Message----- >> From: Matt McCormick [mailto:matt.mccormick at kitware.com] >> Sent: 23 March 2016 16:29 >> To: Atwood, Robert (DLSLtd,RAL,SCI) >> Cc: D?enan Zuki?; insight-users at itk.org >> Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib -- Solved >> (maybe) >> >> Hi Robert, >> >>> /usr/bin/ld: >>> /dls_sw/apps/itk/itk-master-static/lib/libitkgdcmjpeg8-4.10.a(jerror.c >>> .o): relocation R_X86_64_32S against `.text' can not be used when >>> making a shared object; recompile with -fPIC >> >> This means that "-fPIC" should be added to the CMAKE_CXX_FLAGS for ITK. >> >> HTH, >> Matt >> >> On Wed, Mar 23, 2016 at 11:58 AM, >> wrote: >>> Hi, D?enan, and List : >>> >>> >>> >>> Thanks for the tips, but, building the executable by pointing to the >>> itk-build folder for linking is exactly what I did not want to do. I >>> want the compiled instances of the specific templated objects to be >>> put into a stand-alone library that could then be linked , in an >>> environment where the ITK build directory may not be available, and >>> within a project that?s not using cmake (yet? J ) just for a small >>> single-data-type-specific filter chain that would be a bit nontrivial to just re- >> implement myself! >>> >>> >>> >>> I had some success with the following, for the example ITKFilterLib: >>> >>> >>> >>> Using the itk-master-git-static as built before, (BUILD_SHARED_LIBS >>> OFF) >>> >>> >>> >>> >>> >>> In CMakeLists.txt for the project, add SHARED keyword to the library >>> defninition: >>> >>> >>> >>> 15 ADD_LIBRARY(Example_ITKFilterLib SHARED ITKFilterLib.cxx ) >>> >>> Then use cmake + make to build the libExample_ITKFilterLib.so library. >>> >>> >>> >>> >>> >>> Then I can invoke g++ as follows >>> >>> >>> >>> >>> >>> >>> >>> build]$ g++ ../ITKFilterLib/ITKFilterLibTest.cxx -o testcomp -L . -l >>> Example_ITKFilterLib -I ../ITKFilterLib/ >>> >>> >>> >>> Even if the itk-master-static is not available in that environment, >>> this succeeds, and I believe this is what I want. I don?t want to have >>> a statically linked final executable, but rather a .so library. >>> >>> >>> >>> >>> >>> However ? >>> >>> >>> >>> I encountered another hitch trying to apply this to my actual project. >>> If there were any FileWriter and FileReader present in the library, it >>> would not build, complaining about position-dependent symbols in >>> several IO libraries , most of which I was not actually wanting to use >>> at all. This happened at the step of trying to build the .so library >>> using the makefile created by cmake: >>> >>> >>> >>> /usr/bin/ld: >>> /dls_sw/apps/itk/itk-master-static/lib/libitkgdcmjpeg8-4.10.a(jerror.c.o): >>> relocation R_X86_64_32S against `.text' can not be used when making a >>> shared object; recompile with -fPIC >>> >>> /dls_sw/apps/itk/itk-master-static/lib/libitkgdcmjpeg8-4.10.a: could >>> not read symbols: Bad value >>> >>> >>> >>> >>> >>> Removing any reference to FileReader and FileWriter gets rid of this >>> problem. >>> >>> >>> >>> Thanks! >>> >>> >>> >>> >>> >>> As a further note: >>> >>> >>> >>> There are also some directions in the comments of the ITKFilterLib >>> example that did not turn out to be necessary in my project. I did not >>> have to create global objects for poitners or image containiers >>> outside the scope of the class and still did not have to #include itkImage.h in >> the main program. >>> I placed the typedef?s inside the class and the instantiations of the >>> smart poitners in the class constructor. I don?t see that this extra >>> complication in the example is necessary unless it is platform dependent? >>> >>> >>> >>> ITKFilterLib.cxx from ItkApps example: >>> >>> >>> >>> >>> >>> 23 #include "ITKFilterLib.h" >>> >>> 24 >>> >>> 25 // Nasty local globals inside .cxx file to hide itk from the real world. >>> >>> 26 // Can't put this variable in the class definition otherwise we'd have >>> to >>> >>> 27 // include itkImage.h in every program using this class. >>> >>> 28 // The typedef h_itkFilterLibeDataType is in itkFilterLib.h to hide >>> >>> 29 // templates >>> >>> 30 typedef itk::Image g_ImageType; >>> >>> 31 g_ImageType::Pointer g_InputImage; >>> >>> 32 g_ImageType::Pointer g_OutputImage; >>> >>> >>> >>> I did not find this to be necessary in my project. >>> >>> >>> >>> >>> >>> 33 >>> >>> 34 >>> >>> 35 // >>> >>> 36 // >>> >>> 37 // The first filter in the .lib >>> >>> 38 // >>> >>> 39 // >>> >>> 40 >>> >>> 41 /** The next lines are used to include the definition of the filter >>> >>> 42 * we want to install in the .lib, define a typedef for it, and create >>> >>> 43 * a "smart" pointer to hold it. >>> >>> 44 * CHANGE HERE: The filter to be instantiated. >>> >>> 45 **/ >>> >>> 46 #include "itkCurvatureAnisotropicDiffusionImageFilter.h" >>> >>> 47 typedef itk::CurvatureAnisotropicDiffusionImageFilter>> >>> 48 g_ImageType> g_AnisoFilterType; >>> >>> 49 g_AnisoFilterType::Pointer g_anisoFilter; >>> >>> 50 >>> >>> >>> >>> I also did not find it to be necessary to have this sort of typedef >>> and instantiation of the object at global scope in my project. >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> >>> From: D?enan Zuki? [mailto:dzenanz at gmail.com] >>> Sent: 23 March 2016 14:39 >>> To: Atwood, Robert (DLSLtd,RAL,SCI) >>> Cc: Insight-users >>> Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib >>> >>> >>> >>> Hi Robert, >>> >>> >>> >>> BUILD_SHARED_LIBS OFF is the crucial setting. You can keep the rest of >>> options on defaults. >>> >>> >>> >>> Your CMake code looks OK. You should execute the following from your >> folder: >>> >>> cmake . >>> >>> make >>> >>> >>> >>> During CMake step you should configure options (point to the itk-build >>> folder which was configured with BUILD_SHARED_LIBS OFF). Afterwards, >>> do not invoke g++ directly - invoke make, which supplies correct >>> include directories and link libraries so you don't run into a thousand errors. >>> >>> >>> >>> Regards, >>> >>> D?enan >>> >>> >>> >>> On Tue, Mar 22, 2016 at 6:25 AM, >> wrote: >>> >>> Hi, >>> Thanks, D?enan, for the hint. But, does anyone have specific >>> information on exactly which options to set in each of: the ITK cmake >>> options; and the project cmake options, or the plain g++ for building >>> an external program to link to the library, for this to work ? There >>> appear to be a few that might be related to this. Because, so far, >>> simply changing the build options of the ITK installation didn?t work. See >> below for even more details . >>> >>> Thanks >>> >>> Robert >>> >>> >>> >>> >>> >>> >>> >>> Options selected in the project: >>> >>> ITK_DIR >>> /dls_sw/apps/itk/itk-master-static/lib/cmake/ITK-4.10 >>> >>> >>> >>> >>> >>> >>> >>> In the ITK with installation to itk-master-static: >>> >>> I have tried some combinations of these options but, you know, it >>> takes a while to rebuild ITK even though the computer is pretty good. >>> >>> >>> >>> BUILD_POSITION_DEPENDENT_CODE OFF (I don?t think this should be ON >>> because that really wouldn?t work? ) >>> >>> BUILD_SHARED_LIBS OFF (or ON) >>> >>> CMAKE_CXX_FLAGS -fPIC (or default) >>> >>> CMAKE_EXE_LINKER_FLAGS -fPIC (or default) >>> >>> CMAKE_STATIC_LINKER_FLAGS (should this be set too? ) >>> >>> >>> >>> >>> >>> >>> >>> The CMakeLists in the project file ? only small modification from the >>> original to ?BUILD_OUTSIDE_INSIGHT_APPICATIONS?. The project builds >>> using the Cmake makefile, producing the library and the executable >>> >>> But trying to build either the ?main? procedure provided with linking >>> to that library, or even simplifying the ?main? to do virtually >>> nothing except instantiate the object, results in 1000 error messages >>> of ?undefined symbols? >>> >>> >>> >>> 1 PROJECT(Example_ITKFilterLib) >>> >>> 2 >>> >>> 3 #REMOVED 'IF (BUILD_OUTSIDE_INSIGHT_APPLICATIONS)' >>> >>> 4 >>> >>> 5 FIND_PACKAGE(ITK) >>> >>> 6 IF(ITK_FOUND) >>> >>> 7 INCLUDE(${ITK_USE_FILE}) >>> >>> 8 ELSE(ITK_FOUND) >>> >>> 9 MESSAGE(FATAL_ERROR >>> >>> 10 "Cannot build ITKApps without ITK. Please set ITK_DIR.") >>> >>> 11 ENDIF(ITK_FOUND) >>> >>> 12 >>> >>> 13 #REMOVED 'ENDIF(BUILD_OUTSIDE_INSIGHT_APPLICATIONS)' >>> >>> 14 >>> >>> 15 ADD_LIBRARY(Example_ITKFilterLib ITKFilterLib.cxx ) >>> >>> 16 INSTALL_TARGETS(/lib Example_ITKFilterLib) >>> >>> 17 TARGET_LINK_LIBRARIES(Example_ITKFilterLib ${ITK_LIBRARIES}) >>> >>> 18 >>> >>> 19 ADD_EXECUTABLE(Example_ITKFilterLibTest ITKFilterLibTest.cxx ) >>> >>> 20 INSTALL_TARGETS(/bin Example_ITKFilterLibTest) >>> >>> 21 TARGET_LINK_LIBRARIES(Example_ITKFilterLibTest >>> Example_ITKFilterLib) >>> >>> >>> >>> >>> >>> build]$ ls -l >>> >>> total 2508 >>> >>> -rw-rw-r-- 1 kny48981 kny48981 14393 Mar 22 10:02 CMakeCache.txt >>> >>> drwxrwxr-x 6 kny48981 kny48981 4096 Mar 22 10:05 CMakeFiles >>> >>> -rwxrwxr-x 1 kny48981 kny48981 1417263 Mar 22 10:05 >>> Example_ITKFilterLibTest >>> >>> drwxrwxr-x 2 kny48981 kny48981 4096 Mar 22 10:02 >> ITKIOFactoryRegistration >>> >>> -rw-rw-r-- 1 kny48981 kny48981 7933 Mar 22 10:02 Makefile >>> >>> -rw-rw-r-- 1 kny48981 kny48981 1092874 Mar 22 10:05 >>> libExample_ITKFilterLib.a >>> >>> >>> >>> >>> >>> >>> >>> build]$ g++ -o testcomp ../ITKFilterLib/ITKFilterLibTest.cxx -I >>> ../ITKFilterLib -L . -l Example_ITKFilterLib >& out & >>> >>> >>> >>> ? generates 1100 messages ? >>> >>> >>> >>> >>> >>> 1 ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function >>> `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string>> har, >>> std::char_traits, std::allocat >>> >>> 2 >>> >> ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3 >> itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): >>> undefined reference to `itk::ExceptionObject: >>> >>> ? >>> >>> 1106 >>> ITKFilterLib.cxx:(.text._ZNK3itk12NeighborhoodIPfLj3ENS_21Neighborhood >>> AllocatorIS1_EEE9PrintSelfERSoNS_6IndentE[itk::Neighborhood>> 3u, itk::NeighborhoodAllocato >>> >>> 1107 collect2: ld returned 1 exit status >>> >>> >>> >>> >>> >>> Minimal example main: >>> >>> >>> >>> 1 #include "ITKFilterLib.h" >>> >>> 2 int main(int, char **) { >>> >>> 3 int inputDimSize[3]; >>> >>> 4 float inputOrigin[3]; >>> >>> 5 float inputSpacing[3]; >>> >>> 6 inputDimSize[0] = 5; >>> >>> 7 inputDimSize[1] = 5; >>> >>> 8 inputDimSize[2] = 5; >>> >>> 9 inputOrigin[0] = 0; >>> >>> 10 inputOrigin[1] = 0; >>> >>> 11 inputOrigin[2] = 0; >>> >>> 12 inputSpacing[0] = 1; >>> >>> 13 inputSpacing[1] = 1; >>> >>> 14 inputSpacing[2] = 1; >>> >>> 15 >>> >>> 16 itkFilterLib filter(inputDimSize, inputOrigin, inputSpacing); >>> >>> 17 return (true); >>> >>> 18 } >>> >>> >>> >>> g++ -o testmin minimal_example.cxx -I ../ITKFilterLib -L . -l >>> Example_ITKFilterLib >& out >>> >>> >>> >>> >>> >>> Same output AFAICT: >>> >>> >>> >>> >>> >>> 1 ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function >>> `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string>> har, >>> std::char_traits, std::alloca >>> >>> 2 >>> >> ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3 >> itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): >>> undefined reference to `itk::ExceptionObject: >>> >>> ?. >>> >>> >>> >>> From: D?enan Zuki? [mailto:dzenanz at gmail.com] >>> Sent: 21 March 2016 20:21 >>> To: Atwood, Robert (DLSLtd,RAL,SCI) >>> Cc: Insight-users >>> Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib >>> >>> >>> >>> Hi Robert, >>> >>> >>> >>> maybe you need to link to ITK statically? To accomplish this you >>> probably need to build ITK as static libraries (it is a configuration >>> option in CMake). >>> >>> >>> >>> Regards, >>> >>> D?enan >>> >>> >>> >>> On Mon, Mar 21, 2016 at 12:50 PM, >> wrote: >>> >>> Hi, >>> This example, ITKApps/ITKFilterLib, appears to be an example of what I >>> want to do , bundle or encapsulate a specific ITK-based filter into a >>> library so that another program may just call it without having to >>> have the ITK source installation available. >>> However, a basic test for me is not working. >>> >>> I just tried to compile the test example from command line after >>> building the library with Cmake as usual. I get hundreds of 'undefined >>> reference', as if I have to link with all the ITK libs anyways. >>> Am I missing something? >>> Thanks >>> >>> >>> >>> >>> g++ -o testcomp ../ITKFilterLib/ITKFilterLibTest.cxx -I >>> g++ ../ITKFilterLib/ -L >>> . -l Example_ITKFilterLib >>> >>> >>> First few lines of output: >>> >>> ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function >>> `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string>> har, std::char_traits, std::allocator > const&, unsigned >>> int, std::basic_string, >>> std::allocator > const&, std::basic_string>> std::char_traits, std::allocator >>>> const&)': >>> >> ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3 >> itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): >>> undefined reference to >>> `itk::ExceptionObject::ExceptionObject(std::basic_string>> std::char_traits, std::allocator > const&, unsigned int, >>> std::basic_string, std::allocator > >>> const&, std::basic_string>> >> ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3 >> itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x44): >>> undefined reference to `vtable for itk::MemoryAllocationError' >>> ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function >>> `itk::ProcessAborted::ProcessAborted(char const*, unsigned int)': >>> >> ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAb >> ortedC5EPKcj]+0x33): >>> undefined reference to `itk::ExceptionObject::ExceptionObject(char >>> const*, unsigned int, char const*, char const*)' >>> >> ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAb >> ortedC5EPKcj]+0x3e): >>> undefined reference to `vtable for itk::ProcessAborted' >>> >> ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAb >> ortedC5EPKcj]+0x4f): >>> undefined reference to `itk::ExceptionObject::SetDescription(char const*)' >>> >> ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAb >> ortedC5EPKcj]+0x62): >>> undefined reference to `itk::ExceptionObject::~ExceptionObject()' >>> >>> >>> >>> This is on a Linux Red Hat with ITK git master today (March 21 2016) >>> >>> cmake --version >>> cmake version 2.8.12.2 >>> >>> /proc/version: >>> >>> Linux version 2.6.32-573.18.1.el6.x86_64 >>> (mockbuild at x86-010.build.bos.redhat.com) (gcc version 4.4.7 20120313 >>> (Red Hat 4.4.7-16) (GCC) ) #1 SMP Wed Jan 6 11:20:49 EST 2016 >>> >>> >>> >>> -- >>> This e-mail and any attachments may contain confidential, copyright >>> and or privileged material, and are for the use of the intended >>> addressee only. If you are not the intended addressee or an authorised >>> recipient of the addressee please notify us of receipt by returning >>> the e-mail and do not use, copy, retain, distribute or disclose the >>> information in or attached to the e-mail. >>> Any opinions expressed within this e-mail are those of the individual >>> and not necessarily of Diamond Light Source Ltd. >>> Diamond Light Source Ltd. cannot guarantee that this e-mail or any >>> attachments are free from viruses and we cannot accept liability for >>> any damage which you may sustain as a result of software viruses which >>> may be transmitted in or with the message. >>> Diamond Light Source Limited (company no. 4375679). Registered in >>> England and Wales with its registered office at Diamond House, Harwell >>> Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United >>> Kingdom >>> >>> _____________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://www.kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the ITK FAQ at: >>> http://www.itk.org/Wiki/ITK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/insight-users >>> >>> >>> >>> >>> >>> -- >>> >>> This e-mail and any attachments may contain confidential, copyright >>> and or privileged material, and are for the use of the intended >>> addressee only. If you are not the intended addressee or an authorised >>> recipient of the addressee please notify us of receipt by returning >>> the e-mail and do not use, copy, retain, distribute or disclose the >>> information in or attached to the e-mail. >>> Any opinions expressed within this e-mail are those of the individual >>> and not necessarily of Diamond Light Source Ltd. >>> Diamond Light Source Ltd. cannot guarantee that this e-mail or any >>> attachments are free from viruses and we cannot accept liability for >>> any damage which you may sustain as a result of software viruses which >>> may be transmitted in or with the message. >>> Diamond Light Source Limited (company no. 4375679). Registered in >>> England and Wales with its registered office at Diamond House, Harwell >>> Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United >>> Kingdom >>> >>> >>> >>> >>> >>> >>> -- >>> >>> This e-mail and any attachments may contain confidential, copyright >>> and or privileged material, and are for the use of the intended >>> addressee only. If you are not the intended addressee or an authorised >>> recipient of the addressee please notify us of receipt by returning >>> the e-mail and do not use, copy, retain, distribute or disclose the >>> information in or attached to the e-mail. >>> Any opinions expressed within this e-mail are those of the individual >>> and not necessarily of Diamond Light Source Ltd. >>> Diamond Light Source Ltd. cannot guarantee that this e-mail or any >>> attachments are free from viruses and we cannot accept liability for >>> any damage which you may sustain as a result of software viruses which >>> may be transmitted in or with the message. >>> Diamond Light Source Limited (company no. 4375679). Registered in >>> England and Wales with its registered office at Diamond House, Harwell >>> Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United >>> Kingdom >>> >>> >>> >>> _____________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://www.kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the ITK FAQ at: >>> http://www.itk.org/Wiki/ITK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/insight-users >>> > > -- > This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. > Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. > Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. > Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 Jared.Becksfort at STJUDE.ORG Wed Mar 23 13:26:02 2016 From: Jared.Becksfort at STJUDE.ORG (Becksfort, Jared) Date: Wed, 23 Mar 2016 17:26:02 +0000 Subject: [ITK-users] Rigid 3D rotation based on plane Message-ID: Hello, I am trying to rotate a 3D image about a plane. I am attempting to do this using the PointSetToPointSet registration examples. I grab points from a plane that I find in the image and correspond them with the center of the image volume or the top of the image in a certain slice, etc. I notice that the examples all tend to end by printing the solution. I am able to get this far. It is not clear to me how I would apply this solution to a rigid 3D registration method such as the Versor transform, or if I am even taking the correct approach at all. I only have one image, not a moving one and a fixed one. I simply want to reorient an MRI volume so that its center of mass is in the center of the image coordinates and rotate it so that some 3D plane I find travels through the center of the image also. Can someone please point me in the right direction? http://www.itk.org/Doxygen/html/Examples_2RegistrationITKv4_2IterativeClose stPoint3_8cxx-example.html#_a4 Thank You, Jared ________________________________ Email Disclaimer: www.stjude.org/emaildisclaimer Consultation Disclaimer: www.stjude.org/consultationdisclaimer From Robert.Atwood at diamond.ac.uk Wed Mar 23 13:36:18 2016 From: Robert.Atwood at diamond.ac.uk (Robert.Atwood at diamond.ac.uk) Date: Wed, 23 Mar 2016 17:36:18 +0000 Subject: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib -- Solved (maybe) In-Reply-To: References: <6CCDD8FC6578314C902BBF87D511D9D8EA6CA999@EXCHMBX01.fed.cclrc.ac.uk> <6CCDD8FC6578314C902BBF87D511D9D8EA6CA9E5@EXCHMBX01.fed.cclrc.ac.uk> Message-ID: <6CCDD8FC6578314C902BBF87D511D9D8EA6CAA38@EXCHMBX01.fed.cclrc.ac.uk> Does this also require the newer CMAKE? I had 2.10.8 but I am not afraid to install a newer one (3.5.0?) From: Bradley Lowekamp [mailto:blowekamp at mail.nih.gov] Sent: 23 March 2016 17:23 To: Atwood, Robert (DLSLtd,RAL,SCI) Cc: matt.mccormick at kitware.com; insight-users at itk.org Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib -- Solved (maybe) Hello, I think there are some plan old C file too. I just add the following to the cmake command line: -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON You could also add ?-fPIC? to the CFLAGS too. Brad On Mar 23, 2016, at 1:04 PM, > > wrote: Hi, Matt I did that but it didn't work. Exactly the same error. See a little further back in the thread: That's where I lost patience with 'combinatorial trial and error approach' , I added -fPIC everywhere I could think of The position-independent-code seems to be generated for all libs except a small selction of i/o libs ; gdcm* ,Nrrd , and a couple of others (trial-and-error) If I don't include these in the final link, then the link is successful. All other libraries appear to have PIC generated. But, the final library isn't usable. I wonder what these ones have in common?? Is there a 'glitch' in the makefile generation that omits -fPIC in these cases somehow? libitkgdcmjpeg8-4.10.a libitkgdcmjpeg12-4.10.a libitkgdcmjpeg16-4.10.a libitkgdcmopenjpeg-4.10.a libitkgdcmuuid-4.10.a libITKEXPAT-4.10.a libITKniftiio-4.10.a libITKNrrdIO-4.10.a libitkhdf5-4.10.a libitksys-4.10.a (using system jpeg, tiff, zlib and png) Ironically , it's only .mhd I actually want to use and it is not on the problem list. But the io-objects need all these to be available just in case they get used, I suppose. I have tried some combinations of these options but, you know, it takes a while to rebuild ITK even though the computer is pretty good. BUILD_POSITION_DEPENDENT_CODE OFF (I don?t think this should be ON because that really wouldn?t work? ) BUILD_SHARED_LIBS OFF (or ON) CMAKE_CXX_FLAGS -fPIC (or default) CMAKE_EXE_LINKER_FLAGS -fPIC (or default) CMAKE_STATIC_LINKER_FLAGS (should this be set too? ) Regards, Robert -----Original Message----- From: Matt McCormick [mailto:matt.mccormick at kitware.com] Sent: 23 March 2016 16:29 To: Atwood, Robert (DLSLtd,RAL,SCI) Cc: D?enan Zuki?; insight-users at itk.org Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib -- Solved (maybe) Hi Robert, /usr/bin/ld: /dls_sw/apps/itk/itk-master-static/lib/libitkgdcmjpeg8-4.10.a(jerror.c .o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC This means that "-fPIC" should be added to the CMAKE_CXX_FLAGS for ITK. HTH, Matt On Wed, Mar 23, 2016 at 11:58 AM, > wrote: Hi, D?enan, and List : Thanks for the tips, but, building the executable by pointing to the itk-build folder for linking is exactly what I did not want to do. I want the compiled instances of the specific templated objects to be put into a stand-alone library that could then be linked , in an environment where the ITK build directory may not be available, and within a project that?s not using cmake (yet? J ) just for a small single-data-type-specific filter chain that would be a bit nontrivial to just re- implement myself! I had some success with the following, for the example ITKFilterLib: Using the itk-master-git-static as built before, (BUILD_SHARED_LIBS OFF) In CMakeLists.txt for the project, add SHARED keyword to the library defninition: 15 ADD_LIBRARY(Example_ITKFilterLib SHARED ITKFilterLib.cxx ) Then use cmake + make to build the libExample_ITKFilterLib.so library. Then I can invoke g++ as follows build]$ g++ ../ITKFilterLib/ITKFilterLibTest.cxx -o testcomp -L . -l Example_ITKFilterLib -I ../ITKFilterLib/ Even if the itk-master-static is not available in that environment, this succeeds, and I believe this is what I want. I don?t want to have a statically linked final executable, but rather a .so library. However ? I encountered another hitch trying to apply this to my actual project. If there were any FileWriter and FileReader present in the library, it would not build, complaining about position-dependent symbols in several IO libraries , most of which I was not actually wanting to use at all. This happened at the step of trying to build the .so library using the makefile created by cmake: /usr/bin/ld: /dls_sw/apps/itk/itk-master-static/lib/libitkgdcmjpeg8-4.10.a(jerror.c.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC /dls_sw/apps/itk/itk-master-static/lib/libitkgdcmjpeg8-4.10.a: could not read symbols: Bad value Removing any reference to FileReader and FileWriter gets rid of this problem. Thanks! As a further note: There are also some directions in the comments of the ITKFilterLib example that did not turn out to be necessary in my project. I did not have to create global objects for poitners or image containiers outside the scope of the class and still did not have to #include itkImage.h in the main program. I placed the typedef?s inside the class and the instantiations of the smart poitners in the class constructor. I don?t see that this extra complication in the example is necessary unless it is platform dependent? ITKFilterLib.cxx from ItkApps example: 23 #include "ITKFilterLib.h" 24 25 // Nasty local globals inside .cxx file to hide itk from the real world. 26 // Can't put this variable in the class definition otherwise we'd have to 27 // include itkImage.h in every program using this class. 28 // The typedef h_itkFilterLibeDataType is in itkFilterLib.h to hide 29 // templates 30 typedef itk::Image g_ImageType; 31 g_ImageType::Pointer g_InputImage; 32 g_ImageType::Pointer g_OutputImage; I did not find this to be necessary in my project. 33 34 35 // 36 // 37 // The first filter in the .lib 38 // 39 // 40 41 /** The next lines are used to include the definition of the filter 42 * we want to install in the .lib, define a typedef for it, and create 43 * a "smart" pointer to hold it. 44 * CHANGE HERE: The filter to be instantiated. 45 **/ 46 #include "itkCurvatureAnisotropicDiffusionImageFilter.h" 47 typedef itk::CurvatureAnisotropicDiffusionImageFilter g_AnisoFilterType; 49 g_AnisoFilterType::Pointer g_anisoFilter; 50 I also did not find it to be necessary to have this sort of typedef and instantiation of the object at global scope in my project. From: D?enan Zuki? [mailto:dzenanz at gmail.com] Sent: 23 March 2016 14:39 To: Atwood, Robert (DLSLtd,RAL,SCI) Cc: Insight-users Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib Hi Robert, BUILD_SHARED_LIBS OFF is the crucial setting. You can keep the rest of options on defaults. Your CMake code looks OK. You should execute the following from your folder: cmake . make During CMake step you should configure options (point to the itk-build folder which was configured with BUILD_SHARED_LIBS OFF). Afterwards, do not invoke g++ directly - invoke make, which supplies correct include directories and link libraries so you don't run into a thousand errors. Regards, D?enan On Tue, Mar 22, 2016 at 6:25 AM, > wrote: Hi, Thanks, D?enan, for the hint. But, does anyone have specific information on exactly which options to set in each of: the ITK cmake options; and the project cmake options, or the plain g++ for building an external program to link to the library, for this to work ? There appear to be a few that might be related to this. Because, so far, simply changing the build options of the ITK installation didn?t work. See below for even more details . Thanks Robert Options selected in the project: ITK_DIR /dls_sw/apps/itk/itk-master-static/lib/cmake/ITK-4.10 In the ITK with installation to itk-master-static: I have tried some combinations of these options but, you know, it takes a while to rebuild ITK even though the computer is pretty good. BUILD_POSITION_DEPENDENT_CODE OFF (I don?t think this should be ON because that really wouldn?t work? ) BUILD_SHARED_LIBS OFF (or ON) CMAKE_CXX_FLAGS -fPIC (or default) CMAKE_EXE_LINKER_FLAGS -fPIC (or default) CMAKE_STATIC_LINKER_FLAGS (should this be set too? ) The CMakeLists in the project file ? only small modification from the original to ?BUILD_OUTSIDE_INSIGHT_APPICATIONS?. The project builds using the Cmake makefile, producing the library and the executable But trying to build either the ?main? procedure provided with linking to that library, or even simplifying the ?main? to do virtually nothing except instantiate the object, results in 1000 error messages of ?undefined symbols? 1 PROJECT(Example_ITKFilterLib) 2 3 #REMOVED 'IF (BUILD_OUTSIDE_INSIGHT_APPLICATIONS)' 4 5 FIND_PACKAGE(ITK) 6 IF(ITK_FOUND) 7 INCLUDE(${ITK_USE_FILE}) 8 ELSE(ITK_FOUND) 9 MESSAGE(FATAL_ERROR 10 "Cannot build ITKApps without ITK. Please set ITK_DIR.") 11 ENDIF(ITK_FOUND) 12 13 #REMOVED 'ENDIF(BUILD_OUTSIDE_INSIGHT_APPLICATIONS)' 14 15 ADD_LIBRARY(Example_ITKFilterLib ITKFilterLib.cxx ) 16 INSTALL_TARGETS(/lib Example_ITKFilterLib) 17 TARGET_LINK_LIBRARIES(Example_ITKFilterLib ${ITK_LIBRARIES}) 18 19 ADD_EXECUTABLE(Example_ITKFilterLibTest ITKFilterLibTest.cxx ) 20 INSTALL_TARGETS(/bin Example_ITKFilterLibTest) 21 TARGET_LINK_LIBRARIES(Example_ITKFilterLibTest Example_ITKFilterLib) build]$ ls -l total 2508 -rw-rw-r-- 1 kny48981 kny48981 14393 Mar 22 10:02 CMakeCache.txt drwxrwxr-x 6 kny48981 kny48981 4096 Mar 22 10:05 CMakeFiles -rwxrwxr-x 1 kny48981 kny48981 1417263 Mar 22 10:05 Example_ITKFilterLibTest drwxrwxr-x 2 kny48981 kny48981 4096 Mar 22 10:02 ITKIOFactoryRegistration -rw-rw-r-- 1 kny48981 kny48981 7933 Mar 22 10:02 Makefile -rw-rw-r-- 1 kny48981 kny48981 1092874 Mar 22 10:05 libExample_ITKFilterLib.a build]$ g++ -o testcomp ../ITKFilterLib/ITKFilterLibTest.cxx -I ../ITKFilterLib -L . -l Example_ITKFilterLib >& out & ? generates 1100 messages ? 1 ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string, std::allocat 2 ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3 itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): undefined reference to `itk::ExceptionObject: ? 1106 ITKFilterLib.cxx:(.text._ZNK3itk12NeighborhoodIPfLj3ENS_21Neighborhood AllocatorIS1_EEE9PrintSelfERSoNS_6IndentE[itk::Neighborhood& out Same output AFAICT: 1 ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string, std::alloca 2 ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3 itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): undefined reference to `itk::ExceptionObject: ?. From: D?enan Zuki? [mailto:dzenanz at gmail.com] Sent: 21 March 2016 20:21 To: Atwood, Robert (DLSLtd,RAL,SCI) Cc: Insight-users Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib Hi Robert, maybe you need to link to ITK statically? To accomplish this you probably need to build ITK as static libraries (it is a configuration option in CMake). Regards, D?enan On Mon, Mar 21, 2016 at 12:50 PM, > wrote: Hi, This example, ITKApps/ITKFilterLib, appears to be an example of what I want to do , bundle or encapsulate a specific ITK-based filter into a library so that another program may just call it without having to have the ITK source installation available. However, a basic test for me is not working. I just tried to compile the test example from command line after building the library with Cmake as usual. I get hundreds of 'undefined reference', as if I have to link with all the ITK libs anyways. Am I missing something? Thanks g++ -o testcomp ../ITKFilterLib/ITKFilterLibTest.cxx -I g++ ../ITKFilterLib/ -L . -l Example_ITKFilterLib First few lines of output: ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string, std::allocator > const&, unsigned int, std::basic_string, std::allocator > const&, std::basic_string, std::allocator const&)': ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3 itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): undefined reference to `itk::ExceptionObject::ExceptionObject(std::basic_string, std::allocator > const&, unsigned int, std::basic_string, std::allocator > const&, std::basic_string) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ) #1 SMP Wed Jan 6 11:20:49 EST 2016 -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 dzenanz at gmail.com Wed Mar 23 13:37:49 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Wed, 23 Mar 2016 13:37:49 -0400 Subject: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib -- Solved (maybe) In-Reply-To: References: <6CCDD8FC6578314C902BBF87D511D9D8EA6CA999@EXCHMBX01.fed.cclrc.ac.uk> <6CCDD8FC6578314C902BBF87D511D9D8EA6CA9E5@EXCHMBX01.fed.cclrc.ac.uk> Message-ID: ?Hi Robert, another approach which m?ight solve your problems is to have a "wrapper library". Small .cxx file which defines some function such as void smooth(short *imageBuffer, int xSize, ySize, zSize, spacing etc). This function would then use import image filter to construct itk::image from its parameters. Then normally call itk filters. Once you have the results, copy its pixel buffer into imageBuffer or some other pointer passed as a parameter. You link this library to itk which was configured with BUILD_SHARED_LIBS OFF. You should be able to compile this library as either shared or static. Then your main program would only need one function prototype (void smooth(...);) and one wrapper library to link against. It would not explicitly depend on itk (because it was linked in statically by the wrapper library). HTH, D?enan On Wed, Mar 23, 2016 at 1:21 PM, Matt McCormick wrote: > Hi Robert, > > If CMake is new enough, just set CMAKE_POSITION_INDEPENDENT_CODE to > ON. This automatically add -fPIC to the build flags. > > Otherwise, add -fPIC to the build flags. Those libraries were still > causing issues likely because they contain both C and C++ code; add > the flag to both CMAKE_C_FLAGS and CMAKE_CXX_FLAGS if > CMAKE_POSITION_INDEPENDENT_CODE is not used. > > HTH, > Matt > > On Wed, Mar 23, 2016 at 1:04 PM, wrote: > > Hi, Matt > > I did that but it didn't work. Exactly the same error. See a little > further back in the thread: > > > > That's where I lost patience with 'combinatorial trial and error > approach' , I added -fPIC everywhere I could think of > > The position-independent-code seems to be generated for all libs except > a small selction of i/o libs ; gdcm* ,Nrrd , and a couple of others > (trial-and-error) > > > > If I don't include these in the final link, then the link is > successful. All other libraries appear to have PIC generated. > > > > But, the final library isn't usable. I wonder what these ones have in > common?? Is there a 'glitch' in the makefile generation that omits -fPIC > in these cases somehow? > > > > > > libitkgdcmjpeg8-4.10.a > > libitkgdcmjpeg12-4.10.a > > libitkgdcmjpeg16-4.10.a > > libitkgdcmopenjpeg-4.10.a > > libitkgdcmuuid-4.10.a > > libITKEXPAT-4.10.a > > libITKniftiio-4.10.a > > libITKNrrdIO-4.10.a > > libitkhdf5-4.10.a > > libitksys-4.10.a > > > > (using system jpeg, tiff, zlib and png) > > > > Ironically , it's only .mhd I actually want to use and it is not on the > problem list. But the io-objects need all these to be available just in > case they get used, I suppose. > > > > > > > > > >> > I have tried some combinations of these options but, you know, it > >> > takes a while to rebuild ITK even though the computer is pretty good. > >> > BUILD_POSITION_DEPENDENT_CODE OFF (I don?t think this should be ON > >> > because that really wouldn?t work? ) > >> > BUILD_SHARED_LIBS OFF (or ON) > >> > CMAKE_CXX_FLAGS -fPIC (or default) > >> > CMAKE_EXE_LINKER_FLAGS -fPIC (or default) > >> > CMAKE_STATIC_LINKER_FLAGS (should this be set too? ) > > > > Regards, Robert > > > > > > > > > > > >> -----Original Message----- > >> From: Matt McCormick [mailto:matt.mccormick at kitware.com] > >> Sent: 23 March 2016 16:29 > >> To: Atwood, Robert (DLSLtd,RAL,SCI) > >> Cc: D?enan Zuki?; insight-users at itk.org > >> Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib -- > Solved > >> (maybe) > >> > >> Hi Robert, > >> > >> > /usr/bin/ld: > >> > /dls_sw/apps/itk/itk-master-static/lib/libitkgdcmjpeg8-4.10.a(jerror.c > >> > .o): relocation R_X86_64_32S against `.text' can not be used when > >> > making a shared object; recompile with -fPIC > >> > >> This means that "-fPIC" should be added to the CMAKE_CXX_FLAGS for ITK. > >> > >> HTH, > >> Matt > >> > >> On Wed, Mar 23, 2016 at 11:58 AM, > >> wrote: > >> > Hi, D?enan, and List : > >> > > >> > > >> > > >> > Thanks for the tips, but, building the executable by pointing to the > >> > itk-build folder for linking is exactly what I did not want to do. I > >> > want the compiled instances of the specific templated objects to be > >> > put into a stand-alone library that could then be linked , in an > >> > environment where the ITK build directory may not be available, and > >> > within a project that?s not using cmake (yet? J ) just for a small > >> > single-data-type-specific filter chain that would be a bit nontrivial > to just re- > >> implement myself! > >> > > >> > > >> > > >> > I had some success with the following, for the example ITKFilterLib: > >> > > >> > > >> > > >> > Using the itk-master-git-static as built before, (BUILD_SHARED_LIBS > >> > OFF) > >> > > >> > > >> > > >> > > >> > > >> > In CMakeLists.txt for the project, add SHARED keyword to the library > >> > defninition: > >> > > >> > > >> > > >> > 15 ADD_LIBRARY(Example_ITKFilterLib SHARED ITKFilterLib.cxx ) > >> > > >> > Then use cmake + make to build the libExample_ITKFilterLib.so library. > >> > > >> > > >> > > >> > > >> > > >> > Then I can invoke g++ as follows > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > build]$ g++ ../ITKFilterLib/ITKFilterLibTest.cxx -o testcomp -L . -l > >> > Example_ITKFilterLib -I ../ITKFilterLib/ > >> > > >> > > >> > > >> > Even if the itk-master-static is not available in that environment, > >> > this succeeds, and I believe this is what I want. I don?t want to have > >> > a statically linked final executable, but rather a .so library. > >> > > >> > > >> > > >> > > >> > > >> > However ? > >> > > >> > > >> > > >> > I encountered another hitch trying to apply this to my actual project. > >> > If there were any FileWriter and FileReader present in the library, it > >> > would not build, complaining about position-dependent symbols in > >> > several IO libraries , most of which I was not actually wanting to use > >> > at all. This happened at the step of trying to build the .so library > >> > using the makefile created by cmake: > >> > > >> > > >> > > >> > /usr/bin/ld: > >> > > /dls_sw/apps/itk/itk-master-static/lib/libitkgdcmjpeg8-4.10.a(jerror.c.o): > >> > relocation R_X86_64_32S against `.text' can not be used when making a > >> > shared object; recompile with -fPIC > >> > > >> > /dls_sw/apps/itk/itk-master-static/lib/libitkgdcmjpeg8-4.10.a: could > >> > not read symbols: Bad value > >> > > >> > > >> > > >> > > >> > > >> > Removing any reference to FileReader and FileWriter gets rid of this > >> > problem. > >> > > >> > > >> > > >> > Thanks! > >> > > >> > > >> > > >> > > >> > > >> > As a further note: > >> > > >> > > >> > > >> > There are also some directions in the comments of the ITKFilterLib > >> > example that did not turn out to be necessary in my project. I did not > >> > have to create global objects for poitners or image containiers > >> > outside the scope of the class and still did not have to #include > itkImage.h in > >> the main program. > >> > I placed the typedef?s inside the class and the instantiations of the > >> > smart poitners in the class constructor. I don?t see that this extra > >> > complication in the example is necessary unless it is platform > dependent? > >> > > >> > > >> > > >> > ITKFilterLib.cxx from ItkApps example: > >> > > >> > > >> > > >> > > >> > > >> > 23 #include "ITKFilterLib.h" > >> > > >> > 24 > >> > > >> > 25 // Nasty local globals inside .cxx file to hide itk from the real > world. > >> > > >> > 26 // Can't put this variable in the class definition otherwise > we'd have > >> > to > >> > > >> > 27 // include itkImage.h in every program using this class. > >> > > >> > 28 // The typedef h_itkFilterLibeDataType is in itkFilterLib.h to hide > >> > > >> > 29 // templates > >> > > >> > 30 typedef itk::Image g_ImageType; > >> > > >> > 31 g_ImageType::Pointer g_InputImage; > >> > > >> > 32 g_ImageType::Pointer g_OutputImage; > >> > > >> > > >> > > >> > I did not find this to be necessary in my project. > >> > > >> > > >> > > >> > > >> > > >> > 33 > >> > > >> > 34 > >> > > >> > 35 // > >> > > >> > 36 // > >> > > >> > 37 // The first filter in the .lib > >> > > >> > 38 // > >> > > >> > 39 // > >> > > >> > 40 > >> > > >> > 41 /** The next lines are used to include the definition of the filter > >> > > >> > 42 * we want to install in the .lib, define a typedef for it, and > create > >> > > >> > 43 * a "smart" pointer to hold it. > >> > > >> > 44 * CHANGE HERE: The filter to be instantiated. > >> > > >> > 45 **/ > >> > > >> > 46 #include "itkCurvatureAnisotropicDiffusionImageFilter.h" > >> > > >> > 47 typedef itk::CurvatureAnisotropicDiffusionImageFilter >> > > >> > 48 g_ImageType> g_AnisoFilterType; > >> > > >> > 49 g_AnisoFilterType::Pointer g_anisoFilter; > >> > > >> > 50 > >> > > >> > > >> > > >> > I also did not find it to be necessary to have this sort of typedef > >> > and instantiation of the object at global scope in my project. > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > From: D?enan Zuki? [mailto:dzenanz at gmail.com] > >> > Sent: 23 March 2016 14:39 > >> > To: Atwood, Robert (DLSLtd,RAL,SCI) > >> > Cc: Insight-users > >> > Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib > >> > > >> > > >> > > >> > Hi Robert, > >> > > >> > > >> > > >> > BUILD_SHARED_LIBS OFF is the crucial setting. You can keep the rest of > >> > options on defaults. > >> > > >> > > >> > > >> > Your CMake code looks OK. You should execute the following from your > >> folder: > >> > > >> > cmake . > >> > > >> > make > >> > > >> > > >> > > >> > During CMake step you should configure options (point to the itk-build > >> > folder which was configured with BUILD_SHARED_LIBS OFF). Afterwards, > >> > do not invoke g++ directly - invoke make, which supplies correct > >> > include directories and link libraries so you don't run into a > thousand errors. > >> > > >> > > >> > > >> > Regards, > >> > > >> > D?enan > >> > > >> > > >> > > >> > On Tue, Mar 22, 2016 at 6:25 AM, > >> wrote: > >> > > >> > Hi, > >> > Thanks, D?enan, for the hint. But, does anyone have specific > >> > information on exactly which options to set in each of: the ITK cmake > >> > options; and the project cmake options, or the plain g++ for building > >> > an external program to link to the library, for this to work ? There > >> > appear to be a few that might be related to this. Because, so far, > >> > simply changing the build options of the ITK installation didn?t > work. See > >> below for even more details . > >> > > >> > Thanks > >> > > >> > Robert > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > Options selected in the project: > >> > > >> > ITK_DIR > >> > /dls_sw/apps/itk/itk-master-static/lib/cmake/ITK-4.10 > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > In the ITK with installation to itk-master-static: > >> > > >> > I have tried some combinations of these options but, you know, it > >> > takes a while to rebuild ITK even though the computer is pretty good. > >> > > >> > > >> > > >> > BUILD_POSITION_DEPENDENT_CODE OFF (I don?t think this should be ON > >> > because that really wouldn?t work? ) > >> > > >> > BUILD_SHARED_LIBS OFF (or ON) > >> > > >> > CMAKE_CXX_FLAGS -fPIC (or default) > >> > > >> > CMAKE_EXE_LINKER_FLAGS -fPIC (or default) > >> > > >> > CMAKE_STATIC_LINKER_FLAGS (should this be set too? ) > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > The CMakeLists in the project file ? only small modification from the > >> > original to ?BUILD_OUTSIDE_INSIGHT_APPICATIONS?. The project builds > >> > using the Cmake makefile, producing the library and the executable > >> > > >> > But trying to build either the ?main? procedure provided with linking > >> > to that library, or even simplifying the ?main? to do virtually > >> > nothing except instantiate the object, results in 1000 error messages > >> > of ?undefined symbols? > >> > > >> > > >> > > >> > 1 PROJECT(Example_ITKFilterLib) > >> > > >> > 2 > >> > > >> > 3 #REMOVED 'IF (BUILD_OUTSIDE_INSIGHT_APPLICATIONS)' > >> > > >> > 4 > >> > > >> > 5 FIND_PACKAGE(ITK) > >> > > >> > 6 IF(ITK_FOUND) > >> > > >> > 7 INCLUDE(${ITK_USE_FILE}) > >> > > >> > 8 ELSE(ITK_FOUND) > >> > > >> > 9 MESSAGE(FATAL_ERROR > >> > > >> > 10 "Cannot build ITKApps without ITK. Please set > ITK_DIR.") > >> > > >> > 11 ENDIF(ITK_FOUND) > >> > > >> > 12 > >> > > >> > 13 #REMOVED 'ENDIF(BUILD_OUTSIDE_INSIGHT_APPLICATIONS)' > >> > > >> > 14 > >> > > >> > 15 ADD_LIBRARY(Example_ITKFilterLib ITKFilterLib.cxx ) > >> > > >> > 16 INSTALL_TARGETS(/lib Example_ITKFilterLib) > >> > > >> > 17 TARGET_LINK_LIBRARIES(Example_ITKFilterLib ${ITK_LIBRARIES}) > >> > > >> > 18 > >> > > >> > 19 ADD_EXECUTABLE(Example_ITKFilterLibTest ITKFilterLibTest.cxx ) > >> > > >> > 20 INSTALL_TARGETS(/bin Example_ITKFilterLibTest) > >> > > >> > 21 TARGET_LINK_LIBRARIES(Example_ITKFilterLibTest > >> > Example_ITKFilterLib) > >> > > >> > > >> > > >> > > >> > > >> > build]$ ls -l > >> > > >> > total 2508 > >> > > >> > -rw-rw-r-- 1 kny48981 kny48981 14393 Mar 22 10:02 CMakeCache.txt > >> > > >> > drwxrwxr-x 6 kny48981 kny48981 4096 Mar 22 10:05 CMakeFiles > >> > > >> > -rwxrwxr-x 1 kny48981 kny48981 1417263 Mar 22 10:05 > >> > Example_ITKFilterLibTest > >> > > >> > drwxrwxr-x 2 kny48981 kny48981 4096 Mar 22 10:02 > >> ITKIOFactoryRegistration > >> > > >> > -rw-rw-r-- 1 kny48981 kny48981 7933 Mar 22 10:02 Makefile > >> > > >> > -rw-rw-r-- 1 kny48981 kny48981 1092874 Mar 22 10:05 > >> > libExample_ITKFilterLib.a > >> > > >> > > >> > > >> > > >> > > >> > > >> > > >> > build]$ g++ -o testcomp ../ITKFilterLib/ITKFilterLibTest.cxx -I > >> > ../ITKFilterLib -L . -l Example_ITKFilterLib >& out & > >> > > >> > > >> > > >> > ? generates 1100 messages ? > >> > > >> > > >> > > >> > > >> > > >> > 1 ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function > >> > `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string >> > har, > >> > std::char_traits, std::allocat > >> > > >> > 2 > >> > > >> > ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3 > >> itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): > >> > undefined reference to `itk::ExceptionObject: > >> > > >> > ? > >> > > >> > 1106 > >> > ITKFilterLib.cxx:(.text._ZNK3itk12NeighborhoodIPfLj3ENS_21Neighborhood > >> > AllocatorIS1_EEE9PrintSelfERSoNS_6IndentE[itk::Neighborhood >> > 3u, itk::NeighborhoodAllocato > >> > > >> > 1107 collect2: ld returned 1 exit status > >> > > >> > > >> > > >> > > >> > > >> > Minimal example main: > >> > > >> > > >> > > >> > 1 #include "ITKFilterLib.h" > >> > > >> > 2 int main(int, char **) { > >> > > >> > 3 int inputDimSize[3]; > >> > > >> > 4 float inputOrigin[3]; > >> > > >> > 5 float inputSpacing[3]; > >> > > >> > 6 inputDimSize[0] = 5; > >> > > >> > 7 inputDimSize[1] = 5; > >> > > >> > 8 inputDimSize[2] = 5; > >> > > >> > 9 inputOrigin[0] = 0; > >> > > >> > 10 inputOrigin[1] = 0; > >> > > >> > 11 inputOrigin[2] = 0; > >> > > >> > 12 inputSpacing[0] = 1; > >> > > >> > 13 inputSpacing[1] = 1; > >> > > >> > 14 inputSpacing[2] = 1; > >> > > >> > 15 > >> > > >> > 16 itkFilterLib filter(inputDimSize, inputOrigin, inputSpacing); > >> > > >> > 17 return (true); > >> > > >> > 18 } > >> > > >> > > >> > > >> > g++ -o testmin minimal_example.cxx -I ../ITKFilterLib -L . -l > >> > Example_ITKFilterLib >& out > >> > > >> > > >> > > >> > > >> > > >> > Same output AFAICT: > >> > > >> > > >> > > >> > > >> > > >> > 1 ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function > >> > `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string >> > har, > >> > std::char_traits, std::alloca > >> > > >> > 2 > >> > > >> > ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3 > >> itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): > >> > undefined reference to `itk::ExceptionObject: > >> > > >> > ?. > >> > > >> > > >> > > >> > From: D?enan Zuki? [mailto:dzenanz at gmail.com] > >> > Sent: 21 March 2016 20:21 > >> > To: Atwood, Robert (DLSLtd,RAL,SCI) > >> > Cc: Insight-users > >> > Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib > >> > > >> > > >> > > >> > Hi Robert, > >> > > >> > > >> > > >> > maybe you need to link to ITK statically? To accomplish this you > >> > probably need to build ITK as static libraries (it is a configuration > >> > option in CMake). > >> > > >> > > >> > > >> > Regards, > >> > > >> > D?enan > >> > > >> > > >> > > >> > On Mon, Mar 21, 2016 at 12:50 PM, > >> wrote: > >> > > >> > Hi, > >> > This example, ITKApps/ITKFilterLib, appears to be an example of what I > >> > want to do , bundle or encapsulate a specific ITK-based filter into a > >> > library so that another program may just call it without having to > >> > have the ITK source installation available. > >> > However, a basic test for me is not working. > >> > > >> > I just tried to compile the test example from command line after > >> > building the library with Cmake as usual. I get hundreds of 'undefined > >> > reference', as if I have to link with all the ITK libs anyways. > >> > Am I missing something? > >> > Thanks > >> > > >> > > >> > > >> > > >> > g++ -o testcomp ../ITKFilterLib/ITKFilterLibTest.cxx -I > >> > g++ ../ITKFilterLib/ -L > >> > . -l Example_ITKFilterLib > >> > > >> > > >> > First few lines of output: > >> > > >> > ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function > >> > `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string >> > har, std::char_traits, std::allocator > const&, unsigned > >> > int, std::basic_string, > >> > std::allocator > const&, std::basic_string >> > std::char_traits, std::allocator > >> >> const&)': > >> > > >> > ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3 > >> itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): > >> > undefined reference to > >> > `itk::ExceptionObject::ExceptionObject(std::basic_string >> > std::char_traits, std::allocator > const&, unsigned int, > >> > std::basic_string, std::allocator > > >> > const&, std::basic_string >> > > >> > ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3 > >> itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x44): > >> > undefined reference to `vtable for itk::MemoryAllocationError' > >> > ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function > >> > `itk::ProcessAborted::ProcessAborted(char const*, unsigned int)': > >> > > >> > ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAb > >> ortedC5EPKcj]+0x33): > >> > undefined reference to `itk::ExceptionObject::ExceptionObject(char > >> > const*, unsigned int, char const*, char const*)' > >> > > >> > ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAb > >> ortedC5EPKcj]+0x3e): > >> > undefined reference to `vtable for itk::ProcessAborted' > >> > > >> > ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAb > >> ortedC5EPKcj]+0x4f): > >> > undefined reference to `itk::ExceptionObject::SetDescription(char > const*)' > >> > > >> > ITKFilterLib.cxx:(.text._ZN3itk14ProcessAbortedC2EPKcj[_ZN3itk14ProcessAb > >> ortedC5EPKcj]+0x62): > >> > undefined reference to `itk::ExceptionObject::~ExceptionObject()' > >> > > >> > > >> > > >> > This is on a Linux Red Hat with ITK git master today (March 21 2016) > >> > > >> > cmake --version > >> > cmake version 2.8.12.2 > >> > > >> > /proc/version: > >> > > >> > Linux version 2.6.32-573.18.1.el6.x86_64 > >> > (mockbuild at x86-010.build.bos.redhat.com) (gcc version 4.4.7 20120313 > >> > (Red Hat 4.4.7-16) (GCC) ) #1 SMP Wed Jan 6 11:20:49 EST 2016 > >> > > >> > > >> > > >> > -- > >> > This e-mail and any attachments may contain confidential, copyright > >> > and or privileged material, and are for the use of the intended > >> > addressee only. If you are not the intended addressee or an authorised > >> > recipient of the addressee please notify us of receipt by returning > >> > the e-mail and do not use, copy, retain, distribute or disclose the > >> > information in or attached to the e-mail. > >> > Any opinions expressed within this e-mail are those of the individual > >> > and not necessarily of Diamond Light Source Ltd. > >> > Diamond Light Source Ltd. cannot guarantee that this e-mail or any > >> > attachments are free from viruses and we cannot accept liability for > >> > any damage which you may sustain as a result of software viruses which > >> > may be transmitted in or with the message. > >> > Diamond Light Source Limited (company no. 4375679). Registered in > >> > England and Wales with its registered office at Diamond House, Harwell > >> > Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United > >> > Kingdom > >> > > >> > _____________________________________ > >> > Powered by www.kitware.com > >> > > >> > Visit other Kitware open-source projects at > >> > http://www.kitware.com/opensource/opensource.html > >> > > >> > Kitware offers ITK Training Courses, for more information visit: > >> > http://www.kitware.com/products/protraining.php > >> > > >> > Please keep messages on-topic and check the ITK FAQ at: > >> > http://www.itk.org/Wiki/ITK_FAQ > >> > > >> > Follow this link to subscribe/unsubscribe: > >> > http://public.kitware.com/mailman/listinfo/insight-users > >> > > >> > > >> > > >> > > >> > > >> > -- > >> > > >> > This e-mail and any attachments may contain confidential, copyright > >> > and or privileged material, and are for the use of the intended > >> > addressee only. If you are not the intended addressee or an authorised > >> > recipient of the addressee please notify us of receipt by returning > >> > the e-mail and do not use, copy, retain, distribute or disclose the > >> > information in or attached to the e-mail. > >> > Any opinions expressed within this e-mail are those of the individual > >> > and not necessarily of Diamond Light Source Ltd. > >> > Diamond Light Source Ltd. cannot guarantee that this e-mail or any > >> > attachments are free from viruses and we cannot accept liability for > >> > any damage which you may sustain as a result of software viruses which > >> > may be transmitted in or with the message. > >> > Diamond Light Source Limited (company no. 4375679). Registered in > >> > England and Wales with its registered office at Diamond House, Harwell > >> > Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United > >> > Kingdom > >> > > >> > > >> > > >> > > >> > > >> > > >> > -- > >> > > >> > This e-mail and any attachments may contain confidential, copyright > >> > and or privileged material, and are for the use of the intended > >> > addressee only. If you are not the intended addressee or an authorised > >> > recipient of the addressee please notify us of receipt by returning > >> > the e-mail and do not use, copy, retain, distribute or disclose the > >> > information in or attached to the e-mail. > >> > Any opinions expressed within this e-mail are those of the individual > >> > and not necessarily of Diamond Light Source Ltd. > >> > Diamond Light Source Ltd. cannot guarantee that this e-mail or any > >> > attachments are free from viruses and we cannot accept liability for > >> > any damage which you may sustain as a result of software viruses which > >> > may be transmitted in or with the message. > >> > Diamond Light Source Limited (company no. 4375679). Registered in > >> > England and Wales with its registered office at Diamond House, Harwell > >> > Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United > >> > Kingdom > >> > > >> > > >> > > >> > _____________________________________ > >> > Powered by www.kitware.com > >> > > >> > Visit other Kitware open-source projects at > >> > http://www.kitware.com/opensource/opensource.html > >> > > >> > Kitware offers ITK Training Courses, for more information visit: > >> > http://www.kitware.com/products/protraining.php > >> > > >> > Please keep messages on-topic and check the ITK FAQ at: > >> > http://www.itk.org/Wiki/ITK_FAQ > >> > > >> > Follow this link to subscribe/unsubscribe: > >> > http://public.kitware.com/mailman/listinfo/insight-users > >> > > > > > -- > > This e-mail and any attachments may contain confidential, copyright and > or privileged material, and are for the use of the intended addressee only. > If you are not the intended addressee or an authorised recipient of the > addressee please notify us of receipt by returning the e-mail and do not > use, copy, retain, distribute or disclose the information in or attached to > the e-mail. > > Any opinions expressed within this e-mail are those of the individual > and not necessarily of Diamond Light Source Ltd. > > Diamond Light Source Ltd. cannot guarantee that this e-mail or any > attachments are free from viruses and we cannot accept liability for any > damage which you may sustain as a result of software viruses which may be > transmitted in or with the message. > > Diamond Light Source Limited (company no. 4375679). Registered in > England and Wales with its registered office at Diamond House, Harwell > Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Wed Mar 23 13:52:13 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Wed, 23 Mar 2016 13:52:13 -0400 Subject: [ITK-users] Rigid 3D rotation based on plane In-Reply-To: References: Message-ID: Hi Jared, It sounds like you just want to resample an image with a given transformation. Search for "Resample" on this page: http://www.itk.org/Insight/Doxygen/html/examples.html consider the Euler3DTransform: http://www.itk.org/Insight/Doxygen/html/classitk_1_1Euler3DTransform.html and see the section on Transforms in the ITK Software Guide: http://itk.org/ITKSoftwareGuide/html/Book2/ITKSoftwareGuide-Book2ch3.html#x26-1160003.9 HTH, Matt On Wed, Mar 23, 2016 at 1:26 PM, Becksfort, Jared wrote: > Hello, > > I am trying to rotate a 3D image about a plane. I am attempting to do > this using the PointSetToPointSet registration examples. I grab points > from a plane that I find in the image and correspond them with the center > of the image volume or the top of the image in a certain slice, etc. > > I notice that the examples all tend to end by printing the solution. I am > able to get this far. It is not clear to me how I would apply this > solution to a rigid 3D registration method such as the Versor transform, > or if I am even taking the correct approach at all. I only have one > image, not a moving one and a fixed one. > > I simply want to reorient an MRI volume so that its center of mass is in > the center of the image coordinates and rotate it so that some 3D plane I > find travels through the center of the image also. Can someone please > point me in the right direction? > > http://www.itk.org/Doxygen/html/Examples_2RegistrationITKv4_2IterativeClose > stPoint3_8cxx-example.html#_a4 > > > Thank You, > Jared > > > ________________________________ > > Email Disclaimer: www.stjude.org/emaildisclaimer > Consultation Disclaimer: www.stjude.org/consultationdisclaimer > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users From bill.hoffman at kitware.com Wed Mar 23 14:18:46 2016 From: bill.hoffman at kitware.com (Bill Hoffman) Date: Wed, 23 Mar 2016 14:18:46 -0400 Subject: [ITK-users] CMake IDE integration survey Message-ID: <56F2DE06.8020209@kitware.com> Hi all, Microsoft is assembling a team to improve CMake support in Visual Studio. They are interested in gathering feedback from CMake users. They have created this survey, so if you are using VS and CMake, please fill this out: http://www.instant.ly/s/EwZKW Thanks. -Bill -- Bill Hoffman Kitware, Inc. 28 Corporate Drive Clifton Park, NY 12065 bill.hoffman at kitware.com http://www.kitware.com 518 881-4905 (Direct) 518 371-3971 x105 Fax (518) 371-4573 From Robert.Atwood at diamond.ac.uk Wed Mar 23 14:32:08 2016 From: Robert.Atwood at diamond.ac.uk (Robert.Atwood at diamond.ac.uk) Date: Wed, 23 Mar 2016 18:32:08 +0000 Subject: [ITK-users] Solved ! RE: stand-alone lib -- ITKApps/ITKFilterLib Message-ID: <6CCDD8FC6578314C902BBF87D511D9D8EA6CAAA6@EXCHMBX01.fed.cclrc.ac.uk> Ok, adding ?fPIC everywhere seemed to work , one of those was cmake_c_flags and also module_c_flags, I must have missed those before. Then, downloading CMAKE 3.5.0 and adding the option Bradley has suggested, on the commandline, also worked ! Even for the original project with ITK I/o being used inside the wrapped filter chain! (But, the option CMAKE_POSITION_INDEPENDENT_CODE is not initially presented in the ncurses interface ? ) Thanks , All! Robert From: Bradley Lowekamp [mailto:blowekamp at mail.nih.gov] Sent: 23 March 2016 17:23 To: Atwood, Robert (DLSLtd,RAL,SCI) Cc: matt.mccormick at kitware.com; insight-users at itk.org Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib -- Solved (maybe) Hello, I think there are some plan old C file too. I just add the following to the cmake command line: -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON You could also add ?-fPIC? to the CFLAGS too. Brad On Mar 23, 2016, at 1:04 PM, > > wrote: Hi, Matt I did that but it didn't work. Exactly the same error. See a little further back in the thread: That's where I lost patience with 'combinatorial trial and error approach' , I added -fPIC everywhere I could think of The position-independent-code seems to be generated for all libs except a small selction of i/o libs ; gdcm* ,Nrrd , and a couple of others (trial-and-error) If I don't include these in the final link, then the link is successful. All other libraries appear to have PIC generated. But, the final library isn't usable. I wonder what these ones have in common?? Is there a 'glitch' in the makefile generation that omits -fPIC in these cases somehow? libitkgdcmjpeg8-4.10.a libitkgdcmjpeg12-4.10.a libitkgdcmjpeg16-4.10.a libitkgdcmopenjpeg-4.10.a libitkgdcmuuid-4.10.a libITKEXPAT-4.10.a libITKniftiio-4.10.a libITKNrrdIO-4.10.a libitkhdf5-4.10.a libitksys-4.10.a (using system jpeg, tiff, zlib and png) Ironically , it's only .mhd I actually want to use and it is not on the problem list. But the io-objects need all these to be available just in case they get used, I suppose. I have tried some combinations of these options but, you know, it takes a while to rebuild ITK even though the computer is pretty good. BUILD_POSITION_DEPENDENT_CODE OFF (I don?t think this should be ON because that really wouldn?t work? ) BUILD_SHARED_LIBS OFF (or ON) CMAKE_CXX_FLAGS -fPIC (or default) CMAKE_EXE_LINKER_FLAGS -fPIC (or default) CMAKE_STATIC_LINKER_FLAGS (should this be set too? ) Regards, Robert -----Original Message----- From: Matt McCormick [mailto:matt.mccormick at kitware.com] Sent: 23 March 2016 16:29 To: Atwood, Robert (DLSLtd,RAL,SCI) Cc: D?enan Zuki?; insight-users at itk.org Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib -- Solved (maybe) Hi Robert, /usr/bin/ld: /dls_sw/apps/itk/itk-master-static/lib/libitkgdcmjpeg8-4.10.a(jerror.c .o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC This means that "-fPIC" should be added to the CMAKE_CXX_FLAGS for ITK. HTH, Matt On Wed, Mar 23, 2016 at 11:58 AM, > wrote: Hi, D?enan, and List : Thanks for the tips, but, building the executable by pointing to the itk-build folder for linking is exactly what I did not want to do. I want the compiled instances of the specific templated objects to be put into a stand-alone library that could then be linked , in an environment where the ITK build directory may not be available, and within a project that?s not using cmake (yet? J ) just for a small single-data-type-specific filter chain that would be a bit nontrivial to just re- implement myself! I had some success with the following, for the example ITKFilterLib: Using the itk-master-git-static as built before, (BUILD_SHARED_LIBS OFF) In CMakeLists.txt for the project, add SHARED keyword to the library defninition: 15 ADD_LIBRARY(Example_ITKFilterLib SHARED ITKFilterLib.cxx ) Then use cmake + make to build the libExample_ITKFilterLib.so library. Then I can invoke g++ as follows build]$ g++ ../ITKFilterLib/ITKFilterLibTest.cxx -o testcomp -L . -l Example_ITKFilterLib -I ../ITKFilterLib/ Even if the itk-master-static is not available in that environment, this succeeds, and I believe this is what I want. I don?t want to have a statically linked final executable, but rather a .so library. However ? I encountered another hitch trying to apply this to my actual project. If there were any FileWriter and FileReader present in the library, it would not build, complaining about position-dependent symbols in several IO libraries , most of which I was not actually wanting to use at all. This happened at the step of trying to build the .so library using the makefile created by cmake: /usr/bin/ld: /dls_sw/apps/itk/itk-master-static/lib/libitkgdcmjpeg8-4.10.a(jerror.c.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC /dls_sw/apps/itk/itk-master-static/lib/libitkgdcmjpeg8-4.10.a: could not read symbols: Bad value Removing any reference to FileReader and FileWriter gets rid of this problem. Thanks! As a further note: There are also some directions in the comments of the ITKFilterLib example that did not turn out to be necessary in my project. I did not have to create global objects for poitners or image containiers outside the scope of the class and still did not have to #include itkImage.h in the main program. I placed the typedef?s inside the class and the instantiations of the smart poitners in the class constructor. I don?t see that this extra complication in the example is necessary unless it is platform dependent? ITKFilterLib.cxx from ItkApps example: 23 #include "ITKFilterLib.h" 24 25 // Nasty local globals inside .cxx file to hide itk from the real world. 26 // Can't put this variable in the class definition otherwise we'd have to 27 // include itkImage.h in every program using this class. 28 // The typedef h_itkFilterLibeDataType is in itkFilterLib.h to hide 29 // templates 30 typedef itk::Image g_ImageType; 31 g_ImageType::Pointer g_InputImage; 32 g_ImageType::Pointer g_OutputImage; I did not find this to be necessary in my project. 33 34 35 // 36 // 37 // The first filter in the .lib 38 // 39 // 40 41 /** The next lines are used to include the definition of the filter 42 * we want to install in the .lib, define a typedef for it, and create 43 * a "smart" pointer to hold it. 44 * CHANGE HERE: The filter to be instantiated. 45 **/ 46 #include "itkCurvatureAnisotropicDiffusionImageFilter.h" 47 typedef itk::CurvatureAnisotropicDiffusionImageFilter g_AnisoFilterType; 49 g_AnisoFilterType::Pointer g_anisoFilter; 50 I also did not find it to be necessary to have this sort of typedef and instantiation of the object at global scope in my project. From: D?enan Zuki? [mailto:dzenanz at gmail.com] Sent: 23 March 2016 14:39 To: Atwood, Robert (DLSLtd,RAL,SCI) Cc: Insight-users Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib Hi Robert, BUILD_SHARED_LIBS OFF is the crucial setting. You can keep the rest of options on defaults. Your CMake code looks OK. You should execute the following from your folder: cmake . make During CMake step you should configure options (point to the itk-build folder which was configured with BUILD_SHARED_LIBS OFF). Afterwards, do not invoke g++ directly - invoke make, which supplies correct include directories and link libraries so you don't run into a thousand errors. Regards, D?enan On Tue, Mar 22, 2016 at 6:25 AM, > wrote: Hi, Thanks, D?enan, for the hint. But, does anyone have specific information on exactly which options to set in each of: the ITK cmake options; and the project cmake options, or the plain g++ for building an external program to link to the library, for this to work ? There appear to be a few that might be related to this. Because, so far, simply changing the build options of the ITK installation didn?t work. See below for even more details . Thanks Robert Options selected in the project: ITK_DIR /dls_sw/apps/itk/itk-master-static/lib/cmake/ITK-4.10 In the ITK with installation to itk-master-static: I have tried some combinations of these options but, you know, it takes a while to rebuild ITK even though the computer is pretty good. BUILD_POSITION_DEPENDENT_CODE OFF (I don?t think this should be ON because that really wouldn?t work? ) BUILD_SHARED_LIBS OFF (or ON) CMAKE_CXX_FLAGS -fPIC (or default) CMAKE_EXE_LINKER_FLAGS -fPIC (or default) CMAKE_STATIC_LINKER_FLAGS (should this be set too? ) The CMakeLists in the project file ? only small modification from the original to ?BUILD_OUTSIDE_INSIGHT_APPICATIONS?. The project builds using the Cmake makefile, producing the library and the executable But trying to build either the ?main? procedure provided with linking to that library, or even simplifying the ?main? to do virtually nothing except instantiate the object, results in 1000 error messages of ?undefined symbols? 1 PROJECT(Example_ITKFilterLib) 2 3 #REMOVED 'IF (BUILD_OUTSIDE_INSIGHT_APPLICATIONS)' 4 5 FIND_PACKAGE(ITK) 6 IF(ITK_FOUND) 7 INCLUDE(${ITK_USE_FILE}) 8 ELSE(ITK_FOUND) 9 MESSAGE(FATAL_ERROR 10 "Cannot build ITKApps without ITK. Please set ITK_DIR.") 11 ENDIF(ITK_FOUND) 12 13 #REMOVED 'ENDIF(BUILD_OUTSIDE_INSIGHT_APPLICATIONS)' 14 15 ADD_LIBRARY(Example_ITKFilterLib ITKFilterLib.cxx ) 16 INSTALL_TARGETS(/lib Example_ITKFilterLib) 17 TARGET_LINK_LIBRARIES(Example_ITKFilterLib ${ITK_LIBRARIES}) 18 19 ADD_EXECUTABLE(Example_ITKFilterLibTest ITKFilterLibTest.cxx ) 20 INSTALL_TARGETS(/bin Example_ITKFilterLibTest) 21 TARGET_LINK_LIBRARIES(Example_ITKFilterLibTest Example_ITKFilterLib) build]$ ls -l total 2508 -rw-rw-r-- 1 kny48981 kny48981 14393 Mar 22 10:02 CMakeCache.txt drwxrwxr-x 6 kny48981 kny48981 4096 Mar 22 10:05 CMakeFiles -rwxrwxr-x 1 kny48981 kny48981 1417263 Mar 22 10:05 Example_ITKFilterLibTest drwxrwxr-x 2 kny48981 kny48981 4096 Mar 22 10:02 ITKIOFactoryRegistration -rw-rw-r-- 1 kny48981 kny48981 7933 Mar 22 10:02 Makefile -rw-rw-r-- 1 kny48981 kny48981 1092874 Mar 22 10:05 libExample_ITKFilterLib.a build]$ g++ -o testcomp ../ITKFilterLib/ITKFilterLibTest.cxx -I ../ITKFilterLib -L . -l Example_ITKFilterLib >& out & ? generates 1100 messages ? 1 ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string, std::allocat 2 ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3 itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): undefined reference to `itk::ExceptionObject: ? 1106 ITKFilterLib.cxx:(.text._ZNK3itk12NeighborhoodIPfLj3ENS_21Neighborhood AllocatorIS1_EEE9PrintSelfERSoNS_6IndentE[itk::Neighborhood& out Same output AFAICT: 1 ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string, std::alloca 2 ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3 itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): undefined reference to `itk::ExceptionObject: ?. From: D?enan Zuki? [mailto:dzenanz at gmail.com] Sent: 21 March 2016 20:21 To: Atwood, Robert (DLSLtd,RAL,SCI) Cc: Insight-users Subject: Re: [ITK-users] stand-alone lib -- ITKApps/ITKFilterLib Hi Robert, maybe you need to link to ITK statically? To accomplish this you probably need to build ITK as static libraries (it is a configuration option in CMake). Regards, D?enan On Mon, Mar 21, 2016 at 12:50 PM, > wrote: Hi, This example, ITKApps/ITKFilterLib, appears to be an example of what I want to do , bundle or encapsulate a specific ITK-based filter into a library so that another program may just call it without having to have the ITK source installation available. However, a basic test for me is not working. I just tried to compile the test example from command line after building the library with Cmake as usual. I get hundreds of 'undefined reference', as if I have to link with all the ITK libs anyways. Am I missing something? Thanks g++ -o testcomp ../ITKFilterLib/ITKFilterLibTest.cxx -I g++ ../ITKFilterLib/ -L . -l Example_ITKFilterLib First few lines of output: ./libExample_ITKFilterLib.a(ITKFilterLib.o): In function `itk::MemoryAllocationError::MemoryAllocationError(std::basic_string, std::allocator > const&, unsigned int, std::basic_string, std::allocator > const&, std::basic_string, std::allocator const&)': ITKFilterLib.cxx:(.text._ZN3itk21MemoryAllocationErrorC2ERKSsjS2_S2_[_ZN3 itk21MemoryAllocationErrorC5ERKSsjS2_S2_]+0x39): undefined reference to `itk::ExceptionObject::ExceptionObject(std::basic_string, std::allocator > const&, unsigned int, std::basic_string, std::allocator > const&, std::basic_string) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) ) #1 SMP Wed Jan 6 11:20:49 EST 2016 -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users -- This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message. Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 maya.abi_akl at qatar.tamu.edu Thu Mar 24 01:37:06 2016 From: maya.abi_akl at qatar.tamu.edu (Maya) Date: Wed, 23 Mar 2016 22:37:06 -0700 (MST) Subject: [ITK-users] MRI brain data In-Reply-To: References: <1458726215466-7588633.post@n2.nabble.com> Message-ID: <71E9B0DBA59DA84EAEB12C2DA63062A2CA75796D@EXMBX-P1.qatar.tamu.edu> Hi Dzenan, Thank you for the link, I?ll check it out and let you know. I was hoping to find data for more than 1 patient, i.e. a sample with many MRI images to analyze. Do you think it?s possible? Thanks, Maya Maya Abi Akl Physics Laboratory Coordinator Science Department Texas A&M University at Qatar PO Box 23874 | Doha, Qatar 355 Texas A&M Engineering Building | Education City (o) +974.4423.0202 Email: maya.abi_akl at qatar.tamu.edu From: dzenanz [via ITK Insight Users] [mailto:ml-node+s2283740n7588636h5 at n2.nabble.com] Sent: Wednesday, March 23, 2016 5:46 PM To: Abi Akl, Maya Subject: Re: [ITK-users] MRI brain data Hi Maya, I don't know how much of a bias field this has (it seems to be weaker inferiorly), but you can use my brain scan: https://dl.dropboxusercontent.com/u/48665006/tmj_DZ.nrrd Tell me if you find it useful. Regards, D?enan On Wed, Mar 23, 2016 at 5:43 AM, Maya <[hidden email]> wrote: Hello, I started using itk to do Bias Field correction on MRI brain data. I would like to ask if there is any brain MRI data available with significant bias field that I can use?\ Thanks, Maya -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/MRI-brain-data-tp7588633.html Sent from the ITK Insight Users mailing list archive at Nabble.com. _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users ________________________________ If you reply to this email, your message will be added to the discussion below: http://itk-insight-users.2283740.n2.nabble.com/MRI-brain-data-tp7588633p7588636.html To unsubscribe from MRI brain data, click here. NAML -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/MRI-brain-data-tp7588633p7588649.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From dzenanz at gmail.com Thu Mar 24 08:23:15 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Thu, 24 Mar 2016 08:23:15 -0400 Subject: [ITK-users] MRI brain data In-Reply-To: <71E9B0DBA59DA84EAEB12C2DA63062A2CA75796D@EXMBX-P1.qatar.tamu.edu> References: <1458726215466-7588633.post@n2.nabble.com> <71E9B0DBA59DA84EAEB12C2DA63062A2CA75796D@EXMBX-P1.qatar.tamu.edu> Message-ID: In that case, the first place to look would be grand challenge website . You can also look at BrainWeb . Also, do a general web search from MRI, bias, brain. If you do not specifically require brain images, you can also look at SpineWeb . HTH, D?enan On Thu, Mar 24, 2016 at 1:37 AM, Maya wrote: > Hi Dzenan, > > Thank you for the link, I?ll check it out and let you know. > I was hoping to find data for more than 1 patient, i.e. a sample with many > MRI images to analyze. > Do you think it?s possible? > > Thanks, > Maya > > Maya Abi Akl > Physics Laboratory Coordinator > Science Department > Texas A&M University at Qatar > PO Box 23874 | Doha, Qatar > 355 Texas A&M Engineering Building | Education City > (o) +974.4423.0202 > Email: maya.abi_akl at qatar.tamu.edu > > > From: dzenanz [via ITK Insight Users] [mailto: > ml-node+s2283740n7588636h5 at n2.nabble.com] > Sent: Wednesday, March 23, 2016 5:46 PM > To: Abi Akl, Maya > Subject: Re: [ITK-users] MRI brain data > > Hi Maya, > > I don't know how much of a bias field this has (it seems to be weaker > inferiorly), but you can use my brain scan: > https://dl.dropboxusercontent.com/u/48665006/tmj_DZ.nrrd< > https://urldefense.proofpoint.com/v2/url?u=https-3A__dl.dropboxusercontent.com_u_48665006_tmj-5FDZ.nrrd&d=CwMFaQ&c=bnyvWLdNsiLM7TAqr9FAIzD3xPtiaC-DpEuDzu-03E4&r=N16Y7EA4OotTdsFfvR9_sJtDoeMkz85zsb-9JFwlY38&m=VHSZZLdYrNF-5JR2SJw7qy1Az8IogQi9iqs5Y2SiNyk&s=obWbvyfDFQ2EfjY34N6m4DlbKacD3dpiFV7jOwLlA7I&e= > > > > Tell me if you find it useful. > > Regards, > D?enan > > On Wed, Mar 23, 2016 at 5:43 AM, Maya <[hidden > email]> wrote: > Hello, > > I started using itk to do Bias Field correction on MRI brain data. > I would like to ask if there is any brain MRI data available with > significant bias field that I can use?\ > > Thanks, > Maya > > > > -- > View this message in context: > http://itk-insight-users.2283740.n2.nabble.com/MRI-brain-data-tp7588633.html > < > https://urldefense.proofpoint.com/v2/url?u=http-3A__itk-2Dinsight-2Dusers.2283740.n2.nabble.com_MRI-2Dbrain-2Ddata-2Dtp7588633.html&d=CwMFaQ&c=bnyvWLdNsiLM7TAqr9FAIzD3xPtiaC-DpEuDzu-03E4&r=N16Y7EA4OotTdsFfvR9_sJtDoeMkz85zsb-9JFwlY38&m=VHSZZLdYrNF-5JR2SJw7qy1Az8IogQi9iqs5Y2SiNyk&s=TZOLFq0MtJ2r1GFUb41GFsJNRk9hpGLw3lBbiVsGozw&e= > > > Sent from the ITK Insight Users mailing list archive at Nabble.com. > _____________________________________ > Powered by www.kitware.com< > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.kitware.com&d=CwMFaQ&c=bnyvWLdNsiLM7TAqr9FAIzD3xPtiaC-DpEuDzu-03E4&r=N16Y7EA4OotTdsFfvR9_sJtDoeMkz85zsb-9JFwlY38&m=VHSZZLdYrNF-5JR2SJw7qy1Az8IogQi9iqs5Y2SiNyk&s=PHs-GTzElc7rH811A4ABOL_sOAuCnhbqwAdWdjUtwLU&e= > > > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html< > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.kitware.com_opensource_opensource.html&d=CwMFaQ&c=bnyvWLdNsiLM7TAqr9FAIzD3xPtiaC-DpEuDzu-03E4&r=N16Y7EA4OotTdsFfvR9_sJtDoeMkz85zsb-9JFwlY38&m=VHSZZLdYrNF-5JR2SJw7qy1Az8IogQi9iqs5Y2SiNyk&s=s8FjwT_mZjrvPt4eY2qbseRBopqlcHAuvImlq66DGNk&e= > > > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php< > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.kitware.com_products_protraining.php&d=CwMFaQ&c=bnyvWLdNsiLM7TAqr9FAIzD3xPtiaC-DpEuDzu-03E4&r=N16Y7EA4OotTdsFfvR9_sJtDoeMkz85zsb-9JFwlY38&m=VHSZZLdYrNF-5JR2SJw7qy1Az8IogQi9iqs5Y2SiNyk&s=e2Sv-lR2ckQchHey4p1RsZjzI2nFumyiATpd7BSMIYE&e= > > > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ< > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.itk.org_Wiki_ITK-5FFAQ&d=CwMFaQ&c=bnyvWLdNsiLM7TAqr9FAIzD3xPtiaC-DpEuDzu-03E4&r=N16Y7EA4OotTdsFfvR9_sJtDoeMkz85zsb-9JFwlY38&m=VHSZZLdYrNF-5JR2SJw7qy1Az8IogQi9iqs5Y2SiNyk&s=QfupgSaKihA0tfPEMoiTN7YklPvLH1bzN-6ZKkJcr64&e= > > > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users< > https://urldefense.proofpoint.com/v2/url?u=http-3A__public.kitware.com_mailman_listinfo_insight-2Dusers&d=CwMFaQ&c=bnyvWLdNsiLM7TAqr9FAIzD3xPtiaC-DpEuDzu-03E4&r=N16Y7EA4OotTdsFfvR9_sJtDoeMkz85zsb-9JFwlY38&m=VHSZZLdYrNF-5JR2SJw7qy1Az8IogQi9iqs5Y2SiNyk&s=c5ddJ5od_Zs70lVf0guwypEWwEBeSOjX2f5CcUkhqHk&e= > > > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html< > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.kitware.com_opensource_opensource.html&d=CwMFaQ&c=bnyvWLdNsiLM7TAqr9FAIzD3xPtiaC-DpEuDzu-03E4&r=N16Y7EA4OotTdsFfvR9_sJtDoeMkz85zsb-9JFwlY38&m=VHSZZLdYrNF-5JR2SJw7qy1Az8IogQi9iqs5Y2SiNyk&s=s8FjwT_mZjrvPt4eY2qbseRBopqlcHAuvImlq66DGNk&e= > > > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php< > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.kitware.com_products_protraining.php&d=CwMFaQ&c=bnyvWLdNsiLM7TAqr9FAIzD3xPtiaC-DpEuDzu-03E4&r=N16Y7EA4OotTdsFfvR9_sJtDoeMkz85zsb-9JFwlY38&m=VHSZZLdYrNF-5JR2SJw7qy1Az8IogQi9iqs5Y2SiNyk&s=e2Sv-lR2ckQchHey4p1RsZjzI2nFumyiATpd7BSMIYE&e= > > > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ< > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.itk.org_Wiki_ITK-5FFAQ&d=CwMFaQ&c=bnyvWLdNsiLM7TAqr9FAIzD3xPtiaC-DpEuDzu-03E4&r=N16Y7EA4OotTdsFfvR9_sJtDoeMkz85zsb-9JFwlY38&m=VHSZZLdYrNF-5JR2SJw7qy1Az8IogQi9iqs5Y2SiNyk&s=QfupgSaKihA0tfPEMoiTN7YklPvLH1bzN-6ZKkJcr64&e= > > > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users< > https://urldefense.proofpoint.com/v2/url?u=http-3A__public.kitware.com_mailman_listinfo_insight-2Dusers&d=CwMFaQ&c=bnyvWLdNsiLM7TAqr9FAIzD3xPtiaC-DpEuDzu-03E4&r=N16Y7EA4OotTdsFfvR9_sJtDoeMkz85zsb-9JFwlY38&m=VHSZZLdYrNF-5JR2SJw7qy1Az8IogQi9iqs5Y2SiNyk&s=c5ddJ5od_Zs70lVf0guwypEWwEBeSOjX2f5CcUkhqHk&e= > > > > ________________________________ > If you reply to this email, your message will be added to the discussion > below: > > http://itk-insight-users.2283740.n2.nabble.com/MRI-brain-data-tp7588633p7588636.html > < > https://urldefense.proofpoint.com/v2/url?u=http-3A__itk-2Dinsight-2Dusers.2283740.n2.nabble.com_MRI-2Dbrain-2Ddata-2Dtp7588633p7588636.html&d=CwMFaQ&c=bnyvWLdNsiLM7TAqr9FAIzD3xPtiaC-DpEuDzu-03E4&r=N16Y7EA4OotTdsFfvR9_sJtDoeMkz85zsb-9JFwlY38&m=VHSZZLdYrNF-5JR2SJw7qy1Az8IogQi9iqs5Y2SiNyk&s=CICfwFSU2PnmoXzLzDMYzLKfdufepFjR2WeFD9Uv2G4&e= > > > To unsubscribe from MRI brain data, click here< > https://urldefense.proofpoint.com/v2/url?u=http-3A__itk-2Dinsight-2Dusers.2283740.n2.nabble.com_template_NamlServlet.jtp-3Fmacro-3Dunsubscribe-5Fby-5Fcode-26node-3D7588633-26code-3DbWF5YS5hYmlfYWtsQHFhdGFyLnRhbXUuZWR1fDc1ODg2MzN8LTQ3NTc5MjE5Mw-3D-3D&d=CwMFaQ&c=bnyvWLdNsiLM7TAqr9FAIzD3xPtiaC-DpEuDzu-03E4&r=N16Y7EA4OotTdsFfvR9_sJtDoeMkz85zsb-9JFwlY38&m=VHSZZLdYrNF-5JR2SJw7qy1Az8IogQi9iqs5Y2SiNyk&s=T7y-1UOjUBPNUDPdlitpyD9y5GBFFoWkNI2a8QwXHoA&e= > >. > NAML< > https://urldefense.proofpoint.com/v2/url?u=http-3A__itk-2Dinsight-2Dusers.2283740.n2.nabble.com_template_NamlServlet.jtp-3Fmacro-3Dmacro-5Fviewer-26id-3Dinstant-5Fhtml-2521nabble-253Aemail.naml-26base-3Dnabble.naml.namespaces.BasicNamespace-2Dnabble.view.web.template.NabbleNamespace-2Dnabble.view.web.template.NodeNamespace-26breadcrumbs-3Dnotify-5Fsubscribers-2521nabble-253Aemail.naml-2Dinstant-5Femails-2521nabble-253Aemail.naml-2Dsend-5Finstant-5Femail-2521nabble-253Aemail.naml&d=CwMFaQ&c=bnyvWLdNsiLM7TAqr9FAIzD3xPtiaC-DpEuDzu-03E4&r=N16Y7EA4OotTdsFfvR9_sJtDoeMkz85zsb-9JFwlY38&m=VHSZZLdYrNF-5JR2SJw7qy1Az8IogQi9iqs5Y2SiNyk&s=BjjHKEdTOjc2LIG5M2Jrr9xTka2SwVzlk8pNgKKngtY&e= > > > > > > > -- > View this message in context: > http://itk-insight-users.2283740.n2.nabble.com/MRI-brain-data-tp7588633p7588649.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 maya.abi_akl at qatar.tamu.edu Thu Mar 24 08:34:07 2016 From: maya.abi_akl at qatar.tamu.edu (Maya) Date: Thu, 24 Mar 2016 05:34:07 -0700 (MST) Subject: [ITK-users] MRI brain data In-Reply-To: References: <1458726215466-7588633.post@n2.nabble.com> <71E9B0DBA59DA84EAEB12C2DA63062A2CA75796D@EXMBX-P1.qatar.tamu.edu> Message-ID: <71E9B0DBA59DA84EAEB12C2DA63062A2CA7581B3@EXMBX-P1.qatar.tamu.edu> I definitely will. Thanks again for your prompt reply. Best regards, Maya Maya Abi Akl Physics Laboratory Coordinator Science Department Texas A&M University at Qatar PO Box 23874 | Doha, Qatar 355 Texas A&M Engineering Building | Education City (o) +974.4423.0202 Email: maya.abi_akl at qatar.tamu.edu From: dzenanz [via ITK Insight Users] [mailto:ml-node+s2283740n7588650h39 at n2.nabble.com] Sent: Thursday, March 24, 2016 3:24 PM To: Abi Akl, Maya Subject: Re: [ITK-users] MRI brain data In that case, the first place to look would be grand challenge website. You can also look at BrainWeb. Also, do a general web search from MRI, bias, brain. If you do not specifically require brain images, you can also look at SpineWeb. HTH, D?enan On Thu, Mar 24, 2016 at 1:37 AM, Maya <[hidden email]> wrote: Hi Dzenan, Thank you for the link, I?ll check it out and let you know. I was hoping to find data for more than 1 patient, i.e. a sample with many MRI images to analyze. Do you think it?s possible? Thanks, Maya Maya Abi Akl Physics Laboratory Coordinator Science Department Texas A&M University at Qatar PO Box 23874 | Doha, Qatar 355 Texas A&M Engineering Building | Education City (o) +974.4423.0202 Email: [hidden email]> From: dzenanz [via ITK Insight Users] [mailto:[hidden email]] Sent: Wednesday, March 23, 2016 5:46 PM To: Abi Akl, Maya <[hidden email]> Subject: Re: [ITK-users] MRI brain data Hi Maya, I don't know how much of a bias field this has (it seems to be weaker inferiorly), but you can use my brain scan: https://dl.dropboxusercontent.com/u/48665006/tmj_DZ.nrrd Tell me if you find it useful. Regards, D?enan On Wed, Mar 23, 2016 at 5:43 AM, Maya <[hidden email]> wrote: Hello, I started using itk to do Bias Field correction on MRI brain data. I would like to ask if there is any brain MRI data available with significant bias field that I can use?\ Thanks, Maya -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/MRI-brain-data-tp7588633.html Sent from the ITK Insight Users mailing list archive at Nabble.com. _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users _____________________________________ Powered by www.kitware.com> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users ________________________________ If you reply to this email, your message will be added to the discussion below: http://itk-insight-users.2283740.n2.nabble.com/MRI-brain-data-tp7588633p7588636.html To unsubscribe from MRI brain data, click here. NAML -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/MRI-brain-data-tp7588633p7588649.html Sent from the ITK Insight Users mailing list archive at Nabble.com. _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users ________________________________ If you reply to this email, your message will be added to the discussion below: http://itk-insight-users.2283740.n2.nabble.com/MRI-brain-data-tp7588633p7588650.html To unsubscribe from MRI brain data, click here. NAML -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/MRI-brain-data-tp7588633p7588651.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From Jared.Becksfort at STJUDE.ORG Thu Mar 24 10:27:22 2016 From: Jared.Becksfort at STJUDE.ORG (Becksfort, Jared) Date: Thu, 24 Mar 2016 14:27:22 +0000 Subject: [ITK-users] Rigid 3D rotation based on plane In-Reply-To: References: Message-ID: Matt, Thank you. Resampling (and documentation reading) is what I needed. Jared On 3/23/16, 12:52 PM, "Matt McCormick" wrote: >Hi Jared, > >It sounds like you just want to resample an image with a given >transformation. Search for "Resample" on this page: > > http://www.itk.org/Insight/Doxygen/html/examples.html > >consider the Euler3DTransform: > > >http://www.itk.org/Insight/Doxygen/html/classitk_1_1Euler3DTransform.html > >and see the section on Transforms in the ITK Software Guide: > > >http://itk.org/ITKSoftwareGuide/html/Book2/ITKSoftwareGuide-Book2ch3.html# >x26-1160003.9 > >HTH, >Matt > >On Wed, Mar 23, 2016 at 1:26 PM, Becksfort, Jared > wrote: >> Hello, >> >> I am trying to rotate a 3D image about a plane. I am attempting to do >> this using the PointSetToPointSet registration examples. I grab points >> from a plane that I find in the image and correspond them with the >>center >> of the image volume or the top of the image in a certain slice, etc. >> >> I notice that the examples all tend to end by printing the solution. I >>am >> able to get this far. It is not clear to me how I would apply this >> solution to a rigid 3D registration method such as the Versor transform, >> or if I am even taking the correct approach at all. I only have one >> image, not a moving one and a fixed one. >> >> I simply want to reorient an MRI volume so that its center of mass is in >> the center of the image coordinates and rotate it so that some 3D plane >>I >> find travels through the center of the image also. Can someone please >> point me in the right direction? >> >> >>http://www.itk.org/Doxygen/html/Examples_2RegistrationITKv4_2IterativeClo >>se >> stPoint3_8cxx-example.html#_a4 >> >> >> Thank You, >> Jared >> >> >> ________________________________ >> >> Email Disclaimer: www.stjude.org/emaildisclaimer >> Consultation Disclaimer: www.stjude.org/consultationdisclaimer >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users From emily-hammond at uiowa.edu Fri Mar 25 15:26:29 2016 From: emily-hammond at uiowa.edu (Hammond, Emily M) Date: Fri, 25 Mar 2016 19:26:29 +0000 Subject: [ITK-users] convert affine transform to scale versor 3D transform Message-ID: Hello, I am trying to read in an affine transform from a file and convert it to a scale versor 3D transform. To do this I wish to manually define the matrix in the versor transform and then manually define the translation. Thus far, I have run into some difficulties in manually setting the matrix. As far as I can tell it is as basic as this one line of code. affineTransform is of itk::AffineTransform< double > versorTransform is of itk::ScaleVersor3DTransform< double > versorTransform->SetMatrix( affineTransform->GetMatrix() ); However, I am getting some runtime errors and I cannot figure out why. Both my versor transform and my affine transform are defined so I am not trying to access something that does not exist. Can anyone give me some insight as to why this member function may not work or if there is a better way to go about converting from affine to versor based transform? Thanks! Emily Hammond -------------- next part -------------- An HTML attachment was scrubbed... URL: From dzenanz at gmail.com Fri Mar 25 15:56:45 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Fri, 25 Mar 2016 15:56:45 -0400 Subject: [ITK-users] convert affine transform to scale versor 3D transform In-Reply-To: References: Message-ID: Hi Emily, the docs say that matrix set via SetMatrix is not checked for orthogonality. This is probably the reason that you get runtime errors later. To see how affine is properly transformed into scale versor, you might want to take a look at BRAINSFit's code to see how it is done there. The answer might not be in that file, but I remember BRAINSFit had a conversion routine. Regards, D?enan On Fri, Mar 25, 2016 at 3:26 PM, Hammond, Emily M wrote: > Hello, > > > I am trying to read in an affine transform from a file and convert it to a > scale versor 3D transform. To do this I wish to manually define the matrix > in the versor transform and then manually define the translation. Thus far, > I have run into some difficulties in manually setting the matrix. As far as > I can tell it is as basic as this one line of code. > > > affineTransform is of itk::AffineTransform< double > > > versorTransform is of itk::ScaleVersor3DTransform< double > > > > versorTransform->SetMatrix( affineTransform->GetMatrix() ); > > > However, I am getting some runtime errors and I cannot figure out why. > Both my versor transform and my affine transform are defined so I am not > trying to access something that does not exist. Can anyone give me some > insight as to why this member function may not work or if there is a better > way to go about converting from affine to versor based transform? > > > Thanks! > Emily Hammond > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 bakkari.abdelkhalek at hotmail.fr Fri Mar 25 17:23:45 2016 From: bakkari.abdelkhalek at hotmail.fr (Abdelkhalek Bakkari) Date: Fri, 25 Mar 2016 22:23:45 +0100 Subject: [ITK-users] Cerebral Spinal Fluid Extraction from 3D Image Message-ID: Hi ! I would like to extract the CSF (Cerebral Spinal Fluid) from a 3D Segmented Dicom Image (.dcm) using ITK. Any help ! Any suggestion ! please. Best regards, Abdelkhalek BakkariPh.D candidate in Computer ScienceInstitute of Applied Computer ScienceLodz University of Technology, Poland -------------- next part -------------- An HTML attachment was scrubbed... URL: From fisidoro at ethz.ch Sat Mar 26 12:13:38 2016 From: fisidoro at ethz.ch (D'Isidoro Fabio) Date: Sat, 26 Mar 2016 16:13:38 +0000 Subject: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python Wrap Message-ID: <50B858FB5F53124F9E32314E5C1B409435B3E077@MBX112.d.ethz.ch> Hallo, I am trying to implement my own Digital Radiograph Reconstruction algorithm with ITK v 4.8 Python Wrap. I have looked on the web and found examples that make use of the itk::RayCastInterpolateImageFunction. However, it seems that this function has not been wrapped for Python because I get the error: 'LazyITKModule' object has not attribute 'RayCastInterpolateImageFunction' Any help? Hast this been done in the new 4.9 Version or what do you suggest for me to do? Thank you. Fabio -------------- next part -------------- An HTML attachment was scrubbed... URL: From michkapopoff at gmail.com Sat Mar 26 14:16:18 2016 From: michkapopoff at gmail.com (Michka Popoff) Date: Sat, 26 Mar 2016 19:16:18 +0100 Subject: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python Wrap In-Reply-To: <50B858FB5F53124F9E32314E5C1B409435B3E077@MBX112.d.ethz.ch> References: <50B858FB5F53124F9E32314E5C1B409435B3E077@MBX112.d.ethz.ch> Message-ID: Hi The function was not wrapped at all. Most of them are, and the remaining are added slowly, mostly on-demand (for the moment). I made a patch which you can test/review here: http://review.source.kitware.com/#/c/20945/ We can probably add it to the 4.9.1 release; else it will land in the ITK 4.10 release. Michka > On 26 Mar 2016, at 17:13, D'Isidoro Fabio wrote: > > Hallo, > > I am trying to implement my own Digital Radiograph Reconstruction algorithm with ITK v 4.8 Python Wrap. I have looked on the web and found examples that make use of the itk::RayCastInterpolateImageFunction. However, it seems that this function has not been wrapped for Python because I get the error: > > ?LazyITKModule? object has not attribute ?RayCastInterpolateImageFunction? > > Any help? Hast this been done in the new 4.9 Version or what do you suggest for me to do? > > Thank you. > > Fabio > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 fisidoro at ethz.ch Sat Mar 26 14:27:45 2016 From: fisidoro at ethz.ch (D'Isidoro Fabio) Date: Sat, 26 Mar 2016 18:27:45 +0000 Subject: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python Wrap In-Reply-To: References: <50B858FB5F53124F9E32314E5C1B409435B3E077@MBX112.d.ethz.ch> Message-ID: <50B858FB5F53124F9E32314E5C1B409435B3E093@MBX112.d.ethz.ch> Thank you for your reply. I miss the skills to test/review that patch. I do not know how to wrap a C++ code to Python. Is there any relatively easy guide for it? Also, what are my possibilities now? Writing my own RayCasting Filter in Python and possibly use it as interpolator for the ResampleImageFilter Filter? Or necessarily turn to C++ forgetting about Python? Thanks From: Michka Popoff [mailto:michkapopoff at gmail.com] Sent: Samstag, 26. M?rz 2016 19:16 To: D'Isidoro Fabio Cc: insight-users at itk.org Subject: Re: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python Wrap Hi The function was not wrapped at all. Most of them are, and the remaining are added slowly, mostly on-demand (for the moment). I made a patch which you can test/review here: http://review.source.kitware.com/#/c/20945/ We can probably add it to the 4.9.1 release; else it will land in the ITK 4.10 release. Michka On 26 Mar 2016, at 17:13, D'Isidoro Fabio > wrote: Hallo, I am trying to implement my own Digital Radiograph Reconstruction algorithm with ITK v 4.8 Python Wrap. I have looked on the web and found examples that make use of the itk::RayCastInterpolateImageFunction. However, it seems that this function has not been wrapped for Python because I get the error: ?LazyITKModule? object has not attribute ?RayCastInterpolateImageFunction? Any help? Hast this been done in the new 4.9 Version or what do you suggest for me to do? Thank you. Fabio _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From michkapopoff at gmail.com Sat Mar 26 14:41:46 2016 From: michkapopoff at gmail.com (Michka Popoff) Date: Sat, 26 Mar 2016 19:41:46 +0100 Subject: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python Wrap In-Reply-To: <50B858FB5F53124F9E32314E5C1B409435B3E093@MBX112.d.ethz.ch> References: <50B858FB5F53124F9E32314E5C1B409435B3E077@MBX112.d.ethz.ch> <50B858FB5F53124F9E32314E5C1B409435B3E093@MBX112.d.ethz.ch> Message-ID: <4F6CCA0D-3ACF-4818-B3C0-EB1AC89FA902@gmail.com> I can notify you once it is merged to the master branch of ITK. This should be fast (as soon as it gets reviewed). Wrapping new functions/classes is made by adding a .wrap file in the corresponding ?wrapping" folder of the module. I often just copy-paste a similar .wrap file an adapt it. There are sometimes some surprise, and the .wrap file needs to be tweaked. Not sure if we have a guide on how to do it. Some cases like this one are really easy to implement, some others are more involved. Once the patch is merged, you will need to build ITK from source. This is pretty easy: http://www.itk.org/Wiki/ITK/Configuring_and_Building We can assist you if there are problems. Writing your own filter in Python is doable; but I never tried such thing. It would be a nice proof-of-concept to get something like this to run. But this is probably more work than it is worth. If you can wait a few days until the patch is merged, and are willing to build ITK from source, the python solution is probably the easiest. Michka > On 26 Mar 2016, at 19:27, D'Isidoro Fabio wrote: > > Thank you for your reply. > > I miss the skills to test/review that patch. I do not know how to wrap a C++ code to Python. Is there any relatively easy guide for it? > > Also, what are my possibilities now? Writing my own RayCasting Filter in Python and possibly use it as interpolator for the ResampleImageFilter Filter? Or necessarily turn to C++ forgetting about Python? > > Thanks > > From: Michka Popoff [mailto:michkapopoff at gmail.com] > Sent: Samstag, 26. M?rz 2016 19:16 > To: D'Isidoro Fabio > Cc: insight-users at itk.org > Subject: Re: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python Wrap > > Hi > > The function was not wrapped at all. > Most of them are, and the remaining are added slowly, mostly on-demand (for the moment). > > I made a patch which you can test/review here: http://review.source.kitware.com/#/c/20945/ > > We can probably add it to the 4.9.1 release; else it will land in the ITK 4.10 release. > > Michka > > On 26 Mar 2016, at 17:13, D'Isidoro Fabio > wrote: > > Hallo, > > I am trying to implement my own Digital Radiograph Reconstruction algorithm with ITK v 4.8 Python Wrap. I have looked on the web and found examples that make use of the itk::RayCastInterpolateImageFunction. However, it seems that this function has not been wrapped for Python because I get the error: > > ?LazyITKModule? object has not attribute ?RayCastInterpolateImageFunction? > > Any help? Hast this been done in the new 4.9 Version or what do you suggest for me to do? > > Thank you. > > Fabio > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Sat Mar 26 21:59:09 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Sat, 26 Mar 2016 21:59:09 -0400 Subject: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python Wrap In-Reply-To: <4F6CCA0D-3ACF-4818-B3C0-EB1AC89FA902@gmail.com> References: <50B858FB5F53124F9E32314E5C1B409435B3E077@MBX112.d.ethz.ch> <50B858FB5F53124F9E32314E5C1B409435B3E093@MBX112.d.ethz.ch> <4F6CCA0D-3ACF-4818-B3C0-EB1AC89FA902@gmail.com> Message-ID: Hi, Here are some pointers to relevant documentation: How to add wrapping for a filter: http://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch9.html#x50-1500009.5 How to perform a review: https://insightsoftwareconsortium.github.io/ITKBarCamp-doc/CommunitySoftwareProcess/PerformAGerritReview/index.html How to download ITK with Git: http://www.itk.org/Wiki/ITK/Git Hope this helps, Matt On Sat, Mar 26, 2016 at 2:41 PM, Michka Popoff wrote: > I can notify you once it is merged to the master branch of ITK. > This should be fast (as soon as it gets reviewed). > > Wrapping new functions/classes is made by adding a .wrap file > in the corresponding ?wrapping" folder of the module. > I often just copy-paste a similar .wrap file an adapt it. There are > sometimes > some surprise, and the .wrap file needs to be tweaked. > > Not sure if we have a guide on how to do it. > Some cases like this one are really easy to implement, some others are more > involved. > > Once the patch is merged, you will need to build ITK from source. > This is pretty easy: http://www.itk.org/Wiki/ITK/Configuring_and_Building > We can assist you if there are problems. > > Writing your own filter in Python is doable; but I never tried such thing. > It would be a nice proof-of-concept to get something like this to run. > But this is probably more work than it is worth. > > If you can wait a few days until the patch is merged, and are willing > to build ITK from source, the python solution is probably the easiest. > > Michka > > > On 26 Mar 2016, at 19:27, D'Isidoro Fabio wrote: > > Thank you for your reply. > > I miss the skills to test/review that patch. I do not know how to wrap a C++ > code to Python. Is there any relatively easy guide for it? > > Also, what are my possibilities now? Writing my own RayCasting Filter in > Python and possibly use it as interpolator for the ResampleImageFilter > Filter? Or necessarily turn to C++ forgetting about Python? > > Thanks > > From: Michka Popoff [mailto:michkapopoff at gmail.com] > Sent: Samstag, 26. M?rz 2016 19:16 > To: D'Isidoro Fabio > Cc: insight-users at itk.org > Subject: Re: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python > Wrap > > Hi > > The function was not wrapped at all. > Most of them are, and the remaining are added slowly, mostly on-demand (for > the moment). > > I made a patch which you can test/review here: > http://review.source.kitware.com/#/c/20945/ > > We can probably add it to the 4.9.1 release; else it will land in the ITK > 4.10 release. > > Michka > > > On 26 Mar 2016, at 17:13, D'Isidoro Fabio wrote: > > Hallo, > > I am trying to implement my own Digital Radiograph Reconstruction algorithm > with ITK v 4.8 Python Wrap. I have looked on the web and found examples that > make use of the itk::RayCastInterpolateImageFunction. However, it seems that > this function has not been wrapped for Python because I get the error: > > ?LazyITKModule? object has not attribute ?RayCastInterpolateImageFunction? > > Any help? Hast this been done in the new 4.9 Version or what do you suggest > for me to do? > > Thank you. > > Fabio > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > From michkapopoff at gmail.com Sun Mar 27 05:20:03 2016 From: michkapopoff at gmail.com (Michka Popoff) Date: Sun, 27 Mar 2016 11:20:03 +0200 Subject: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python Wrap In-Reply-To: References: <50B858FB5F53124F9E32314E5C1B409435B3E077@MBX112.d.ethz.ch> <50B858FB5F53124F9E32314E5C1B409435B3E093@MBX112.d.ethz.ch> <4F6CCA0D-3ACF-4818-B3C0-EB1AC89FA902@gmail.com> Message-ID: <0A63EEFB-3478-4C84-A875-CCA5DF78CB3B@gmail.com> Patch has been merged. You should now be able to use it. Thanks Matt for the quick review. Michka > On 27 Mar 2016, at 03:59, Matt McCormick wrote: > > Hi, > > Here are some pointers to relevant documentation: > > How to add wrapping for a filter: > http://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch9.html#x50-1500009.5 > > How to perform a review: > https://insightsoftwareconsortium.github.io/ITKBarCamp-doc/CommunitySoftwareProcess/PerformAGerritReview/index.html > > How to download ITK with Git: http://www.itk.org/Wiki/ITK/Git > > Hope this helps, > Matt > > On Sat, Mar 26, 2016 at 2:41 PM, Michka Popoff wrote: >> I can notify you once it is merged to the master branch of ITK. >> This should be fast (as soon as it gets reviewed). >> >> Wrapping new functions/classes is made by adding a .wrap file >> in the corresponding ?wrapping" folder of the module. >> I often just copy-paste a similar .wrap file an adapt it. There are >> sometimes >> some surprise, and the .wrap file needs to be tweaked. >> >> Not sure if we have a guide on how to do it. >> Some cases like this one are really easy to implement, some others are more >> involved. >> >> Once the patch is merged, you will need to build ITK from source. >> This is pretty easy: http://www.itk.org/Wiki/ITK/Configuring_and_Building >> We can assist you if there are problems. >> >> Writing your own filter in Python is doable; but I never tried such thing. >> It would be a nice proof-of-concept to get something like this to run. >> But this is probably more work than it is worth. >> >> If you can wait a few days until the patch is merged, and are willing >> to build ITK from source, the python solution is probably the easiest. >> >> Michka >> >> >> On 26 Mar 2016, at 19:27, D'Isidoro Fabio wrote: >> >> Thank you for your reply. >> >> I miss the skills to test/review that patch. I do not know how to wrap a C++ >> code to Python. Is there any relatively easy guide for it? >> >> Also, what are my possibilities now? Writing my own RayCasting Filter in >> Python and possibly use it as interpolator for the ResampleImageFilter >> Filter? Or necessarily turn to C++ forgetting about Python? >> >> Thanks >> >> From: Michka Popoff [mailto:michkapopoff at gmail.com] >> Sent: Samstag, 26. M?rz 2016 19:16 >> To: D'Isidoro Fabio >> Cc: insight-users at itk.org >> Subject: Re: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python >> Wrap >> >> Hi >> >> The function was not wrapped at all. >> Most of them are, and the remaining are added slowly, mostly on-demand (for >> the moment). >> >> I made a patch which you can test/review here: >> http://review.source.kitware.com/#/c/20945/ >> >> We can probably add it to the 4.9.1 release; else it will land in the ITK >> 4.10 release. >> >> Michka >> >> >> On 26 Mar 2016, at 17:13, D'Isidoro Fabio wrote: >> >> Hallo, >> >> I am trying to implement my own Digital Radiograph Reconstruction algorithm >> with ITK v 4.8 Python Wrap. I have looked on the web and found examples that >> make use of the itk::RayCastInterpolateImageFunction. However, it seems that >> this function has not been wrapped for Python because I get the error: >> >> ?LazyITKModule? object has not attribute ?RayCastInterpolateImageFunction? >> >> Any help? Hast this been done in the new 4.9 Version or what do you suggest >> for me to do? >> >> Thank you. >> >> Fabio >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> >> >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> From fisidoro at ethz.ch Sun Mar 27 15:41:37 2016 From: fisidoro at ethz.ch (D'Isidoro Fabio) Date: Sun, 27 Mar 2016 19:41:37 +0000 Subject: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python Wrap In-Reply-To: <0A63EEFB-3478-4C84-A875-CCA5DF78CB3B@gmail.com> References: <50B858FB5F53124F9E32314E5C1B409435B3E077@MBX112.d.ethz.ch> <50B858FB5F53124F9E32314E5C1B409435B3E093@MBX112.d.ethz.ch> <4F6CCA0D-3ACF-4818-B3C0-EB1AC89FA902@gmail.com> <0A63EEFB-3478-4C84-A875-CCA5DF78CB3B@gmail.com> Message-ID: <50B858FB5F53124F9E32314E5C1B409435B3E522@MBX112.d.ethz.ch> Thank you. I downloaded ITK with Git from: http://www.itk.org/Wiki/ITK/Git and built it with Visual Studio and the ITK_WRAP_PYTHON option (I had one this procedure many times already before). Unfortunately my build (8 hours on my laptop, without BUILD_EXAMPLES) was unsuccessful. Apparently there are mistakes related to itk:NumericTraits (see below a part of it): ... $NumericTraits at H@itk@@2HB) already defined in itkAbsImageFilterPython.obj 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static unsigned int const itk::NumericTraits::Zero" (?Zero@?$NumericTraits at I@itk@@2IB) already defined in itkAbsImageFilterPython.obj 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static unsigned int const itk::NumericTraits::One" (?One@?$NumericTraits at I@itk@@2IB) already defined in itkAbsImageFilterPython.obj 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static long const itk::NumericTraits::Zero" (?Zero@?$NumericTraits at J@itk@@2JB) already defined in itkAbsImageFilterPython.obj 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static long const itk::NumericTraits::One" (?One@?$NumericTraits at J@itk@@2JB) already defined in itkAbsImageFilterPython.obj 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static bool const itk::NumericTraits::Zero" (?Zero@?$NumericTraits at _N@itk@@2_NB) already defined in itkAbsImageFilterPython.obj 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static bool const itk::NumericTraits::One" (?One@?$NumericTraits at _N@itk@@2_NB) already defined in itkAbsImageFilterPython.obj 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static unsigned long const itk::NumericTraits::Zero" (?Zero@?$NumericTraits at K@itk@@2KB) already defined in itkAbsImageFilterPython.obj 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static unsigned long const itk::NumericTraits::One" (?One@?$NumericTraits at K@itk@@2KB) already defined in itkAbsImageFilterPython.obj 503> Creating library C:/Users/difabio/ITK_49_Wrap/lib/Release/ITKImageIntensityPython.lib and object C:/Users/difabio/ITK_49_Wrap/lib/Release/ITKImageIntensityPython.exp 503>C:\Users\difabio\ITK_49_Wrap\lib\Release\_ITKImageIntensityPython.pyd : fatal error LNK1169: one or more multiply defined symbols found 529>------ Build started: Project: ALL_BUILD, Configuration: Release Win32 ------ 529> Building Custom Rule C:/Users/difabio/ITK/CMakeLists.txt 529> CMake does not need to re-run because C:\Users\difabio\ITK_49_Wrap\CMakeFiles\generate.stamp is up-to-date. ========== Build: 452 succeeded, 77 failed, 0 up-to-date, 0 skipped ========== In my Cmake build configuration, I remember I added the data type "double" and maybe also "unsigned float" to the standard ones. May this be the problem? Any help would be appreciated. Thanks. -----Original Message----- From: Michka Popoff [mailto:michkapopoff at gmail.com] Sent: Sonntag, 27. M?rz 2016 11:20 To: Matt McCormick Cc: D'Isidoro Fabio; insight-users at itk.org Subject: Re: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python Wrap Patch has been merged. You should now be able to use it. Thanks Matt for the quick review. Michka > On 27 Mar 2016, at 03:59, Matt McCormick wrote: > > Hi, > > Here are some pointers to relevant documentation: > > How to add wrapping for a filter: > http://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch9.h > tml#x50-1500009.5 > > How to perform a review: > https://insightsoftwareconsortium.github.io/ITKBarCamp-doc/CommunitySo > ftwareProcess/PerformAGerritReview/index.html > > How to download ITK with Git: http://www.itk.org/Wiki/ITK/Git > > Hope this helps, > Matt > > On Sat, Mar 26, 2016 at 2:41 PM, Michka Popoff wrote: >> I can notify you once it is merged to the master branch of ITK. >> This should be fast (as soon as it gets reviewed). >> >> Wrapping new functions/classes is made by adding a .wrap file in the >> corresponding ?wrapping" folder of the module. >> I often just copy-paste a similar .wrap file an adapt it. There are >> sometimes some surprise, and the .wrap file needs to be tweaked. >> >> Not sure if we have a guide on how to do it. >> Some cases like this one are really easy to implement, some others >> are more involved. >> >> Once the patch is merged, you will need to build ITK from source. >> This is pretty easy: >> http://www.itk.org/Wiki/ITK/Configuring_and_Building >> We can assist you if there are problems. >> >> Writing your own filter in Python is doable; but I never tried such thing. >> It would be a nice proof-of-concept to get something like this to run. >> But this is probably more work than it is worth. >> >> If you can wait a few days until the patch is merged, and are willing >> to build ITK from source, the python solution is probably the easiest. >> >> Michka >> >> >> On 26 Mar 2016, at 19:27, D'Isidoro Fabio wrote: >> >> Thank you for your reply. >> >> I miss the skills to test/review that patch. I do not know how to >> wrap a C++ code to Python. Is there any relatively easy guide for it? >> >> Also, what are my possibilities now? Writing my own RayCasting Filter >> in Python and possibly use it as interpolator for the >> ResampleImageFilter Filter? Or necessarily turn to C++ forgetting about Python? >> >> Thanks >> >> From: Michka Popoff [mailto:michkapopoff at gmail.com] >> Sent: Samstag, 26. M?rz 2016 19:16 >> To: D'Isidoro Fabio >> Cc: insight-users at itk.org >> Subject: Re: [ITK-users] itk::RayCastInterpolateImageFunction for ITK >> Python Wrap >> >> Hi >> >> The function was not wrapped at all. >> Most of them are, and the remaining are added slowly, mostly >> on-demand (for the moment). >> >> I made a patch which you can test/review here: >> http://review.source.kitware.com/#/c/20945/ >> >> We can probably add it to the 4.9.1 release; else it will land in the >> ITK >> 4.10 release. >> >> Michka >> >> >> On 26 Mar 2016, at 17:13, D'Isidoro Fabio wrote: >> >> Hallo, >> >> I am trying to implement my own Digital Radiograph Reconstruction >> algorithm with ITK v 4.8 Python Wrap. I have looked on the web and >> found examples that make use of the >> itk::RayCastInterpolateImageFunction. However, it seems that this function has not been wrapped for Python because I get the error: >> >> ?LazyITKModule? object has not attribute ?RayCastInterpolateImageFunction? >> >> Any help? Hast this been done in the new 4.9 Version or what do you >> suggest for me to do? >> >> Thank you. >> >> Fabio >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> >> >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> From michkapopoff at gmail.com Mon Mar 28 05:58:16 2016 From: michkapopoff at gmail.com (Michka Popoff) Date: Mon, 28 Mar 2016 11:58:16 +0200 Subject: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python Wrap In-Reply-To: <50B858FB5F53124F9E32314E5C1B409435B3E522@MBX112.d.ethz.ch> References: <50B858FB5F53124F9E32314E5C1B409435B3E077@MBX112.d.ethz.ch> <50B858FB5F53124F9E32314E5C1B409435B3E093@MBX112.d.ethz.ch> <4F6CCA0D-3ACF-4818-B3C0-EB1AC89FA902@gmail.com> <0A63EEFB-3478-4C84-A875-CCA5DF78CB3B@gmail.com> <50B858FB5F53124F9E32314E5C1B409435B3E522@MBX112.d.ethz.ch> Message-ID: <9769712B-4147-4111-8235-20FBAAEEA3BD@gmail.com> I just looked at our buildbots, this problem is also popping up here: https://open.cdash.org/viewBuildError.php?buildid=4297981 The errors are similar. We will have to fix them. Matt, do you have an idea what that could be ? I will not have time to setup a Windows build anytime soon. Michka > On 27 Mar 2016, at 21:41, D'Isidoro Fabio wrote: > > Thank you. > > I downloaded ITK with Git from: http://www.itk.org/Wiki/ITK/Git and built it with Visual Studio and the ITK_WRAP_PYTHON option (I had one this procedure many times already before). Unfortunately my build (8 hours on my laptop, without BUILD_EXAMPLES) was unsuccessful. Apparently there are mistakes related to itk:NumericTraits (see below a part of it): > > ... > $NumericTraits at H@itk@@2HB) already defined in itkAbsImageFilterPython.obj > 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static unsigned int const itk::NumericTraits::Zero" (?Zero@?$NumericTraits at I@itk@@2IB) already defined in itkAbsImageFilterPython.obj > 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static unsigned int const itk::NumericTraits::One" (?One@?$NumericTraits at I@itk@@2IB) already defined in itkAbsImageFilterPython.obj > 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static long const itk::NumericTraits::Zero" (?Zero@?$NumericTraits at J@itk@@2JB) already defined in itkAbsImageFilterPython.obj > 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static long const itk::NumericTraits::One" (?One@?$NumericTraits at J@itk@@2JB) already defined in itkAbsImageFilterPython.obj > 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static bool const itk::NumericTraits::Zero" (?Zero@?$NumericTraits at _N@itk@@2_NB) already defined in itkAbsImageFilterPython.obj > 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static bool const itk::NumericTraits::One" (?One@?$NumericTraits at _N@itk@@2_NB) already defined in itkAbsImageFilterPython.obj > 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static unsigned long const itk::NumericTraits::Zero" (?Zero@?$NumericTraits at K@itk@@2KB) already defined in itkAbsImageFilterPython.obj > 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static unsigned long const itk::NumericTraits::One" (?One@?$NumericTraits at K@itk@@2KB) already defined in itkAbsImageFilterPython.obj > 503> Creating library C:/Users/difabio/ITK_49_Wrap/lib/Release/ITKImageIntensityPython.lib and object C:/Users/difabio/ITK_49_Wrap/lib/Release/ITKImageIntensityPython.exp > 503>C:\Users\difabio\ITK_49_Wrap\lib\Release\_ITKImageIntensityPython.pyd : fatal error LNK1169: one or more multiply defined symbols found > 529>------ Build started: Project: ALL_BUILD, Configuration: Release Win32 ------ > 529> Building Custom Rule C:/Users/difabio/ITK/CMakeLists.txt > 529> CMake does not need to re-run because C:\Users\difabio\ITK_49_Wrap\CMakeFiles\generate.stamp is up-to-date. > ========== Build: 452 succeeded, 77 failed, 0 up-to-date, 0 skipped ========== > > > In my Cmake build configuration, I remember I added the data type "double" and maybe also "unsigned float" to the standard ones. May this be the problem? > > Any help would be appreciated. Thanks. > > -----Original Message----- > From: Michka Popoff [mailto:michkapopoff at gmail.com] > Sent: Sonntag, 27. M?rz 2016 11:20 > To: Matt McCormick > Cc: D'Isidoro Fabio; insight-users at itk.org > Subject: Re: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python Wrap > > Patch has been merged. You should now be able to use it. > Thanks Matt for the quick review. > > Michka > >> On 27 Mar 2016, at 03:59, Matt McCormick wrote: >> >> Hi, >> >> Here are some pointers to relevant documentation: >> >> How to add wrapping for a filter: >> http://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch9.h >> tml#x50-1500009.5 >> >> How to perform a review: >> https://insightsoftwareconsortium.github.io/ITKBarCamp-doc/CommunitySo >> ftwareProcess/PerformAGerritReview/index.html >> >> How to download ITK with Git: http://www.itk.org/Wiki/ITK/Git >> >> Hope this helps, >> Matt >> >> On Sat, Mar 26, 2016 at 2:41 PM, Michka Popoff wrote: >>> I can notify you once it is merged to the master branch of ITK. >>> This should be fast (as soon as it gets reviewed). >>> >>> Wrapping new functions/classes is made by adding a .wrap file in the >>> corresponding ?wrapping" folder of the module. >>> I often just copy-paste a similar .wrap file an adapt it. There are >>> sometimes some surprise, and the .wrap file needs to be tweaked. >>> >>> Not sure if we have a guide on how to do it. >>> Some cases like this one are really easy to implement, some others >>> are more involved. >>> >>> Once the patch is merged, you will need to build ITK from source. >>> This is pretty easy: >>> http://www.itk.org/Wiki/ITK/Configuring_and_Building >>> We can assist you if there are problems. >>> >>> Writing your own filter in Python is doable; but I never tried such thing. >>> It would be a nice proof-of-concept to get something like this to run. >>> But this is probably more work than it is worth. >>> >>> If you can wait a few days until the patch is merged, and are willing >>> to build ITK from source, the python solution is probably the easiest. >>> >>> Michka >>> >>> >>> On 26 Mar 2016, at 19:27, D'Isidoro Fabio wrote: >>> >>> Thank you for your reply. >>> >>> I miss the skills to test/review that patch. I do not know how to >>> wrap a C++ code to Python. Is there any relatively easy guide for it? >>> >>> Also, what are my possibilities now? Writing my own RayCasting Filter >>> in Python and possibly use it as interpolator for the >>> ResampleImageFilter Filter? Or necessarily turn to C++ forgetting about Python? >>> >>> Thanks >>> >>> From: Michka Popoff [mailto:michkapopoff at gmail.com] >>> Sent: Samstag, 26. M?rz 2016 19:16 >>> To: D'Isidoro Fabio >>> Cc: insight-users at itk.org >>> Subject: Re: [ITK-users] itk::RayCastInterpolateImageFunction for ITK >>> Python Wrap >>> >>> Hi >>> >>> The function was not wrapped at all. >>> Most of them are, and the remaining are added slowly, mostly >>> on-demand (for the moment). >>> >>> I made a patch which you can test/review here: >>> http://review.source.kitware.com/#/c/20945/ >>> >>> We can probably add it to the 4.9.1 release; else it will land in the >>> ITK >>> 4.10 release. >>> >>> Michka >>> >>> >>> On 26 Mar 2016, at 17:13, D'Isidoro Fabio wrote: >>> >>> Hallo, >>> >>> I am trying to implement my own Digital Radiograph Reconstruction >>> algorithm with ITK v 4.8 Python Wrap. I have looked on the web and >>> found examples that make use of the >>> itk::RayCastInterpolateImageFunction. However, it seems that this function has not been wrapped for Python because I get the error: >>> >>> ?LazyITKModule? object has not attribute ?RayCastInterpolateImageFunction? >>> >>> Any help? Hast this been done in the new 4.9 Version or what do you >>> suggest for me to do? >>> >>> Thank you. >>> >>> Fabio >>> >>> _____________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://www.kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the ITK FAQ at: >>> http://www.itk.org/Wiki/ITK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/insight-users >>> >>> >>> >>> _____________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://www.kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the ITK FAQ at: >>> http://www.itk.org/Wiki/ITK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/insight-users >>> > From matt.mccormick at kitware.com Mon Mar 28 09:12:36 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 28 Mar 2016 09:12:36 -0400 Subject: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python Wrap In-Reply-To: <9769712B-4147-4111-8235-20FBAAEEA3BD@gmail.com> References: <50B858FB5F53124F9E32314E5C1B409435B3E077@MBX112.d.ethz.ch> <50B858FB5F53124F9E32314E5C1B409435B3E093@MBX112.d.ethz.ch> <4F6CCA0D-3ACF-4818-B3C0-EB1AC89FA902@gmail.com> <0A63EEFB-3478-4C84-A875-CCA5DF78CB3B@gmail.com> <50B858FB5F53124F9E32314E5C1B409435B3E522@MBX112.d.ethz.ch> <9769712B-4147-4111-8235-20FBAAEEA3BD@gmail.com> Message-ID: @Michka, Yes, good idea to check the dashboard. This is a known issue related to recent development, probably this patch: http://review.source.kitware.com/#/c/20905/ I will start a Windows build to investigate. @Fabio, Make sure to also have BUILD_TESTING turned off on your build. All Visual Studio wrapping builds should be markedly faster after we merge this patch: http://review.source.kitware.com/#/c/20208/ Thanks, Matt On Mon, Mar 28, 2016 at 5:58 AM, Michka Popoff wrote: > I just looked at our buildbots, this problem is also popping up here: > https://open.cdash.org/viewBuildError.php?buildid=4297981 > > The errors are similar. We will have to fix them. > > Matt, do you have an idea what that could be ? > I will not have time to setup a Windows build anytime soon. > > Michka > > >> On 27 Mar 2016, at 21:41, D'Isidoro Fabio wrote: >> >> Thank you. >> >> I downloaded ITK with Git from: http://www.itk.org/Wiki/ITK/Git and built it with Visual Studio and the ITK_WRAP_PYTHON option (I had one this procedure many times already before). Unfortunately my build (8 hours on my laptop, without BUILD_EXAMPLES) was unsuccessful. Apparently there are mistakes related to itk:NumericTraits (see below a part of it): >> >> ... >> $NumericTraits at H@itk@@2HB) already defined in itkAbsImageFilterPython.obj >> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static unsigned int const itk::NumericTraits::Zero" (?Zero@?$NumericTraits at I@itk@@2IB) already defined in itkAbsImageFilterPython.obj >> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static unsigned int const itk::NumericTraits::One" (?One@?$NumericTraits at I@itk@@2IB) already defined in itkAbsImageFilterPython.obj >> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static long const itk::NumericTraits::Zero" (?Zero@?$NumericTraits at J@itk@@2JB) already defined in itkAbsImageFilterPython.obj >> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static long const itk::NumericTraits::One" (?One@?$NumericTraits at J@itk@@2JB) already defined in itkAbsImageFilterPython.obj >> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static bool const itk::NumericTraits::Zero" (?Zero@?$NumericTraits at _N@itk@@2_NB) already defined in itkAbsImageFilterPython.obj >> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static bool const itk::NumericTraits::One" (?One@?$NumericTraits at _N@itk@@2_NB) already defined in itkAbsImageFilterPython.obj >> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static unsigned long const itk::NumericTraits::Zero" (?Zero@?$NumericTraits at K@itk@@2KB) already defined in itkAbsImageFilterPython.obj >> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static unsigned long const itk::NumericTraits::One" (?One@?$NumericTraits at K@itk@@2KB) already defined in itkAbsImageFilterPython.obj >> 503> Creating library C:/Users/difabio/ITK_49_Wrap/lib/Release/ITKImageIntensityPython.lib and object C:/Users/difabio/ITK_49_Wrap/lib/Release/ITKImageIntensityPython.exp >> 503>C:\Users\difabio\ITK_49_Wrap\lib\Release\_ITKImageIntensityPython.pyd : fatal error LNK1169: one or more multiply defined symbols found >> 529>------ Build started: Project: ALL_BUILD, Configuration: Release Win32 ------ >> 529> Building Custom Rule C:/Users/difabio/ITK/CMakeLists.txt >> 529> CMake does not need to re-run because C:\Users\difabio\ITK_49_Wrap\CMakeFiles\generate.stamp is up-to-date. >> ========== Build: 452 succeeded, 77 failed, 0 up-to-date, 0 skipped ========== >> >> >> In my Cmake build configuration, I remember I added the data type "double" and maybe also "unsigned float" to the standard ones. May this be the problem? >> >> Any help would be appreciated. Thanks. >> >> -----Original Message----- >> From: Michka Popoff [mailto:michkapopoff at gmail.com] >> Sent: Sonntag, 27. M?rz 2016 11:20 >> To: Matt McCormick >> Cc: D'Isidoro Fabio; insight-users at itk.org >> Subject: Re: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python Wrap >> >> Patch has been merged. You should now be able to use it. >> Thanks Matt for the quick review. >> >> Michka >> >>> On 27 Mar 2016, at 03:59, Matt McCormick wrote: >>> >>> Hi, >>> >>> Here are some pointers to relevant documentation: >>> >>> How to add wrapping for a filter: >>> http://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch9.h >>> tml#x50-1500009.5 >>> >>> How to perform a review: >>> https://insightsoftwareconsortium.github.io/ITKBarCamp-doc/CommunitySo >>> ftwareProcess/PerformAGerritReview/index.html >>> >>> How to download ITK with Git: http://www.itk.org/Wiki/ITK/Git >>> >>> Hope this helps, >>> Matt >>> >>> On Sat, Mar 26, 2016 at 2:41 PM, Michka Popoff wrote: >>>> I can notify you once it is merged to the master branch of ITK. >>>> This should be fast (as soon as it gets reviewed). >>>> >>>> Wrapping new functions/classes is made by adding a .wrap file in the >>>> corresponding ?wrapping" folder of the module. >>>> I often just copy-paste a similar .wrap file an adapt it. There are >>>> sometimes some surprise, and the .wrap file needs to be tweaked. >>>> >>>> Not sure if we have a guide on how to do it. >>>> Some cases like this one are really easy to implement, some others >>>> are more involved. >>>> >>>> Once the patch is merged, you will need to build ITK from source. >>>> This is pretty easy: >>>> http://www.itk.org/Wiki/ITK/Configuring_and_Building >>>> We can assist you if there are problems. >>>> >>>> Writing your own filter in Python is doable; but I never tried such thing. >>>> It would be a nice proof-of-concept to get something like this to run. >>>> But this is probably more work than it is worth. >>>> >>>> If you can wait a few days until the patch is merged, and are willing >>>> to build ITK from source, the python solution is probably the easiest. >>>> >>>> Michka >>>> >>>> >>>> On 26 Mar 2016, at 19:27, D'Isidoro Fabio wrote: >>>> >>>> Thank you for your reply. >>>> >>>> I miss the skills to test/review that patch. I do not know how to >>>> wrap a C++ code to Python. Is there any relatively easy guide for it? >>>> >>>> Also, what are my possibilities now? Writing my own RayCasting Filter >>>> in Python and possibly use it as interpolator for the >>>> ResampleImageFilter Filter? Or necessarily turn to C++ forgetting about Python? >>>> >>>> Thanks >>>> >>>> From: Michka Popoff [mailto:michkapopoff at gmail.com] >>>> Sent: Samstag, 26. M?rz 2016 19:16 >>>> To: D'Isidoro Fabio >>>> Cc: insight-users at itk.org >>>> Subject: Re: [ITK-users] itk::RayCastInterpolateImageFunction for ITK >>>> Python Wrap >>>> >>>> Hi >>>> >>>> The function was not wrapped at all. >>>> Most of them are, and the remaining are added slowly, mostly >>>> on-demand (for the moment). >>>> >>>> I made a patch which you can test/review here: >>>> http://review.source.kitware.com/#/c/20945/ >>>> >>>> We can probably add it to the 4.9.1 release; else it will land in the >>>> ITK >>>> 4.10 release. >>>> >>>> Michka >>>> >>>> >>>> On 26 Mar 2016, at 17:13, D'Isidoro Fabio wrote: >>>> >>>> Hallo, >>>> >>>> I am trying to implement my own Digital Radiograph Reconstruction >>>> algorithm with ITK v 4.8 Python Wrap. I have looked on the web and >>>> found examples that make use of the >>>> itk::RayCastInterpolateImageFunction. However, it seems that this function has not been wrapped for Python because I get the error: >>>> >>>> ?LazyITKModule? object has not attribute ?RayCastInterpolateImageFunction? >>>> >>>> Any help? Hast this been done in the new 4.9 Version or what do you >>>> suggest for me to do? >>>> >>>> Thank you. >>>> >>>> Fabio >>>> >>>> _____________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Kitware offers ITK Training Courses, for more information visit: >>>> http://www.kitware.com/products/protraining.php >>>> >>>> Please keep messages on-topic and check the ITK FAQ at: >>>> http://www.itk.org/Wiki/ITK_FAQ >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/insight-users >>>> >>>> >>>> >>>> _____________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Kitware offers ITK Training Courses, for more information visit: >>>> http://www.kitware.com/products/protraining.php >>>> >>>> Please keep messages on-topic and check the ITK FAQ at: >>>> http://www.itk.org/Wiki/ITK_FAQ >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/insight-users >>>> >> > From blowekamp at mail.nih.gov Mon Mar 28 09:52:10 2016 From: blowekamp at mail.nih.gov (Lowekamp, Bradley (NIH/NLM/LHC) [C]) Date: Mon, 28 Mar 2016 13:52:10 +0000 Subject: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python Wrap In-Reply-To: References: <50B858FB5F53124F9E32314E5C1B409435B3E077@MBX112.d.ethz.ch> <50B858FB5F53124F9E32314E5C1B409435B3E093@MBX112.d.ethz.ch> <4F6CCA0D-3ACF-4818-B3C0-EB1AC89FA902@gmail.com> <0A63EEFB-3478-4C84-A875-CCA5DF78CB3B@gmail.com> <50B858FB5F53124F9E32314E5C1B409435B3E522@MBX112.d.ethz.ch> <9769712B-4147-4111-8235-20FBAAEEA3BD@gmail.com>, Message-ID: Hello, Sorry I dropped the ball on following up this problem from that patch. I just quickly submitted my current WIP, with some comments on my experiments and observations of the situation [1]. If anyone can chime in on the portable way to declare and define "static const" integers with inline initialization it would be appreciated. Thanks, Brad [1] http://review.source.kitware.com/#/c/20946/ ________________________________________ From: Matt McCormick [matt.mccormick at kitware.com] Sent: Monday, March 28, 2016 9:12 AM To: Michka Popoff Cc: insight-users at itk.org Subject: Re: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python Wrap @Michka, Yes, good idea to check the dashboard. This is a known issue related to recent development, probably this patch: http://review.source.kitware.com/#/c/20905/ I will start a Windows build to investigate. @Fabio, Make sure to also have BUILD_TESTING turned off on your build. All Visual Studio wrapping builds should be markedly faster after we merge this patch: http://review.source.kitware.com/#/c/20208/ Thanks, Matt On Mon, Mar 28, 2016 at 5:58 AM, Michka Popoff wrote: > I just looked at our buildbots, this problem is also popping up here: > https://open.cdash.org/viewBuildError.php?buildid=4297981 > > The errors are similar. We will have to fix them. > > Matt, do you have an idea what that could be ? > I will not have time to setup a Windows build anytime soon. > > Michka > > >> On 27 Mar 2016, at 21:41, D'Isidoro Fabio wrote: >> >> Thank you. >> >> I downloaded ITK with Git from: http://www.itk.org/Wiki/ITK/Git and built it with Visual Studio and the ITK_WRAP_PYTHON option (I had one this procedure many times already before). Unfortunately my build (8 hours on my laptop, without BUILD_EXAMPLES) was unsuccessful. Apparently there are mistakes related to itk:NumericTraits (see below a part of it): >> >> ... >> $NumericTraits at H@itk@@2HB) already defined in itkAbsImageFilterPython.obj >> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static unsigned int const itk::NumericTraits::Zero" (?Zero@?$NumericTraits at I@itk@@2IB) already defined in itkAbsImageFilterPython.obj >> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static unsigned int const itk::NumericTraits::One" (?One@?$NumericTraits at I@itk@@2IB) already defined in itkAbsImageFilterPython.obj >> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static long const itk::NumericTraits::Zero" (?Zero@?$NumericTraits at J@itk@@2JB) already defined in itkAbsImageFilterPython.obj >> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static long const itk::NumericTraits::One" (?One@?$NumericTraits at J@itk@@2JB) already defined in itkAbsImageFilterPython.obj >> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static bool const itk::NumericTraits::Zero" (?Zero@?$NumericTraits at _N@itk@@2_NB) already defined in itkAbsImageFilterPython.obj >> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static bool const itk::NumericTraits::One" (?One@?$NumericTraits at _N@itk@@2_NB) already defined in itkAbsImageFilterPython.obj >> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static unsigned long const itk::NumericTraits::Zero" (?Zero@?$NumericTraits at K@itk@@2KB) already defined in itkAbsImageFilterPython.obj >> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static unsigned long const itk::NumericTraits::One" (?One@?$NumericTraits at K@itk@@2KB) already defined in itkAbsImageFilterPython.obj >> 503> Creating library C:/Users/difabio/ITK_49_Wrap/lib/Release/ITKImageIntensityPython.lib and object C:/Users/difabio/ITK_49_Wrap/lib/Release/ITKImageIntensityPython.exp >> 503>C:\Users\difabio\ITK_49_Wrap\lib\Release\_ITKImageIntensityPython.pyd : fatal error LNK1169: one or more multiply defined symbols found >> 529>------ Build started: Project: ALL_BUILD, Configuration: Release Win32 ------ >> 529> Building Custom Rule C:/Users/difabio/ITK/CMakeLists.txt >> 529> CMake does not need to re-run because C:\Users\difabio\ITK_49_Wrap\CMakeFiles\generate.stamp is up-to-date. >> ========== Build: 452 succeeded, 77 failed, 0 up-to-date, 0 skipped ========== >> >> >> In my Cmake build configuration, I remember I added the data type "double" and maybe also "unsigned float" to the standard ones. May this be the problem? >> >> Any help would be appreciated. Thanks. >> >> -----Original Message----- >> From: Michka Popoff [mailto:michkapopoff at gmail.com] >> Sent: Sonntag, 27. M?rz 2016 11:20 >> To: Matt McCormick >> Cc: D'Isidoro Fabio; insight-users at itk.org >> Subject: Re: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python Wrap >> >> Patch has been merged. You should now be able to use it. >> Thanks Matt for the quick review. >> >> Michka >> >>> On 27 Mar 2016, at 03:59, Matt McCormick wrote: >>> >>> Hi, >>> >>> Here are some pointers to relevant documentation: >>> >>> How to add wrapping for a filter: >>> http://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch9.h >>> tml#x50-1500009.5 >>> >>> How to perform a review: >>> https://insightsoftwareconsortium.github.io/ITKBarCamp-doc/CommunitySo >>> ftwareProcess/PerformAGerritReview/index.html >>> >>> How to download ITK with Git: http://www.itk.org/Wiki/ITK/Git >>> >>> Hope this helps, >>> Matt >>> >>> On Sat, Mar 26, 2016 at 2:41 PM, Michka Popoff wrote: >>>> I can notify you once it is merged to the master branch of ITK. >>>> This should be fast (as soon as it gets reviewed). >>>> >>>> Wrapping new functions/classes is made by adding a .wrap file in the >>>> corresponding ?wrapping" folder of the module. >>>> I often just copy-paste a similar .wrap file an adapt it. There are >>>> sometimes some surprise, and the .wrap file needs to be tweaked. >>>> >>>> Not sure if we have a guide on how to do it. >>>> Some cases like this one are really easy to implement, some others >>>> are more involved. >>>> >>>> Once the patch is merged, you will need to build ITK from source. >>>> This is pretty easy: >>>> http://www.itk.org/Wiki/ITK/Configuring_and_Building >>>> We can assist you if there are problems. >>>> >>>> Writing your own filter in Python is doable; but I never tried such thing. >>>> It would be a nice proof-of-concept to get something like this to run. >>>> But this is probably more work than it is worth. >>>> >>>> If you can wait a few days until the patch is merged, and are willing >>>> to build ITK from source, the python solution is probably the easiest. >>>> >>>> Michka >>>> >>>> >>>> On 26 Mar 2016, at 19:27, D'Isidoro Fabio wrote: >>>> >>>> Thank you for your reply. >>>> >>>> I miss the skills to test/review that patch. I do not know how to >>>> wrap a C++ code to Python. Is there any relatively easy guide for it? >>>> >>>> Also, what are my possibilities now? Writing my own RayCasting Filter >>>> in Python and possibly use it as interpolator for the >>>> ResampleImageFilter Filter? Or necessarily turn to C++ forgetting about Python? >>>> >>>> Thanks >>>> >>>> From: Michka Popoff [mailto:michkapopoff at gmail.com] >>>> Sent: Samstag, 26. M?rz 2016 19:16 >>>> To: D'Isidoro Fabio >>>> Cc: insight-users at itk.org >>>> Subject: Re: [ITK-users] itk::RayCastInterpolateImageFunction for ITK >>>> Python Wrap >>>> >>>> Hi >>>> >>>> The function was not wrapped at all. >>>> Most of them are, and the remaining are added slowly, mostly >>>> on-demand (for the moment). >>>> >>>> I made a patch which you can test/review here: >>>> http://review.source.kitware.com/#/c/20945/ >>>> >>>> We can probably add it to the 4.9.1 release; else it will land in the >>>> ITK >>>> 4.10 release. >>>> >>>> Michka >>>> >>>> >>>> On 26 Mar 2016, at 17:13, D'Isidoro Fabio wrote: >>>> >>>> Hallo, >>>> >>>> I am trying to implement my own Digital Radiograph Reconstruction >>>> algorithm with ITK v 4.8 Python Wrap. I have looked on the web and >>>> found examples that make use of the >>>> itk::RayCastInterpolateImageFunction. However, it seems that this function has not been wrapped for Python because I get the error: >>>> >>>> ?LazyITKModule? object has not attribute ?RayCastInterpolateImageFunction? >>>> >>>> Any help? Hast this been done in the new 4.9 Version or what do you >>>> suggest for me to do? >>>> >>>> Thank you. >>>> >>>> Fabio >>>> >>>> _____________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Kitware offers ITK Training Courses, for more information visit: >>>> http://www.kitware.com/products/protraining.php >>>> >>>> Please keep messages on-topic and check the ITK FAQ at: >>>> http://www.itk.org/Wiki/ITK_FAQ >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/insight-users >>>> >>>> >>>> >>>> _____________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Kitware offers ITK Training Courses, for more information visit: >>>> http://www.kitware.com/products/protraining.php >>>> >>>> Please keep messages on-topic and check the ITK FAQ at: >>>> http://www.itk.org/Wiki/ITK_FAQ >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/insight-users >>>> >> > _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From dzenanz at gmail.com Tue Mar 29 11:04:41 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Tue, 29 Mar 2016 11:04:41 -0400 Subject: [ITK-users] [ITK] Cerebral Spinal Fluid Extraction from 3D Image In-Reply-To: References: Message-ID: Hi Abdelkhalek, what do you mean by "Segmented Dicom Image"? How is it segmented? If it is unsegmented (as I suspect), it is not really trivial. What is the imaging modality, CT or MRI (and which sequence)? Your question is simply too open-ended to give a useful answer. Regards, D?enan On Fri, Mar 25, 2016 at 5:23 PM, Abdelkhalek Bakkari < bakkari.abdelkhalek at hotmail.fr> wrote: > Hi ! > > I would like to extract the CSF (Cerebral Spinal Fluid) from a 3D > Segmented Dicom Image (.dcm) using ITK. > > Any help ! Any suggestion ! please. > > Best regards, > > > Abdelkhalek Bakkari > Ph.D candidate in Computer Science > Institute of Applied Computer Science > Lodz University of Technology, Poland > > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Tue Mar 29 12:12:54 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 29 Mar 2016 12:12:54 -0400 Subject: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python Wrap In-Reply-To: <50B858FB5F53124F9E32314E5C1B409435B3E716@MBX112.d.ethz.ch> References: <50B858FB5F53124F9E32314E5C1B409435B3E077@MBX112.d.ethz.ch> <50B858FB5F53124F9E32314E5C1B409435B3E093@MBX112.d.ethz.ch> <4F6CCA0D-3ACF-4818-B3C0-EB1AC89FA902@gmail.com> <0A63EEFB-3478-4C84-A875-CCA5DF78CB3B@gmail.com> <50B858FB5F53124F9E32314E5C1B409435B3E522@MBX112.d.ethz.ch> <9769712B-4147-4111-8235-20FBAAEEA3BD@gmail.com> <50B858FB5F53124F9E32314E5C1B409435B3E716@MBX112.d.ethz.ch> Message-ID: Hi Fabio, Yes, the build issues are unrelated to the wrapping, and you can try out the wrapping patch only by starting from ITK 4.9.0. I merged the patch to the release branch, so it can be tested by: cd /path/to/ITK git checkout -b release origin/release git pull HTH, Matt On Tue, Mar 29, 2016 at 11:09 AM, D'Isidoro Fabio wrote: > Hi Matt, > > While waiting for the python Wrap to be ready I have tried to build ITK normally (no Python Wrap) on Visual Studio. The result of the build was: > > ========== Build: 213 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== > > And the failed one was: > > .... > 159>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static bool const itk::NumericTraits::One" (?One@?$NumericTraits at _N@itk@@2_NB) already defined in itkTestDriver.obj > 159>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static unsigned long const itk::NumericTraits::Zero" (?Zero@?$NumericTraits at K@itk@@2KB) already defined in itkTestDriver.obj > 159>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static unsigned long const itk::NumericTraits::One" (?One@?$NumericTraits at K@itk@@2KB) already defined in itkTestDriver.obj > 166>------ Build started: Project: ITKOptimizersv4, Configuration: Release Win32 ------ > 166> Building Custom Rule C:/Users/difabio/ITK/Modules/Numerics/Optimizersv4/src/CMakeLists.txt > 159>C:\Users\difabio\ITK_build_cpp\bin\Release\itkTestDriver.exe : fatal error LNK1169: one or more multiply defined symbols found > > Can I work with this build or I still need to wait, also for building ITK without python wrapping? > > And for building ITK without python wrap, would it be different if I downloaded the release version rather than the Git version? > > Thanks > > ---------------------------------------------------------------------- > Fabio D?Isidoro > PhD Student ? Institute for Biomechanics, ETH Z?rich > HPP O 14, Schafmattstrasse 30, 8093 Zuerich, Switzerland > Tel: +41 44 633 40 60 > > > -----Original Message----- > From: Matt McCormick [mailto:matt.mccormick at kitware.com] > Sent: Montag, 28. M?rz 2016 15:13 > To: Michka Popoff > Cc: D'Isidoro Fabio; insight-users at itk.org > Subject: Re: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python Wrap > > @Michka, > > Yes, good idea to check the dashboard. This is a known issue related to recent development, probably this patch: > > http://review.source.kitware.com/#/c/20905/ > > I will start a Windows build to investigate. > > > @Fabio, > > Make sure to also have BUILD_TESTING turned off on your build. All Visual Studio wrapping builds should be markedly faster after we merge this patch: > > http://review.source.kitware.com/#/c/20208/ > > > Thanks, > Matt > > On Mon, Mar 28, 2016 at 5:58 AM, Michka Popoff wrote: >> I just looked at our buildbots, this problem is also popping up here: >> https://open.cdash.org/viewBuildError.php?buildid=4297981 >> >> The errors are similar. We will have to fix them. >> >> Matt, do you have an idea what that could be ? >> I will not have time to setup a Windows build anytime soon. >> >> Michka >> >> >>> On 27 Mar 2016, at 21:41, D'Isidoro Fabio wrote: >>> >>> Thank you. >>> >>> I downloaded ITK with Git from: http://www.itk.org/Wiki/ITK/Git and built it with Visual Studio and the ITK_WRAP_PYTHON option (I had one this procedure many times already before). Unfortunately my build (8 hours on my laptop, without BUILD_EXAMPLES) was unsuccessful. Apparently there are mistakes related to itk:NumericTraits (see below a part of it): >>> >>> ... >>> $NumericTraits at H@itk@@2HB) already defined in >>> itkAbsImageFilterPython.obj >>> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: >>> 503>"public: static unsigned int const itk::NumericTraits>> 503>int>::Zero" (?Zero@?$NumericTraits at I@itk@@2IB) already defined in >>> 503>itkAbsImageFilterPython.obj >>> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: >>> 503>"public: static unsigned int const itk::NumericTraits>> 503>int>::One" (?One@?$NumericTraits at I@itk@@2IB) already defined in >>> 503>itkAbsImageFilterPython.obj >>> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: >>> 503>"public: static long const itk::NumericTraits::Zero" >>> 503>(?Zero@?$NumericTraits at J@itk@@2JB) already defined in >>> 503>itkAbsImageFilterPython.obj >>> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: >>> 503>"public: static long const itk::NumericTraits::One" >>> 503>(?One@?$NumericTraits at J@itk@@2JB) already defined in >>> 503>itkAbsImageFilterPython.obj >>> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: >>> 503>"public: static bool const itk::NumericTraits::Zero" >>> 503>(?Zero@?$NumericTraits at _N@itk@@2_NB) already defined in >>> 503>itkAbsImageFilterPython.obj >>> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: >>> 503>"public: static bool const itk::NumericTraits::One" >>> 503>(?One@?$NumericTraits at _N@itk@@2_NB) already defined in >>> 503>itkAbsImageFilterPython.obj >>> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: >>> 503>"public: static unsigned long const itk::NumericTraits>> 503>long>::Zero" (?Zero@?$NumericTraits at K@itk@@2KB) already defined >>> 503>in itkAbsImageFilterPython.obj >>> 503>ITKCommon-4.10.lib(itkNumericTraits.obj) : error LNK2005: "public: static unsigned long const itk::NumericTraits::One" (?One@?$NumericTraits at K@itk@@2KB) already defined in itkAbsImageFilterPython.obj >>> 503> Creating library >>> 503>C:/Users/difabio/ITK_49_Wrap/lib/Release/ITKImageIntensityPython. >>> 503>lib and object >>> 503>C:/Users/difabio/ITK_49_Wrap/lib/Release/ITKImageIntensityPython. >>> 503>exp >>> 503>C:\Users\difabio\ITK_49_Wrap\lib\Release\_ITKImageIntensityPython >>> 503>.pyd : fatal error LNK1169: one or more multiply defined symbols >>> 503>found >>> 529>------ Build started: Project: ALL_BUILD, Configuration: Release >>> 529>Win32 ------ >>> 529> Building Custom Rule C:/Users/difabio/ITK/CMakeLists.txt >>> 529> CMake does not need to re-run because C:\Users\difabio\ITK_49_Wrap\CMakeFiles\generate.stamp is up-to-date. >>> ========== Build: 452 succeeded, 77 failed, 0 up-to-date, 0 skipped >>> ========== >>> >>> >>> In my Cmake build configuration, I remember I added the data type "double" and maybe also "unsigned float" to the standard ones. May this be the problem? >>> >>> Any help would be appreciated. Thanks. >>> >>> -----Original Message----- >>> From: Michka Popoff [mailto:michkapopoff at gmail.com] >>> Sent: Sonntag, 27. M?rz 2016 11:20 >>> To: Matt McCormick >>> Cc: D'Isidoro Fabio; insight-users at itk.org >>> Subject: Re: [ITK-users] itk::RayCastInterpolateImageFunction for ITK >>> Python Wrap >>> >>> Patch has been merged. You should now be able to use it. >>> Thanks Matt for the quick review. >>> >>> Michka >>> >>>> On 27 Mar 2016, at 03:59, Matt McCormick wrote: >>>> >>>> Hi, >>>> >>>> Here are some pointers to relevant documentation: >>>> >>>> How to add wrapping for a filter: >>>> http://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch9 >>>> .h >>>> tml#x50-1500009.5 >>>> >>>> How to perform a review: >>>> https://insightsoftwareconsortium.github.io/ITKBarCamp-doc/Community >>>> So ftwareProcess/PerformAGerritReview/index.html >>>> >>>> How to download ITK with Git: http://www.itk.org/Wiki/ITK/Git >>>> >>>> Hope this helps, >>>> Matt >>>> >>>> On Sat, Mar 26, 2016 at 2:41 PM, Michka Popoff wrote: >>>>> I can notify you once it is merged to the master branch of ITK. >>>>> This should be fast (as soon as it gets reviewed). >>>>> >>>>> Wrapping new functions/classes is made by adding a .wrap file in >>>>> the corresponding ?wrapping" folder of the module. >>>>> I often just copy-paste a similar .wrap file an adapt it. There are >>>>> sometimes some surprise, and the .wrap file needs to be tweaked. >>>>> >>>>> Not sure if we have a guide on how to do it. >>>>> Some cases like this one are really easy to implement, some others >>>>> are more involved. >>>>> >>>>> Once the patch is merged, you will need to build ITK from source. >>>>> This is pretty easy: >>>>> http://www.itk.org/Wiki/ITK/Configuring_and_Building >>>>> We can assist you if there are problems. >>>>> >>>>> Writing your own filter in Python is doable; but I never tried such thing. >>>>> It would be a nice proof-of-concept to get something like this to run. >>>>> But this is probably more work than it is worth. >>>>> >>>>> If you can wait a few days until the patch is merged, and are >>>>> willing to build ITK from source, the python solution is probably the easiest. >>>>> >>>>> Michka >>>>> >>>>> >>>>> On 26 Mar 2016, at 19:27, D'Isidoro Fabio wrote: >>>>> >>>>> Thank you for your reply. >>>>> >>>>> I miss the skills to test/review that patch. I do not know how to >>>>> wrap a C++ code to Python. Is there any relatively easy guide for it? >>>>> >>>>> Also, what are my possibilities now? Writing my own RayCasting >>>>> Filter in Python and possibly use it as interpolator for the >>>>> ResampleImageFilter Filter? Or necessarily turn to C++ forgetting about Python? >>>>> >>>>> Thanks >>>>> >>>>> From: Michka Popoff [mailto:michkapopoff at gmail.com] >>>>> Sent: Samstag, 26. M?rz 2016 19:16 >>>>> To: D'Isidoro Fabio >>>>> Cc: insight-users at itk.org >>>>> Subject: Re: [ITK-users] itk::RayCastInterpolateImageFunction for >>>>> ITK Python Wrap >>>>> >>>>> Hi >>>>> >>>>> The function was not wrapped at all. >>>>> Most of them are, and the remaining are added slowly, mostly >>>>> on-demand (for the moment). >>>>> >>>>> I made a patch which you can test/review here: >>>>> http://review.source.kitware.com/#/c/20945/ >>>>> >>>>> We can probably add it to the 4.9.1 release; else it will land in >>>>> the ITK >>>>> 4.10 release. >>>>> >>>>> Michka >>>>> >>>>> >>>>> On 26 Mar 2016, at 17:13, D'Isidoro Fabio wrote: >>>>> >>>>> Hallo, >>>>> >>>>> I am trying to implement my own Digital Radiograph Reconstruction >>>>> algorithm with ITK v 4.8 Python Wrap. I have looked on the web and >>>>> found examples that make use of the >>>>> itk::RayCastInterpolateImageFunction. However, it seems that this function has not been wrapped for Python because I get the error: >>>>> >>>>> ?LazyITKModule? object has not attribute ?RayCastInterpolateImageFunction? >>>>> >>>>> Any help? Hast this been done in the new 4.9 Version or what do you >>>>> suggest for me to do? >>>>> >>>>> Thank you. >>>>> >>>>> Fabio >>>>> >>>>> _____________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Kitware offers ITK Training Courses, for more information visit: >>>>> http://www.kitware.com/products/protraining.php >>>>> >>>>> Please keep messages on-topic and check the ITK FAQ at: >>>>> http://www.itk.org/Wiki/ITK_FAQ >>>>> >>>>> Follow this link to subscribe/unsubscribe: >>>>> http://public.kitware.com/mailman/listinfo/insight-users >>>>> >>>>> >>>>> >>>>> _____________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Kitware offers ITK Training Courses, for more information visit: >>>>> http://www.kitware.com/products/protraining.php >>>>> >>>>> Please keep messages on-topic and check the ITK FAQ at: >>>>> http://www.itk.org/Wiki/ITK_FAQ >>>>> >>>>> Follow this link to subscribe/unsubscribe: >>>>> http://public.kitware.com/mailman/listinfo/insight-users >>>>> >>> >> From jose.de.paula at live.com Tue Mar 29 13:00:15 2016 From: jose.de.paula at live.com (JoseBarretoT) Date: Tue, 29 Mar 2016 10:00:15 -0700 (MST) Subject: [ITK-users] Send img VTK for ITK Message-ID: <1459270815815-7588668.post@n2.nabble.com> In VTK and ITK is possible to pass images between them. But, only possible send image ITK for VTK with "itk::ImageToVTKImageFilter". Is possible send image of vtk for itk ? -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-users-Send-img-VTK-for-ITK-tp7588668.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From chinander at gmail.com Tue Mar 29 13:07:24 2016 From: chinander at gmail.com (Mike Chinander) Date: Tue, 29 Mar 2016 12:07:24 -0500 Subject: [ITK-users] Send img VTK for ITK In-Reply-To: <1459270815815-7588668.post@n2.nabble.com> References: <1459270815815-7588668.post@n2.nabble.com> Message-ID: If you enable vtkGlue when building ITK, there is both itkVTKImageToImageFilter.h and itkImageToVTKImageFilter.h On Tue, Mar 29, 2016 at 12:00 PM, JoseBarretoT wrote: > In VTK and ITK is possible to pass images between them. > But, only possible send image ITK for VTK with > "itk::ImageToVTKImageFilter". > > Is possible send image of vtk for itk ? > > > > -- > View this message in context: > http://itk-insight-users.2283740.n2.nabble.com/ITK-users-Send-img-VTK-for-ITK-tp7588668.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 matt.mccormick at kitware.com Tue Mar 29 13:20:50 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 29 Mar 2016 13:20:50 -0400 Subject: [ITK-users] Send img VTK for ITK In-Reply-To: References: <1459270815815-7588668.post@n2.nabble.com> Message-ID: Hi, Here is an example: http://itk.org/ITKExamples/src/Bridge/VtkGlue/ConvertvtkImageDataToAnitkImage/Documentation.html HTH, Matt On Tue, Mar 29, 2016 at 1:07 PM, Mike Chinander wrote: > If you enable vtkGlue when building ITK, there is both > itkVTKImageToImageFilter.h and itkImageToVTKImageFilter.h > > On Tue, Mar 29, 2016 at 12:00 PM, JoseBarretoT > wrote: >> >> In VTK and ITK is possible to pass images between them. >> But, only possible send image ITK for VTK with >> "itk::ImageToVTKImageFilter". >> >> Is possible send image of vtk for itk ? >> >> >> >> -- >> View this message in context: >> http://itk-insight-users.2283740.n2.nabble.com/ITK-users-Send-img-VTK-for-ITK-tp7588668.html >> Sent from the ITK Insight Users mailing list archive at Nabble.com. >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users > > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > From jb_tamez at hotmail.com Wed Mar 30 03:28:31 2016 From: jb_tamez at hotmail.com (Juan Bernardo Tamez) Date: Wed, 30 Mar 2016 00:28:31 -0700 (MST) Subject: [ITK-users] ld error when linking -litkTestDriver Message-ID: <1459322911672-7588671.post@n2.nabble.com> Hi, I keep getting the following ld error when trying to compile an ITK project: cannot find -litkTestDriver error: ld returned 1 exit status Now, itkTestDriver is located on my ITK/build/bin folder and I'm pretty sure I'm passing that folder location correctly to ld. But this is an executable. not an .so file. So I'm not sure if I'm doing things correctly. Regards, Juan -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ld-error-when-linking-litkTestDriver-tp7588671.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From suneezahanif02 at gmail.com Wed Mar 30 08:02:04 2016 From: suneezahanif02 at gmail.com (suneeza hanif) Date: Wed, 30 Mar 2016 14:02:04 +0200 Subject: [ITK-users] Sampling Percentage in Registration Method Message-ID: Hello Everyone, I am having problem with sampling percentage. I am getting same transform matrix and same error value even if I use different sampling percentage (e.g. 0.8 and 0.2) in case of both random and regular sampling strategy. I am using same lines of code as written in manual and in examples. * RegistrationType::MetricSamplingStrategyType samplingStrategy=RegistrationType::RANDOM;* * Registration->SetMetricSamplingStrategy( samplingStrategy );* * Registration->SetMetricSamplingPercentage( 0.8);* Am I missing something in code? I really appreciate your help. Best Regards, Suneeza -------------- next part -------------- An HTML attachment was scrubbed... URL: From dzenanz at gmail.com Wed Mar 30 10:17:40 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Wed, 30 Mar 2016 10:17:40 -0400 Subject: [ITK-users] ld error when linking -litkTestDriver In-Reply-To: <1459322911672-7588671.post@n2.nabble.com> References: <1459322911672-7588671.post@n2.nabble.com> Message-ID: Hi Juan, do you have itkTestDriver.lib? Somewhere in ITKv4-build\lib\Release or similar? Are you using CMake to configure your project, or something else? Regards On Wed, Mar 30, 2016 at 3:28 AM, Juan Bernardo Tamez wrote: > Hi, > > I keep getting the following ld error when trying to compile an ITK > project: > > cannot find -litkTestDriver > error: ld returned 1 exit status > > Now, itkTestDriver is located on my ITK/build/bin folder and I'm pretty > sure > I'm passing that folder location correctly to ld. But this is an > executable. > not an .so file. So I'm not sure if I'm doing things correctly. > > Regards, > Juan > > > > -- > View this message in context: > http://itk-insight-users.2283740.n2.nabble.com/ld-error-when-linking-litkTestDriver-tp7588671.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 jb_tamez at hotmail.com Wed Mar 30 11:05:35 2016 From: jb_tamez at hotmail.com (Juan Bernardo Tamez) Date: Wed, 30 Mar 2016 08:05:35 -0700 (MST) Subject: [ITK-users] ld error when linking -litkTestDriver In-Reply-To: References: <1459322911672-7588671.post@n2.nabble.com> Message-ID: <1459350335072-7588674.post@n2.nabble.com> Hi dzenanz, No, I couldn't find any instances of itkTestDriver.lib on the build folder. I used cmake to generate the project following the instructions from http://www.itk.org/Wiki/ITK/Configuring_and_Building. It appears to generate only the TestDriver executable and some intermediate files: itkTestDriver (executable) itkTestDriver.dir itkTestDriver.cxx.o Regards, Juan -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ld-error-when-linking-litkTestDriver-tp7588671p7588674.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From jb_tamez at hotmail.com Wed Mar 30 11:13:02 2016 From: jb_tamez at hotmail.com (Juan Bernardo Tamez) Date: Wed, 30 Mar 2016 08:13:02 -0700 (MST) Subject: [ITK-users] ld error when linking -litkTestDriver In-Reply-To: <1459350335072-7588674.post@n2.nabble.com> References: <1459322911672-7588671.post@n2.nabble.com> <1459350335072-7588674.post@n2.nabble.com> Message-ID: <1459350782724-7588675.post@n2.nabble.com> By the way, I'm trying to build specifically ITK 4.6.1 -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ld-error-when-linking-litkTestDriver-tp7588671p7588675.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From dzenanz at gmail.com Wed Mar 30 11:24:52 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Wed, 30 Mar 2016 11:24:52 -0400 Subject: [ITK-users] ld error when linking -litkTestDriver In-Reply-To: <1459350335072-7588674.post@n2.nabble.com> References: <1459322911672-7588671.post@n2.nabble.com> <1459350335072-7588674.post@n2.nabble.com> Message-ID: You should not need to link to test driver. Since ITK is a library, it does not generate executables. If you did not enable dynamic libraries, it means that results of "building" the library reside in /lib folder, not /bin. Also, a big part of ITK is header-only, which means there is nothing to be generated until you include it in your project. Are you trying to compile the ITK library itself, or a project using ITK library? Regards, D?enan On Wed, Mar 30, 2016 at 11:05 AM, Juan Bernardo Tamez wrote: > Hi dzenanz, > > No, I couldn't find any instances of itkTestDriver.lib on the build folder. > I used cmake to generate the project following the instructions from > http://www.itk.org/Wiki/ITK/Configuring_and_Building. It appears to > generate > only the TestDriver executable and some intermediate files: > > itkTestDriver (executable) > itkTestDriver.dir > itkTestDriver.cxx.o > > Regards, > Juan > > > > -- > View this message in context: > http://itk-insight-users.2283740.n2.nabble.com/ld-error-when-linking-litkTestDriver-tp7588671p7588674.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 jb_tamez at hotmail.com Wed Mar 30 11:43:46 2016 From: jb_tamez at hotmail.com (Juan Bernardo Tamez) Date: Wed, 30 Mar 2016 08:43:46 -0700 (MST) Subject: [ITK-users] ld error when linking -litkTestDriver In-Reply-To: References: <1459322911672-7588671.post@n2.nabble.com> <1459350335072-7588674.post@n2.nabble.com> Message-ID: <1459352626786-7588677.post@n2.nabble.com> I'm trying to compile a project that uses ITK 4.6.1. I'm going to remove itkTestDriver from the list of required libs and see how it goes. Thanks! Regards, Juan -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ld-error-when-linking-litkTestDriver-tp7588671p7588677.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From ogdenk at upstate.edu Thu Mar 31 15:08:32 2016 From: ogdenk at upstate.edu (Kent Ogden) Date: Thu, 31 Mar 2016 15:08:32 -0400 Subject: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python Wrap In-Reply-To: <4F6CCA0D-3ACF-4818-B3C0-EB1AC89FA902@gmail.com> References: <50B858FB5F53124F9E32314E5C1B409435B3E077@MBX112.d.ethz.ch> <50B858FB5F53124F9E32314E5C1B409435B3E093@MBX112.d.ethz.ch> <4F6CCA0D-3ACF-4818-B3C0-EB1AC89FA902@gmail.com> Message-ID: <56FD3D7002000082000EA1A9@gatedom1.upstate.edu> On a related note, are there instructions somewhere for building/installing Python wrapping for ITK (and VTK for that matter)? I have built ITK many times and use it in C++ regularly, but I would love to have this functionality in Python, which I am just learning. I have tried building ITK with Python wrapping On, and have specified the needed directories appropriately (I think), but after I build the INSTALL project, I don't see anything related to ITK in the Python site-packages directory. I'm sure I'm missing something simple in my ignorance. I am working in Windows 7 using VS 2015. I have tried using the Python(x,y) distribution which has both ITK and VTK, but I found some functionality was missing ( ImageToVTKImageFilter for example). Kent On 26 Mar 2016, at 19:27, D'Isidoro Fabio wrote: Thank you for your reply. I miss the skills to test/review that patch. I do not know how to wrap a C++ code to Python. Is there any relatively easy guide for it? Also, what are my possibilities now? Writing my own RayCasting Filter in Python and possibly use it as interpolator for the ResampleImageFilter Filter? Or necessarily turn to C++ forgetting about Python? Thanks From: Michka Popoff [mailto:michkapopoff at gmail.com] Sent: Samstag, 26. M?rz 2016 19:16 To: D'Isidoro Fabio Cc: insight-users at itk.org Subject: Re: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python Wrap Hi The function was not wrapped at all. Most of them are, and the remaining are added slowly, mostly on-demand (for the moment). I made a patch which you can test/review here: http://review.source.kitware.com/#/c/20945/ We can probably add it to the 4.9.1 release; else it will land in the ITK 4.10 release. Michka On 26 Mar 2016, at 17:13, D'Isidoro Fabio wrote: Hallo, I am trying to implement my own Digital Radiograph Reconstruction algorithm with ITK v 4.8 Python Wrap. I have looked on the web and found examples that make use of the itk::RayCastInterpolateImageFunction. However, it seems that this function has not been wrapped for Python because I get the error: ?LazyITKModule? object has not attribute ?RayCastInterpolateImageFunction? Any help? Hast this been done in the new 4.9 Version or what do you suggest for me to do? Thank you. Fabio _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Thu Mar 31 15:48:11 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 31 Mar 2016 15:48:11 -0400 Subject: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python Wrap In-Reply-To: <56FD3D7002000082000EA1A9@gatedom1.upstate.edu> References: <50B858FB5F53124F9E32314E5C1B409435B3E077@MBX112.d.ethz.ch> <50B858FB5F53124F9E32314E5C1B409435B3E093@MBX112.d.ethz.ch> <4F6CCA0D-3ACF-4818-B3C0-EB1AC89FA902@gmail.com> <56FD3D7002000082000EA1A9@gatedom1.upstate.edu> Message-ID: @Kent, yes, better documentation is now available in the ITK Software Guide (and there have been many recent improvements to the Python wrapping): http://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch3.html#x34-410003.7 To enable VTK Python wrapping, set the CMake build option VTK_WRAP_PYTHON=ON @Fabio, the Visual Studio build errors have now been resolved in ITK Git master. Running cd /path/to/ITK git checkout master git pull will result in the updated version. There are changes that will soon be merged into ITK Git master that will greatly reduce Visual Studio wrapping build times. Thanks, Matt On Thu, Mar 31, 2016 at 3:08 PM, Kent Ogden wrote: > On a related note, are there instructions somewhere for building/installing > Python wrapping for ITK (and VTK for that matter)? I have built ITK many > times and use it in C++ regularly, but I would love to have this > functionality in Python, which I am just learning. > > I have tried building ITK with Python wrapping On, and have specified the > needed directories appropriately (I think), but after I build the INSTALL > project, I don't see anything related to ITK in the Python site-packages > directory. I'm sure I'm missing something simple in my ignorance. > > I am working in Windows 7 using VS 2015. > > I have tried using the Python(x,y) distribution which has both ITK and VTK, > but I found some functionality was missing ( ImageToVTKImageFilter for > example). > > Kent > > > On 26 Mar 2016, at 19:27, D'Isidoro Fabio wrote: > > > Thank you for your reply. > I miss the skills to test/review that patch. I do not know how to wrap a C++ > code to Python. Is there any relatively easy guide for it? > Also, what are my possibilities now? Writing my own RayCasting Filter in > Python and possibly use it as interpolator for the ResampleImageFilter > Filter? Or necessarily turn to C++ forgetting about Python? > Thanks > From: Michka Popoff [mailto:michkapopoff at gmail.com] > Sent: Samstag, 26. M?rz 2016 19:16 > To: D'Isidoro Fabio > Cc: insight-users at itk.org > Subject: Re: [ITK-users] itk::RayCastInterpolateImageFunction for ITK Python > Wrap > Hi > The function was not wrapped at all. > Most of them are, and the remaining are added slowly, mostly on-demand (for > the moment). > I made a patch which you can test/review here: > http://review.source.kitware.com/#/c/20945/ > We can probably add it to the 4.9.1 release; else it will land in the ITK > 4.10 release. > Michka > > On 26 Mar 2016, at 17:13, D'Isidoro Fabio wrote: > Hallo, > I am trying to implement my own Digital Radiograph Reconstruction algorithm > with ITK v 4.8 Python Wrap. I have looked on the web and found examples that > make use of the itk::RayCastInterpolateImageFunction. However, it seems that > this function has not been wrapped for Python because I get the error: > ?LazyITKModule? object has not attribute ?RayCastInterpolateImageFunction? > Any help? Hast this been done in the new 4.9 Version or what do you suggest > for me to do? > Thank you. > Fabio > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 >