From davis.vigneault at gmail.com Mon May 2 13:22:56 2016 From: davis.vigneault at gmail.com (DVigneault) Date: Mon, 2 May 2016 10:22:56 -0700 (MST) Subject: [ITK-users] Determining parent cell following (iterative Loop) subdivision? Message-ID: <1462209776737-7588798.post@n2.nabble.com> All-- Take this example [1] as a starting point, where an itk::QuadEdgeMesh is iteratively subdivided using the Loop scheme. Given a cell in the child mesh, is there a way to determine from which cell in the original mesh it is descended? In an attempt to pass this information down, I tried setting the cell data in the parent mesh to the cell's ID and then checking the cell data in the child mesh; however, the cell data unfortunately isn't passed down. (In retrospect this makes sense, as a cell in the output of a subdivision filter will not, in general, correspond in a 1-to-1 fashion to a cell in its parent.) I tried to add this functionality to the subcases where there *is* a 1-to-1 correspondence by modifying the GenerateOutputCells() method [2], but I got hung up because I couldn't determine the relationship between the QEPrimal returned from AddTriangleFace() [3] and the cell ID to which I would need to assign the data. Before going farther down the rabbit hole, I thought I'd write to see if there is a better way of approaching my original problem. Best, and thanks, --Davis [1] http://itk.org/Wiki/ITK/Examples/Meshes/LoopTriangleCellSubdivision [2] https://github.com/InsightSoftwareConsortium/itkSubdivisionQuadEdgeMeshFilter/blob/master/include/itkTriangleCellSubdivisionQuadEdgeMeshFilter.hxx [3] https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Core/QuadEdgeMesh/include/itkQuadEdgeMesh.hxx#L1395 -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Determining-parent-cell-following-iterative-Loop-subdivision-tp7588798.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From matt.mccormick at kitware.com Mon May 2 17:38:12 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 2 May 2016 17:38:12 -0400 Subject: [ITK-users] [Example] Perform Registration on Vector Images In-Reply-To: References: Message-ID: Erratum: the original code and test was added by Jeff Duda. On Fri, Apr 29, 2016 at 4:22 PM, Matt McCormick wrote: > Hi folks, > > Based off Nick Tustison's code and test, we have a new example on how > to perform registration on vector images: > > http://itk.org/ITKExamples/src/Registration/Metricsv4/PerformRegistrationOnVectorImages/Documentation.html > > > Matt From zhuangming.shen at sphic.org.cn Mon May 2 22:40:02 2016 From: zhuangming.shen at sphic.org.cn (=?utf-8?B?5rKI5bqE5piO?=) Date: Tue, 3 May 2016 02:40:02 +0000 Subject: [ITK-users] Strange situation when ITK writes DICOM file In-Reply-To: References: <1450834862664.8600@sphic.org.cn> <1461914235636.15330@sphic.org.cn>, Message-ID: <1462243202460.83843@sphic.org.cn> Hi D?enan, Thanks for your prompt response. I used ITK 4.9.1 and your attached code (just changed inDir and outFile) to test both public DICOM data (http://www.osirix-viewer.com/datasets/DATA/BREBIX.zip) and private DICOM data, the results are still incorrect (please see the attached screenshot). What's the problem? Besides, as far as I know, rescaling the intensity from short type to char type leads to lose precision because the DICOM tags ( (0028,0100) and (0028,0101) ) show the BitsAllocated is 16-bits and the BitsStored is 12-bits. Consequently, this solution doesn't seem to be a good solution. Is it possible to output the DICOM file by other tools (e.g. DCMTK) if the GDCM doesn't support short type?? Regards, Zhuangming Shen ________________________________ From: D?enan Zuki? Sent: Friday, April 29, 2016 9:59 PM To: ??? Cc: insight-users at itk.org; Matt McCormick Subject: Re: [ITK-users] Strange situation when ITK writes DICOM file Hi Shen, GDCM version was updated recently. It now complains that short type is unsupported, and works correctly with char type. I attached an example which rescales the intensity and works correctly. Regards, D?enan On Fri, Apr 29, 2016 at 3:17 AM, ??? > wrote: Hi D?enan, ? I'd like to know if the bug regarding 3D DICOM writer has been fixed. When I tried to run the same code but using ITK 4.9.1, I still got the same results, i.e. the output DICOM file does not properly record original image's origin and spacing. Regards, Zhuangming Shen ________________________________ From: D?enan Zuki? > Sent: Saturday, December 26, 2015 1:44 AM To: ??? Cc: insight-users at itk.org Subject: Re: [ITK-users] Strange situation when ITK writes DICOM file ?I have confirmed this bug and entered it into tracker along with a DICOM series which reproduces it.? Thanks Shen On Tue, Dec 22, 2015 at 8:41 PM, ??? > wrote: Hi all, I met a very strange situation when I used ITK 4.8.1. I'd like to read a DICOM series, write it to a DICOM file (i.e. save the volume created by the DICOM series to a .dcm file), and read the DICOM file. Theoretically, the DICOM series and the DCM file should have the same information, e.g origin, spacing, size. However, My results show me that the information has been changed. When I use other ITK-support file format (e.g. nii, nrrd), the information has not been changed. It seems a bug. My code and results are listed as below. Has anyone met the same situation? Regards, Zhuangming Shen ? ================ My code ================= import itk input_dir = "/home/zshen/workspace/Data/testDCM/bbb" output_filename = "/home/zshen/workspace/Data/bbb2.dcm" # read DICOM series dicom_io = itk.GDCMImageIO.New() reader = itk.ImageSeriesReader[itk.Image.SS3].New() reader.SetImageIO(dicom_io) name_generator = itk.GDCMSeriesFileNames.New() name_generator.SetUseSeriesDetails(True) name_generator.SetDirectory(input_dir) series_uid = name_generator.GetSeriesUIDs() series_identifier = series_uid[0] file_names = name_generator.GetFileNames(series_identifier) reader.SetFileNames(file_names) reader.Update() print("**** series DICOM information: *****") print("size: "+str(reader.GetOutput().GetLargestPossibleRegion().GetSize())) print("origin: "+str(reader.GetOutput().GetOrigin())) print("spacing: "+str(reader.GetOutput().GetSpacing())) writer = itk.ImageFileWriter[itk.Image.SS3].New() writer.SetInput(reader.GetOutput()) writer.SetFileName(output_filename) writer.Update() # read again reader2 = itk.ImageFileReader[itk.Image.SS3].New() reader2.SetFileName(output_filename) reader2.Update() print("**** DICOM information: *****") print("size: "+str(reader2.GetOutput().GetLargestPossibleRegion().GetSize())) print("origin: "+str(reader2.GetOutput().GetOrigin())) print("spacing: "+str(reader2.GetOutput().GetSpacing())) ================= My results ==================== **** series DICOM information: ***** size: itkSize3 ([512, 512, 118]) origin: itkPointD3 ([-229.5, -96.5, -553]) spacing: itkVectorD3 ([0.896484, 0.896484, 3]) **** DICOM information: ***** size: itkSize3 ([512, 512, 118]) origin: itkPointD3 ([0, 0, 0]) spacing: itkVectorD3 ([0.896484, 0.896484, 1]) _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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: Result.png Type: image/png Size: 23765 bytes Desc: Result.png URL: From abenchaaben at histalim.com Tue May 3 05:13:52 2016 From: abenchaaben at histalim.com (abenchaaben) Date: Tue, 3 May 2016 02:13:52 -0700 (MST) Subject: [ITK-users] Itk Volume From Slices Message-ID: <1462266832069-7588801.post@n2.nabble.com> Hi, I'm using the volume from slices ITK example to build a volume from 2d RGB png files. I want to know if they a condition on the numbers of images that i should pass to the seriesReader class. Because my applicvation just crash when i put many image to the class. Regards. -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Itk-Volume-From-Slices-tp7588801.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From Anchit.Dhar at mathworks.com Tue May 3 17:28:35 2016 From: Anchit.Dhar at mathworks.com (Anchit Dhar) Date: Tue, 3 May 2016 21:28:35 +0000 Subject: [ITK-users] Registration performance regression on machines with large number of cores Message-ID: Hello, We are registering two images using the 'MultiResolutionImageRegistrationMethod' in ITK v4.8 and are seeing a performance degradation on machines with large number of cores. We use the MultiResolutionImageRegistrationMethod with RegularStepGradientDescent optimizer and MeanSquares metric. Two separate issues are observed here: 1. Performance degradation of image registration on machines with higher number of cores as compared to ones with lower number. A Dual-core machine showed better performance with the image registration than one with 20 cores. The performance degradation observed on a machine with 20 physical cores and also on one with 6 physical (12 logical cores). 2. Performance degradation of image registration on subsequent runs on the same machine (with higher number of cores) The performance of registration continuously regresses on subsequent runs within an application session. This issue gets resolved on setting the number of cores to a lower number (setting to number of physical cores rather than logical cores) I have gone ahead and created the a bug for this issue. https://issues.itk.org/jira/browse/ITK-3427 Has anyone else had similar experiences with the multi-threaded MultiResolutionImageRegistrationMethod? Thanks. -Anchit -------------- next part -------------- An HTML attachment was scrubbed... URL: From Aude.CHENET-ext at galderma.com Wed May 4 10:15:00 2016 From: Aude.CHENET-ext at galderma.com (CHENET Aude (External)) Date: Wed, 4 May 2016 14:15:00 +0000 Subject: [ITK-users] Using ITK with python wrapping Message-ID: <512AA6AA7E7E224A874888677C6CB2FB586B60@WWEURMBX03.galderma.com> Hello I've built ITK 4.9 with Python wrapping. Compilation is OK. I tried to use ITK in my python code : import itk pixelType = itk.UC imageType = itk.Image[pixelType,2] readerType = itk.ImageFileReader[imageType] reader = readerType.New() reader.SetFileName('test.tif') There is the following error : Traceback (most recent call last): File "C:\test.py", line 12, in imageType = itk.Image[pixelType,2] File "C:\Python27\Lib\site-packages\itkLazy.py", line 42, in __getattribute__ itkBase.LoadModule(module, namespace) File "C:\Python27\Lib\site-packages\itkBase.py", line 118, in LoadModule LoadModule(dep, namespace) File "C:\Python27\Lib\site-packages\itkBase.py", line 118, in LoadModule LoadModule(dep, namespace) File "C:\Python27\Lib\site-packages\itkBase.py", line 118, in LoadModule LoadModule(dep, namespace) File "C:\Python27\Lib\site-packages\itkBase.py", line 118, in LoadModule LoadModule(dep, namespace) File "C:\Python27\Lib\site-packages\itkBase.py", line 128, in LoadModule module = loader.load(swigModuleName) File "C:\Python27\Lib\site-packages\itkBase.py", line 245, in load return imp.load_module(name, fp, pathname, description) File "C:\Python27\Lib\site-packages\itk\ITKCommonPython.py", line 32, in _ITKCommonPython = swig_import_helper() File "C:\Python27\Lib\site-packages\itk\ITKCommonPython.py", line 28, in swig_import_helper _mod = imp.load_module('_ITKCommonPython', fp, pathname, description) ImportError: DLL load failed: Le module sp?cifi? est introuvable. Can someone help me to use itk in my code? Aude -------------- next part -------------- An HTML attachment was scrubbed... URL: From fausto.milletari at gmail.com Wed May 4 13:14:37 2016 From: fausto.milletari at gmail.com (=?utf-8?Q?fausto_milletar=C3=AC?=) Date: Wed, 4 May 2016 19:14:37 +0200 Subject: [ITK-users] SimpleITK, read MHD volume and convert it into a numpy array respecting its transformation Message-ID: <251D64E2-389D-425C-A142-FF43AD08D18D@gmail.com> Hello everyone, I have a probably naive question about simpleITK. I find simpleITK extremely useful to process medical data such as MRI scans but I would like also to enjoy being able to convert my images in numpy format while respecting the transformation of the volume. In other words I would like to get the MRI image in numpy rotated by the correct amount around each axis with zero padding for example. when i do simply sitk.GetArrayFromImage(imgResampledCropped)I get back the raw data itself, but what I would like to do is to have a numpy array that contains the data ?ready to visualise? by simple slicing of the array itself. Do you think this is doable? Is there a standard way of doing it? Kind regards, Fausto -------------- next part -------------- An HTML attachment was scrubbed... URL: From javij1 at gmail.com Wed May 4 14:15:22 2016 From: javij1 at gmail.com (=?UTF-8?Q?Javier_Juan_Albarrac=c3=adn?=) Date: Wed, 4 May 2016 20:15:22 +0200 Subject: [ITK-users] Get for each voxel of a 4D image inside a mask, their corresponding 4D values Message-ID: <5cfb5664-dddf-c842-4d43-817c85659a9a@gmail.com> Hello, I am sorry if the question is too simple but I am a newbie with ITK and I don't find the way to solve my problem I have a 4D image, which is a DSC Perfusion weighted MRI. First of all, the type of the image must be itk::Image or itk::Image, 3> ?? In the later case, I do not know at compile time the value of N. And the core question, supose the image is of size 270x270x171x34, I want to extract for each voxel of the image which is inside the intracraneal mask, their 34 corresponding values. The intracraneal mask is not a rectangular region, but is a brain-like mask (itk::Image volume). In a classic "for loop" scheme (where I come from) the code would be for (int x = 0; x < image.width(); x++) { for (int y = 0; y < image.height(); y++) { for (int z = 0; z < image.depth(); z++) { if (!mask(x, y, z)) continue; for (int c = 0; c < image.spectrum(); c++) int v = image(x, y, z, c); i++; } } } How can do this in ITK?? I have read several ImageRegionIterator examples, but I do not find a clean and correct way to do what I want. Thank you very much. Regards. Javier. From blowekamp at mail.nih.gov Wed May 4 14:36:43 2016 From: blowekamp at mail.nih.gov (Lowekamp, Bradley (NIH/NLM/LHC) [C]) Date: Wed, 4 May 2016 18:36:43 +0000 Subject: [ITK-users] SimpleITK, read MHD volume and convert it into a numpy array respecting its transformation In-Reply-To: <251D64E2-389D-425C-A142-FF43AD08D18D@gmail.com> References: <251D64E2-389D-425C-A142-FF43AD08D18D@gmail.com> Message-ID: <2E7CE142-2BFD-4C27-ADF5-794E633224FE@mail.nih.gov> Hello, If I understand you correctly you want to rotate the image and pad it for visualization before exporting to numpy. Have you looked into the ResampleImageFilter? It accepts a transform, along with output image geometry so that you can readily manipulate the image for display. You also may want to scale the image?s intensity with a WindowLevelImageFilter for better visualization of the range of interest. HTH, Brad On May 4, 2016, at 1:14 PM, fausto milletar? > wrote: Hello everyone, I have a probably naive question about simpleITK. I find simpleITK extremely useful to process medical data such as MRI scans but I would like also to enjoy being able to convert my images in numpy format while respecting the transformation of the volume. In other words I would like to get the MRI image in numpy rotated by the correct amount around each axis with zero padding for example. when i do simply sitk.GetArrayFromImage(imgResampledCropped)I get back the raw data itself, but what I would like to do is to have a numpy array that contains the data ?ready to visualise? by simple slicing of the array itself. Do you think this is doable? Is there a standard way of doing it? Kind regards, Fausto _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 fausto.milletari at gmail.com Wed May 4 14:40:23 2016 From: fausto.milletari at gmail.com (=?utf-8?Q?fausto_milletar=C3=AC?=) Date: Wed, 4 May 2016 20:40:23 +0200 Subject: [ITK-users] SimpleITK, read MHD volume and convert it into a numpy array respecting its transformation In-Reply-To: <2E7CE142-2BFD-4C27-ADF5-794E633224FE@mail.nih.gov> References: <251D64E2-389D-425C-A142-FF43AD08D18D@gmail.com> <2E7CE142-2BFD-4C27-ADF5-794E633224FE@mail.nih.gov> Message-ID: <6DA80880-E1D3-42EF-B32F-81020FF76C1B@gmail.com> Hello, I thank you for you fast and accurate answer. This was exactly what I was looking for. Actually I don?t need to visualise the data but further process it in a common reference frame. I think that your answer solves the problem. I will look into the ResampleImageFilter (that so far I was using only to adjust the resolution of different volumes acquired with different scanners to a common one). Thanks a lot! Fausto Milletari > On 04 May 2016, at 20:36, Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote: > > Hello, > > If I understand you correctly you want to rotate the image and pad it for visualization before exporting to numpy. > > Have you looked into the ResampleImageFilter? It accepts a transform, along with output image geometry so that you can readily manipulate the image for display. You also may want to scale the image?s intensity with a WindowLevelImageFilter for better visualization of the range of interest. > > HTH, > Brad > >> On May 4, 2016, at 1:14 PM, fausto milletar? > wrote: >> >> Hello everyone, >> >> I have a probably naive question about simpleITK. I find simpleITK extremely useful to process medical data such as MRI scans but I would like also to enjoy being able to convert my images in numpy format while respecting the transformation of the volume. >> >> In other words I would like to get the MRI image in numpy rotated by the correct amount around each axis with zero padding for example. >> >> when i do simply sitk.GetArrayFromImage(imgResampledCropped)I get back the raw data itself, but what I would like to do is to have a numpy array that contains the data ?ready to visualise? by simple slicing of the array itself. >> >> Do you think this is doable? Is there a standard way of doing it? >> >> >> >> Kind regards, >> >> Fausto >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the 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 hans-johnson at uiowa.edu Wed May 4 14:19:02 2016 From: hans-johnson at uiowa.edu (Johnson, Hans J) Date: Wed, 4 May 2016 18:19:02 +0000 Subject: [ITK-users] Get for each voxel of a 4D image inside a mask, their corresponding 4D values In-Reply-To: <5cfb5664-dddf-c842-4d43-817c85659a9a@gmail.com> References: <5cfb5664-dddf-c842-4d43-817c85659a9a@gmail.com> Message-ID: Consider the ?ImageRegionIteratorWithIndex? for(it.GotoBegin(); !it.IsAtEnd(); ++it) { const IndexType index = it.GetIndex(); If(mask.Get(Index)) { newvalue = it->GetValue() } } Hans -- On 5/4/16, 1:15 PM, "Insight-users on behalf of Javier Juan Albarrac?n" wrote: >Hello, > >I am sorry if the question is too simple but I am a newbie with ITK and >I don't find the way to solve my problem > >I have a 4D image, which is a DSC Perfusion weighted MRI. First of all, >the type of the image must be itk::Image or >itk::Image, 3> ?? In the later case, I do >not know at compile time the value of N. > >And the core question, supose the image is of size 270x270x171x34, I >want to extract for each voxel of the image which is inside the >intracraneal mask, their 34 corresponding values. The intracraneal mask >is not a rectangular region, but is a brain-like mask (itk::Image3> volume). > >In a classic "for loop" scheme (where I come from) the code would be > >for (int x = 0; x < image.width(); x++) >{ > for (int y = 0; y < image.height(); y++) > { > for (int z = 0; z < image.depth(); z++) > { > if (!mask(x, y, z)) > continue; > > for (int c = 0; c < image.spectrum(); c++) > int v = image(x, y, z, c); > i++; > } > } >} > > >How can do this in ITK?? I have read several ImageRegionIterator >examples, but I do not find a clean and correct way to do what I want. > >Thank you very much. >Regards. > >Javier. >_____________________________________ >Powered by www.kitware.com > >Visit other Kitware open-source projects at >http://www.kitware.com/opensource/opensource.html > >Kitware offers ITK Training Courses, for more information visit: >http://www.kitware.com/products/protraining.php > >Please keep messages on-topic and check the 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 p.zaffino at yahoo.it Wed May 4 15:36:07 2016 From: p.zaffino at yahoo.it (Paolo Zaffino) Date: Wed, 4 May 2016 21:36:07 +0200 Subject: [ITK-users] [ITK] SimpleITK, read MHD volume and convert it into a numpy array respecting its transformation In-Reply-To: <6DA80880-E1D3-42EF-B32F-81020FF76C1B@gmail.com> References: <251D64E2-389D-425C-A142-FF43AD08D18D@gmail.com> <2E7CE142-2BFD-4C27-ADF5-794E633224FE@mail.nih.gov> <6DA80880-E1D3-42EF-B32F-81020FF76C1B@gmail.com> Message-ID: <2e9e205a-8f6a-5eb0-71ca-0ac730685f10@yahoo.it> Hi Fausto, if you want to accomplish all the stuff entirely from the scipy/scikit side, I think you could use [1] and [2] (check the matching between documentation version and library version). HTH. Best. Paolo [1] http://docs.scipy.org/doc/scipy-0.16.0/reference/generated/scipy.ndimage.interpolation.rotate.html [2] http://scikit-image.org/docs/dev/api/skimage.transform.html#skimage.transform.rotate On 04/05/2016 20:40, fausto milletar? wrote: > Hello, > > I thank you for you fast and accurate answer. This was exactly what I > was looking for. Actually I don?t need to visualise the data but > further process it in a common reference frame. I think that your > answer solves the problem. I will look into the ResampleImageFilter > (that so far I was using only to adjust the resolution of different > volumes acquired with different scanners to a common one). > > > Thanks a lot! > > Fausto Milletari >> On 04 May 2016, at 20:36, Lowekamp, Bradley (NIH/NLM/LHC) [C] >> > wrote: >> >> Hello, >> >> If I understand you correctly you want to rotate the image and pad it >> for visualization before exporting to numpy. >> >> Have you looked into the ResampleImageFilter? It accepts a transform, >> along with output image geometry so that you can readily manipulate >> the image for display. You also may want to scale the image?s >> intensity with a WindowLevelImageFilter for better visualization of >> the range of interest. >> >> HTH, >> Brad >> >>> On May 4, 2016, at 1:14 PM, fausto milletar? >>> > wrote: >>> >>> Hello everyone, >>> >>> I have a probably naive question about simpleITK. I find simpleITK >>> extremely useful to process medical data such as MRI scans but I >>> would like also to enjoy being able to convert my images in numpy >>> format while respecting the transformation of the volume. >>> >>> In other words I would like to get the MRI image in numpy rotated by >>> the correct amount around each axis with zero padding for example. >>> >>> when i do simply sitk.GetArrayFromImage(imgResampledCropped)I get >>> back the raw data itself, but what I would like to do is to have a >>> numpy array that contains the data ?ready to visualise? by simple >>> slicing of the array itself. >>> >>> Do you think this is doable? Is there a standard way of doing it? >>> >>> >>> >>> Kind regards, >>> >>> Fausto >>> >>> _____________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://www.kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the 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 fausto.milletari at gmail.com Wed May 4 16:17:56 2016 From: fausto.milletari at gmail.com (=?utf-8?Q?fausto_milletar=C3=AC?=) Date: Wed, 4 May 2016 22:17:56 +0200 Subject: [ITK-users] SimpleITK, read MHD volume and convert it into a numpy array respecting its transformation In-Reply-To: <6DA80880-E1D3-42EF-B32F-81020FF76C1B@gmail.com> References: <251D64E2-389D-425C-A142-FF43AD08D18D@gmail.com> <2E7CE142-2BFD-4C27-ADF5-794E633224FE@mail.nih.gov> <6DA80880-E1D3-42EF-B32F-81020FF76C1B@gmail.com> Message-ID: <79C2352D-F2E6-40B4-AADE-3901CF2E2956@gmail.com> Hello, just as a brief attempt i tried: resample=sitk.ResampleImageFilter() resample.SetReferenceImage(img) resample.SetOutputDirection(img.GetDirection()) Seems that, after I obtain the numpy array as: test=resample.Execute(img) volume=sitk.GetArrayFromImage(test) Nothing changes in terms of data array. If I also add resample.SetOutputSpacing(img.GetSpacing()/2.) then the numpy array changes and depicts a down-sampled version of the image. I suspect i have to use resample.SetTransform() but I will need to create this transform using one of the transform types available in sitk. How can I create a transform that is equivalent to the one contained in the header of my MHD file? Should I create a transform starting from the volume direction and maybe offset? I could not find any example of this so far? Best regards and thanks much for your help and your answers, Fausto > On 04 May 2016, at 20:40, fausto milletar? wrote: > > Hello, > > I thank you for you fast and accurate answer. This was exactly what I was looking for. Actually I don?t need to visualise the data but further process it in a common reference frame. I think that your answer solves the problem. I will look into the ResampleImageFilter (that so far I was using only to adjust the resolution of different volumes acquired with different scanners to a common one). > > > Thanks a lot! > > Fausto Milletari >> On 04 May 2016, at 20:36, Lowekamp, Bradley (NIH/NLM/LHC) [C] > wrote: >> >> Hello, >> >> If I understand you correctly you want to rotate the image and pad it for visualization before exporting to numpy. >> >> Have you looked into the ResampleImageFilter? It accepts a transform, along with output image geometry so that you can readily manipulate the image for display. You also may want to scale the image?s intensity with a WindowLevelImageFilter for better visualization of the range of interest. >> >> HTH, >> Brad >> >>> On May 4, 2016, at 1:14 PM, fausto milletar? > wrote: >>> >>> Hello everyone, >>> >>> I have a probably naive question about simpleITK. I find simpleITK extremely useful to process medical data such as MRI scans but I would like also to enjoy being able to convert my images in numpy format while respecting the transformation of the volume. >>> >>> In other words I would like to get the MRI image in numpy rotated by the correct amount around each axis with zero padding for example. >>> >>> when i do simply sitk.GetArrayFromImage(imgResampledCropped)I get back the raw data itself, but what I would like to do is to have a numpy array that contains the data ?ready to visualise? by simple slicing of the array itself. >>> >>> Do you think this is doable? Is there a standard way of doing it? >>> >>> >>> >>> Kind regards, >>> >>> Fausto >>> >>> _____________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://www.kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the 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 javij1 at gmail.com Thu May 5 05:48:24 2016 From: javij1 at gmail.com (=?UTF-8?Q?Javier_Juan_Albarrac=c3=adn?=) Date: Thu, 5 May 2016 11:48:24 +0200 Subject: [ITK-users] 4D Image to Matrix inside mask In-Reply-To: <5cfb5664-dddf-c842-4d43-817c85659a9a@gmail.com> References: <5cfb5664-dddf-c842-4d43-817c85659a9a@gmail.com> Message-ID: Hello, I have a 4D image, which is a DSC Perfusion weighted MRI. Supose the image has the dimenisions 270x270x171x34. I want to convert this image into a Matrix of size Nx34, where N are the number of voxels inside the intracraneal mask. The Matrix class comes from Eigen library. In a classic "for loop" scheme the code would be for (int x = 0; x < image.width(); x++) { for (int y = 0; y < image.height(); y++) { for (int z = 0; z < image.depth(); z++) { if (!mask(x, y, z)) continue; for (int c = 0; c < image.spectrum(); c++) Matrix(i, c) = image(x, y, z, c); i++; } } } How can I do this in ITK?? I have read several ImageRegionIterator examples, but I do not find a clean and correct way to do what I want. Thank you very much. Regards. Javier. -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Thu May 5 09:18:33 2016 From: blowekamp at mail.nih.gov (Lowekamp, Bradley (NIH/NLM/LHC) [C]) Date: Thu, 5 May 2016 13:18:33 +0000 Subject: [ITK-users] SimpleITK, read MHD volume and convert it into a numpy array respecting its transformation In-Reply-To: <79C2352D-F2E6-40B4-AADE-3901CF2E2956@gmail.com> References: <251D64E2-389D-425C-A142-FF43AD08D18D@gmail.com> <2E7CE142-2BFD-4C27-ADF5-794E633224FE@mail.nih.gov> <6DA80880-E1D3-42EF-B32F-81020FF76C1B@gmail.com> <79C2352D-F2E6-40B4-AADE-3901CF2E2956@gmail.com> Message-ID: <5D73897C-30E8-4368-9ADD-447F5C0F8F64@mail.nih.gov> Hi, One of the key feature of ITK is that images are not just voxel, but oriented object that have a physical location. This is why the Image class has associated with the an Origin, Spacing, and Direction. You can use the Image::TransformIndexToPhysicalPoint to see this mapping. Also print the SimpleITK image and look at these attributes. The ResampleImageFilter applies a geometric transform from the input image's physical space to the output image's physical space defined by the Output parameters of the ResampleImageFiler. In your first attempt, your input image and output image are in the same physical space so it is expected that they would be the same. The input and output image maintain the same meta-data, because of the call the SetReferenceIamge(img). From your initial post, it sounds like you want to resample a set of images to a common reference frame. So you need to define that common reference image?s origin, spacing, direction, and size. And use that information in the ResampleImageFilter. This assumes that you don?t want to change the physical location of the image. HTH, Brad On May 4, 2016, at 4:17 PM, fausto milletar? > wrote: Hello, just as a brief attempt i tried: resample=sitk.ResampleImageFilter() resample.SetReferenceImage(img) resample.SetOutputDirection(img.GetDirection()) Seems that, after I obtain the numpy array as: test=resample.Execute(img) volume=sitk.GetArrayFromImage(test) Nothing changes in terms of data array. If I also add resample.SetOutputSpacing(img.GetSpacing()/2.) then the numpy array changes and depicts a down-sampled version of the image. I suspect i have to use resample.SetTransform() but I will need to create this transform using one of the transform types available in sitk. How can I create a transform that is equivalent to the one contained in the header of my MHD file? Should I create a transform starting from the volume direction and maybe offset? I could not find any example of this so far? Best regards and thanks much for your help and your answers, Fausto On 04 May 2016, at 20:40, fausto milletar? > wrote: Hello, I thank you for you fast and accurate answer. This was exactly what I was looking for. Actually I don?t need to visualise the data but further process it in a common reference frame. I think that your answer solves the problem. I will look into the ResampleImageFilter (that so far I was using only to adjust the resolution of different volumes acquired with different scanners to a common one). Thanks a lot! Fausto Milletari On 04 May 2016, at 20:36, Lowekamp, Bradley (NIH/NLM/LHC) [C] > wrote: Hello, If I understand you correctly you want to rotate the image and pad it for visualization before exporting to numpy. Have you looked into the ResampleImageFilter? It accepts a transform, along with output image geometry so that you can readily manipulate the image for display. You also may want to scale the image?s intensity with a WindowLevelImageFilter for better visualization of the range of interest. HTH, Brad On May 4, 2016, at 1:14 PM, fausto milletar? > wrote: Hello everyone, I have a probably naive question about simpleITK. I find simpleITK extremely useful to process medical data such as MRI scans but I would like also to enjoy being able to convert my images in numpy format while respecting the transformation of the volume. In other words I would like to get the MRI image in numpy rotated by the correct amount around each axis with zero padding for example. when i do simply sitk.GetArrayFromImage(imgResampledCropped)I get back the raw data itself, but what I would like to do is to have a numpy array that contains the data ?ready to visualise? by simple slicing of the array itself. Do you think this is doable? Is there a standard way of doing it? Kind regards, Fausto _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 May 5 10:12:06 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 5 May 2016 10:12:06 -0400 Subject: [ITK-users] Using ITK with python wrapping In-Reply-To: <512AA6AA7E7E224A874888677C6CB2FB586B60@WWEURMBX03.galderma.com> References: <512AA6AA7E7E224A874888677C6CB2FB586B60@WWEURMBX03.galderma.com> Message-ID: Hello Aude, Welcome to ITK! The directory containing the ITK DLL files needs to be added to the PATH environmental variable on Windows. For more information, see the Wrapping section of the ITK Software Guide: https://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch3.html#x34-410003.7 As of ITK 4.10, this will no longer be necessary if BUILD_SHARED_LIBS is OFF in the CMake configuration. Hope this helps, Matt On Wed, May 4, 2016 at 10:15 AM, CHENET Aude (External) wrote: > Hello > > > > I?ve built ITK 4.9 with Python wrapping. Compilation is OK. > > I tried to use ITK in my python code : > > > > import itk > > pixelType = itk.UC > > imageType = itk.Image[pixelType,2] > > readerType = itk.ImageFileReader[imageType] > > reader = readerType.New() > > reader.SetFileName(?test.tif?) > > > > There is the following error : > > > > Traceback (most recent call last): > > File "C:\test.py", line 12, in > > imageType = itk.Image[pixelType,2] > > File "C:\Python27\Lib\site-packages\itkLazy.py", line 42, in > __getattribute__ > > itkBase.LoadModule(module, namespace) > > File "C:\Python27\Lib\site-packages\itkBase.py", line 118, in LoadModule > > LoadModule(dep, namespace) > > File "C:\Python27\Lib\site-packages\itkBase.py", line 118, in LoadModule > > LoadModule(dep, namespace) > > File "C:\Python27\Lib\site-packages\itkBase.py", line 118, in LoadModule > > LoadModule(dep, namespace) > > File "C:\Python27\Lib\site-packages\itkBase.py", line 118, in LoadModule > > LoadModule(dep, namespace) > > File "C:\Python27\Lib\site-packages\itkBase.py", line 128, in LoadModule > > module = loader.load(swigModuleName) > > File "C:\Python27\Lib\site-packages\itkBase.py", line 245, in load > > return imp.load_module(name, fp, pathname, description) > > File "C:\Python27\Lib\site-packages\itk\ITKCommonPython.py", line 32, in > > > _ITKCommonPython = swig_import_helper() > > File "C:\Python27\Lib\site-packages\itk\ITKCommonPython.py", line 28, in > swig_import_helper > > _mod = imp.load_module('_ITKCommonPython', fp, pathname, description) > > ImportError: DLL load failed: Le module sp?cifi? est introuvable. > > > > > > Can someone help me to use itk in my code? > > > > Aude > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 Thu May 5 10:21:12 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 5 May 2016 10:21:12 -0400 Subject: [ITK-users] Strange situation when ITK writes DICOM file In-Reply-To: <1462243202460.83843@sphic.org.cn> References: <1450834862664.8600@sphic.org.cn> <1461914235636.15330@sphic.org.cn> <1462243202460.83843@sphic.org.cn> Message-ID: Hi Zhuangming Shen, GDCM was updated in ITK Git master, to be released in ITK 4.10. Instructions on how to obtain this version can be found here: https://itk.org/Wiki/ITK/Git/Download Thanks, Matt On Mon, May 2, 2016 at 10:40 PM, ??? wrote: > Hi D?enan, > > > Thanks for your prompt response. I used ITK 4.9.1 and your attached code > (just changed inDir and outFile) to test both public DICOM data > (http://www.osirix-viewer.com/datasets/DATA/BREBIX.zip) and private DICOM > data, the results are still incorrect (please see the attached screenshot). > What's the problem? > > > Besides, as far as I know, rescaling the intensity from short type to char > type leads to lose precision because the DICOM tags ( (0028,0100) and > (0028,0101) ) show the BitsAllocated is 16-bits and the BitsStored is > 12-bits. Consequently, this solution doesn't seem to be a good solution. Is > it possible to output the DICOM file by other tools (e.g. DCMTK) if the GDCM > doesn't support short type? > > > > Regards, > > > Zhuangming Shen > > > > > ________________________________ > From: D?enan Zuki? > Sent: Friday, April 29, 2016 9:59 PM > To: ??? > Cc: insight-users at itk.org; Matt McCormick > > Subject: Re: [ITK-users] Strange situation when ITK writes DICOM file > > Hi Shen, > > GDCM version was updated recently. It now complains that short type is > unsupported, and works correctly with char type. I attached an example which > rescales the intensity and works correctly. > > Regards, > D?enan > > On Fri, Apr 29, 2016 at 3:17 AM, ??? wrote: >> >> Hi D?enan, >> >> >> I'd like to know if the bug regarding 3D DICOM writer has been fixed. When >> I tried to run the same code but using ITK 4.9.1, I still got the same >> results, i.e. the output DICOM file does not properly record original >> image's origin and spacing. >> >> >> >> Regards, >> >> >> Zhuangming Shen >> >> ________________________________ >> From: D?enan Zuki? >> Sent: Saturday, December 26, 2015 1:44 AM >> To: ??? >> Cc: insight-users at itk.org >> Subject: Re: [ITK-users] Strange situation when ITK writes DICOM file >> >> I have confirmed this bug and entered it into tracker along with a DICOM >> series which reproduces it. >> >> Thanks Shen >> >> On Tue, Dec 22, 2015 at 8:41 PM, ??? wrote: >>> >>> Hi all, >>> >>> >>> I met a very strange situation when I used ITK 4.8.1. I'd like to read a >>> DICOM series, write it to a DICOM file (i.e. save the volume created by the >>> DICOM series to a .dcm file), and read the DICOM file. Theoretically, the >>> DICOM series and the DCM file should have the same information, e.g origin, >>> spacing, size. However, My results show me that the information has been >>> changed. When I use other ITK-support file format (e.g. nii, nrrd), the >>> information has not been changed. It seems a bug. My code and results are >>> listed as below. Has anyone met the same situation? >>> >>> >>> Regards, >>> >>> >>> Zhuangming Shen >>> >>> >>> >>> >>> ================ My code ================= >>> >>> >>> import itk >>> >>> input_dir = "/home/zshen/workspace/Data/testDCM/bbb" >>> output_filename = "/home/zshen/workspace/Data/bbb2.dcm" >>> >>> # read DICOM series >>> dicom_io = itk.GDCMImageIO.New() >>> >>> reader = itk.ImageSeriesReader[itk.Image.SS3].New() >>> reader.SetImageIO(dicom_io) >>> >>> name_generator = itk.GDCMSeriesFileNames.New() >>> name_generator.SetUseSeriesDetails(True) >>> name_generator.SetDirectory(input_dir) >>> >>> series_uid = name_generator.GetSeriesUIDs() >>> >>> series_identifier = series_uid[0] >>> >>> file_names = name_generator.GetFileNames(series_identifier) >>> >>> reader.SetFileNames(file_names) >>> reader.Update() >>> >>> print("**** series DICOM information: *****") >>> print("size: >>> "+str(reader.GetOutput().GetLargestPossibleRegion().GetSize())) >>> print("origin: "+str(reader.GetOutput().GetOrigin())) >>> print("spacing: "+str(reader.GetOutput().GetSpacing())) >>> >>> writer = itk.ImageFileWriter[itk.Image.SS3].New() >>> writer.SetInput(reader.GetOutput()) >>> writer.SetFileName(output_filename) >>> writer.Update() >>> >>> # read again >>> reader2 = itk.ImageFileReader[itk.Image.SS3].New() >>> reader2.SetFileName(output_filename) >>> reader2.Update() >>> >>> print("**** DICOM information: *****") >>> print("size: >>> "+str(reader2.GetOutput().GetLargestPossibleRegion().GetSize())) >>> print("origin: "+str(reader2.GetOutput().GetOrigin())) >>> print("spacing: "+str(reader2.GetOutput().GetSpacing())) >>> >>> >>> ================= My results ==================== >>> >>> **** series DICOM information: ***** >>> size: itkSize3 ([512, 512, 118]) >>> origin: itkPointD3 ([-229.5, -96.5, -553]) >>> spacing: itkVectorD3 ([0.896484, 0.896484, 3]) >>> **** DICOM information: ***** >>> size: itkSize3 ([512, 512, 118]) >>> origin: itkPointD3 ([0, 0, 0]) >>> spacing: itkVectorD3 ([0.896484, 0.896484, 1]) >>> >>> >>> >>> >>> _____________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://www.kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the 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 Thu May 5 10:46:05 2016 From: alexfd7 at gmail.com (alexfd7) Date: Thu, 5 May 2016 07:46:05 -0700 (MST) Subject: [ITK-users] image->GetBufferPointer() and opposite way for 3d images Message-ID: <1462459565166-7588815.post@n2.nabble.com> Hello everyone, I have a problem, someone help me? I'm getting the image buffer. So I want to do the opposite way, import the buffer (pixelData) back to the image object, I am using importImageFilter filter to have the original image again. 2D images works very well, however with 3d images (.nrrd) i'm not getting good result, I get a darker resulting image than the original. I thank the attention and the available space for me to post my question float* pixelData; /**< Pointer to image data */ typedef float InputPixelType; typedef float OutputPixelType; typedef itk::Image InputImageType; typedef itk::Image OutputImageType; typedef itk::ImageFileReader ReaderType; typedef itk::ImageFileWriter WriterType; typedef itk::ImportImageFilter< float, 3 > ImportFilterType; ImportFilterType::Pointer importFilter = ImportFilterType::New(); typename ReaderType::Pointer reader = ReaderType::New(); reader->SetFileName( inputVolume.c_str() ); reader->Update(); typename InputImageType::Pointer image = reader->GetOutput(); typename InputImageType::RegionType region = image->GetLargestPossibleRegion(); typename InputImageType::SizeType size = region.GetSize(); int sizePixel = (size[0]*size[1]*size[2]); pixelData = (float*)malloc(size[0]*size[1]*size[2] * sizeof(float)); memcpy( pixelData, image->GetBufferPointer(), size[0]*size[1]*size[2]*sizeof(float)); ImportFilterType::SizeType sizeImport; sizeImport[0] = size[0]; // size along X sizeImport[1] = size[1]; // size along Y sizeImport[2] = size[2]; // size along Y ImportFilterType::IndexType start; start.Fill( 0 ); ImportFilterType::RegionType regionImport; regionImport.SetIndex( start ); regionImport.SetSize( sizeImport ); importFilter->SetRegion( regionImport ); const itk::SpacePrecisionType origin[ 3 ] = { 0.0, 0.0, 0.0}; importFilter->SetOrigin( origin ); const itk::SpacePrecisionType spacing[ 3 ] = { 1.0, 1.0, 1.0}; importFilter->SetSpacing( spacing ); const bool importImageFilterWillOwnTheBuffer = true; importFilter->SetImportPointer( pixelData, sizePixel, importImageFilterWillOwnTheBuffer ); importFilter->Update(); typename WriterType::Pointer writer = WriterType::New(); writer->SetFileName( outputVolume.c_str() ); writer->SetInput( importFilter->GetOutput() ); writer->SetUseCompression(1); writer->Update(); -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/image-GetBufferPointer-and-opposite-way-for-3d-images-tp7588815.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From matt.mccormick at kitware.com Thu May 5 11:17:37 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 5 May 2016 11:17:37 -0400 Subject: [ITK-users] image->GetBufferPointer() and opposite way for 3d images In-Reply-To: <1462459565166-7588815.post@n2.nabble.com> References: <1462459565166-7588815.post@n2.nabble.com> Message-ID: Hello, It looks like it may just be a change in the window / level of the visualization tool being used? HTH, Matt On Thu, May 5, 2016 at 10:46 AM, alexfd7 wrote: > Hello everyone, I have a problem, someone help me? > > > I'm getting the image buffer. So I want to do the opposite way, import the > buffer (pixelData) back to the image object, I am using importImageFilter > filter to have the original image again. 2D images works very well, however > with 3d images (.nrrd) i'm not getting good result, I get a darker resulting > image than the original. > > > I thank the attention and the available space for me to post my question > > > float* pixelData; /**< Pointer to image data */ > > > typedef float InputPixelType; > typedef float OutputPixelType; > > typedef itk::Image InputImageType; > typedef itk::Image OutputImageType; > > typedef itk::ImageFileReader ReaderType; > typedef itk::ImageFileWriter WriterType; > > typedef itk::ImportImageFilter< float, 3 > ImportFilterType; > ImportFilterType::Pointer importFilter = ImportFilterType::New(); > > typename ReaderType::Pointer reader = ReaderType::New(); > > reader->SetFileName( inputVolume.c_str() ); > > reader->Update(); > > typename InputImageType::Pointer image = reader->GetOutput(); > > typename InputImageType::RegionType region = > image->GetLargestPossibleRegion(); > > typename InputImageType::SizeType size = region.GetSize(); > > int sizePixel = (size[0]*size[1]*size[2]); > > pixelData = (float*)malloc(size[0]*size[1]*size[2] * sizeof(float)); > memcpy( pixelData, image->GetBufferPointer(), > size[0]*size[1]*size[2]*sizeof(float)); > > > ImportFilterType::SizeType sizeImport; > sizeImport[0] = size[0]; // size along X > sizeImport[1] = size[1]; // size along Y > sizeImport[2] = size[2]; // size along Y > ImportFilterType::IndexType start; > start.Fill( 0 ); > ImportFilterType::RegionType regionImport; > regionImport.SetIndex( start ); > regionImport.SetSize( sizeImport ); > > importFilter->SetRegion( regionImport ); > > > const itk::SpacePrecisionType origin[ 3 ] = { 0.0, 0.0, 0.0}; > importFilter->SetOrigin( origin ); > > const itk::SpacePrecisionType spacing[ 3 ] = { 1.0, 1.0, 1.0}; > importFilter->SetSpacing( spacing ); > > const bool importImageFilterWillOwnTheBuffer = true; > importFilter->SetImportPointer( pixelData, sizePixel, > importImageFilterWillOwnTheBuffer ); > > importFilter->Update(); > > > typename WriterType::Pointer writer = WriterType::New(); > writer->SetFileName( outputVolume.c_str() ); > writer->SetInput( importFilter->GetOutput() ); > writer->SetUseCompression(1); > writer->Update(); > > > > > > > > > > -- > View this message in context: http://itk-insight-users.2283740.n2.nabble.com/image-GetBufferPointer-and-opposite-way-for-3d-images-tp7588815.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 hans-johnson at uiowa.edu Thu May 5 11:27:39 2016 From: hans-johnson at uiowa.edu (Johnson, Hans J) Date: Thu, 5 May 2016 15:27:39 +0000 Subject: [ITK-users] Image to matrix and viceversa In-Reply-To: <441468380.25788.1462459750877.JavaMail.administrator@mjim.nabble.com> References: <441468380.25788.1462459750877.JavaMail.administrator@mjim.nabble.com> Message-ID: Javier, Please keep the conversation on the public mailing list. This does not sound like you are having ITK issues per-se, but rather issues data reformatting. Here is pseudo-code that I think would address your problem. #include #include #include itk::Array2D MakeMatrix(itk::Image,3>::Pointer image, itk::Image::Pointer mask) { if( mask->GetLargestPossibleRegion() != image->GetLargestPossibleRegion() ) { std::cerr << "ERROR regions must match" << std::endl; } itk::ImageRegionConstIteratorWithIndex > maskIt(mask,mask->GetLargestPossibleRegion()); itk::ImageRegionIteratorWithIndex,3> > imIt(image,image->GetLargestPossibleRegion()); size_t numInMaskVoxels = 0; for(maskIt.GoToBegin(); !maskIt.IsAtEnd(); ++maskIt) { if(maskIt.Value() > 0) { ++numInMaskVoxels; } } imIt.GoToBegin(); const size_t numElementsInPixel = imIt.Value().size(); itk::Array2D myMatrix(numInMaskVoxels,numElementsInPixel); size_t curr_row = 0; for(maskIt.GoToBegin(); !maskIt.IsAtEnd(); ++maskIt) { if (maskIt.Value() > 0) { const itk::Image::IndexType & index = maskIt.GetIndex(); const std::vector & refPixel = image->GetPixel(index); size_t curr_col = 0; for(std::vector::const_iterator vi = refPixel.begin(), refPixelEnd = refPixel.end(); vi != refPixelEnd; ++vi ) { myMatrix(curr_row,curr_col) = *vi; ++curr_row; ++curr_col; } } } return myMatrix; } Hans -- On 5/5/16, 9:49 AM, "javij1 at gmail.com" wrote: > >Dear Johnson, Hans > >First of all, sorry for bother you again, but I cannot solve the problem I have and you are the only one that has answered my question. Please, I would appreciatte a lot if you can help me to solve the issue. I have the following problem: > >I have an image that has the dimensions 270x270x171x34. I want to convert this image into a Matrix of size Nx34, where N is the number of voxels inside a mask of size 270x270x171. The Matrix datatype is an Eigen Matrix class. In a classic "for loop" scheme the code to get what I want is > >for (int x = 0; x < image.width(); x++) >{ > for (int y = 0; y < image.height(); y++) > { > for (int z = 0; z < image.depth(); z++) > { > if (!mask(x, y, z)) > continue; > > for (int c = 0; c < image.spectrum(); c++) > Matrix(i, c) = image(x, y, z, c); > i++; > } > } >} > > >How can I do this in ITK?? I have read several ImageRegionIterator examples, but I do not find a clean and correct way to do it. I need to walk around my image and for those pixels that are inside the mask, store their 34 values in a row of the matrix. > >Thank you very much. >Regards. > >Javier. > >_____________________________________ >Sent from http://itk-insight-users.2283740.n2.nabble.com > From alexfd7 at gmail.com Thu May 5 12:36:31 2016 From: alexfd7 at gmail.com (Alexandre Freitas Duarte) Date: Thu, 5 May 2016 13:36:31 -0300 Subject: [ITK-users] image->GetBufferPointer() and opposite way for 3d images In-Reply-To: References: <1462459565166-7588815.post@n2.nabble.com> Message-ID: I opened the original 3D image in the slicer, and then i opened the resulting image to compare. How can be a change in the window, have any idea? -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Thu May 5 12:44:52 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 5 May 2016 12:44:52 -0400 Subject: [ITK-users] image->GetBufferPointer() and opposite way for 3d images In-Reply-To: References: <1462459565166-7588815.post@n2.nabble.com> Message-ID: The Window / Level is displayed and can be adjusted in the Volumes module: https://www.slicer.org/slicerWiki/index.php/Documentation/4.5/Modules/Volumes On Thu, May 5, 2016 at 12:36 PM, Alexandre Freitas Duarte wrote: > I opened the original 3D image in the slicer, and then i opened the > resulting image to compare. How can be a change in the window, have any > idea? From aptea at mskcc.org Thu May 5 12:55:26 2016 From: aptea at mskcc.org (aptea at mskcc.org) Date: Thu, 5 May 2016 16:55:26 +0000 Subject: [ITK-users] write out intermediate results during texture calculation Message-ID: I am using the following example to generate GLCM texture images: https://itk.org/Wiki/ITK/Examples/Statistics/TextureFeatures Is there an example code to print/write out intermediate results like the discretized image, discretization levels, co-occurrence matrix? thx, Aditya ===================================================================== Please note that this e-mail and any files transmitted from Memorial Sloan Kettering Cancer Center may be privileged, confidential, and protected from disclosure under applicable law. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any reading, dissemination, distribution, copying, or other use of this communication or any of its attachments is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to this message and deleting this message, any attachments, and all copies and backups from your computer. -------------- next part -------------- An HTML attachment was scrubbed... URL: From artioml at post.bgu.ac.il Sat May 7 09:26:27 2016 From: artioml at post.bgu.ac.il (Artiom Lapshin) Date: Sat, 7 May 2016 06:26:27 -0700 (MST) Subject: [ITK-users] Vector image deformable registration In-Reply-To: References: <1460792423106-37034.post@n7.nabble.com> <1460868866870-37035.post@n7.nabble.com> Message-ID: <1462627587438-7588821.post@n2.nabble.com> Hello Matt, Thank you for the example. I have always used /itkImageRegistrationMethodv4/, but it doesn't support vector metrics. The workaround of using Optimization and Metric directly without the /itkImageRegistrationMethodv4/ does work but limit the registration features (The built in multi-resolution registration). The reason /itkImageRegistrationMethodv4/ doesn't support vector registration is the hard coded MetricTraits it assumes. Take a look at line 149 : ImageRegistrationMethodv4 It always use the default MetricTrait. I tried to add the MetricTraits to the templates that /itkImageRegistrationMethodv4/ receives, but there are conflicts with PointSetMetric. At the end I just created my own version of /itkImageRegistrationMethodv4/ and commented out any code that works with PointSet metric. Here are the source files: DeformableRegistrationArt.cxx itkArtImageRegistrationMethodv4.h itkArtImageRegistrationMethodv4.hxx Please tell me what you think. Maybe I missed something and all the changes in the code weren't necessary. If there is no other solution I can re-factor my code and create /itkVectorImageRegistrationMethodv4/. Hope this is useful, Thank you, Art. -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-users-Vector-image-deformable-registration-tp7588750p7588821.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From tevain at telecom-paristech.fr Mon May 9 05:47:35 2016 From: tevain at telecom-paristech.fr (Timothee Evain) Date: Mon, 9 May 2016 11:47:35 +0200 (CEST) Subject: [ITK-users] [ITK] 4D Image to Matrix inside mask In-Reply-To: References: <5cfb5664-dddf-c842-4d43-817c85659a9a@gmail.com> Message-ID: <1724813147.51217614.1462787255881.JavaMail.zimbra@enst.fr> Hello Javier, About the question on pixel type, both are possible, it just depends on how you see it. But since it is for a temporal evolution of MRI image I would choose a 4D image. A 3D vector image is used to represent thing like displacement field or gradient of 3D images. One way to do it is to iterate over your mask image and get the value where the spatial coordinates match your perfusion image: itk::ImageRegionConstIteratorWithIndex> MyIterator(MaskImage,MaskImage->GetLargestPossibleRegion()); MyIterator.GoToBegin(); std::vector> MyMatrix(N);//N number of ON pixels of the mask for(int NbPix=0;NbPix tmp_vect(34); MyMatrix.pushback(tmp_vect); } int count=0; while(!MyIterator.IsAtEnd()) { if (MyIterator.Get()==1)//Mask Pixel is ON { itk::Index<3> SpatialIndex=MyIterator.GetIndex(); for (int i=0;i<34;i++) { itk::Index<4> FullIndex; FullIndex[0]=SpatialIndex[0]; FullIndex[1]=SpatialIndex[1]; FullIndex[2]=SpatialIndex[2]; FullIndex[3]=i; MyMatrix[count][i]=PerfusionImage->GetPixel(FullIndex); } count++; } ++MyIterator; } I've taken std::vector to do the matrix here, but you could change for the eigen matrix pretty easily if I remember well. HTH, Tim ----- Mail original ----- De: "Javier Juan Albarrac?n" ?: insight-users at itk.org Envoy?: Jeudi 5 Mai 2016 11:48:24 Objet: [ITK] [ITK-users] 4D Image to Matrix inside mask Hello, I have a 4D image, which is a DSC Perfusion weighted MRI. Supose the image has the dimenisions 270x270x171x34. I want to convert this image into a Matrix of size Nx34, where N are the number of voxels inside the intracraneal mask. The Matrix class comes from Eigen library. In a classic "for loop" scheme the code would be for (int x = 0; x < image.width(); x++) { for (int y = 0; y < image.height(); y++) { for (int z = 0; z < image.depth(); z++) { if (!mask(x, y, z)) continue; for (int c = 0; c < image.spectrum(); c++) Matrix(i, c) = image(x, y, z, c); i++; } } } How can I do this in ITK?? I have read several ImageRegionIterator examples, but I do not find a clean and correct way to do what I want. Thank you very much. Regards. Javier. _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 grothausmann.roman at mh-hannover.de Mon May 9 10:21:14 2016 From: grothausmann.roman at mh-hannover.de (Grothausmann, Roman Dr.) Date: Mon, 9 May 2016 16:21:14 +0200 Subject: [ITK-users] reading images of vectors with variable length in addition to scalar, RGB, RGBA (itkVectorGradientMagnitudeImageFilter) Message-ID: <57309CDA.6010108@mh-hannover.de> Dear mailing list members, Based on Bill's feedback I created a template.cxx (https://github.com/romangrothausmann/ITK-CLIs/blob/master/template.cxx) that I just extend according to some ITK-filters when needed. In general it works well for images of varying dimension and for scalar, often even for RGB and RGBA types. However, now I'm in the need to apply itkVectorGradientMagnitudeImageFilter to images of vectors with lengths 2 to 5 for which my approach with VariableLengthVector does not work. gradient_mag_vec.cxx (https://github.com/romangrothausmann/ITK-CLIs/blob/master/gradient_mag_vec.cxx) is based on template.cxx (diff: https://github.com/romangrothausmann/ITK-CLIs/commit/544345b259adce2ef903183553a1aa97648e85b8) with dim= 1 and scalar removed (because not supported by itkVectorGradientMagnitudeImageFilter). gradient_mag_vec.cxx compiles fine if complex and vector are commented out but for e.g. RGB yields outputs where the last DimSize is 3* the input DimSize. Including vector compilation aborts with complains like: itkVectorGradientMagnitudeImageFilter.h:184:62: error: ?Dimension? is not a member of ?itk::Image, 3u>::PixelType {aka itk::VariableLengthVector}? typedef typename ConstNeighborhoodIteratorType::RadiusType RadiusType; What would I have to change to make this work for images composed of vectors with e.g. 2 to 5 elements? Would that also solve the incorrect output for RGB/RGBA? Is there any elegant way to circumvent using GetNumberOfComponentsPerPixel to instantiate another template level in case a vector image is detected? Many thanks for any help or hints. Roman -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-2900 From krismz at sci.utah.edu Mon May 9 16:18:40 2016 From: krismz at sci.utah.edu (Kristen Zygmunt) Date: Mon, 9 May 2016 14:18:40 -0600 Subject: [ITK-users] reading images of vectors with variable length in addition to scalar, RGB, RGBA (itkVectorGradientMagnitudeImageFilter) In-Reply-To: References: Message-ID: <18B5E78A-B0BB-4B93-B2A1-584A747344D1@sci.utah.edu> Hi Roman, You can also take a look at the Patch Based Denoising Filter that was designed to work with both VectorImage and Image types. For example, the DispatchedMinMax and DispatchedArrayMinMax methods in Modules/Filtering/Denoising/itkPatchBasedDenoisingImageFilter.hxx are instantiated appropriately to use the NthElementImageAdaptor as necessary to aid in calling filters for certain image types. You should be also able to uncomment the VectorImage examples in itkPatchBasedDenoisingImageFilterTest.cxx as they will compile now. -Kris > Date: Mon, 9 May 2016 16:21:14 +0200 > From: "Grothausmann, Roman Dr." > To: ITK Mailing List > Subject: [ITK-users] reading images of vectors with variable length in > addition to scalar, RGB, RGBA (itkVectorGradientMagnitudeImageFilter) > Message-ID: <57309CDA.6010108 at mh-hannover.de> > Content-Type: text/plain; charset=utf-8; format=flowed > > Dear mailing list members, > > > Based on Bill's feedback I created a template.cxx > (https://github.com/romangrothausmann/ITK-CLIs/blob/master/template.cxx) that I > just extend according to some ITK-filters when needed. In general it works well > for images of varying dimension and for scalar, often even for RGB and RGBA types. > However, now I'm in the need to apply itkVectorGradientMagnitudeImageFilter to > images of vectors with lengths 2 to 5 for which my approach with > VariableLengthVector does not work. > > gradient_mag_vec.cxx > (https://github.com/romangrothausmann/ITK-CLIs/blob/master/gradient_mag_vec.cxx) > is based on template.cxx (diff: > https://github.com/romangrothausmann/ITK-CLIs/commit/544345b259adce2ef903183553a1aa97648e85b8) > > with dim= 1 and scalar removed (because not supported by > itkVectorGradientMagnitudeImageFilter). > gradient_mag_vec.cxx compiles fine if complex and vector are commented out but > for e.g. RGB yields outputs where the last DimSize is 3* the input DimSize. > > Including vector compilation aborts with complains like: > > itkVectorGradientMagnitudeImageFilter.h:184:62: error: ?Dimension? is not a > member of ?itk::Image, 3u>::PixelType {aka > itk::VariableLengthVector}? > typedef typename ConstNeighborhoodIteratorType::RadiusType RadiusType; > > What would I have to change to make this work for images composed of vectors > with e.g. 2 to 5 elements? > Would that also solve the incorrect output for RGB/RGBA? > Is there any elegant way to circumvent using GetNumberOfComponentsPerPixel to > instantiate another template level in case a vector image is detected? > > Many thanks for any help or hints. > Roman > > -- > Dr. Roman Grothausmann > > Tomographie und Digitale Bildverarbeitung > Tomography and Digital Image Analysis > > Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 > Medizinische Hochschule Hannover > Carl-Neuberg-Str. 1 > D-30625 Hannover > > Tel. +49 511 532-2900 > > From zhuangming.shen at sphic.org.cn Mon May 9 20:45:10 2016 From: zhuangming.shen at sphic.org.cn (=?utf-8?B?5rKI5bqE5piO?=) Date: Tue, 10 May 2016 00:45:10 +0000 Subject: [ITK-users] Strange situation when ITK writes DICOM file In-Reply-To: References: <1450834862664.8600@sphic.org.cn> <1461914235636.15330@sphic.org.cn> <1462243202460.83843@sphic.org.cn>, Message-ID: <1462841109770.29758@sphic.org.cn> Hi Matt, Thank you for your reply. I have tried to use ITK Git master and the code provided by D?enan, it can work correctly. Thanks again. By the way, could you list what data types (e.g. char type) do the updated GDCM support now? Regards, Zhuangming Shen ________________________________________ From: Matt McCormick Sent: Thursday, May 5, 2016 10:21 PM To: ??? Cc: D?enan Zuki?; insight-users at itk.org Subject: Re: [ITK-users] Strange situation when ITK writes DICOM file Hi Zhuangming Shen, GDCM was updated in ITK Git master, to be released in ITK 4.10. Instructions on how to obtain this version can be found here: https://itk.org/Wiki/ITK/Git/Download Thanks, Matt On Mon, May 2, 2016 at 10:40 PM, ??? wrote: > Hi D?enan, > > > Thanks for your prompt response. I used ITK 4.9.1 and your attached code > (just changed inDir and outFile) to test both public DICOM data > (http://www.osirix-viewer.com/datasets/DATA/BREBIX.zip) and private DICOM > data, the results are still incorrect (please see the attached screenshot). > What's the problem? > > > Besides, as far as I know, rescaling the intensity from short type to char > type leads to lose precision because the DICOM tags ( (0028,0100) and > (0028,0101) ) show the BitsAllocated is 16-bits and the BitsStored is > 12-bits. Consequently, this solution doesn't seem to be a good solution. Is > it possible to output the DICOM file by other tools (e.g. DCMTK) if the GDCM > doesn't support short type? > > > > Regards, > > > Zhuangming Shen > > > > > ________________________________ > From: D?enan Zuki? > Sent: Friday, April 29, 2016 9:59 PM > To: ??? > Cc: insight-users at itk.org; Matt McCormick > > Subject: Re: [ITK-users] Strange situation when ITK writes DICOM file > > Hi Shen, > > GDCM version was updated recently. It now complains that short type is > unsupported, and works correctly with char type. I attached an example which > rescales the intensity and works correctly. > > Regards, > D?enan > > On Fri, Apr 29, 2016 at 3:17 AM, ??? wrote: >> >> Hi D?enan, >> >> >> I'd like to know if the bug regarding 3D DICOM writer has been fixed. When >> I tried to run the same code but using ITK 4.9.1, I still got the same >> results, i.e. the output DICOM file does not properly record original >> image's origin and spacing. >> >> >> >> Regards, >> >> >> Zhuangming Shen >> >> ________________________________ >> From: D?enan Zuki? >> Sent: Saturday, December 26, 2015 1:44 AM >> To: ??? >> Cc: insight-users at itk.org >> Subject: Re: [ITK-users] Strange situation when ITK writes DICOM file >> >> I have confirmed this bug and entered it into tracker along with a DICOM >> series which reproduces it. >> >> Thanks Shen >> >> On Tue, Dec 22, 2015 at 8:41 PM, ??? wrote: >>> >>> Hi all, >>> >>> >>> I met a very strange situation when I used ITK 4.8.1. I'd like to read a >>> DICOM series, write it to a DICOM file (i.e. save the volume created by the >>> DICOM series to a .dcm file), and read the DICOM file. Theoretically, the >>> DICOM series and the DCM file should have the same information, e.g origin, >>> spacing, size. However, My results show me that the information has been >>> changed. When I use other ITK-support file format (e.g. nii, nrrd), the >>> information has not been changed. It seems a bug. My code and results are >>> listed as below. Has anyone met the same situation? >>> >>> >>> Regards, >>> >>> >>> Zhuangming Shen >>> >>> >>> >>> >>> ================ My code ================= >>> >>> >>> import itk >>> >>> input_dir = "/home/zshen/workspace/Data/testDCM/bbb" >>> output_filename = "/home/zshen/workspace/Data/bbb2.dcm" >>> >>> # read DICOM series >>> dicom_io = itk.GDCMImageIO.New() >>> >>> reader = itk.ImageSeriesReader[itk.Image.SS3].New() >>> reader.SetImageIO(dicom_io) >>> >>> name_generator = itk.GDCMSeriesFileNames.New() >>> name_generator.SetUseSeriesDetails(True) >>> name_generator.SetDirectory(input_dir) >>> >>> series_uid = name_generator.GetSeriesUIDs() >>> >>> series_identifier = series_uid[0] >>> >>> file_names = name_generator.GetFileNames(series_identifier) >>> >>> reader.SetFileNames(file_names) >>> reader.Update() >>> >>> print("**** series DICOM information: *****") >>> print("size: >>> "+str(reader.GetOutput().GetLargestPossibleRegion().GetSize())) >>> print("origin: "+str(reader.GetOutput().GetOrigin())) >>> print("spacing: "+str(reader.GetOutput().GetSpacing())) >>> >>> writer = itk.ImageFileWriter[itk.Image.SS3].New() >>> writer.SetInput(reader.GetOutput()) >>> writer.SetFileName(output_filename) >>> writer.Update() >>> >>> # read again >>> reader2 = itk.ImageFileReader[itk.Image.SS3].New() >>> reader2.SetFileName(output_filename) >>> reader2.Update() >>> >>> print("**** DICOM information: *****") >>> print("size: >>> "+str(reader2.GetOutput().GetLargestPossibleRegion().GetSize())) >>> print("origin: "+str(reader2.GetOutput().GetOrigin())) >>> print("spacing: "+str(reader2.GetOutput().GetSpacing())) >>> >>> >>> ================= My results ==================== >>> >>> **** series DICOM information: ***** >>> size: itkSize3 ([512, 512, 118]) >>> origin: itkPointD3 ([-229.5, -96.5, -553]) >>> spacing: itkVectorD3 ([0.896484, 0.896484, 3]) >>> **** DICOM information: ***** >>> size: itkSize3 ([512, 512, 118]) >>> origin: itkPointD3 ([0, 0, 0]) >>> spacing: itkVectorD3 ([0.896484, 0.896484, 1]) >>> >>> >>> >>> >>> _____________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://www.kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the ITK FAQ at: >>> http://www.itk.org/Wiki/ITK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/insight-users >>> >> > From grothausmann.roman at mh-hannover.de Tue May 10 05:17:37 2016 From: grothausmann.roman at mh-hannover.de (Grothausmann, Roman Dr.) Date: Tue, 10 May 2016 11:17:37 +0200 Subject: [ITK-users] reading images of vectors with variable length in addition to scalar, RGB, RGBA (itkVectorGradientMagnitudeImageFilter) In-Reply-To: <18B5E78A-B0BB-4B93-B2A1-584A747344D1@sci.utah.edu> References: <18B5E78A-B0BB-4B93-B2A1-584A747344D1@sci.utah.edu> Message-ID: <5731A731.6070505@mh-hannover.de> Hi Kris, Many thanks for Your quick reply. Looking at itkPatchBasedDenoisingImageFilter.hxx and according to itkPatchBasedDenoisingImageFilterTest.cxx I exchanged itkImage of VariableLengthVector with itkVectorImage (https://github.com/romangrothausmann/ITK-CLIs/commit/87281e2bad89e1d1d3303ac6605b3c43963026d3) but the error stays the same. I think my problem arises from VectorGradientMagnitudeImageFilter not being able to cope with VariableLengthVector which is also used by VectorImage. So I guess I would either have to modify VectorGradientMagnitudeImageFilter to handle VariableLengthVector or create itkImage of Vector using another template level to set fixed NumberOfComponentsPerPixel as needed. What does it depend on whether a Filter can handle VariableLengthVector or just Vector? Many thanks for Your help. Roman On 09/05/16 22:18, Kristen Zygmunt wrote: > Hi Roman, You can also take a look at the Patch Based Denoising Filter that > was designed to work with both VectorImage and Image types. For example, the > DispatchedMinMax and DispatchedArrayMinMax methods in > Modules/Filtering/Denoising/itkPatchBasedDenoisingImageFilter.hxx are > instantiated appropriately to use the NthElementImageAdaptor as necessary to > aid in calling filters for certain image types. You should be also able to > uncomment the VectorImage examples in > itkPatchBasedDenoisingImageFilterTest.cxx as they will compile now. > > -Kris > >> Date: Mon, 9 May 2016 16:21:14 +0200 From: "Grothausmann, Roman Dr." >> To: ITK Mailing List >> Subject: [ITK-users] reading images of vectors with >> variable length in addition to scalar, RGB, RGBA >> (itkVectorGradientMagnitudeImageFilter) Message-ID: >> <57309CDA.6010108 at mh-hannover.de> Content-Type: text/plain; charset=utf-8; >> format=flowed >> >> Dear mailing list members, >> >> >> Based on Bill's feedback I created a template.cxx >> (https://github.com/romangrothausmann/ITK-CLIs/blob/master/template.cxx) >> that I just extend according to some ITK-filters when needed. In general it >> works well for images of varying dimension and for scalar, often even for >> RGB and RGBA types. However, now I'm in the need to apply >> itkVectorGradientMagnitudeImageFilter to images of vectors with lengths 2 >> to 5 for which my approach with VariableLengthVector does not work. >> >> gradient_mag_vec.cxx >> (https://github.com/romangrothausmann/ITK-CLIs/blob/master/gradient_mag_vec.cxx) >> >> is based on template.cxx (diff: >> https://github.com/romangrothausmann/ITK-CLIs/commit/544345b259adce2ef903183553a1aa97648e85b8) >> >> >> with dim= 1 and scalar removed (because not supported by >> itkVectorGradientMagnitudeImageFilter). gradient_mag_vec.cxx compiles fine >> if complex and vector are commented out but for e.g. RGB yields outputs >> where the last DimSize is 3* the input DimSize. >> >> Including vector compilation aborts with complains like: >> >> itkVectorGradientMagnitudeImageFilter.h:184:62: error: ?Dimension? is not >> a member of ?itk::Image, 3u>::PixelType >> {aka itk::VariableLengthVector}? typedef typename >> ConstNeighborhoodIteratorType::RadiusType RadiusType; >> >> What would I have to change to make this work for images composed of >> vectors with e.g. 2 to 5 elements? Would that also solve the incorrect >> output for RGB/RGBA? Is there any elegant way to circumvent using >> GetNumberOfComponentsPerPixel to instantiate another template level in case >> a vector image is detected? >> >> Many thanks for any help or hints. Roman >> >> -- Dr. Roman Grothausmann >> >> Tomographie und Digitale Bildverarbeitung Tomography and Digital Image >> Analysis >> >> Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische >> Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover >> >> Tel. +49 511 532-2900 >> >> > -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-2900 From grothausmann.roman at mh-hannover.de Tue May 10 08:27:04 2016 From: grothausmann.roman at mh-hannover.de (Grothausmann, Roman Dr.) Date: Tue, 10 May 2016 14:27:04 +0200 Subject: [ITK-users] reading images of vectors with variable length in addition to scalar, RGB, RGBA (itkVectorGradientMagnitudeImageFilter) In-Reply-To: <57309CDA.6010108@mh-hannover.de> References: <57309CDA.6010108@mh-hannover.de> Message-ID: <5731D398.3080000@mh-hannover.de> Got it working with Kris' help, adding another template level to set fixed NumberOfComponentsPerPixel, which is needed because VectorGradientMagnitudeImageFilter cannot handle VariableLengthVector (which is also used by VectorImage): https://github.com/romangrothausmann/ITK-CLIs/commit/75bf503a923b408e7b9a229d123b797c3765dc85 On 09/05/16 16:21, Grothausmann, Roman Dr. wrote: > Dear mailing list members, > > > Based on Bill's feedback I created a template.cxx > (https://github.com/romangrothausmann/ITK-CLIs/blob/master/template.cxx) that I > just extend according to some ITK-filters when needed. In general it works well > for images of varying dimension and for scalar, often even for RGB and RGBA types. > However, now I'm in the need to apply itkVectorGradientMagnitudeImageFilter to > images of vectors with lengths 2 to 5 for which my approach with > VariableLengthVector does not work. > > gradient_mag_vec.cxx > (https://github.com/romangrothausmann/ITK-CLIs/blob/master/gradient_mag_vec.cxx) > is based on template.cxx (diff: > https://github.com/romangrothausmann/ITK-CLIs/commit/544345b259adce2ef903183553a1aa97648e85b8) > > with dim= 1 and scalar removed (because not supported by > itkVectorGradientMagnitudeImageFilter). > gradient_mag_vec.cxx compiles fine if complex and vector are commented out but > for e.g. RGB yields outputs where the last DimSize is 3* the input DimSize. > > Including vector compilation aborts with complains like: > > itkVectorGradientMagnitudeImageFilter.h:184:62: error: ?Dimension? is not a > member of ?itk::Image, 3u>::PixelType {aka > itk::VariableLengthVector}? > typedef typename ConstNeighborhoodIteratorType::RadiusType RadiusType; > > What would I have to change to make this work for images composed of vectors > with e.g. 2 to 5 elements? > Would that also solve the incorrect output for RGB/RGBA? > Is there any elegant way to circumvent using GetNumberOfComponentsPerPixel to > instantiate another template level in case a vector image is detected? > > Many thanks for any help or hints. > Roman > -- Dr. Roman Grothausmann Tomographie und Digitale Bildverarbeitung Tomography and Digital Image Analysis Institut f?r Funktionelle und Angewandte Anatomie, OE 4120 Medizinische Hochschule Hannover Carl-Neuberg-Str. 1 D-30625 Hannover Tel. +49 511 532-2900 From Aude.CHENET-ext at galderma.com Tue May 10 10:19:55 2016 From: Aude.CHENET-ext at galderma.com (CHENET Aude (External)) Date: Tue, 10 May 2016 14:19:55 +0000 Subject: [ITK-users] Using Requested Regions with Filter Message-ID: <512AA6AA7E7E224A874888677C6CB2FB587011@WWEURMBX03.galderma.com> Hello, I'm using ITK (with Python wrapping) and I'd like to work only on a part of an image (because of memory problems) I've declared the requestedRegion for the output of my filter, but still have the memory problem. Do I have to declare something else to the filter? Here is my code : pixelType = itk.SS imageType = itk.Image[pixelType,3] readerType = itk.ImageFileReader[imageType] reader = readerType.New() reader.SetFileName('resamp.tif') imageResamp = reader.GetOutput() idx = itk.Index[3]() idx[1]=80 s = itk.Size[3]() s[0]=1354 s[1]=20 s[2]=1440 region = itk.ImageRegion[3]() region.SetIndex(idx) region.SetSize(s) imageResamp.SetBufferedRegion(region) imageResamp.SetRequestedRegion(region) h = itk.HessianRecursiveGaussianImageFilter[imageType].New() h2v = itk.Hessian3DToVesselnessMeasureImageFilter[itk.SS].New() h2v.SetInput(h.GetOutput()) h.SetInput(imageResamp) h2v.GetOutput().SetRequestedRegion(region) h2v.GetOutput().UpdateOutputInformation() h2v.GetOutput().PropagateRequestedRegion() h2v.Update() Thanks for your help. Aude -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Tue May 10 13:59:33 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 10 May 2016 13:59:33 -0400 Subject: [ITK-users] Using Requested Regions with Filter In-Reply-To: <512AA6AA7E7E224A874888677C6CB2FB587011@WWEURMBX03.galderma.com> References: <512AA6AA7E7E224A874888677C6CB2FB587011@WWEURMBX03.galderma.com> Message-ID: Hi Aude, The itk::HessianRecursiveGaussianImageFilter does not currently support streaming: https://github.com/InsightSoftwareConsortium/ITK/blob/4944f06ca0d25d6fd23b7cef3c3da730ac26ff8f/Modules/Filtering/ImageFeature/include/itkHessianRecursiveGaussianImageFilter.hxx#L137-L154 so the pipeline will not stream. Some options: - Use an itk::RegionOfInterestImageFilter on the reader output. - Implement a Hessian image filter that is capable of streaming. The itkDiscreteHessianGaussianImageFunction.{h,hxx} in the ITK Review module may be useful. HTH, Matt On Tue, May 10, 2016 at 10:19 AM, CHENET Aude (External) wrote: > Hello, > > > > I?m using ITK (with Python wrapping) and I?d like to work only on a part of > an image (because of memory problems) > > I?ve declared the requestedRegion for the output of my filter, but still > have the memory problem. > > Do I have to declare something else to the filter? > > > > Here is my code : > > pixelType = itk.SS > > imageType = itk.Image[pixelType,3] > > readerType = itk.ImageFileReader[imageType] > > reader = readerType.New() > > reader.SetFileName('resamp.tif') > > > > imageResamp = reader.GetOutput() > > > > idx = itk.Index[3]() > > idx[1]=80 > > s = itk.Size[3]() > > s[0]=1354 > > s[1]=20 > > s[2]=1440 > > region = itk.ImageRegion[3]() > > region.SetIndex(idx) > > region.SetSize(s) > > > > imageResamp.SetBufferedRegion(region) > > imageResamp.SetRequestedRegion(region) > > > > h = itk.HessianRecursiveGaussianImageFilter[imageType].New() > > h2v = itk.Hessian3DToVesselnessMeasureImageFilter[itk.SS].New() > > h2v.SetInput(h.GetOutput()) > > > > h.SetInput(imageResamp) > > h2v.GetOutput().SetRequestedRegion(region) > > h2v.GetOutput().UpdateOutputInformation() > > h2v.GetOutput().PropagateRequestedRegion() > > > > h2v.Update() > > > > > > Thanks for your help. > > > > Aude > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 sami.koho at gmail.com Wed May 11 06:18:51 2016 From: sami.koho at gmail.com (Sami Koho) Date: Wed, 11 May 2016 13:18:51 +0300 Subject: [ITK-users] SimpleITK - Transform construction Message-ID: <2499BF08-25FD-44E2-AC94-ED8F1AEBA2FF@gmail.com> Hi, I am planning to save SimpleITK spatial transforms into a HDF5 file, as image attributes. I have divided the transform into three arguments: 1. params = transform.GetParameters() 2. fixed_params = transform.GetFixedParameters() 3. transform_type = an integer based on the TransformEnum I tried to rebuild the transform from those parameters using the constructor: > itk::simple::Transform::Transform (unsigned int dimensions, TransformEnum type) and then setting the fixed and moving parameters. This appears to work fine. There are a couple of small problems however: 1. In the itk::simple::Transform Class Reference it is written that the said constructor is Deprecated. What would be the up-to-date method for constructing a specific Transform? 2. Is there a way of extracting the type of a Transform from an existing spatial transform? I tried transform.GetName() and type(transform).__name__, but both produce ?Transform?, instead of the specific transform Name. Best, Sami -------------- next part -------------- An HTML attachment was scrubbed... URL: From dzenanz at gmail.com Wed May 11 08:56:23 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Wed, 11 May 2016 08:56:23 -0400 Subject: [ITK-users] Itk Volume From Slices In-Reply-To: <1462266832069-7588801.post@n2.nabble.com> References: <1462266832069-7588801.post@n2.nabble.com> Message-ID: Have you tried running you application under debugger? Where in code does it crash, and what is the error/exception? Regards, D?enan On Tue, May 3, 2016 at 5:13 AM, abenchaaben wrote: > Hi, > > I'm using the volume from slices ITK example to build a volume from 2d RGB > png files. I want to know if they a condition on the numbers of images that > i should pass to the seriesReader class. Because my applicvation just crash > when i put many image to the class. > > Regards. > > > > -- > View this message in context: > http://itk-insight-users.2283740.n2.nabble.com/Itk-Volume-From-Slices-tp7588801.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 blowekamp at mail.nih.gov Wed May 11 09:24:11 2016 From: blowekamp at mail.nih.gov (Lowekamp, Bradley (NIH/NLM/LHC) [C]) Date: Wed, 11 May 2016 13:24:11 +0000 Subject: [ITK-users] SimpleITK - Transform construction In-Reply-To: <2499BF08-25FD-44E2-AC94-ED8F1AEBA2FF@gmail.com> References: <2499BF08-25FD-44E2-AC94-ED8F1AEBA2FF@gmail.com> Message-ID: <2BD27E3C-AEF1-44A1-A09F-CAA7F081BB9F@mail.nih.gov> Hello, ITK Transform IO already have an HDF5 format for serialization. Is there a way you can reuse this code? Perhaps using some type of HDF5 utility to merge two files? More answers inline: > > 1. In the itk::simple::Transform Class Reference it is written that the said constructor is Deprecated. What would be the up-to-date method for constructing a specific Transform? There was a lot of negative feedback with this method and the base sitk::Transform interface, because it presented all transforms as the same. So the transform specific classes derived from this class are the recommended interface to use. Also you can not create a displacement field with this method. It would be recommended to handle the construction of each transform separately. > > 2. Is there a way of extracting the type of a Transform from an existing spatial transform? I tried transform.GetName() and type(transform).__name__, but both produce ?Transform?, instead of the specific transform Name. There should be a method to at least get the TransformEnum, but there are several cases where the underlying transform may be unknown. I?ll add that right away. There is also the ToString method which will print the underlying ITK transform. HTH, Brad > > Best, > > Sami > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users From matimontg at gmail.com Thu May 12 09:56:36 2016 From: matimontg at gmail.com (Matias Montroull) Date: Thu, 12 May 2016 13:56:36 +0000 Subject: [ITK-users] Windows Levels after write Message-ID: Hi, I've written code to flip an image in its X axis, it work fine but for some reason, the flipped image has its window levels changed... Original image has WW 40 and WC 400 and the resulting image has WW -435 and WC 5178. *The images I'm trying are signed short Dicom files.* The original file has rescaleintercept -1024 and the resulting image has this value set to 0 which is also strange Any reason why this happens? Here's the code: #include "itkImage.h" #include "itkImageFileReader.h" #include "itkImageFileWriter.h" #include "itkFlipImageFilter.h" int main(int argc, char* argv[]) { if (argc != 4) { std::cerr << "Usage: " << argv[0]; std::cerr << " "; std::cerr << std::endl; return EXIT_FAILURE; } typedef itk::Image< signed short, 2 > ImageType; typedef itk::ImageFileReader< ImageType > ReaderType; ReaderType::Pointer reader = ReaderType::New(); reader->SetFileName(argv[1]); typedef itk::FlipImageFilter< ImageType > FlipImageFilterType; FlipImageFilterType::Pointer flipFilter = FlipImageFilterType::New(); flipFilter->SetInput(reader->GetOutput()); FlipImageFilterType::FlipAxesArrayType flipAxes; if (atoi(argv[3]) == 0) { flipAxes[0] = true; flipAxes[1] = false; } else { flipAxes[0] = false; flipAxes[1] = true; } flipFilter->SetFlipAxes(flipAxes); typedef itk::ImageFileWriter< ImageType > WriterType; WriterType::Pointer writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(flipFilter->GetOutput()); try { writer->Update(); } catch (itk::ExceptionObject & error) { std::cerr << "Error: " << error << std::endl; return EXIT_FAILURE; } return EXIT_SUCCESS; } -- Matias -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Thu May 12 14:53:22 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 12 May 2016 14:53:22 -0400 Subject: [ITK-users] [ANN] ITK 4.10 Release Candidate 1 is ready for testing! Message-ID: On behalf of the Insight Toolkit community, we are proud to announce that ITK 4.10 release candidate 1 has been tagged and is available for testing! Please take this opportunity to test the new features in the release candidate. To obtain the source code, git clone http://itk.org/ITK.git cd ITK git checkout -q --detach v4.10rc01 For more details, please see the Git documentation [1]. A few selected highlights for this release: - New Remote module: TwoProjectionRegistration performs simultaneous registration of two projection images to a 3D image volume, which is useful for external beam radiotherapy and other applications. It uses Powell?s method for optimization and the Siddon-Jacobs fast ray-tracing algorithm. - First update to internal VNL in five years. Many improvements were made to upstream VNL. We now push patches upstream and stay in sync via a Git subtree workflow. - Windows builds now support processing 4GB+ images by default - GDCM updated for better DICOM support Additionally, in the Python wrapping, type specification is no longer necessary during the creation of most filters. The required type is inferred from a primary input passed on filter creation. For example, instead of the explicit type specification: median = itk.MedianImageFilter[ImageType, ImageType].New() median.SetInput(reader.GetOutput()) It is now possible to call: median = itk.MedianImageFilter.New(Input=reader.GetOutput()) Or, the shortened: median = itk.MedianImageFilter.New(reader.GetOutput()) Or: median = itk.MedianImageFliter.New(reader) An itk.ImageFileReader can be created by specifying the FileName during instantiation: reader = itk.ImageFileReader.New(FileName=?inputFile.mha?) Please test the release candidate and share your experiences on the mailing list, issue tracker, and Gerrit Code Review. An Experimental build, which demonstrates how the test suite performs on your local build system, can be submitted to the dashboard [2] with: mkdir ../ITK-build cd ../ITK-build cmake ../ITK ctest -j 4 -M Experimental -T Configure -T Build -T Test -T Submit Visual Studio builds must also add ?-C Release? to the ctest command. Notify the mailing list if there are any unexpected failures. Testing your own applications against the RC is also appreciated. Congratulations and well done to the 26 contributors to this release. We would especially like to recognize the new contributors: Andrey Fedorov, Sujin Philip, Francois Budin, and b'Alvaro Sanchez. The 4.10.0 final release is scheduled for the end of May. [1] http://www.itk.org/Wiki/ITK/Git [2] http://open.cdash.org/index.php?project=Insight New Features --------------------- * Wrapping improvements - ITK_USE_64BITS_IDS supported on Windows - Faster builds (CastXML calls and build targets reduced by half) - Faster runtime loading and smaller binary size due to hidden symbol visibility - Wrapping with BUILD_SHARED_LIBS disabled is supported - Do not link to libpython when possible - Filter types do not need to be specified when ?Input=inputImage? is specified in the constructor - Improved wrapping class coverage - Visual Studio 2015 Update 2 Supported * New Remote Module - TwoProjectionRegistration - 2D-3D registration designed for radiotherapy - http://hdl.handle.net/10380/3245 * Core Improvements - Data and build tool downloads now over HTTPS - Extended constexpr usage with ITK_CONSTEXPR and ITKCONSTEXPR_FUNC macros - ITK_USE_64BITS_IDS, required to process 4GB+ images on Windows, now enabled by default - VNL updated and modernized - CMake configuration major modernization - vcl has been removed in favor of the standard libraries - vnl_math_ function avoided in favor of std:: and itk::Math - VNL had suppressed integer data conversion warnings on Visual Studio (C4257); this suppression has been removed and all warnings addressed - Various improvements for building a module externally against an ITK build tree - CMAKE_POSITION_INDEPENDENT_CODE is enabled by default - Improved EXERCISE_BASIC_OBJECT_METHODS testing macro * Filtering Improvements - RGB pixel support added to itk::ImageToVTKImageFilter - itk::Box* filters moved out of the Review module - itk::GaussianDerivativeOperator moved out of the Review module - MaskLabel is deprecated in N4BiasFieldCorrectionFilter in favor any non-zero pixel * Registration Improvements - Fixed and moving masks added to the v4 registration methods * Documentation Improvements - Updates to the Software Guide, Doxygen, Wiki and Sphinx Examples * Third Party Library Updates - pygccxml updated to v1.7.3 - GDCM updated to the release branch latest - VNL updated to latest upstream - MINC updated to the latest upstream - SWIG updated to v3.0.8 - PCRE update to v8.38 * Improved code coverage -- we are at 85.0%! * *Lots* of important bug fixes * And much more! See details in the log below. Changes from v4.9.0..v4.10rc01 ------------------------------------------------ Alvaro Sanchez (1): STYLE: moved itkKappaSigmaThresholdImageFilter/Calculator from Nonunit/Review Andrey Fedorov (2): BUG: Add missing itk_expat_mangle.h install target BUG: fix typo in file name Bill Hoffman (2): COMP: fix shared build on Windows when Review is on. COMP: work around for VS 2015 optimizer bug causing test failures. Bill Lorensen (6): ENH: Bump version for style fixups. ENH: Bump wiki examples version, new remote module process ENH: Bump wiki examples version, new remote module process STYLE: SuperClass should be Superclass COMP: Resolve clang linkage issue BUG: Valgrind detected an invalid read Bradley Lowekamp (21): BUG: Compilation problem with GCC 4.1 and explicit instantiation ENH: Update Insight Journal handle links to https ENH: Adding const qualifier to results BUG: Adding missing const qualifier for GetConfusionMatrix method BUG: Use Set/GetMacros, fix const correctness and PrintSelf. ENH: added inlined Zero and one values for integer NumericTraits ENH: Use constexpr for floating point NumericTraits ENH: Make NumericTraits functions constexpr for intrinsic BUG: Add definition of static constexpr NumericTrait members BUG: Declared static constexpr members need to be defined as constexpr ENH: ITK_CONSTEXPR_FUNC implies inline BUG: Addressing VS10 and VS11 NumericTraits linkage issue BUG: Use LargestPossible region for BSpline domain BUG: Remove errant file COMP: Address warning about this usage in initializer list ENH: Prefer ZeroValue function over variable STYLE: Use consistent path for try_compiles binary directory BUG: Don't use "=" in cmake variable name ENH: Test address of NumericTraits One and Zero constexpr ENH: Use ITK_USE_64BITS_IDS for windows 64 by default ENH: Enable run-time dependency on Python library Davis Vigneault (4): ENH: Update itkFileTools to allow std::string arguments. ENH: Add Floored and Truncated Modulus to VNL ENH: Add Ternary Operator Image Filter STYLE: Prefer static cast D?enan Zuki? (1): ENH: CovariantVector's Normalize returns the norm. Francois Budin (6): PERF: Simplify itkTemplate New() input type identification. ENH: Avoid template type specification for image reader in Python wrapping BUG: Missing IOPixelType strings in ImageIOBase BUG: Wrapping intermediate files were not automatically updated ENH: Reduce number of dependencies for XML files generated for wrapping BUG: GCC is limited when calling overloaded base class functions GCC-XML Upstream (1): ENH: pygccxml v1.7.3 (reduced) GDCM Upstream (1): GDCM 2015-09-02 (1efe9e28) Hans Johnson (27): COMP: Static analysis warning COMP: Incorrect delete found by static analysis PERF: Avoid temporary std:vector copying. COMP: Provide VXL backward compatible includes COMP: ITK requires legacy methods ENH: Need propagate ITK_LIBRARY_PROPERTIES ENH: Added UpdateFromUpstream.sh for VNL ENH: Manual copy from vxl/master STYLE: vnl_math_[min|max] -> std::[min|max] STYLE: Text files should end with a newline COMP: Prefer C++11 constexpr when possible COMP: Prefer C++11 constexpr when possible ENH: Simplify std:: math function definitions COMP: Error in constexpr usage COMP: Add const to previous const variables COMP: SizeValueType can has different definition for itkArray ENH: Added utility for modernizing vcl_ to std:: ENH: Reference vnl_math.h constants directly ENH: Avoid using vnl_math_ functions COMP: Missing symbol for itkStaticConstMacro COMP: Function override missing in BioCell ENH: Convert vcl_ to std:: BUG: Windows vcl_snprintf failures addressed COMP: Disabmiguate function calls to SetData ENH: Provided static code API for external applications COMP: Remove possible type conversion warnings ENH: Merge GDCM release branch Hyun Jae Kang (25): COMP: Fixed the compiler error of ITKCommon2TestDriver on OSX 10.6 BUG: Fixed the runtime crash of VideoSourceTest on OSX 10.6 BUG: Fixed the runtime crash of itkTimeProbeTest2 BUG: Fixed the runtime crash of ITKFastMarchingTestDriver's tests on OSX 10.6 BUG: Fixed the runtime crash of ITKReviewTestDriver on OSX 10.6 COMP: Fixed the data conversion warning messages of itkResourceProbe BUG: Fixed the runtime crash of itkLabelOverlapMeasuresImageFilterTest BUG: Fixed the runtime crash of ITKStatisticsTestDriver tests on OSX 10.6 BUG: Fixed the runtime crash of itkMRIBiasFieldCorrectionFilterTest BUG: Fixed the runtime crash of itkBinaryShapeOpeningImageFilterTest1 BUG: Fixed the runtime crash of vnl_test_complex on OSX 10.6 BUG: Fixed the runtime crash of vnl_test_numeric_traits BUG: Fixed the runtime crash of test_pow_log on OSX 10.6 BUG: Exclude a test code of ITKLabelMapTestDriver on OSX 10.6 BUG: Fixed the failed test case of itkSTLThreadTest on OS X 10.8 COMP: Update KWStyle to utilize the latest boost library COMP: Fixed the compiler error of ITK on Mingw-w64 COMP: Temporarily suppress the warning messages of data-conversion on VS14 COMP: Put back the disappeared option of "BUILD EXAMPLES". BUG: Fix segmentation faults on mingw-W64 x86_64. BUG: Fix the failed test of itkCastImageFilterTest on mingw-w64 compiler. COMP: Fixed the cmake configuration for ITK_WRAP_DOC COMP: Fixed the warning messages on VS14. COMP: Add a missing head file at itkNumericTraitsStdVector.h COMP: Fix the wraning message of data-conversion Jean-Christophe Fillion-Robin (4): COMP: ITKExternalModule: Support building module without test directory. STYLE: Facilitate maintenance of CastXML generator refactoring CMakeLists COMP: Allow use of multiple "ITK external modules" in the same project. STYLE: UseITK: Document static registration of ITK IO factories. See #3393 Jon Haitz Legarreta (7): COMP: Delete unused variable compiler warning. ENH: Refactored itkBioCellTest ENH: Exercise non-tested itk::Math methods. ENH: Improve MersenneTwister class and test. ENH: Improve itkFEMLoadPoint coverage. ENH: Improve itkVersion class code coverage. ENH: Perform class name checks in test macro KWSys Robot (1): KWSys 2016-03-09 (36d8666f) Lucas Gandel (9): ENH: Implement GetNumberOfParameter() in ImageToSpatialObjectMetric COMP: Enable wrapping of multiple "ITK external modules" in the same project COMP: Fix CASTXML_EXECUTABLE value for multiple external module COMP: Fix external module testing COMP: Fix git protocol setup ENH: Conditionally add testing for External Modules BUG: Fix call to std::max() with different variable types Manuel Grizonnet (1): COMP: add ITKCommon_EXPORT to fix link issues with external applications Matthew McCormick (73): ENH: Add TwoProjectionRegistration Remote Module. ENH: Allow ITKVideoBridgeOpenCV to be built externally. COMP: Add export specification for itk::ResourceProbe. ENH: Do not force shared libraries when wrapping. BUG: BUILD_TESTING should be not advanced. ENH: Bump ITK version to 4.10.0. DOC: Correct ITKImageNoise description spelling. ENH: Wrap FFTNormalizedCorrelationImageFilter. BUG: Remove Azure ExternalData resource. BUG: ExternalData downloads from midas3.kitware.com only supports https. BUG: Update ExternalData resource. BUG: slicer.kitware.com/midas3/ ExternalData will not support http. ENH: Add ITK_CUSTOM_LIBRARY_SUFFIX variable. ENH: Wrap PipelineMonitorImageFilter. BUG: Update MIDAS url for https in archive testing data script. ENH: Wrap std::vector< itk::ImageRegion >. BUG: Fix wrapping build with DEFAULT_MODULES OFF. ENH: Add RGB pixel support to ImageToVTKImageFilter. ENH: Add RGB and vector pixel type wrapping for ImageToVTKImageFilter. STYLE: Use PixelType and ImageType in Python tests. ENH: Avoid template type specification in Python wrapping. COMP: Do not use has_key in itkTemplate New. DOC: Emphasize that push access is not required to contribute patches. ENH: Download SWIG and PCRE from midas3.kitware.com. COMP: Ignore build warning from KWStyle's boost. BUG: Remove Azure ExternalData resource. BUG: ExternalData downloads from midas3.kitware.com only supports https. BUG: slicer.kitware.com/midas3/ ExternalData will not support http. ENH: Update the VNL README-ITK.txt subtree commit revision. BUG: Mark VXL internal CMake variables as advanced. BUG: Run itk_module_target on itknetlib. DOC: Direct patches for VXL upstream to the GitHub repository. BUG: Run itk_module_target on itknetlib. COMP: Account for removal of vcl_* from upstream VXL. COMP: Remove itkTypeMacro from BioCellHelper. COMP: Convert itkBioCellTest arguments from double to int. COMP: Turn off BUILD_DOCUMENTATION for VNL. BUG: Install VXL config files to backwards-compatible locations. ENH: Remove vcl_complex from the wrapping. BUG: Install vnl_export.h and vnl_algo_export.h to previous locations. BUG: midas3.kitware.com only supports the https protocol. BUG: ImageIOBase SetDimensions should take SizeValueType. ENH: Add wrapping for ImagePCAShapeModelEstimator. COMP: Do not specify COMPONENTS with find_package(VTK. DOC: Fix FFTW warning grammar. COMP: Build against system HDF5 1.8.16. ENH: Set a default CMAKE_BUILD_TYPE when building a module externally COMP: Make initial HDF5 discovery of 1.8.16 quiet. ENH: Use hidden symbol visibility for the CPython extension modules. ENH: Turn on CMAKE_POSITION_INDEPENDENT_CODE by default. BUG: FEMLoadPoint uninitialized value in the constructor. BUG: Fix wrapping of complex types in VNL. ENH: Bump CMakeLists.txt version 4.9.1. COMP: Address ITKCommon Python submodule order. BUG: Extend ExternalData_TIMEOUT_ABSOLUTE to 900 seconds. BUG: Do not run KWStyle Git config on a release tarball. COMP: Ambiguous RGBPixel access in CustomColormapFunction. BUG: Prevent division by zero in PhasedArray3DSpecialCoordinatesImage. BUG: Initialize azimuth and elevation to pi/2 in PhasedArray3D. BUG: Increase MaskLabel backwards compatibility in N4 bias correction. ENH: Deprecate MaskLabel in N4BiasFieldCorrectionImageFilter. COMP: Update CastXML to support Visual Studio 2015 Update 2. COMP: Do not set wrapping library visibility with static builds. COMP: Update CastXML to support Visual Studio 2015 Update 2. COMP: Broaden the KWStyle warning exception. COMP: Update KWStyle version. BUG: Do not use the same output file in N4BiasField Test 2,3. COMP: Expand EXERCISE_BASIC_OBJECT_METHODS for other GCC versions. ENH: Update Cuberille Remote to 2015-05-01. ENH: Enable registration of the IOOpenSlide module through CMake. ENH: Update itk.org URL's for HTTPS support. BUG: Use CastXML built against LLVM with LLVM_ENABLE_TERMINFO OFF. BUG: Fix Python wrapping on Windows when ITK_USE_64BIT_IDS is ON. Michka Popoff (12): ENH: Use importlib for python 3.4 instead of imp ENH: Update to Swig 3.0.8 ENH: Update PCRE to version 8.38 ENH: Wrap RayCastInterpolateImageFunction ENH: Wrap RayCastInterpolateImageFunction COMP: Remove debug output after vcl_complex removal from wrapping ENH: Consolidate .idx file generation with swig .i generation. ENH: Update UpdatepygccxmlFromUpstream.sh script COMP: Set CastXML path and name for pygccxml 1.7.3 COMP: Fix RayCastInterpolateImageFunction wrapping for image dim 2 ENH: Use argparse instead of optparse in igenerator.py ENH: Use https URL for OS X castxml binary (for consistency) Nick Tustison (2): ENH: Add fixed/moving masking in reg. methods. ENH: Making the mask usage consistent with ITK. Pablo Hernandez-Cerdan (1): COMP: Fix warn in FFTW about delete []. Sean McBride (18): COMP: Made script OS X compatible COMP: mark GDCM GetSeriesHelper() method as deprecated BUG: update script to fetch GDCM from its release-2-4 branch instead of master DOC: Updated comment to reflect new GDCM version COMP: Fixed recently introduced build error with deprecated GDCM method BUG: Fixed invalid memory access found by ASan COMP: Fixed clang warning about macro expansion giving defined COMP: Fixed minor dashboards warnings and typos. COMP: Fixed a bunch of clang -Wunreachable-code-break warnings COMP: fixed some dashboard warnings (dead code, false positive) BUG: Fixed off-by-1 error found by ASan COMP: Fixed clang -Wcomma warning COMP: Introduce ITK_FALLTHROUGH, to suppress switch fall through warnings COMP: Fixed -Wwritable-strings warnings COMP: Fixed remaining -Wcomma warnings ENH: switch gdcm to release branch, not release-2-4 COMP: Hack HDF5 to build under ASan & UBSan COMP: fixed clang -Wdeprecated-writable-strings warning Shawn Waldon (1): STYLE: move itkGaussianDerivativeOperator Sujin Philip (1): STYLE: Move itkBox* Filters Sumedha Singla (3): ENH: Issue: ITK#3363 Replaced assignment in SetParameters function. ENH: Remove unnecessary const_cast BUG: Fixed the test itkHDF5ImageIOTest VXL Maintainers (9): VNL 2015-11-22 (ea1d60fb) VNL 2016-03-02 (cb31149e) VNL 2016-03-13 (ae34f0fc) VNL 2016-03-15 (751698ab) VNL 2016-03-19 (df10fefa) VNL 2016-03-25 (f0040231) VNL 2016-03-30 (88f50849) VNL 2016-04-22 (0ed18124) VNL 2016-04-26 (6b168535) Vladimir S. FONOV (3): MINC 2015-12-17 (dcb93a5f) MINC 2016-01-30 (783bca38) MINC 2016-02-24 (8632513e) Ziv Yaniv (1): BUG: Interpretation of the Euler angles ZYX or ZXY was not exported. ----------------------------------------------------- Errors or omissions? Please fix them here: https://docs.google.com/document/d/1n6xDC3phae7bH40OVO-QTECZ6gKRlPr1dwZR3fydzfU/edit From bakkari.abdelkhalek at hotmail.fr Fri May 13 05:18:12 2016 From: bakkari.abdelkhalek at hotmail.fr (Abdelkhalek Bakkari) Date: Fri, 13 May 2016 10:18:12 +0100 Subject: [ITK-users] Reading of .dcm and .mha series Message-ID: Dear ITK-users, I would like to ask about how can I read .dcm and .mha series for the same application. Any help ! Any suggestion. Kind regards, Abdelkhalek BakkariPh.D candidate in Computer ScienceInstitute of Applied Computer ScienceLodz University of Technology, Poland Virus-free. www.avast.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From ehsan.basafa at gmail.com Fri May 13 11:26:07 2016 From: ehsan.basafa at gmail.com (ebasafa) Date: Fri, 13 May 2016 08:26:07 -0700 (MST) Subject: [ITK-users] ShapeLabelMap Roundness/Perimeter Calculation Issue Message-ID: <1463153167301-7588837.post@n2.nabble.com> Hi everyone, Recently I noticed that BinaryImageToShapeLabelMapFilter does not calculate roundness of objects correctly, and I traced it back to perimeter calculation. More curiously, the results I get from the GetRoundness() and GetPerimeter() methods differ between debug and release builds! And to make it even more confusing, it's a machine-dependent problem, i.e. on some machines debug and release give the same (correct?) numbers and on some machines they don't. I suspect that release results are erroneous, since some roundness numbers turn out to be >1.0 in release but are always <1.0 in debug mode. I am working in a Windows 8.1 64-bit environment and am using the latest release of ITK (4.9.1) on all different machines. I have tried several searches to see if this is a resolved issue, but the latest post I found was from 2011 (link below) and has been unanswered. http://itk-users.7.n7.nabble.com/Perimeter-Calculation-via-LabelImageToShapeLabelMapFilter-td14917.html Seems like there was a bug report filed that time (https://itk.org/Bug/view.php?id=11934) whose status still says "assigned". I appreciate any help. Thanks, Ehsan -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ShapeLabelMap-Roundness-Perimeter-Calculation-Issue-tp7588837.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From blowekamp at mail.nih.gov Fri May 13 12:14:42 2016 From: blowekamp at mail.nih.gov (Lowekamp, Bradley (NIH/NLM/LHC) [C]) Date: Fri, 13 May 2016 16:14:42 +0000 Subject: [ITK-users] [ITK] ShapeLabelMap Roundness/Perimeter Calculation Issue In-Reply-To: <1463153167301-7588837.post@n2.nabble.com> References: <1463153167301-7588837.post@n2.nabble.com> Message-ID: <2D593B3D-C6D6-45EF-93C8-75484575FD49@mail.nih.gov> Hello, You can find additional information about how this parameter is defined in the following insight journal: http://www.insight-journal.org/browse/publication/852 This method is generalizable to N-D, so it may not be the most accurate in 2D. The method can produce roundness numbers that are >1. However is should be consistent in debug and release modes. Getting consistent numeric computation with C++ and vectorizable operations can be challenging with different architectures. You did not provide any specifics for the difference in computation between release and debug modes. HTH, Brad > On May 13, 2016, at 11:26 AM, ebasafa wrote: > > Hi everyone, > > Recently I noticed that BinaryImageToShapeLabelMapFilter does not calculate > roundness of objects correctly, and I traced it back to perimeter > calculation. More curiously, the results I get from the GetRoundness() and > GetPerimeter() methods differ between debug and release builds! And to make > it even more confusing, it's a machine-dependent problem, i.e. on some > machines debug and release give the same (correct?) numbers and on some > machines they don't. I suspect that release results are erroneous, since > some roundness numbers turn out to be >1.0 in release but are always <1.0 in > debug mode. I am working in a Windows 8.1 64-bit environment and am using > the latest release of ITK (4.9.1) on all different machines. > > I have tried several searches to see if this is a resolved issue, but the > latest post I found was from 2011 (link below) and has been unanswered. > > http://itk-users.7.n7.nabble.com/Perimeter-Calculation-via-LabelImageToShapeLabelMapFilter-td14917.html > > Seems like there was a bug report filed that time > (https://itk.org/Bug/view.php?id=11934) whose status still says "assigned". > I appreciate any help. > > Thanks, > Ehsan > > > > > -- > View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ShapeLabelMap-Roundness-Perimeter-Calculation-Issue-tp7588837.html > Sent from the ITK Insight Users mailing list archive at Nabble.com. > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community From ehsan.basafa at gmail.com Fri May 13 15:12:13 2016 From: ehsan.basafa at gmail.com (ebasafa) Date: Fri, 13 May 2016 12:12:13 -0700 (MST) Subject: [ITK-users] [ITK] ShapeLabelMap Roundness/Perimeter Calculation Issue In-Reply-To: <2D593B3D-C6D6-45EF-93C8-75484575FD49@mail.nih.gov> References: <1463153167301-7588837.post@n2.nabble.com> <2D593B3D-C6D6-45EF-93C8-75484575FD49@mail.nih.gov> Message-ID: <1463166733620-7588839.post@n2.nabble.com> Thank you! The IJ article is really helpful. However, the issue still remains that debug and release give different answers. I do not know what specifics I need to provide. Basically, I have a pipeline that loads a volume from file, thresholds the image into a binary image, and then passes it to BinaryImageToShapeLabelMapFilter to process all the objects found after thresholding. The exact same pipeline, run over the same image volume, prints out different values for perimeter and roundness of the same objects. I should have mentioned that I am working in 3D, and also the values I get for other shape parameters, e.g. flatness, elongation, equivalent ellipsoid radii, volume, etc. are the same for debug and release. My very naive guess is that, possibly, there is some uninitialized parameter being used somewhere in the filter, which results in debug and release initializing it to two different values. Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote > Hello, > > You can find additional information about how this parameter is defined in > the following insight journal: > http://www.insight-journal.org/browse/publication/852 > > This method is generalizable to N-D, so it may not be the most accurate in > 2D. The method can produce roundness numbers that are >1. However is > should be consistent in debug and release modes. Getting consistent > numeric computation with C++ and vectorizable operations can be > challenging with different architectures. > > You did not provide any specifics for the difference in computation > between release and debug modes. > > HTH, > Brad > >> On May 13, 2016, at 11:26 AM, ebasafa < > ehsan.basafa@ > > wrote: >> >> Hi everyone, >> >> Recently I noticed that BinaryImageToShapeLabelMapFilter does not >> calculate >> roundness of objects correctly, and I traced it back to perimeter >> calculation. More curiously, the results I get from the GetRoundness() >> and >> GetPerimeter() methods differ between debug and release builds! And to >> make >> it even more confusing, it's a machine-dependent problem, i.e. on some >> machines debug and release give the same (correct?) numbers and on some >> machines they don't. I suspect that release results are erroneous, since >> some roundness numbers turn out to be >1.0 in release but are always <1.0 >> in >> debug mode. I am working in a Windows 8.1 64-bit environment and am using >> the latest release of ITK (4.9.1) on all different machines. >> >> I have tried several searches to see if this is a resolved issue, but the >> latest post I found was from 2011 (link below) and has been unanswered. >> >> http://itk-users.7.n7.nabble.com/Perimeter-Calculation-via-LabelImageToShapeLabelMapFilter-td14917.html >> >> Seems like there was a bug report filed that time >> (https://itk.org/Bug/view.php?id=11934) whose status still says >> "assigned". >> I appreciate any help. >> >> Thanks, >> Ehsan >> >> >> >> >> -- >> View this message in context: >> http://itk-insight-users.2283740.n2.nabble.com/ShapeLabelMap-Roundness-Perimeter-Calculation-Issue-tp7588837.html >> Sent from the ITK Insight Users mailing list archive at Nabble.com. >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> _______________________________________________ >> Community mailing list >> > Community@ >> http://public.kitware.com/mailman/listinfo/community > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote > Hello, > > You can find additional information about how this parameter is defined in > the following insight journal: > http://www.insight-journal.org/browse/publication/852 > > This method is generalizable to N-D, so it may not be the most accurate in > 2D. The method can produce roundness numbers that are >1. However is > should be consistent in debug and release modes. Getting consistent > numeric computation with C++ and vectorizable operations can be > challenging with different architectures. > > You did not provide any specifics for the difference in computation > between release and debug modes. > > HTH, > Brad > >> On May 13, 2016, at 11:26 AM, ebasafa < > ehsan.basafa@ > > wrote: >> >> Hi everyone, >> >> Recently I noticed that BinaryImageToShapeLabelMapFilter does not >> calculate >> roundness of objects correctly, and I traced it back to perimeter >> calculation. More curiously, the results I get from the GetRoundness() >> and >> GetPerimeter() methods differ between debug and release builds! And to >> make >> it even more confusing, it's a machine-dependent problem, i.e. on some >> machines debug and release give the same (correct?) numbers and on some >> machines they don't. I suspect that release results are erroneous, since >> some roundness numbers turn out to be >1.0 in release but are always <1.0 >> in >> debug mode. I am working in a Windows 8.1 64-bit environment and am using >> the latest release of ITK (4.9.1) on all different machines. >> >> I have tried several searches to see if this is a resolved issue, but the >> latest post I found was from 2011 (link below) and has been unanswered. >> >> http://itk-users.7.n7.nabble.com/Perimeter-Calculation-via-LabelImageToShapeLabelMapFilter-td14917.html >> >> Seems like there was a bug report filed that time >> (https://itk.org/Bug/view.php?id=11934) whose status still says >> "assigned". >> I appreciate any help. >> >> Thanks, >> Ehsan >> >> >> >> >> -- >> View this message in context: >> http://itk-insight-users.2283740.n2.nabble.com/ShapeLabelMap-Roundness-Perimeter-Calculation-Issue-tp7588837.html >> Sent from the ITK Insight Users mailing list archive at Nabble.com. >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> _______________________________________________ >> Community mailing list >> > Community@ >> http://public.kitware.com/mailman/listinfo/community > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ShapeLabelMap-Roundness-Perimeter-Calculation-Issue-tp7588837p7588839.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From blowekamp at mail.nih.gov Fri May 13 15:39:57 2016 From: blowekamp at mail.nih.gov (Lowekamp, Bradley (NIH/NLM/LHC) [C]) Date: Fri, 13 May 2016 19:39:57 +0000 Subject: [ITK-users] [ITK] ShapeLabelMap Roundness/Perimeter Calculation Issue In-Reply-To: <1463166733620-7588839.post@n2.nabble.com> References: <1463153167301-7588837.post@n2.nabble.com> <2D593B3D-C6D6-45EF-93C8-75484575FD49@mail.nih.gov> <1463166733620-7588839.post@n2.nabble.com> Message-ID: <2841BCB1-D769-4736-B82F-E23CA390494C@mail.nih.gov> Hi, I was initially wondering the magnitude of the difference, but this should not be a problem for this algorithm. Looking at the algorithm a little closer, I see it is computed mostly by counting voxel and intercepts ( not with floating point operations ), so the results should be extremely numerically stable and not subject to accumulation error. It would be good to find a reproducible and shareable case. That is can you share a small image where the problem occours? Hopefully it can be reproduced by just reading it and running BinaryImageToShapLabelMapFilter. Do you know if the release or debug state is correct? To roll out a threading issue, can you set ITK to use only one thread, with the env variable ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1, or itk::MultiThreader::SetGlobalDefaultNumberOfThread(1) and see if the problem persists? If the problem persists with one thread then, add a debug message to this method [1], to print the label ID and number of intercepts for each axis. This should be the same. HTH, Brad [1] https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/LabelMap/include/itkShapeLabelMapFilter.hxx#L633 On May 13, 2016, at 3:12 PM, ebasafa > wrote: Thank you! The IJ article is really helpful. However, the issue still remains that debug and release give different answers. I do not know what specifics I need to provide. Basically, I have a pipeline that loads a volume from file, thresholds the image into a binary image, and then passes it to BinaryImageToShapeLabelMapFilter to process all the objects found after thresholding. The exact same pipeline, run over the same image volume, prints out different values for perimeter and roundness of the same objects. I should have mentioned that I am working in 3D, and also the values I get for other shape parameters, e.g. flatness, elongation, equivalent ellipsoid radii, volume, etc. are the same for debug and release. My very naive guess is that, possibly, there is some uninitialized parameter being used somewhere in the filter, which results in debug and release initializing it to two different values. Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote Hello, You can find additional information about how this parameter is defined in the following insight journal: http://www.insight-journal.org/browse/publication/852 This method is generalizable to N-D, so it may not be the most accurate in 2D. The method can produce roundness numbers that are >1. However is should be consistent in debug and release modes. Getting consistent numeric computation with C++ and vectorizable operations can be challenging with different architectures. You did not provide any specifics for the difference in computation between release and debug modes. HTH, Brad On May 13, 2016, at 11:26 AM, ebasafa < ehsan.basafa@ > wrote: Hi everyone, Recently I noticed that BinaryImageToShapeLabelMapFilter does not calculate roundness of objects correctly, and I traced it back to perimeter calculation. More curiously, the results I get from the GetRoundness() and GetPerimeter() methods differ between debug and release builds! And to make it even more confusing, it's a machine-dependent problem, i.e. on some machines debug and release give the same (correct?) numbers and on some machines they don't. I suspect that release results are erroneous, since some roundness numbers turn out to be >1.0 in release but are always <1.0 in debug mode. I am working in a Windows 8.1 64-bit environment and am using the latest release of ITK (4.9.1) on all different machines. I have tried several searches to see if this is a resolved issue, but the latest post I found was from 2011 (link below) and has been unanswered. http://itk-users.7.n7.nabble.com/Perimeter-Calculation-via-LabelImageToShapeLabelMapFilter-td14917.html Seems like there was a bug report filed that time (https://itk.org/Bug/view.php?id=11934) whose status still says "assigned". I appreciate any help. Thanks, Ehsan -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ShapeLabelMap-Roundness-Perimeter-Calculation-Issue-tp7588837.html Sent from the ITK Insight Users mailing list archive at Nabble.com. _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users _______________________________________________ Community mailing list Community@ http://public.kitware.com/mailman/listinfo/community _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote Hello, You can find additional information about how this parameter is defined in the following insight journal: http://www.insight-journal.org/browse/publication/852 This method is generalizable to N-D, so it may not be the most accurate in 2D. The method can produce roundness numbers that are >1. However is should be consistent in debug and release modes. Getting consistent numeric computation with C++ and vectorizable operations can be challenging with different architectures. You did not provide any specifics for the difference in computation between release and debug modes. HTH, Brad On May 13, 2016, at 11:26 AM, ebasafa < ehsan.basafa@ > wrote: Hi everyone, Recently I noticed that BinaryImageToShapeLabelMapFilter does not calculate roundness of objects correctly, and I traced it back to perimeter calculation. More curiously, the results I get from the GetRoundness() and GetPerimeter() methods differ between debug and release builds! And to make it even more confusing, it's a machine-dependent problem, i.e. on some machines debug and release give the same (correct?) numbers and on some machines they don't. I suspect that release results are erroneous, since some roundness numbers turn out to be >1.0 in release but are always <1.0 in debug mode. I am working in a Windows 8.1 64-bit environment and am using the latest release of ITK (4.9.1) on all different machines. I have tried several searches to see if this is a resolved issue, but the latest post I found was from 2011 (link below) and has been unanswered. http://itk-users.7.n7.nabble.com/Perimeter-Calculation-via-LabelImageToShapeLabelMapFilter-td14917.html Seems like there was a bug report filed that time (https://itk.org/Bug/view.php?id=11934) whose status still says "assigned". I appreciate any help. Thanks, Ehsan -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ShapeLabelMap-Roundness-Perimeter-Calculation-Issue-tp7588837.html Sent from the ITK Insight Users mailing list archive at Nabble.com. _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users _______________________________________________ Community mailing list Community@ http://public.kitware.com/mailman/listinfo/community _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ShapeLabelMap-Roundness-Perimeter-Calculation-Issue-tp7588837p7588839.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 ehsan.basafa at gmail.com Fri May 13 17:28:04 2016 From: ehsan.basafa at gmail.com (ebasafa) Date: Fri, 13 May 2016 14:28:04 -0700 (MST) Subject: [ITK-users] [ITK] ShapeLabelMap Roundness/Perimeter Calculation Issue In-Reply-To: <2841BCB1-D769-4736-B82F-E23CA390494C@mail.nih.gov> References: <1463153167301-7588837.post@n2.nabble.com> <2D593B3D-C6D6-45EF-93C8-75484575FD49@mail.nih.gov> <1463166733620-7588839.post@n2.nabble.com> <2841BCB1-D769-4736-B82F-E23CA390494C@mail.nih.gov> Message-ID: <1463174884133-7588841.post@n2.nabble.com> Thank you for the pointer! After fiddling with the hxx file for a couple hours, I traced the issue further and found out the method vnl_math_abs() called on line 537 (which seems like in the repository has been replaced by itk::Math::abs() but not implemented in the stable release), provides different answers for absolute values in debug and release. Surprisingly, for example, this method reports -1 as absolute value of -1 in release! Replacing that with std::abs() resolves the issue and now roundness and perimeter are the same and (seemingly) correct. I think a bug fix, if not already done via itk::Math as I mentioned, is in order. -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ShapeLabelMap-Roundness-Perimeter-Calculation-Issue-tp7588837p7588841.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From dzenanz at gmail.com Fri May 13 19:09:54 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Fri, 13 May 2016 19:09:54 -0400 Subject: [ITK-users] [ITK] ShapeLabelMap Roundness/Perimeter Calculation Issue In-Reply-To: <1463174884133-7588841.post@n2.nabble.com> References: <1463153167301-7588837.post@n2.nabble.com> <2D593B3D-C6D6-45EF-93C8-75484575FD49@mail.nih.gov> <1463166733620-7588839.post@n2.nabble.com> <2841BCB1-D769-4736-B82F-E23CA390494C@mail.nih.gov> <1463174884133-7588841.post@n2.nabble.com> Message-ID: You have found a bug, great! Now share the patch with the rest of us the world. If you get stuck, please let us know. Thanks, D?enan On Fri, May 13, 2016 at 5:28 PM, ebasafa wrote: > Thank you for the pointer! After fiddling with the hxx file for a couple > hours, I traced the issue further and found out the method vnl_math_abs() > called on line 537 (which seems like in the repository has been replaced by > itk::Math::abs() but not implemented in the stable release), provides > different answers for absolute values in debug and release. Surprisingly, > for example, this method reports -1 as absolute value of -1 in release! > Replacing that with std::abs() resolves the issue and now roundness and > perimeter are the same and (seemingly) correct. I think a bug fix, if not > already done via itk::Math as I mentioned, is in order. > > > > > -- > View this message in context: > http://itk-insight-users.2283740.n2.nabble.com/ShapeLabelMap-Roundness-Perimeter-Calculation-Issue-tp7588837p7588841.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 blowekamp at mail.nih.gov Sat May 14 07:18:55 2016 From: blowekamp at mail.nih.gov (Bradley Lowekamp) Date: Sat, 14 May 2016 07:18:55 -0400 Subject: [ITK-users] [ITK] ShapeLabelMap Roundness/Perimeter Calculation Issue In-Reply-To: <1463174884133-7588841.post@n2.nabble.com> References: <1463153167301-7588837.post@n2.nabble.com> <2D593B3D-C6D6-45EF-93C8-75484575FD49@mail.nih.gov> <1463166733620-7588839.post@n2.nabble.com> <2841BCB1-D769-4736-B82F-E23CA390494C@mail.nih.gov> <1463174884133-7588841.post@n2.nabble.com> Message-ID: <4667DA58-5F4B-4C4F-B1E6-C907A432DCAC@mail.nih.gov> Hello, Great work tracking the issue down! Does updating to the 4.10rc1 fix your problem? Brad > On May 13, 2016, at 5:28 PM, ebasafa wrote: > > Thank you for the pointer! After fiddling with the hxx file for a couple > hours, I traced the issue further and found out the method vnl_math_abs() > called on line 537 (which seems like in the repository has been replaced by > itk::Math::abs() but not implemented in the stable release), provides > different answers for absolute values in debug and release. Surprisingly, > for example, this method reports -1 as absolute value of -1 in release! > Replacing that with std::abs() resolves the issue and now roundness and > perimeter are the same and (seemingly) correct. I think a bug fix, if not > already done via itk::Math as I mentioned, is in order. > > > > > -- > View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ShapeLabelMap-Roundness-Perimeter-Calculation-Issue-tp7588837p7588841.html > Sent from the ITK Insight Users mailing list archive at Nabble.com. > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community From matimontg at gmail.com Sat May 14 19:42:44 2016 From: matimontg at gmail.com (Matias Montroull) Date: Sat, 14 May 2016 23:42:44 +0000 Subject: [ITK-users] SetOutputOrigin(origin) not working on writer Message-ID: Hi, I have the following code to flip an image and preserve origin and spacing. For some reason, the writer doesn't copy the Origin from the original image into the output Image. I can see the Output Image origin is the Original Image origin but I don't understand why the writer doesn't take that value. I have no issues with the spacing, that one is copied just fine into the output image. I'm using ITK 4.7.2 #include "itkImage.h" #include "itkImageFileReader.h" #include "itkImageFileWriter.h" #include "itkFlipImageFilter.h" #include "itkChangeInformationImageFilter.h" int main(int argc, char* argv[]) { if (argc != 4) { std::cerr << "Usage: " << argv[0]; std::cerr << " "; std::cerr << std::endl; return EXIT_FAILURE; } typedef itk::Image ImageType; typedef itk::ImageFileReader< ImageType > ReaderType; ReaderType::Pointer reader = ReaderType::New(); reader->SetFileName(argv[1]); ImageType::Pointer inputImage = reader->GetOutput(); inputImage->Update(); //Importante!! Sin esto no agarra el origen ImageType::PointType origin = inputImage->GetOrigin(); ImageType::SpacingType spacing = inputImage->GetSpacing(); typedef itk::FlipImageFilter< ImageType > FlipImageFilterType; FlipImageFilterType::Pointer flipFilter = FlipImageFilterType::New(); typedef itk::ChangeInformationImageFilter< ImageType > FilterType; FilterType::Pointer filter = FilterType::New(); filter->SetInput(reader->GetOutput()); filter->SetOutputOrigin(origin); filter->ChangeOriginOn(); filter->SetOutputSpacing(spacing); filter->ChangeSpacingOn(); flipFilter->SetInput(filter->GetOutput()); flipFilter->Update(); FlipImageFilterType::FlipAxesArrayType flipAxes; if (atoi(argv[3]) == 0) { flipAxes[0] = true; flipAxes[1] = false; } else { flipAxes[0] = false; flipAxes[1] = true; } flipFilter->SetFlipAxes(flipAxes); typedef itk::ImageFileWriter< ImageType > WriterType; WriterType::Pointer writer = WriterType::New(); writer->SetFileName(argv[2]); writer->SetInput(flipFilter->GetOutput()); try { writer->Update(); std::cout << "Input origin is: " << reader->GetOutput()->GetOrigin() << std::endl; std::cout << "Output origin is: " << flipFilter->GetOutput()->GetOrigin() << std::endl; } catch (itk::ExceptionObject & error) { std::cerr << "Error: " << error << std::endl; return EXIT_FAILURE; } return EXIT_SUCCESS; } -- Matias -------------- next part -------------- An HTML attachment was scrubbed... URL: From hans-johnson at uiowa.edu Sun May 15 09:24:30 2016 From: hans-johnson at uiowa.edu (Johnson, Hans J) Date: Sun, 15 May 2016 13:24:30 +0000 Subject: [ITK-users] [ITK] ShapeLabelMap Roundness/Perimeter Calculation Issue In-Reply-To: <4667DA58-5F4B-4C4F-B1E6-C907A432DCAC@mail.nih.gov> References: <1463153167301-7588837.post@n2.nabble.com> <2D593B3D-C6D6-45EF-93C8-75484575FD49@mail.nih.gov> <1463166733620-7588839.post@n2.nabble.com> <2841BCB1-D769-4736-B82F-E23CA390494C@mail.nih.gov> <1463174884133-7588841.post@n2.nabble.com> <4667DA58-5F4B-4C4F-B1E6-C907A432DCAC@mail.nih.gov> Message-ID: <90B961A4-E84E-4BD5-97CD-21A33E9770B7@uiowa.edu> Ebasafa Can you please modify one of the tests in ?ITK/Modules/Filtering/LabelMap/test? to expose the bug that you are encountering? If you can extend one of these tests so that the test demonstrates the failure (i.e. starts reporting failures to the dashboard), you will gain support of many of the community in fixing the problem in the most robust way. Thanks, Hans -- On 5/14/16, 6:18 AM, "Insight-users on behalf of Bradley Lowekamp" wrote: >Hello, > >Great work tracking the issue down! > >Does updating to the 4.10rc1 fix your problem? > >Brad >> On May 13, 2016, at 5:28 PM, ebasafa wrote: >> >> Thank you for the pointer! After fiddling with the hxx file for a couple >> hours, I traced the issue further and found out the method vnl_math_abs() >> called on line 537 (which seems like in the repository has been replaced by >> itk::Math::abs() but not implemented in the stable release), provides >> different answers for absolute values in debug and release. Surprisingly, >> for example, this method reports -1 as absolute value of -1 in release! >> Replacing that with std::abs() resolves the issue and now roundness and >> perimeter are the same and (seemingly) correct. I think a bug fix, if not >> already done via itk::Math as I mentioned, is in order. >> >> >> >> >> -- >> View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ShapeLabelMap-Roundness-Perimeter-Calculation-Issue-tp7588837p7588841.html >> Sent from the ITK Insight Users mailing list archive at Nabble.com. >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> _______________________________________________ >> Community mailing list >> Community at itk.org >> http://public.kitware.com/mailman/listinfo/community >_____________________________________ >Powered by www.kitware.com > >Visit other Kitware open-source projects at >http://www.kitware.com/opensource/opensource.html > >Kitware offers ITK Training Courses, for more information visit: >http://www.kitware.com/products/protraining.php > >Please keep messages on-topic and check the 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 hans-johnson at uiowa.edu Sun May 15 09:15:10 2016 From: hans-johnson at uiowa.edu (Johnson, Hans J) Date: Sun, 15 May 2016 13:15:10 +0000 Subject: [ITK-users] [ITK] ShapeLabelMap Roundness/Perimeter Calculation Issue In-Reply-To: <4667DA58-5F4B-4C4F-B1E6-C907A432DCAC@mail.nih.gov> References: <1463153167301-7588837.post@n2.nabble.com> <2D593B3D-C6D6-45EF-93C8-75484575FD49@mail.nih.gov> <1463166733620-7588839.post@n2.nabble.com> <2841BCB1-D769-4736-B82F-E23CA390494C@mail.nih.gov> <1463174884133-7588841.post@n2.nabble.com> <4667DA58-5F4B-4C4F-B1E6-C907A432DCAC@mail.nih.gov> Message-ID: <6D4C82AF-0CF6-458C-97E9-C2710D5DD223@uiowa.edu> ehsan.basafa at gmail.com Could you please provide a new details about the compiler settings that caused problems. It is great that a solution was found, but I would like to understand the root cause of this problem. Were you building with C++11 or C++98 compliance? GCC or clang or windows? What version of ITK are you using? (i.e. what is the git hash? Thank you, Hans -- On 5/14/16, 6:18 AM, "Insight-users on behalf of Bradley Lowekamp" wrote: >Hello, > >Great work tracking the issue down! > >Does updating to the 4.10rc1 fix your problem? > >Brad >> On May 13, 2016, at 5:28 PM, ebasafa wrote: >> >> Thank you for the pointer! After fiddling with the hxx file for a couple >> hours, I traced the issue further and found out the method vnl_math_abs() >> called on line 537 (which seems like in the repository has been replaced by >> itk::Math::abs() but not implemented in the stable release), provides >> different answers for absolute values in debug and release. Surprisingly, >> for example, this method reports -1 as absolute value of -1 in release! >> Replacing that with std::abs() resolves the issue and now roundness and >> perimeter are the same and (seemingly) correct. I think a bug fix, if not >> already done via itk::Math as I mentioned, is in order. >> >> >> >> >> -- >> View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ShapeLabelMap-Roundness-Perimeter-Calculation-Issue-tp7588837p7588841.html >> Sent from the ITK Insight Users mailing list archive at Nabble.com. >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> _______________________________________________ >> Community mailing list >> Community at itk.org >> http://public.kitware.com/mailman/listinfo/community >_____________________________________ >Powered by www.kitware.com > >Visit other Kitware open-source projects at >http://www.kitware.com/opensource/opensource.html > >Kitware offers ITK Training Courses, for more information visit: >http://www.kitware.com/products/protraining.php > >Please keep messages on-topic and check the 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 javij1 at gmail.com Sun May 15 10:41:10 2016 From: javij1 at gmail.com (=?UTF-8?Q?Javier_Juan_Albarrac=c3=adn?=) Date: Sun, 15 May 2016 16:41:10 +0200 Subject: [ITK-users] Check if an image is 2D or 3D Message-ID: <5a59bd00-2c47-d2f2-4896-579eb3a0c88c@gmail.com> Hello, I have an algorithm than can only be applied to 3D volumes, not 2D images. I plann to implement the function as: bool Algorithm::run(ImagePointer image) Is there any form to know through the ImageType or ImagePointer whether is a 3D or a 2D volume?? Or should I change the header of the function to something like: bool Algorithmrun(ImagePointer image) With this function header I have direct access to the image dimension, but in the other header, there is no form to know the image dimension through the typedef ImageType?? Thank you From bill.lorensen at gmail.com Sun May 15 11:45:37 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Sun, 15 May 2016 11:45:37 -0400 Subject: [ITK-users] SetOutputOrigin(origin) not working on writer In-Reply-To: References: Message-ID: After reader->SetFileName(argv[1]); reader->Update(); No need for inputImage->Update(); Since you did not Update the reader, the origin and spacing will be (0,0,0) and(1,1,1) by defulat. On Sat, May 14, 2016 at 7:42 PM, Matias Montroull wrote: > Hi, > > I have the following code to flip an image and preserve origin and spacing. > For some reason, the writer doesn't copy the Origin from the original image > into the output Image. > > I can see the Output Image origin is the Original Image origin but I don't > understand why the writer doesn't take that value. I have no issues with the > spacing, that one is copied just fine into the output image. > > I'm using ITK 4.7.2 > > #include "itkImage.h" > #include "itkImageFileReader.h" > #include "itkImageFileWriter.h" > #include "itkFlipImageFilter.h" > #include "itkChangeInformationImageFilter.h" > > int main(int argc, char* argv[]) > { > if (argc != 4) > { > std::cerr << "Usage: " << argv[0]; > std::cerr << " "; > std::cerr << std::endl; > return EXIT_FAILURE; > } > > typedef itk::Image ImageType; > > typedef itk::ImageFileReader< ImageType > ReaderType; > ReaderType::Pointer reader = ReaderType::New(); > > reader->SetFileName(argv[1]); > > ImageType::Pointer inputImage = reader->GetOutput(); > inputImage->Update(); //Importante!! Sin esto no agarra el origen > > ImageType::PointType origin = inputImage->GetOrigin(); > ImageType::SpacingType spacing = inputImage->GetSpacing(); > > typedef itk::FlipImageFilter< ImageType > FlipImageFilterType; > FlipImageFilterType::Pointer flipFilter = FlipImageFilterType::New(); > > typedef itk::ChangeInformationImageFilter< ImageType > FilterType; > FilterType::Pointer filter = FilterType::New(); > filter->SetInput(reader->GetOutput()); > > filter->SetOutputOrigin(origin); > filter->ChangeOriginOn(); > filter->SetOutputSpacing(spacing); > filter->ChangeSpacingOn(); > > flipFilter->SetInput(filter->GetOutput()); > flipFilter->Update(); > > FlipImageFilterType::FlipAxesArrayType flipAxes; > if (atoi(argv[3]) == 0) > { > flipAxes[0] = true; > flipAxes[1] = false; > } > else > { > flipAxes[0] = false; > flipAxes[1] = true; > } > > flipFilter->SetFlipAxes(flipAxes); > typedef itk::ImageFileWriter< ImageType > WriterType; > WriterType::Pointer writer = WriterType::New(); > writer->SetFileName(argv[2]); > writer->SetInput(flipFilter->GetOutput()); > try > { > writer->Update(); > std::cout << "Input origin is: " << reader->GetOutput()->GetOrigin() << > std::endl; > std::cout << "Output origin is: " << flipFilter->GetOutput()->GetOrigin() << > std::endl; > } > catch (itk::ExceptionObject & error) > { > std::cerr << "Error: " << error << std::endl; > return EXIT_FAILURE; > } > > return EXIT_SUCCESS; > } > > -- > Matias > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > -- Unpaid intern in BillsBasement at noware dot com From dzenanz at gmail.com Sun May 15 12:13:00 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Sun, 15 May 2016 12:13:00 -0400 Subject: [ITK-users] Check if an image is 2D or 3D In-Reply-To: <5a59bd00-2c47-d2f2-4896-579eb3a0c88c@gmail.com> References: <5a59bd00-2c47-d2f2-4896-579eb3a0c88c@gmail.com> Message-ID: Hi Javier, you can also access image dimension with the other signature too, like this: ImageType::ImageDimension Regards, D?enan On Sun, May 15, 2016 at 10:41 AM, Javier Juan Albarrac?n wrote: > > Hello, I have an algorithm than can only be applied to 3D volumes, not 2D > images. > > I plann to implement the function as: > > bool Algorithm::run(ImagePointer image) > > Is there any form to know through the ImageType or ImagePointer whether is > a 3D or a 2D volume?? Or should I change the header of the function to > something like: > > bool Algorithmrun(ImagePointer image) > > With this function header I have direct access to the image dimension, but > in the other header, there is no form to know the image dimension through > the typedef ImageType?? > > Thank you > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From scorpiuni at gmail.com Mon May 16 11:30:35 2016 From: scorpiuni at gmail.com (Robert) Date: Mon, 16 May 2016 08:30:35 -0700 (MST) Subject: [ITK-users] Geodesic Active Contour Error: Inputs do not occupy the same physical space! Message-ID: <1463412635700-7588851.post@n2.nabble.com> Hi, I have an error which I can't find a solution for (or even the origin of it): I have a 3D Volume, which I preprocess with several filters: smoothing->SetInput( reader->GetOutput() ); gradientMagnitude->SetInput( smoothing->GetOutput() ); sigmoid->SetInput( gradientMagnitude->GetOutput() ); std::cout << "-------After sigmoid IMPORTANT--------"<< std::endl; const InternalImageType::PointType & origin2 = sigmoid->GetOutput()->GetOrigin(); std::cout << "Origin = "; std::cout << origin2[0] << ", " << origin2[1] << ", " << origin2[2] << std::endl; The Origin Output here is 0,0,0 as expected. Now I do this: geodesicActiveContour->SetInput( fastMarching->GetOutput() ); std::cout << "-------After fastmarching -> GetOutput() IMPORTANT--------"<< std::endl; const InternalImageType::PointType & origin3 = fastMarching->GetOutput()->GetOrigin(); std::cout << "Origin = "; std::cout << origin3[0] << ", " << origin3[1] << ", " << origin3[2] << std::endl; //Output still is 0 0 0 float ori[3] = {0, 0, 0}; sigmoid->GetOutput()->SetOrigin(ori); geodesicActiveContour->SetFeatureImage( sigmoid->GetOutput() ); const InternalImageType::PointType & originx = sigmoid->GetOutput()->GetOrigin(); std::cout << "Origin Important= "; std::cout << originx[0] << ", " << originx[1] << ", " << originx[2] << std::endl; Again, here, the cout for the origin says 0,0,0, which should be correct, and work with the filter. Now when I execute the whole thing, this pops up: Exception caught ! itk::ExceptionObject (0xfb0a10) Location: "void itk::ImageToImageFilter::VerifyInputInformation() [with TInputImage = itk::Image; TOutputImage = itk::Image]" File: /usr/local/include/ITK-4.9/itkImageToImageFilter.hxx Line: 250 Description: itk::ERROR: GeodesicActiveContourLevelSetImageFilter(0xf87d40): Inputs do not occupy the same physical space! InputImage Origin: [0.0000000e+00, 0.0000000e+00, 0.0000000e+00], InputImage_1 Origin: [7.2991424e+00, 1.0553263e+01, -7.8717673e+00] Tolerance: 1.0000000e-06 InputImage Spacing: [1.0000000e+00, 1.0000000e+00, 1.0000000e+00], InputImage_1 Spacing: [1.6000000e-01, 1.6000000e-01, 1.5999985e-01] Tolerance: 1.0000000e-06 InputImage Direction: 1.0000000e+00 0.0000000e+00 0.0000000e+00 0.0000000e+00 1.0000000e+00 0.0000000e+00 0.0000000e+00 0.0000000e+00 1.0000000e+00 , InputImage_1 Direction: -1.0000000e+00 0.0000000e+00 0.0000000e+00 0.0000000e+00 -1.0000000e+00 0.0000000e+00 0.0000000e+00 0.0000000e+00 1.0000000e+00 Tolerance: 1.0000000e-06 No matter what I set the origin to (called ori in the above code), this output stays the same. InputImage_1 should be my sigmoid Image, however, right? Why does the spacing, origin, etc change here? Any help is appreciated! Robert -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Geodesic-Active-Contour-Error-Inputs-do-not-occupy-the-same-physical-space-tp7588851.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From matt.mccormick at kitware.com Mon May 16 11:43:47 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 16 May 2016 11:43:47 -0400 Subject: [ITK-users] Geodesic Active Contour Error: Inputs do not occupy the same physical space! In-Reply-To: <1463412635700-7588851.post@n2.nabble.com> References: <1463412635700-7588851.post@n2.nabble.com> Message-ID: Hi Robert, Has ->Update() been called on all filters before checking their output Origin's? If the origin is checked before the image has been populated, it might not be the correct value. HTH, Matt On Mon, May 16, 2016 at 11:30 AM, Robert wrote: > Hi, > I have an error which I can't find a solution for (or even the origin of > it): > > I have a 3D Volume, which I preprocess with several filters: > > smoothing->SetInput( reader->GetOutput() ); > > gradientMagnitude->SetInput( smoothing->GetOutput() ); > > sigmoid->SetInput( gradientMagnitude->GetOutput() ); > > std::cout << "-------After sigmoid IMPORTANT--------"<< std::endl; > const InternalImageType::PointType & origin2 = > sigmoid->GetOutput()->GetOrigin(); > std::cout << "Origin = "; > std::cout << origin2[0] << ", " > << origin2[1] << ", " > << origin2[2] << std::endl; > > The Origin Output here is 0,0,0 as expected. > Now I do this: > > geodesicActiveContour->SetInput( fastMarching->GetOutput() ); > > > std::cout << "-------After fastmarching -> GetOutput() > IMPORTANT--------"<< std::endl; > const InternalImageType::PointType & origin3 = > fastMarching->GetOutput()->GetOrigin(); > std::cout << "Origin = "; > std::cout << origin3[0] << ", " > << origin3[1] << ", " > << origin3[2] << std::endl; > > //Output still is 0 0 0 > > float ori[3] = {0, 0, 0}; > sigmoid->GetOutput()->SetOrigin(ori); > geodesicActiveContour->SetFeatureImage( sigmoid->GetOutput() ); > const InternalImageType::PointType & originx = > sigmoid->GetOutput()->GetOrigin(); > std::cout << "Origin Important= "; > std::cout << originx[0] << ", " > << originx[1] << ", " > << originx[2] << std::endl; > > Again, here, the cout for the origin says 0,0,0, which should be correct, > and work with the filter. > Now when I execute the whole thing, this pops up: > > Exception caught ! > > itk::ExceptionObject (0xfb0a10) > Location: "void itk::ImageToImageFilter TOutputImage>::VerifyInputInformation() [with TInputImage = > itk::Image; TOutputImage = itk::Image]" > File: /usr/local/include/ITK-4.9/itkImageToImageFilter.hxx > Line: 250 > Description: itk::ERROR: GeodesicActiveContourLevelSetImageFilter(0xf87d40): > Inputs do not occupy the same physical space! > InputImage Origin: [0.0000000e+00, 0.0000000e+00, 0.0000000e+00], > InputImage_1 Origin: [7.2991424e+00, 1.0553263e+01, -7.8717673e+00] > Tolerance: 1.0000000e-06 > InputImage Spacing: [1.0000000e+00, 1.0000000e+00, 1.0000000e+00], > InputImage_1 Spacing: [1.6000000e-01, 1.6000000e-01, 1.5999985e-01] > Tolerance: 1.0000000e-06 > InputImage Direction: 1.0000000e+00 0.0000000e+00 0.0000000e+00 > 0.0000000e+00 1.0000000e+00 0.0000000e+00 > 0.0000000e+00 0.0000000e+00 1.0000000e+00 > , InputImage_1 Direction: -1.0000000e+00 0.0000000e+00 0.0000000e+00 > 0.0000000e+00 -1.0000000e+00 0.0000000e+00 > 0.0000000e+00 0.0000000e+00 1.0000000e+00 > > Tolerance: 1.0000000e-06 > > No matter what I set the origin to (called ori in the above code), this > output stays the same. > > InputImage_1 should be my sigmoid Image, however, right? Why does the > spacing, origin, etc change here? > Any help is appreciated! > > Robert > > > > -- > View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Geodesic-Active-Contour-Error-Inputs-do-not-occupy-the-same-physical-space-tp7588851.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 basafa at clearguidemedical.com Mon May 16 12:13:15 2016 From: basafa at clearguidemedical.com (ebasafa) Date: Mon, 16 May 2016 09:13:15 -0700 (MST) Subject: [ITK-users] [ITK] ShapeLabelMap Roundness/Perimeter Calculation Issue In-Reply-To: <90B961A4-E84E-4BD5-97CD-21A33E9770B7@uiowa.edu> References: <1463153167301-7588837.post@n2.nabble.com> <2D593B3D-C6D6-45EF-93C8-75484575FD49@mail.nih.gov> <1463166733620-7588839.post@n2.nabble.com> <2841BCB1-D769-4736-B82F-E23CA390494C@mail.nih.gov> <1463174884133-7588841.post@n2.nabble.com> <4667DA58-5F4B-4C4F-B1E6-C907A432DCAC@mail.nih.gov> <90B961A4-E84E-4BD5-97CD-21A33E9770B7@uiowa.edu> Message-ID: <1463415195648-7588854.post@n2.nabble.com> So I downloaded and built the latest repository snapshot (https://github.com/InsightSoftwareConsortium/ITK) and it doesn't have that issue anymore. As far as I can see, all instances of vnl_math have been replaced by std or itk::Math methods. So I assume the next release will not have this issue, correct? More details about the compiler and versions: Windows (Visual Studio 2015 Express Desktop); I was using the latest ITK release (4.9.1) as I had mentioned. I will try to come up with a modified test that exposes this issue. So far I have only been a user of ITK, so please excuse the sluggishness. Best, Ehsan -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ShapeLabelMap-Roundness-Perimeter-Calculation-Issue-tp7588837p7588854.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From scorpiuni at gmail.com Mon May 16 12:54:22 2016 From: scorpiuni at gmail.com (Robert) Date: Mon, 16 May 2016 09:54:22 -0700 (MST) Subject: [ITK-users] Geodesic Active Contour Error: Inputs do not occupy the same physical space! In-Reply-To: References: <1463412635700-7588851.post@n2.nabble.com> Message-ID: <1463417662617-7588855.post@n2.nabble.com> Hello, Yes, the Update was actually part of the problem, why could I forget this... However, now I have this result: Code: fastMarching->GetOutput()->SetOrigin(sigmoid->GetOutput()->GetOrigin()); fastMarching->GetOutput()->SetSpacing(sigmoid->GetOutput()->GetSpacing()); fastMarching->GetOutput()->SetDirection(sigmoid->GetOutput()->GetDirection()); fastMarching->GetOutput()->Update(); geodesicActiveContour->SetInput( fastMarching->GetOutput() ); // geodesicActiveContour->SetInput( fastMarching->GetOutput() ); // geodesicActiveContour->Print( std::cout ); std::cout << "-------After geodesicActiveContour fastmarching -> GetOutput() IMPORTANT--------"<< std::endl; const InternalImageType::PointType & origin3 = fastMarching->GetOutput()->GetOrigin(); std::cout << "Origin FastMarching = "; std::cout << origin3[0] << ", " << origin3[1] << ", " << origin3[2] << std::endl; InternalImageType::SpacingType spacing = fastMarching->GetOutput()->GetSpacing(); std::cout << "spacing FastMarching = "; std::cout << spacing[0] << ", " << spacing[1] << ", " << spacing[2] << std::endl; const InternalImageType::DirectionType& direction = fastMarching->GetOutput()->GetDirection(); std::cout << "Direction fast marching = " << std::endl; std::cout << direction << std::endl; // float ori[3] = {7, 7, 7}; // sigmoid->GetOutput()->SetOrigin(ori); geodesicActiveContour->SetFeatureImage( sigmoid->GetOutput() ); // sigmoid->GetOutput()->Set fastMarching->GetOutput()->Update(); const InternalImageType::PointType & originx = sigmoid->GetOutput()->GetOrigin(); std::cout << "Origin Sigmoid= "; std::cout << originx[0] << ", " << originx[1] << ", " << originx[2] << std::endl; InternalImageType::SpacingType spacing1 = sigmoid->GetOutput()->GetSpacing(); std::cout << "spacing Sigmoid = "; std::cout << spacing1[0] << ", " << spacing1[1] << ", " << spacing1[2] << std::endl; const InternalImageType::DirectionType& direction1 = sigmoid->GetOutput()->GetDirection(); std::cout << "Direction Sigmoid = " << std::endl; std::cout << direction1 << std::endl; // geodesicActiveContour->SetFeatureImage( sigmoid->GetOutput() ); // geodesicActiveContour->Print( std::cout ); Console Output: Origin FastMarching = 7.29914, 10.5533, -7.87177 spacing FastMarching = 0.16, 0.16, 0.16 Direction fast marching = -1 0 0 0 -1 0 0 0 1 Origin Sigmoid= 7.29914, 10.5533, -7.87177 spacing Sigmoid = 0.16, 0.16, 0.16 Direction Sigmoid = -1 0 0 0 -1 0 0 0 1 -------After thresholder-------- Origin Thresholder = 7.29914, 10.5533, -7.87177 Exception caught ! itk::ExceptionObject (0x125d5f0) Location: "void itk::ImageToImageFilter::VerifyInputInformation() [with TInputImage = itk::Image; TOutputImage = itk::Image]" File: /usr/local/include/ITK-4.9/itkImageToImageFilter.hxx Line: 250 Description: itk::ERROR: GeodesicActiveContourLevelSetImageFilter(0x1256d40): Inputs do not occupy the same physical space! InputImage Origin: [0.0000000e+00, 0.0000000e+00, 0.0000000e+00], InputImage_1 Origin: [7.2991424e+00, 1.0553263e+01, -7.8717673e+00] Tolerance: 1.0000000e-06 InputImage Spacing: [1.0000000e+00, 1.0000000e+00, 1.0000000e+00], InputImage_1 Spacing: [1.6000000e-01, 1.6000000e-01, 1.5999985e-01] Tolerance: 1.0000000e-06 InputImage Direction: 1.0000000e+00 0.0000000e+00 0.0000000e+00 0.0000000e+00 1.0000000e+00 0.0000000e+00 0.0000000e+00 0.0000000e+00 1.0000000e+00 , InputImage_1 Direction: -1.0000000e+00 0.0000000e+00 0.0000000e+00 0.0000000e+00 -1.0000000e+00 0.0000000e+00 0.0000000e+00 0.0000000e+00 1.0000000e+00 Tolerance: 1.0000000e-06 So the error is still the same as before, even with my 2 filters updated/having the same output now.... Is there another Update() that I missed? I mean, it should now get 2 times the same values, right? -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Geodesic-Active-Contour-Error-Inputs-do-not-occupy-the-same-physical-space-tp7588851p7588855.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From bill.lorensen at gmail.com Mon May 16 13:00:56 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Mon, 16 May 2016 13:00:56 -0400 Subject: [ITK-users] Geodesic Active Contour Error: Inputs do not occupy the same physical space! In-Reply-To: <1463417662617-7588855.post@n2.nabble.com> References: <1463412635700-7588851.post@n2.nabble.com> <1463417662617-7588855.post@n2.nabble.com> Message-ID: Run updates on your filters, not your images. On Mon, May 16, 2016 at 12:54 PM, Robert wrote: > Hello, > Yes, the Update was actually part of the problem, why could I forget this... > However, now I have this result: > Code: > fastMarching->GetOutput()->SetOrigin(sigmoid->GetOutput()->GetOrigin()); > fastMarching->GetOutput()->SetSpacing(sigmoid->GetOutput()->GetSpacing()); > > fastMarching->GetOutput()->SetDirection(sigmoid->GetOutput()->GetDirection()); > fastMarching->GetOutput()->Update(); > geodesicActiveContour->SetInput( fastMarching->GetOutput() ); > // geodesicActiveContour->SetInput( fastMarching->GetOutput() ); > // geodesicActiveContour->Print( std::cout ); > > > std::cout << "-------After geodesicActiveContour fastmarching -> > GetOutput() IMPORTANT--------"<< std::endl; > const InternalImageType::PointType & origin3 = > fastMarching->GetOutput()->GetOrigin(); > std::cout << "Origin FastMarching = "; > std::cout << origin3[0] << ", " > << origin3[1] << ", " > << origin3[2] << std::endl; > InternalImageType::SpacingType spacing = > fastMarching->GetOutput()->GetSpacing(); > std::cout << "spacing FastMarching = "; > std::cout << spacing[0] << ", " > << spacing[1] << ", " > << spacing[2] << std::endl; > const InternalImageType::DirectionType& direction = > fastMarching->GetOutput()->GetDirection(); > std::cout << "Direction fast marching = " << std::endl; > std::cout << direction << std::endl; > > > > // float ori[3] = {7, 7, 7}; > // sigmoid->GetOutput()->SetOrigin(ori); > geodesicActiveContour->SetFeatureImage( sigmoid->GetOutput() ); > // sigmoid->GetOutput()->Set > fastMarching->GetOutput()->Update(); > const InternalImageType::PointType & originx = > sigmoid->GetOutput()->GetOrigin(); > std::cout << "Origin Sigmoid= "; > std::cout << originx[0] << ", " > << originx[1] << ", " > << originx[2] << std::endl; > InternalImageType::SpacingType spacing1 = > sigmoid->GetOutput()->GetSpacing(); > std::cout << "spacing Sigmoid = "; > std::cout << spacing1[0] << ", " > << spacing1[1] << ", " > << spacing1[2] << std::endl; > const InternalImageType::DirectionType& direction1 = > sigmoid->GetOutput()->GetDirection(); > std::cout << "Direction Sigmoid = " << std::endl; > std::cout << direction1 << std::endl; > // geodesicActiveContour->SetFeatureImage( sigmoid->GetOutput() ); > // geodesicActiveContour->Print( std::cout ); > > Console Output: > > Origin FastMarching = 7.29914, 10.5533, -7.87177 > spacing FastMarching = 0.16, 0.16, 0.16 > Direction fast marching = > -1 0 0 > 0 -1 0 > 0 0 1 > > Origin Sigmoid= 7.29914, 10.5533, -7.87177 > spacing Sigmoid = 0.16, 0.16, 0.16 > Direction Sigmoid = > -1 0 0 > 0 -1 0 > 0 0 1 > > -------After thresholder-------- > Origin Thresholder = 7.29914, 10.5533, -7.87177 > Exception caught ! > > itk::ExceptionObject (0x125d5f0) > Location: "void itk::ImageToImageFilter TOutputImage>::VerifyInputInformation() [with TInputImage = > itk::Image; TOutputImage = itk::Image]" > File: /usr/local/include/ITK-4.9/itkImageToImageFilter.hxx > Line: 250 > Description: itk::ERROR: > GeodesicActiveContourLevelSetImageFilter(0x1256d40): Inputs do not occupy > the same physical space! > InputImage Origin: [0.0000000e+00, 0.0000000e+00, 0.0000000e+00], > InputImage_1 Origin: [7.2991424e+00, 1.0553263e+01, -7.8717673e+00] > Tolerance: 1.0000000e-06 > InputImage Spacing: [1.0000000e+00, 1.0000000e+00, 1.0000000e+00], > InputImage_1 Spacing: [1.6000000e-01, 1.6000000e-01, 1.5999985e-01] > Tolerance: 1.0000000e-06 > InputImage Direction: 1.0000000e+00 0.0000000e+00 0.0000000e+00 > 0.0000000e+00 1.0000000e+00 0.0000000e+00 > 0.0000000e+00 0.0000000e+00 1.0000000e+00 > , InputImage_1 Direction: -1.0000000e+00 0.0000000e+00 0.0000000e+00 > 0.0000000e+00 -1.0000000e+00 0.0000000e+00 > 0.0000000e+00 0.0000000e+00 1.0000000e+00 > > Tolerance: 1.0000000e-06 > > So the error is still the same as before, even with my 2 filters > updated/having the same output now.... Is there another Update() that I > missed? I mean, it should now get 2 times the same values, right? > > > > -- > View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Geodesic-Active-Contour-Error-Inputs-do-not-occupy-the-same-physical-space-tp7588851p7588855.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 -- Unpaid intern in BillsBasement at noware dot com From dzenanz at gmail.com Mon May 16 13:02:21 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Mon, 16 May 2016 13:02:21 -0400 Subject: [ITK-users] [ITK] ShapeLabelMap Roundness/Perimeter Calculation Issue In-Reply-To: <1463415195648-7588854.post@n2.nabble.com> References: <1463153167301-7588837.post@n2.nabble.com> <2D593B3D-C6D6-45EF-93C8-75484575FD49@mail.nih.gov> <1463166733620-7588839.post@n2.nabble.com> <2841BCB1-D769-4736-B82F-E23CA390494C@mail.nih.gov> <1463174884133-7588841.post@n2.nabble.com> <4667DA58-5F4B-4C4F-B1E6-C907A432DCAC@mail.nih.gov> <90B961A4-E84E-4BD5-97CD-21A33E9770B7@uiowa.edu> <1463415195648-7588854.post@n2.nabble.com> Message-ID: Hi Ehsan, master version always has more bugs fixed and a few extra features than the latest release. It is always best to check if a problem has been fixed in master branch before going through creation of a minimum working example to reproduce some problem. Poke around to see if the issue was properly fixed in master, and then report your findings. Regards, D?enan On Mon, May 16, 2016 at 12:13 PM, ebasafa wrote: > So I downloaded and built the latest repository snapshot > (https://github.com/InsightSoftwareConsortium/ITK) and it doesn't have > that > issue anymore. As far as I can see, all instances of vnl_math have been > replaced by std or itk::Math methods. So I assume the next release will not > have this issue, correct? > > More details about the compiler and versions: Windows (Visual Studio 2015 > Express Desktop); I was using the latest ITK release (4.9.1) as I had > mentioned. > > I will try to come up with a modified test that exposes this issue. So far > I > have only been a user of ITK, so please excuse the sluggishness. > > Best, > Ehsan > > > > -- > View this message in context: > http://itk-insight-users.2283740.n2.nabble.com/ShapeLabelMap-Roundness-Perimeter-Calculation-Issue-tp7588837p7588854.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 scorpiuni at gmail.com Mon May 16 13:49:56 2016 From: scorpiuni at gmail.com (Robert) Date: Mon, 16 May 2016 10:49:56 -0700 (MST) Subject: [ITK-users] Geodesic Active Contour Error: Inputs do not occupy the same physical space! In-Reply-To: References: <1463412635700-7588851.post@n2.nabble.com> <1463417662617-7588855.post@n2.nabble.com> Message-ID: <1463420996987-7588858.post@n2.nabble.com> Ooops, you're right. But I still don't get it. Now the last error persisting is this one: terminate called after throwing an instance of 'itk::ExceptionObject' what(): /usr/local/include/ITK-4.9/itkImageToImageFilter.hxx:250: itk::ERROR: GeodesicActiveContourLevelSetImageFilter(0x2127d40): Inputs do not occupy the same physical space! InputImage Origin: [0.0000000e+00, 0.0000000e+00, 0.0000000e+00], InputImage_1 Origin: [7.2991424e+00, 1.0553263e+01, -7.8717673e+00] Tolerance: 1.6000000e-07 Why doesn't the Origin change?! I tried GetOrigin etc as well, nothing worked. It always sets the Origin as 0 0 0. Spacing and Direction now seem to work. Is there some order that needs to be respected? If I change the order of the commands, it seems like the first ont called always fails... Or is it simply impossible to get all 3 arguments correct without modifying the Tolerance somewhere? When 2 Args seem to be right, the 3rd one always fails.... InternalImageType::PointType newOrigin; //newOrigin.Fill(0.0); newOrigin[0] = 7.2991424; newOrigin[1] = 10.553263; newOrigin[2] = -7.8717673; fastMarching->GetOutput()->SetOrigin(newOrigin); fastMarching->Update(); fastMarching->GetOutput()->SetSpacing(sigmoid->GetOutput()->GetSpacing()); fastMarching->Update(); fastMarching->GetOutput()->SetDirection(sigmoid->GetOutput()->GetDirection()); //fastMarching->GetOutput()->Update(); fastMarching->Update(); -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Geodesic-Active-Contour-Error-Inputs-do-not-occupy-the-same-physical-space-tp7588851p7588858.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From bill.lorensen at gmail.com Mon May 16 13:54:48 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Mon, 16 May 2016 13:54:48 -0400 Subject: [ITK-users] Geodesic Active Contour Error: Inputs do not occupy the same physical space! In-Reply-To: <1463420996987-7588858.post@n2.nabble.com> References: <1463412635700-7588851.post@n2.nabble.com> <1463417662617-7588855.post@n2.nabble.com> <1463420996987-7588858.post@n2.nabble.com> Message-ID: You cannot set the origin, direciton and spacing directly. Use the itkChangeInformationImageFilter. It does not copy the data, just changes the meta information. On Mon, May 16, 2016 at 1:49 PM, Robert wrote: > Ooops, you're right. > But I still don't get it. > Now the last error persisting is this one: > > terminate called after throwing an instance of 'itk::ExceptionObject' > what(): /usr/local/include/ITK-4.9/itkImageToImageFilter.hxx:250: > itk::ERROR: GeodesicActiveContourLevelSetImageFilter(0x2127d40): Inputs do > not occupy the same physical space! > InputImage Origin: [0.0000000e+00, 0.0000000e+00, 0.0000000e+00], > InputImage_1 Origin: [7.2991424e+00, 1.0553263e+01, -7.8717673e+00] > Tolerance: 1.6000000e-07 > > Why doesn't the Origin change?! I tried GetOrigin etc as well, nothing > worked. It always sets the Origin as 0 0 0. Spacing and Direction now seem > to work. Is there some order that needs to be respected? If I change the > order of the commands, it seems like the first ont called always fails... Or > is it simply impossible to get all 3 arguments correct without modifying the > Tolerance somewhere? When 2 Args seem to be right, the 3rd one always > fails.... > > InternalImageType::PointType newOrigin; > //newOrigin.Fill(0.0); > newOrigin[0] = 7.2991424; > newOrigin[1] = 10.553263; > newOrigin[2] = -7.8717673; > > fastMarching->GetOutput()->SetOrigin(newOrigin); > fastMarching->Update(); > fastMarching->GetOutput()->SetSpacing(sigmoid->GetOutput()->GetSpacing()); > fastMarching->Update(); > > fastMarching->GetOutput()->SetDirection(sigmoid->GetOutput()->GetDirection()); > //fastMarching->GetOutput()->Update(); > fastMarching->Update(); > > > > -- > View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Geodesic-Active-Contour-Error-Inputs-do-not-occupy-the-same-physical-space-tp7588851p7588858.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 -- Unpaid intern in BillsBasement at noware dot com From dzenanz at gmail.com Mon May 16 13:59:24 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Mon, 16 May 2016 13:59:24 -0400 Subject: [ITK-users] Geodesic Active Contour Error: Inputs do not occupy the same physical space! In-Reply-To: <1463420996987-7588858.post@n2.nabble.com> References: <1463412635700-7588851.post@n2.nabble.com> <1463417662617-7588855.post@n2.nabble.com> <1463420996987-7588858.post@n2.nabble.com> Message-ID: Hi Robert, if you want to modify an intermediate result, you should save it to a variable, e.g.: ImageType::Pointer fmOutput=fastMarching->GetOutput(); then call Set* methods on fmOutput. Otherwise the pipeline update propagation mechanism might interfere with intermediate results and overwrite your changes. Regards, D?enan On Mon, May 16, 2016 at 1:49 PM, Robert wrote: > Ooops, you're right. > But I still don't get it. > Now the last error persisting is this one: > > terminate called after throwing an instance of 'itk::ExceptionObject' > what(): /usr/local/include/ITK-4.9/itkImageToImageFilter.hxx:250: > itk::ERROR: GeodesicActiveContourLevelSetImageFilter(0x2127d40): Inputs do > not occupy the same physical space! > InputImage Origin: [0.0000000e+00, 0.0000000e+00, 0.0000000e+00], > InputImage_1 Origin: [7.2991424e+00, 1.0553263e+01, -7.8717673e+00] > Tolerance: 1.6000000e-07 > > Why doesn't the Origin change?! I tried GetOrigin etc as well, nothing > worked. It always sets the Origin as 0 0 0. Spacing and Direction now seem > to work. Is there some order that needs to be respected? If I change the > order of the commands, it seems like the first ont called always fails... > Or > is it simply impossible to get all 3 arguments correct without modifying > the > Tolerance somewhere? When 2 Args seem to be right, the 3rd one always > fails.... > > InternalImageType::PointType newOrigin; > //newOrigin.Fill(0.0); > newOrigin[0] = 7.2991424; > newOrigin[1] = 10.553263; > newOrigin[2] = -7.8717673; > > fastMarching->GetOutput()->SetOrigin(newOrigin); > fastMarching->Update(); > > fastMarching->GetOutput()->SetSpacing(sigmoid->GetOutput()->GetSpacing()); > fastMarching->Update(); > > > fastMarching->GetOutput()->SetDirection(sigmoid->GetOutput()->GetDirection()); > //fastMarching->GetOutput()->Update(); > fastMarching->Update(); > > > > -- > View this message in context: > http://itk-insight-users.2283740.n2.nabble.com/Geodesic-Active-Contour-Error-Inputs-do-not-occupy-the-same-physical-space-tp7588851p7588858.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 scorpiuni at gmail.com Mon May 16 14:06:50 2016 From: scorpiuni at gmail.com (Robert) Date: Mon, 16 May 2016 11:06:50 -0700 (MST) Subject: [ITK-users] SimpleITK OtsuThresholdImageFilter In-Reply-To: <1463356404009-7588850.post@n2.nabble.com> References: <1463356404009-7588850.post@n2.nabble.com> Message-ID: <1463422010010-7588861.post@n2.nabble.com> Just a shot in the dark as I'm currently not on my programming environment in order to test it for myself, but did you try setting/changing the thresholds? There should be a function like filter.SetInsideValue() and filter.SetOutsideValue() or filter.SetTreshold (this one for the BinaryThresholdImageFilter, as otsu should calculate one on the fly). -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/SimpleITK-OtsuThresholdImageFilter-tp7588850p7588861.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From hans-johnson at uiowa.edu Mon May 16 14:07:12 2016 From: hans-johnson at uiowa.edu (Johnson, Hans J) Date: Mon, 16 May 2016 18:07:12 +0000 Subject: [ITK-users] [ITK] ShapeLabelMap Roundness/Perimeter Calculation Issue In-Reply-To: <1463415195648-7588854.post@n2.nabble.com> References: <1463153167301-7588837.post@n2.nabble.com> <2D593B3D-C6D6-45EF-93C8-75484575FD49@mail.nih.gov> <1463166733620-7588839.post@n2.nabble.com> <2841BCB1-D769-4736-B82F-E23CA390494C@mail.nih.gov> <1463174884133-7588841.post@n2.nabble.com> <4667DA58-5F4B-4C4F-B1E6-C907A432DCAC@mail.nih.gov> <90B961A4-E84E-4BD5-97CD-21A33E9770B7@uiowa.edu> <1463415195648-7588854.post@n2.nabble.com> Message-ID: <9624EA1B-1C34-474C-99F8-8B9D941591AB@uiowa.edu> GREAT! I do think this is resolved in the latest versions of ITK. It will be even more fortified on the next VXL upgrade to ITK where C++11 features of VS are handled better. Hans -- On 5/16/16, 11:13 AM, "Insight-users on behalf of ebasafa" wrote: >So I downloaded and built the latest repository snapshot >(https://github.com/InsightSoftwareConsortium/ITK) and it doesn't have that >issue anymore. As far as I can see, all instances of vnl_math have been >replaced by std or itk::Math methods. So I assume the next release will not >have this issue, correct? > >More details about the compiler and versions: Windows (Visual Studio 2015 >Express Desktop); I was using the latest ITK release (4.9.1) as I had >mentioned. > >I will try to come up with a modified test that exposes this issue. So far I >have only been a user of ITK, so please excuse the sluggishness. > >Best, >Ehsan > > > >-- >View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ShapeLabelMap-Roundness-Perimeter-Calculation-Issue-tp7588837p7588854.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 scorpiuni at gmail.com Tue May 17 12:37:47 2016 From: scorpiuni at gmail.com (Robert) Date: Tue, 17 May 2016 09:37:47 -0700 (MST) Subject: [ITK-users] Geodesic Active Contour Error: Inputs do not occupy the same physical space! In-Reply-To: References: <1463412635700-7588851.post@n2.nabble.com> <1463417662617-7588855.post@n2.nabble.com> <1463420996987-7588858.post@n2.nabble.com> Message-ID: <1463503067706-7588863.post@n2.nabble.com> Thanks for the tip, it now works! -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Geodesic-Active-Contour-Error-Inputs-do-not-occupy-the-same-physical-space-tp7588851p7588863.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From matimontg at gmail.com Tue May 17 21:51:45 2016 From: matimontg at gmail.com (Matias Montroull) Date: Wed, 18 May 2016 01:51:45 +0000 Subject: [ITK-users] SetOutputOrigin(origin) not working on writer In-Reply-To: References: Message-ID: Thanks, I actually had to add this line of code to the writer: writer->UseInputMetaDataDictionaryOff(); Not sure why but it worked and it also copied all tags from the original image into the output image. El dom., 15 de may. de 2016 a la(s) 12:45, Bill Lorensen < bill.lorensen at gmail.com> escribi?: > After > reader->SetFileName(argv[1]); > reader->Update(); > > No need for inputImage->Update(); > > Since you did not Update the reader, the origin and spacing will be > (0,0,0) and(1,1,1) by defulat. > > > On Sat, May 14, 2016 at 7:42 PM, Matias Montroull > wrote: > > Hi, > > > > I have the following code to flip an image and preserve origin and > spacing. > > For some reason, the writer doesn't copy the Origin from the original > image > > into the output Image. > > > > I can see the Output Image origin is the Original Image origin but I > don't > > understand why the writer doesn't take that value. I have no issues with > the > > spacing, that one is copied just fine into the output image. > > > > I'm using ITK 4.7.2 > > > > #include "itkImage.h" > > #include "itkImageFileReader.h" > > #include "itkImageFileWriter.h" > > #include "itkFlipImageFilter.h" > > #include "itkChangeInformationImageFilter.h" > > > > int main(int argc, char* argv[]) > > { > > if (argc != 4) > > { > > std::cerr << "Usage: " << argv[0]; > > std::cerr << " "; > > std::cerr << std::endl; > > return EXIT_FAILURE; > > } > > > > typedef itk::Image ImageType; > > > > typedef itk::ImageFileReader< ImageType > ReaderType; > > ReaderType::Pointer reader = ReaderType::New(); > > > > reader->SetFileName(argv[1]); > > > > ImageType::Pointer inputImage = reader->GetOutput(); > > inputImage->Update(); //Importante!! Sin esto no agarra el origen > > > > ImageType::PointType origin = inputImage->GetOrigin(); > > ImageType::SpacingType spacing = inputImage->GetSpacing(); > > > > typedef itk::FlipImageFilter< ImageType > FlipImageFilterType; > > FlipImageFilterType::Pointer flipFilter = FlipImageFilterType::New(); > > > > typedef itk::ChangeInformationImageFilter< ImageType > FilterType; > > FilterType::Pointer filter = FilterType::New(); > > filter->SetInput(reader->GetOutput()); > > > > filter->SetOutputOrigin(origin); > > filter->ChangeOriginOn(); > > filter->SetOutputSpacing(spacing); > > filter->ChangeSpacingOn(); > > > > flipFilter->SetInput(filter->GetOutput()); > > flipFilter->Update(); > > > > FlipImageFilterType::FlipAxesArrayType flipAxes; > > if (atoi(argv[3]) == 0) > > { > > flipAxes[0] = true; > > flipAxes[1] = false; > > } > > else > > { > > flipAxes[0] = false; > > flipAxes[1] = true; > > } > > > > flipFilter->SetFlipAxes(flipAxes); > > typedef itk::ImageFileWriter< ImageType > WriterType; > > WriterType::Pointer writer = WriterType::New(); > > writer->SetFileName(argv[2]); > > writer->SetInput(flipFilter->GetOutput()); > > try > > { > > writer->Update(); > > std::cout << "Input origin is: " << reader->GetOutput()->GetOrigin() << > > std::endl; > > std::cout << "Output origin is: " << > flipFilter->GetOutput()->GetOrigin() << > > std::endl; > > } > > catch (itk::ExceptionObject & error) > > { > > std::cerr << "Error: " << error << std::endl; > > return EXIT_FAILURE; > > } > > > > return EXIT_SUCCESS; > > } > > > > -- > > Matias > > > > _____________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Kitware offers ITK Training Courses, for more information visit: > > http://www.kitware.com/products/protraining.php > > > > Please keep messages on-topic and check the ITK FAQ at: > > http://www.itk.org/Wiki/ITK_FAQ > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/insight-users > > > > > > -- > Unpaid intern in BillsBasement at noware dot com > -- Matias -------------- next part -------------- An HTML attachment was scrubbed... URL: From scorpiuni at gmail.com Wed May 18 09:38:44 2016 From: scorpiuni at gmail.com (Robert) Date: Wed, 18 May 2016 06:38:44 -0700 (MST) Subject: [ITK-users] Geodesic Active Contour with Shape Guidance Parameters Message-ID: <1463578724389-7588865.post@n2.nabble.com> Hello, I was trying out the Geodesic Active Contour with Shape Guidance example from the ITK book, but I can't get the same result as described in the book. There is a parameter called "startx" and "starty" that you need to provide. This isn't explained in the text. How do I need to choose those parameters, and what do they mean/influence? I tried a few different ones, but I don't see any influence, however my "final parameters" result is different than in the book. Also, my output image looks wrong in the sense that it is not rotated at all, it does not seem to find the right spot in the image.... Could anyone explain those parameters to me? -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Geodesic-Active-Contour-with-Shape-Guidance-Parameters-tp7588865.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From tevain at telecom-paristech.fr Wed May 18 11:40:09 2016 From: tevain at telecom-paristech.fr (Timothee Evain) Date: Wed, 18 May 2016 17:40:09 +0200 (CEST) Subject: [ITK-users] [ITK] Geodesic Active Contour with Shape Guidance Parameters In-Reply-To: <1463578724389-7588865.post@n2.nabble.com> References: <1463578724389-7588865.post@n2.nabble.com> Message-ID: <435157526.59418114.1463586009463.JavaMail.zimbra@enst.fr> Hello, Quote from the ITK book right beside the code snippet that troubles you (at least in my book version, i.e. 4.5): "Before starting the segmentation process we need to also supply the initial best-fit shape estimate. In this example, we start with the unrotated mean shape with the initial x- and y- translation specified through command-line arguments." So startx and starty are the initial translation (of shape model) parameters that are given as the optimizer initialization. The other parameters are the rotation and the principal component multipliers as explained earlier in the example. About the influence, it highly depends on the scale parameters. If you gave them a high scale value relative to others, they are likely to stay stable during the optimization. HTH, Tim ----- Mail original ----- De: "Robert" ?: insight-users at itk.org Envoy?: Mercredi 18 Mai 2016 15:38:44 Objet: [ITK] [ITK-users] Geodesic Active Contour with Shape Guidance Parameters Hello, I was trying out the Geodesic Active Contour with Shape Guidance example from the ITK book, but I can't get the same result as described in the book. There is a parameter called "startx" and "starty" that you need to provide. This isn't explained in the text. How do I need to choose those parameters, and what do they mean/influence? I tried a few different ones, but I don't see any influence, however my "final parameters" result is different than in the book. Also, my output image looks wrong in the sense that it is not rotated at all, it does not seem to find the right spot in the image.... Could anyone explain those parameters to me? -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Geodesic-Active-Contour-with-Shape-Guidance-Parameters-tp7588865.html Sent from the ITK Insight Users mailing list archive at Nabble.com. _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users _______________________________________________ Community mailing list Community at itk.org http://public.kitware.com/mailman/listinfo/community From matt.mccormick at kitware.com Wed May 18 12:16:56 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Wed, 18 May 2016 12:16:56 -0400 Subject: [ITK-users] [ITK] Geodesic Active Contour with Shape Guidance Parameters In-Reply-To: <435157526.59418114.1463586009463.JavaMail.zimbra@enst.fr> References: <1463578724389-7588865.post@n2.nabble.com> <435157526.59418114.1463586009463.JavaMail.zimbra@enst.fr> Message-ID: Hi, Additionally, it may be helpful to look at the source code that is used to generate the text: https://github.com/InsightSoftwareConsortium/ITK/blob/master/Examples/Segmentation/GeodesicActiveContourShapePriorLevelSetImageFilter.cxx There is also a test in ITK. Turn on BUILD_EXAMPLES and BUILD_TESTING in ITK's CMake configuration. To see the command use to run the test, execute "ctest" from the ITK build tree with the "-V" flag for verbose and "-R" to select the test name. `--> ctest -R GeodesicActiveContourShapePriorCallosumTest -V [...] Start 2489: GeodesicActiveContourShapePriorCallosumTest 2489: Test command: /home/matt/bin/ITK-Clang-MinSizeRel/bin/itkTestDriver "--compare" "/home/matt/bin/ITK-Clang-MinSizeRel/ExternalData/Testing/Data/Baseline/Segmentation/GeodesicActiveContourShapePriorCallosumTest.png" "/home/matt/bin/ITK-Clang-MinSizeRel/Testing/Temporary/GeodesicActiveContourShapePriorCallosumTest.png" "/home/matt/bin/ITK-Clang-MinSizeRel/bin/GeodesicActiveContourShapePriorLevelSetImageFilter" "/home/matt/src/ITK/Examples/Data/BrainMidSagittalSlice.png" "/home/matt/bin/ITK-Clang-MinSizeRel/Testing/Temporary/GeodesicActiveContourShapePriorCallosumTest.png" "120" "85" "60" "102" "88" "83" "6" "1.0" "0.5" "0.02" "/home/matt/src/ITK/Examples/Data/CorpusCallosumMeanShape.mha" "3" "/home/matt/src/ITK/Examples/Data/CorpusCallosumMode%d.mha" "10" "0" 2489: Test timeout computed to be: 1500 2489: 1: 0.045812 [-0.035055221959695966, -0.09800734065323966, 0.04907730547869208, 0.005318973983536123, 10.86828403407632, 1.004596337951197] 2489: 2: 0.042193 [-0.059140664486747936, -0.08336078625977526, 0.04435292989759791, 0.004098441654243041, 10.432127400031401, 0.4590531607561731] 2489: 3: 0.0404411 [-0.07105401413026971, -0.06988223639208144, 0.06116857571760887, 0.0014592130990724208, 11.267062616976325, 0.57187964997921] 2489: 4: 0.0387712 [-0.07105401413026971, -0.06988223639208144, 0.06116857571760887, 0.0014592130990724208, 11.267062616976325, 0.57187964997921] [...] HTH, Matt On Wed, May 18, 2016 at 11:40 AM, Timothee Evain wrote: > Hello, > > Quote from the ITK book right beside the code snippet that troubles you (at least in my book version, i.e. 4.5): > "Before starting the segmentation process we need to also supply the initial best-fit shape estimate. > In this example, we start with the unrotated mean shape with the initial x- and y- translation > specified through command-line arguments." > > So startx and starty are the initial translation (of shape model) parameters that are given as the optimizer initialization. > The other parameters are the rotation and the principal component multipliers as explained earlier in the example. > > About the influence, it highly depends on the scale parameters. > If you gave them a high scale value relative to others, they are likely to stay stable during the optimization. > > HTH, > > Tim > > > ----- Mail original ----- > De: "Robert" > ?: insight-users at itk.org > Envoy?: Mercredi 18 Mai 2016 15:38:44 > Objet: [ITK] [ITK-users] Geodesic Active Contour with Shape Guidance Parameters > > Hello, > I was trying out the Geodesic Active Contour with Shape Guidance example > from the ITK book, but I can't get the same result as described in the book. > There is a parameter called "startx" and "starty" that you need to provide. > This isn't explained in the text. How do I need to choose those parameters, > and what do they mean/influence? I tried a few different ones, but I don't > see any influence, however my "final parameters" result is different than in > the book. Also, my output image looks wrong in the sense that it is not > rotated at all, it does not seem to find the right spot in the image.... > Could anyone explain those parameters to me? > > > > > -- > View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Geodesic-Active-Contour-with-Shape-Guidance-Parameters-tp7588865.html > Sent from the ITK Insight Users mailing list archive at Nabble.com. > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 Thu May 19 13:22:50 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 19 May 2016 13:22:50 -0400 Subject: [ITK-users] Strange situation when ITK writes DICOM file In-Reply-To: <1462841109770.29758@sphic.org.cn> References: <1450834862664.8600@sphic.org.cn> <1461914235636.15330@sphic.org.cn> <1462243202460.83843@sphic.org.cn> <1462841109770.29758@sphic.org.cn> Message-ID: Hi Zhuangming, That is great to hear. As far as the data types supported by GDCM that are exposed by ITK, this code snippet is informative: https://github.com/InsightSoftwareConsortium/ITK/blob/417d6a36d01aa3b835855349cc481a9b3dca8506/Modules/IO/GDCM/src/itkGDCMImageIO.cxx#L334-L370 Hope this helps, Matt On Mon, May 9, 2016 at 8:45 PM, ??? wrote: > Hi Matt, > > Thank you for your reply. I have tried to use ITK Git master and the code provided by D?enan, it can work correctly. Thanks again. > > By the way, could you list what data types (e.g. char type) do the updated GDCM support now? > > > Regards, > > Zhuangming Shen > ________________________________________ > From: Matt McCormick > Sent: Thursday, May 5, 2016 10:21 PM > To: ??? > Cc: D?enan Zuki?; insight-users at itk.org > Subject: Re: [ITK-users] Strange situation when ITK writes DICOM file > > Hi Zhuangming Shen, > > GDCM was updated in ITK Git master, to be released in ITK 4.10. > Instructions on how to obtain this version can be found here: > > https://itk.org/Wiki/ITK/Git/Download > > Thanks, > Matt > > On Mon, May 2, 2016 at 10:40 PM, ??? wrote: >> Hi D?enan, >> >> >> Thanks for your prompt response. I used ITK 4.9.1 and your attached code >> (just changed inDir and outFile) to test both public DICOM data >> (http://www.osirix-viewer.com/datasets/DATA/BREBIX.zip) and private DICOM >> data, the results are still incorrect (please see the attached screenshot). >> What's the problem? >> >> >> Besides, as far as I know, rescaling the intensity from short type to char >> type leads to lose precision because the DICOM tags ( (0028,0100) and >> (0028,0101) ) show the BitsAllocated is 16-bits and the BitsStored is >> 12-bits. Consequently, this solution doesn't seem to be a good solution. Is >> it possible to output the DICOM file by other tools (e.g. DCMTK) if the GDCM >> doesn't support short type? >> >> >> >> Regards, >> >> >> Zhuangming Shen >> >> >> >> >> ________________________________ >> From: D?enan Zuki? >> Sent: Friday, April 29, 2016 9:59 PM >> To: ??? >> Cc: insight-users at itk.org; Matt McCormick >> >> Subject: Re: [ITK-users] Strange situation when ITK writes DICOM file >> >> Hi Shen, >> >> GDCM version was updated recently. It now complains that short type is >> unsupported, and works correctly with char type. I attached an example which >> rescales the intensity and works correctly. >> >> Regards, >> D?enan >> >> On Fri, Apr 29, 2016 at 3:17 AM, ??? wrote: >>> >>> Hi D?enan, >>> >>> >>> I'd like to know if the bug regarding 3D DICOM writer has been fixed. When >>> I tried to run the same code but using ITK 4.9.1, I still got the same >>> results, i.e. the output DICOM file does not properly record original >>> image's origin and spacing. >>> >>> >>> >>> Regards, >>> >>> >>> Zhuangming Shen >>> >>> ________________________________ >>> From: D?enan Zuki? >>> Sent: Saturday, December 26, 2015 1:44 AM >>> To: ??? >>> Cc: insight-users at itk.org >>> Subject: Re: [ITK-users] Strange situation when ITK writes DICOM file >>> >>> I have confirmed this bug and entered it into tracker along with a DICOM >>> series which reproduces it. >>> >>> Thanks Shen >>> >>> On Tue, Dec 22, 2015 at 8:41 PM, ??? wrote: >>>> >>>> Hi all, >>>> >>>> >>>> I met a very strange situation when I used ITK 4.8.1. I'd like to read a >>>> DICOM series, write it to a DICOM file (i.e. save the volume created by the >>>> DICOM series to a .dcm file), and read the DICOM file. Theoretically, the >>>> DICOM series and the DCM file should have the same information, e.g origin, >>>> spacing, size. However, My results show me that the information has been >>>> changed. When I use other ITK-support file format (e.g. nii, nrrd), the >>>> information has not been changed. It seems a bug. My code and results are >>>> listed as below. Has anyone met the same situation? >>>> >>>> >>>> Regards, >>>> >>>> >>>> Zhuangming Shen >>>> >>>> >>>> >>>> >>>> ================ My code ================= >>>> >>>> >>>> import itk >>>> >>>> input_dir = "/home/zshen/workspace/Data/testDCM/bbb" >>>> output_filename = "/home/zshen/workspace/Data/bbb2.dcm" >>>> >>>> # read DICOM series >>>> dicom_io = itk.GDCMImageIO.New() >>>> >>>> reader = itk.ImageSeriesReader[itk.Image.SS3].New() >>>> reader.SetImageIO(dicom_io) >>>> >>>> name_generator = itk.GDCMSeriesFileNames.New() >>>> name_generator.SetUseSeriesDetails(True) >>>> name_generator.SetDirectory(input_dir) >>>> >>>> series_uid = name_generator.GetSeriesUIDs() >>>> >>>> series_identifier = series_uid[0] >>>> >>>> file_names = name_generator.GetFileNames(series_identifier) >>>> >>>> reader.SetFileNames(file_names) >>>> reader.Update() >>>> >>>> print("**** series DICOM information: *****") >>>> print("size: >>>> "+str(reader.GetOutput().GetLargestPossibleRegion().GetSize())) >>>> print("origin: "+str(reader.GetOutput().GetOrigin())) >>>> print("spacing: "+str(reader.GetOutput().GetSpacing())) >>>> >>>> writer = itk.ImageFileWriter[itk.Image.SS3].New() >>>> writer.SetInput(reader.GetOutput()) >>>> writer.SetFileName(output_filename) >>>> writer.Update() >>>> >>>> # read again >>>> reader2 = itk.ImageFileReader[itk.Image.SS3].New() >>>> reader2.SetFileName(output_filename) >>>> reader2.Update() >>>> >>>> print("**** DICOM information: *****") >>>> print("size: >>>> "+str(reader2.GetOutput().GetLargestPossibleRegion().GetSize())) >>>> print("origin: "+str(reader2.GetOutput().GetOrigin())) >>>> print("spacing: "+str(reader2.GetOutput().GetSpacing())) >>>> >>>> >>>> ================= My results ==================== >>>> >>>> **** series DICOM information: ***** >>>> size: itkSize3 ([512, 512, 118]) >>>> origin: itkPointD3 ([-229.5, -96.5, -553]) >>>> spacing: itkVectorD3 ([0.896484, 0.896484, 3]) >>>> **** DICOM information: ***** >>>> size: itkSize3 ([512, 512, 118]) >>>> origin: itkPointD3 ([0, 0, 0]) >>>> spacing: itkVectorD3 ([0.896484, 0.896484, 1]) >>>> >>>> >>>> >>>> >>>> _____________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Kitware offers ITK Training Courses, for more information visit: >>>> http://www.kitware.com/products/protraining.php >>>> >>>> Please keep messages on-topic and check the 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 cgodshall at enthought.com Thu May 19 14:11:20 2016 From: cgodshall at enthought.com (Courtenay Godshall (Enthought)) Date: Thu, 19 May 2016 13:11:20 -0500 Subject: [ITK-users] SciPy 2016 Conference (Scientific Computing with Python): Tutorials and Talks Announced In-Reply-To: <014401d1b1f9$c51250e0$4f36f2a0$@enthought.com> References: <010c01d1b1f9$58adc010$0a094030$@enthought.com> <011401d1b1f9$6a748810$3f5d9830$@enthought.com> <011c01d1b1f9$7b622e20$72268a60$@enthought.com> <012401d1b1f9$8c646da0$a52d48e0$@enthought.com> <013101d1b1f9$aa4e5b50$feeb11f0$@enthought.com> <013c01d1b1f9$b5bf9620$213ec260$@enthought.com> <014401d1b1f9$c51250e0$4f36f2a0$@enthought.com> Message-ID: <014c01d1b1f9$d8abb600$8a032200$@enthought.com> **ANN: SciPy 2016 Conference (Scientific Computing with Python): Tutorials and Talks Announced** We're excited to announce this year's accepted Talks & Posters and Tutorial Schedule ! This year's 3 major talk tracks include Python in Data Science, High Performance Computing, and general Scientific Computing. Our six mini-symposia include: Earth and Space Science, Engineering, Medicine and Biology, Case Studies in Industry, Education, and Reproducibility. For tutorials, you can choose from 18 different SciPy tutorials, including a 1 day Software Carpentry Scientific Python course that assumes some programming experience but no Python knowledge, or a 2-day Software Carpentry Instructor Training. We hope you'll join us - early bird registration ENDS May 22, 2016. Register at: http://scipy2016.scipy.org/ehome/146062/332936/ About SciPy 2016 SciPy 2016 , the 15th annual Scientific Computing with Python conference, will be held July 11-17, 2016 in Austin, Texas. SciPy is a community dedicated to the advancement of scientific computing through open source Python software for mathematics, science, and engineering. The annual SciPy Conference brings together over 650 participants from industry, academia, and government to showcase their latest projects, learn from skilled users and developers, and collaborate on code development. The full program will consist of 2 days of tutorials (July 11-12), 3 days of talks (July 13-15), and 2days of developer sprints (July 16-17). More info is available on the conference website at http://scipy2016.scipy.org (where you can sign up for the mailing list); or follow @scipyconf on Twitter. -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Thu May 19 15:20:52 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 19 May 2016 15:20:52 -0400 Subject: [ITK-users] [ANN] ITK 4.10 Release Candidate 2 is ready for testing! Message-ID: On behalf of the Insight Toolkit community, we are proud to announce that ITK 4.10 release candidate 2 has been tagged and is available for testing! Please take this opportunity to test the new features in the release candidate. To obtain the source code, git clone https://itk.org/ITK.git cd ITK git checkout -q --detach v4.10rc02 For more details, please see the Git documentation [1]. A few selected highlights for this release: * New Remote module: TwoProjectionRegistration performs simultaneous registration of two projection images to a 3D image volume, which is useful for external beam radiotherapy and other applications. It uses Powell?s method for optimization and the Siddon-Jacobs fast ray-tracing algorithm. * First update to internal VNL in five years. Many improvements were made to upstream VNL. We now push patches upstream and stay in sync via a Git subtree workflow. * Windows builds now support processing 4GB+ images by default * GDCM updated for better DICOM support Additionally, in the Python wrapping, type specification is no longer necessary during the creation of most filters. The required type is inferred from a primary input passed on filter creation. For example, instead of the explicit type specification: median = itk.MedianImageFilter[ImageType, ImageType].New() median.SetInput(reader.GetOutput()) It is now possible to call: median = itk.MedianImageFilter.New(Input=reader.GetOutput()) Or, the shortened: median = itk.MedianImageFilter.New(reader.GetOutput()) Or: median = itk.MedianImageFliter.New(reader) An itk.ImageFileReader can be created by specifying the FileName during instantiation: reader = itk.ImageFileReader.New(FileName=?inputFile.mha?) Please test the release candidate and share your experiences on the mailing list, issue tracker, and Gerrit Code Review. An Experimental build, which demonstrates how the test suite performs on your local build system, can be submitted to the dashboard [2] with: mkdir ../ITK-build cd ../ITK-build cmake ../ITK ctest -j 4 -M Experimental -T Configure -T Build -T Test -T Submit Visual Studio builds must also add ?-C Release? to the ctest command. Notify the mailing list if there are any unexpected failures. Testing your own applications against the RC is also appreciated. Congratulations to the 26 contributors to this release. We would especially like to recognize the new contributors: Andrey Fedorov, Sujin Philip, Francois Budin, and b'Alvaro Sanchez. The 4.10.0 final release is scheduled for the end of May. [1] http://www.itk.org/Wiki/ITK/Git [2] http://open.cdash.org/index.php?project=Insight New Features =========== * Wrapping improvements ---------------------------------------- * ITK_USE_64BITS_IDS supported on Windows * Faster builds (CastXML calls and build targets reduced by half) * Faster runtime loading and smaller binary size due to hidden symbol visibility * Wrapping with BUILD_SHARED_LIBS disabled is supported * Do not link to libpython when possible * Filter types do not need to be specified when ?Input=inputImage? is specified in the constructor * Improved wrapping class coverage * Visual Studio 2015 Update 2 Supported * New Remote Module ----------------------------------- * TwoProjectionRegistration * 2D-3D registration designed for radiotherapy * http://hdl.handle.net/10380/3245 * Core Improvements --------------------------------- * Data and build tool downloads now over HTTPS * Extended constexpr usage with ITK_CONSTEXPR and ITKCONSTEXPR_FUNC macros * ITK_USE_64BITS_IDS, required to process 4GB+ images on Windows, now enabled by default * VNL updated and modernized * CMake configuration major modernization * vcl has been removed in favor of the standard libraries * vnl_math_ function avoided in favor of std:: and itk::Math * VNL had suppressed integer data conversion warnings on Visual Studio (C4257); this suppression has been removed and all warnings addressed * Various improvements for building a module externally against an ITK build tree * CMAKE_POSITION_INDEPENDENT_CODE is enabled by default * Improved EXERCISE_BASIC_OBJECT_METHODS testing macro * Filtering Improvements --------------------------------------- * RGB pixel support added to itk::ImageToVTKImageFilter * itk::Box* filters moved out of the Review module * itk::GaussianDerivativeOperator moved out of the Review module * MaskLabel is deprecated in N4BiasFieldCorrectionFilter in favor any non-zero pixel * Registration Improvements ------------------------------------------- * Fixed and moving masks added to the v4 registration methods * Documentation Improvements -------------------------------------------------- * Updates to the Software Guide, Doxygen, Wiki and Sphinx Examples * Third Party Library Updates --------------------------------------------- * pygccxml updated to v1.7.3 * GDCM updated to the release branch latest * VNL updated to latest upstream * MINC updated to the latest upstream * SWIG updated to v3.0.8 * PCRE update to v8.38 * Improved code coverage -- we are at 85.0%! * *Lots* of important bug fixes * And much more! See details in the log below. Changes from v4.10rc01..v4.10rc02 ------------------------------------------------ Davis Vigneault (1): BUG: Improve error checking and testing for ConnectedRegionsMesh Hyun Jae Kang (2): BUG: Address the issue of "Missing Delete" within SwapZeroCornerToIRP. COMP: Fixed Mac OSX wrapping configuration warning Matthew McCormick (6): BUG: The ImageFileReader internal pipeline methods should be protected. BUG: Use new VNL include directory variables. COMP: Add missing NeighborhoodAccessor methods to PhasedArray3D image. BUG: Adjust itk.org ExternalData URL. COMP: Do not use target_include_directories with CMake 2.8.11.2. BUG: Address missing shared_ptr for VS9 Changes from v4.9.0..v4.10rc01 ------------------------------------------------ Alvaro Sanchez (1): STYLE: moved itkKappaSigmaThresholdImageFilter/Calculator from Nonunit/Review Andrey Fedorov (2): BUG: Add missing itk_expat_mangle.h install target BUG: fix typo in file name Bill Hoffman (2): COMP: fix shared build on Windows when Review is on. COMP: work around for VS 2015 optimizer bug causing test failures. Bill Lorensen (6): ENH: Bump version for style fixups. ENH: Bump wiki examples version, new remote module process ENH: Bump wiki examples version, new remote module process STYLE: SuperClass should be Superclass COMP: Resolve clang linkage issue BUG: Valgrind detected an invalid read Bradley Lowekamp (21): BUG: Compilation problem with GCC 4.1 and explicit instantiation ENH: Update Insight Journal handle links to https ENH: Adding const qualifier to results BUG: Adding missing const qualifier for GetConfusionMatrix method BUG: Use Set/GetMacros, fix const correctness and PrintSelf. ENH: added inlined Zero and one values for integer NumericTraits ENH: Use constexpr for floating point NumericTraits ENH: Make NumericTraits functions constexpr for intrinsic BUG: Add definition of static constexpr NumericTrait members BUG: Declared static constexpr members need to be defined as constexpr ENH: ITK_CONSTEXPR_FUNC implies inline BUG: Addressing VS10 and VS11 NumericTraits linkage issue BUG: Use LargestPossible region for BSpline domain BUG: Remove errant file COMP: Address warning about this usage in initializer list ENH: Prefer ZeroValue function over variable STYLE: Use consistent path for try_compiles binary directory BUG: Don't use "=" in cmake variable name ENH: Test address of NumericTraits One and Zero constexpr ENH: Use ITK_USE_64BITS_IDS for windows 64 by default ENH: Enable run-time dependency on Python library Davis Vigneault (4): ENH: Update itkFileTools to allow std::string arguments. ENH: Add Floored and Truncated Modulus to VNL ENH: Add Ternary Operator Image Filter STYLE: Prefer static cast D?enan Zuki? (1): ENH: CovariantVector's Normalize returns the norm. Francois Budin (6): PERF: Simplify itkTemplate New() input type identification. ENH: Avoid template type specification for image reader in Python wrapping BUG: Missing IOPixelType strings in ImageIOBase BUG: Wrapping intermediate files were not automatically updated ENH: Reduce number of dependencies for XML files generated for wrapping BUG: GCC is limited when calling overloaded base class functions GCC-XML Upstream (1): ENH: pygccxml v1.7.3 (reduced) GDCM Upstream (1): GDCM 2015-09-02 (1efe9e28) Hans Johnson (27): COMP: Static analysis warning COMP: Incorrect delete found by static analysis PERF: Avoid temporary std:vector copying. COMP: Provide VXL backward compatible includes COMP: ITK requires legacy methods ENH: Need propagate ITK_LIBRARY_PROPERTIES ENH: Added UpdateFromUpstream.sh for VNL ENH: Manual copy from vxl/master STYLE: vnl_math_[min|max] -> std::[min|max] STYLE: Text files should end with a newline COMP: Prefer C++11 constexpr when possible COMP: Prefer C++11 constexpr when possible ENH: Simplify std:: math function definitions COMP: Error in constexpr usage COMP: Add const to previous const variables COMP: SizeValueType can has different definition for itkArray ENH: Added utility for modernizing vcl_ to std:: ENH: Reference vnl_math.h constants directly ENH: Avoid using vnl_math_ functions COMP: Missing symbol for itkStaticConstMacro COMP: Function override missing in BioCell ENH: Convert vcl_ to std:: BUG: Windows vcl_snprintf failures addressed COMP: Disabmiguate function calls to SetData ENH: Provided static code API for external applications COMP: Remove possible type conversion warnings ENH: Merge GDCM release branch Hyun Jae Kang (25): COMP: Fixed the compiler error of ITKCommon2TestDriver on OSX 10.6 BUG: Fixed the runtime crash of VideoSourceTest on OSX 10.6 BUG: Fixed the runtime crash of itkTimeProbeTest2 BUG: Fixed the runtime crash of ITKFastMarchingTestDriver's tests on OSX 10.6 BUG: Fixed the runtime crash of ITKReviewTestDriver on OSX 10.6 COMP: Fixed the data conversion warning messages of itkResourceProbe BUG: Fixed the runtime crash of itkLabelOverlapMeasuresImageFilterTest BUG: Fixed the runtime crash of ITKStatisticsTestDriver tests on OSX 10.6 BUG: Fixed the runtime crash of itkMRIBiasFieldCorrectionFilterTest BUG: Fixed the runtime crash of itkBinaryShapeOpeningImageFilterTest1 BUG: Fixed the runtime crash of vnl_test_complex on OSX 10.6 BUG: Fixed the runtime crash of vnl_test_numeric_traits BUG: Fixed the runtime crash of test_pow_log on OSX 10.6 BUG: Exclude a test code of ITKLabelMapTestDriver on OSX 10.6 BUG: Fixed the failed test case of itkSTLThreadTest on OS X 10.8 COMP: Update KWStyle to utilize the latest boost library COMP: Fixed the compiler error of ITK on Mingw-w64 COMP: Temporarily suppress the warning messages of data-conversion on VS14 COMP: Put back the disappeared option of "BUILD EXAMPLES". BUG: Fix segmentation faults on mingw-W64 x86_64. BUG: Fix the failed test of itkCastImageFilterTest on mingw-w64 compiler. COMP: Fixed the cmake configuration for ITK_WRAP_DOC COMP: Fixed the warning messages on VS14. COMP: Add a missing head file at itkNumericTraitsStdVector.h COMP: Fix the wraning message of data-conversion Jean-Christophe Fillion-Robin (4): COMP: ITKExternalModule: Support building module without test directory. STYLE: Facilitate maintenance of CastXML generator refactoring CMakeLists COMP: Allow use of multiple "ITK external modules" in the same project. STYLE: UseITK: Document static registration of ITK IO factories. See #3393 Jon Haitz Legarreta (7): COMP: Delete unused variable compiler warning. ENH: Refactored itkBioCellTest ENH: Exercise non-tested itk::Math methods. ENH: Improve MersenneTwister class and test. ENH: Improve itkFEMLoadPoint coverage. ENH: Improve itkVersion class code coverage. ENH: Perform class name checks in test macro KWSys Robot (1): KWSys 2016-03-09 (36d8666f) Lucas Gandel (9): ENH: Implement GetNumberOfParameter() in ImageToSpatialObjectMetric COMP: Enable wrapping of multiple "ITK external modules" in the same project COMP: Fix CASTXML_EXECUTABLE value for multiple external module COMP: Fix external module testing COMP: Fix git protocol setup ENH: Conditionally add testing for External Modules BUG: Fix call to std::max() with different variable types Manuel Grizonnet (1): COMP: add ITKCommon_EXPORT to fix link issues with external applications Matthew McCormick (73): ENH: Add TwoProjectionRegistration Remote Module. ENH: Allow ITKVideoBridgeOpenCV to be built externally. COMP: Add export specification for itk::ResourceProbe. ENH: Do not force shared libraries when wrapping. BUG: BUILD_TESTING should be not advanced. ENH: Bump ITK version to 4.10.0. DOC: Correct ITKImageNoise description spelling. ENH: Wrap FFTNormalizedCorrelationImageFilter. BUG: Remove Azure ExternalData resource. BUG: ExternalData downloads from midas3.kitware.com only supports https. BUG: Update ExternalData resource. BUG: slicer.kitware.com/midas3/ ExternalData will not support http. ENH: Add ITK_CUSTOM_LIBRARY_SUFFIX variable. ENH: Wrap PipelineMonitorImageFilter. BUG: Update MIDAS url for https in archive testing data script. ENH: Wrap std::vector< itk::ImageRegion >. BUG: Fix wrapping build with DEFAULT_MODULES OFF. ENH: Add RGB pixel support to ImageToVTKImageFilter. ENH: Add RGB and vector pixel type wrapping for ImageToVTKImageFilter. STYLE: Use PixelType and ImageType in Python tests. ENH: Avoid template type specification in Python wrapping. COMP: Do not use has_key in itkTemplate New. DOC: Emphasize that push access is not required to contribute patches. ENH: Download SWIG and PCRE from midas3.kitware.com. COMP: Ignore build warning from KWStyle's boost. BUG: Remove Azure ExternalData resource. BUG: ExternalData downloads from midas3.kitware.com only supports https. BUG: slicer.kitware.com/midas3/ ExternalData will not support http. ENH: Update the VNL README-ITK.txt subtree commit revision. BUG: Mark VXL internal CMake variables as advanced. BUG: Run itk_module_target on itknetlib. DOC: Direct patches for VXL upstream to the GitHub repository. BUG: Run itk_module_target on itknetlib. COMP: Account for removal of vcl_* from upstream VXL. COMP: Remove itkTypeMacro from BioCellHelper. COMP: Convert itkBioCellTest arguments from double to int. COMP: Turn off BUILD_DOCUMENTATION for VNL. BUG: Install VXL config files to backwards-compatible locations. ENH: Remove vcl_complex from the wrapping. BUG: Install vnl_export.h and vnl_algo_export.h to previous locations. BUG: midas3.kitware.com only supports the https protocol. BUG: ImageIOBase SetDimensions should take SizeValueType. ENH: Add wrapping for ImagePCAShapeModelEstimator. COMP: Do not specify COMPONENTS with find_package(VTK. DOC: Fix FFTW warning grammar. COMP: Build against system HDF5 1.8.16. ENH: Set a default CMAKE_BUILD_TYPE when building a module externally COMP: Make initial HDF5 discovery of 1.8.16 quiet. ENH: Use hidden symbol visibility for the CPython extension modules. ENH: Turn on CMAKE_POSITION_INDEPENDENT_CODE by default. BUG: FEMLoadPoint uninitialized value in the constructor. BUG: Fix wrapping of complex types in VNL. ENH: Bump CMakeLists.txt version 4.9.1. COMP: Address ITKCommon Python submodule order. BUG: Extend ExternalData_TIMEOUT_ABSOLUTE to 900 seconds. BUG: Do not run KWStyle Git config on a release tarball. COMP: Ambiguous RGBPixel access in CustomColormapFunction. BUG: Prevent division by zero in PhasedArray3DSpecialCoordinatesImage. BUG: Initialize azimuth and elevation to pi/2 in PhasedArray3D. BUG: Increase MaskLabel backwards compatibility in N4 bias correction. ENH: Deprecate MaskLabel in N4BiasFieldCorrectionImageFilter. COMP: Update CastXML to support Visual Studio 2015 Update 2. COMP: Do not set wrapping library visibility with static builds. COMP: Update CastXML to support Visual Studio 2015 Update 2. COMP: Broaden the KWStyle warning exception. COMP: Update KWStyle version. BUG: Do not use the same output file in N4BiasField Test 2,3. COMP: Expand EXERCISE_BASIC_OBJECT_METHODS for other GCC versions. ENH: Update Cuberille Remote to 2015-05-01. ENH: Enable registration of the IOOpenSlide module through CMake. ENH: Update itk.org URL's for HTTPS support. BUG: Use CastXML built against LLVM with LLVM_ENABLE_TERMINFO OFF. BUG: Fix Python wrapping on Windows when ITK_USE_64BIT_IDS is ON. Michka Popoff (12): ENH: Use importlib for python 3.4 instead of imp ENH: Update to Swig 3.0.8 ENH: Update PCRE to version 8.38 ENH: Wrap RayCastInterpolateImageFunction ENH: Wrap RayCastInterpolateImageFunction COMP: Remove debug output after vcl_complex removal from wrapping ENH: Consolidate .idx file generation with swig .i generation. ENH: Update UpdatepygccxmlFromUpstream.sh script COMP: Set CastXML path and name for pygccxml 1.7.3 COMP: Fix RayCastInterpolateImageFunction wrapping for image dim 2 ENH: Use argparse instead of optparse in igenerator.py ENH: Use https URL for OS X castxml binary (for consistency) Nick Tustison (2): ENH: Add fixed/moving masking in reg. methods. ENH: Making the mask usage consistent with ITK. Pablo Hernandez-Cerdan (1): COMP: Fix warn in FFTW about delete []. Sean McBride (18): COMP: Made script OS X compatible COMP: mark GDCM GetSeriesHelper() method as deprecated BUG: update script to fetch GDCM from its release-2-4 branch instead of master DOC: Updated comment to reflect new GDCM version COMP: Fixed recently introduced build error with deprecated GDCM method BUG: Fixed invalid memory access found by ASan COMP: Fixed clang warning about macro expansion giving defined COMP: Fixed minor dashboards warnings and typos. COMP: Fixed a bunch of clang -Wunreachable-code-break warnings COMP: fixed some dashboard warnings (dead code, false positive) BUG: Fixed off-by-1 error found by ASan COMP: Fixed clang -Wcomma warning COMP: Introduce ITK_FALLTHROUGH, to suppress switch fall through warnings COMP: Fixed -Wwritable-strings warnings COMP: Fixed remaining -Wcomma warnings ENH: switch gdcm to release branch, not release-2-4 COMP: Hack HDF5 to build under ASan & UBSan COMP: fixed clang -Wdeprecated-writable-strings warning Shawn Waldon (1): STYLE: move itkGaussianDerivativeOperator Sujin Philip (1): STYLE: Move itkBox* Filters Sumedha Singla (3): ENH: Issue: ITK#3363 Replaced assignment in SetParameters function. ENH: Remove unnecessary const_cast BUG: Fixed the test itkHDF5ImageIOTest VXL Maintainers (9): VNL 2015-11-22 (ea1d60fb) VNL 2016-03-02 (cb31149e) VNL 2016-03-13 (ae34f0fc) VNL 2016-03-15 (751698ab) VNL 2016-03-19 (df10fefa) VNL 2016-03-25 (f0040231) VNL 2016-03-30 (88f50849) VNL 2016-04-22 (0ed18124) VNL 2016-04-26 (6b168535) Vladimir S. FONOV (3): MINC 2015-12-17 (dcb93a5f) MINC 2016-01-30 (783bca38) MINC 2016-02-24 (8632513e) Ziv Yaniv (1): BUG: Interpretation of the Euler angles ZYX or ZXY was not exported. ----------------------------------------------------- Errors or omissions? Please fix them here: https://docs.google.com/document/d/1n6xDC3phae7bH40OVO-QTECZ6gKRlPr1dwZR3fydzfU/edit From Tao.Zhao at intusurg.com Thu May 19 23:40:40 2016 From: Tao.Zhao at intusurg.com (Tao Zhao) Date: Fri, 20 May 2016 03:40:40 +0000 Subject: [ITK-users] Switching between debug and release libaraies in Visual Studio Message-ID: Hi, This might be a cmake question but it is related on how to use itk. I built ITK in both debug and release modes and had them installed under ITK - Debug - Release I would like my application to link against ITK debug libs in debug mode and release libs in release mode. I can easily do this under qtcreator. However when I am using Visual Studio, ${CMAKE_BUILD_TYPE} does not take effect. I know there is a way if the libs are in one folder but have different names. I was wondering how can I achieve this with standard ITK set up (i.e., not using different names but using different path for debug and release libs). Thank you very much! Tao -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhuangming.shen at sphic.org.cn Fri May 20 05:00:52 2016 From: zhuangming.shen at sphic.org.cn (=?gb2312?B?yfLXr8P3?=) Date: Fri, 20 May 2016 09:00:52 +0000 Subject: [ITK-users] Iterator for python supported ITK Message-ID: <1463734848567.2024@sphic.org.cn> Hi all, Could anyone give me an example on "itk::ImageRegionIterator" using Python supported ITK? I can't find the wrapped "iterator". Thanks in advance. Regards, Zhuangming Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Fri May 20 08:00:08 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Fri, 20 May 2016 08:00:08 -0400 Subject: [ITK-users] Iterator for python supported ITK In-Reply-To: <1463734848567.2024@sphic.org.cn> References: <1463734848567.2024@sphic.org.cn> Message-ID: Hi Zhuangming, Iterating through pixels is slow in Python -- the iterators may not be wrapped because it is always a good idea to use C++ in this case. HTH, Matt On Fri, May 20, 2016 at 5:00 AM, ??? wrote: > Hi all, > > > Could anyone give me an example on "itk::ImageRegionIterator" using Python > supported ITK? I can't find the wrapped "iterator". Thanks in advance. > > > > Regards, > > > Zhuangming Shen > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 Fri May 20 09:58:48 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Fri, 20 May 2016 09:58:48 -0400 Subject: [ITK-users] Switching between debug and release libaraies in Visual Studio In-Reply-To: References: Message-ID: Hi Tao, with standard ITK setup, you don't have to do anything special. CMake takes care of setting up paths so you just switch between Debug and Release in your application which uses ITK. Regards, D?enan On Thu, May 19, 2016 at 11:40 PM, Tao Zhao wrote: > Hi, > > > > This might be a cmake question but it is related on how to use itk. > > > > I built ITK in both debug and release modes and had them installed under > > ITK > > - Debug > > - Release > > > > I would like my application to link against ITK debug libs in debug mode > and release libs in release mode. I can easily do this under qtcreator. > However when I am using Visual Studio, ${CMAKE_BUILD_TYPE} does not take > effect. I know there is a way if the libs are in one folder but have > different names. I was wondering how can I achieve this with standard ITK > set up (i.e., not using different names but using different path for debug > and release libs). > > > > Thank you very much! > > > Tao > > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 Tao.Zhao at intusurg.com Fri May 20 11:57:03 2016 From: Tao.Zhao at intusurg.com (Tao Zhao) Date: Fri, 20 May 2016 15:57:03 +0000 Subject: [ITK-users] Switching between debug and release libaraies in Visual Studio In-Reply-To: References: Message-ID: Hi D?enan, Thank you for your reply. Here is the details: I assume that I have to have something like this in my application cmake file: set( ITK_DIR "${CMAKE_SOURCE_DIR}/build/external/ITK/Debug/lib/cmake/ITK-4.9" ) find_package(ITK REQUIRED) include(${ITK_USE_FILE}) This works for debug version, but does not adapt to release when I build Release in Visual Studio. I believe this is a pretty common need and there must be a solution. Thanks, Tao From: D?enan Zuki? [mailto:dzenanz at gmail.com] Sent: Friday, May 20, 2016 6:59 AM To: Tao Zhao Cc: insight-users at itk.org Subject: Re: [ITK-users] Switching between debug and release libaraies in Visual Studio Hi Tao, with standard ITK setup, you don't have to do anything special. CMake takes care of setting up paths so you just switch between Debug and Release in your application which uses ITK. Regards, D?enan On Thu, May 19, 2016 at 11:40 PM, Tao Zhao > wrote: Hi, This might be a cmake question but it is related on how to use itk. I built ITK in both debug and release modes and had them installed under ITK - Debug - Release I would like my application to link against ITK debug libs in debug mode and release libs in release mode. I can easily do this under qtcreator. However when I am using Visual Studio, ${CMAKE_BUILD_TYPE} does not take effect. I know there is a way if the libs are in one folder but have different names. I was wondering how can I achieve this with standard ITK set up (i.e., not using different names but using different path for debug and release libs). Thank you very much! Tao _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users ________________________________ NOTE THAT THIS EMAIL ORIGINATED FROM OUTSIDE OF INTUITIVE SURGICAL.. Be alert for fraudulent emails that spoof internal ?@intusurg.com? email addresses. Report these or other security threats to: ITRequest at intusurg.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tevain at telecom-paristech.fr Fri May 20 12:06:31 2016 From: tevain at telecom-paristech.fr (Timothee Evain) Date: Fri, 20 May 2016 18:06:31 +0200 (CEST) Subject: [ITK-users] [ITK] Switching between debug and release libaraies in Visual Studio In-Reply-To: References: Message-ID: <1553502143.61574075.1463760391386.JavaMail.zimbra@enst.fr> Hello Tao, Have you tried the package finder which comes with cmake? It will automatically do the job of taking different builds. Something like this in your cmake file: FIND_PACKAGE ( ITK ) IF ( ITK_FOUND ) INCLUDE( ${ITK_USE_FILE} ) ENDIF( ITK_FOUND ) [...] TARGET_LINK_LIBRARIES ( MyProject ${ITK_LIBRARIES} ) HTH, Tim ----- Mail original ----- De: "Tao Zhao" ?: "D?enan Zuki?" Cc: insight-users at itk.org Envoy?: Vendredi 20 Mai 2016 17:57:03 Objet: Re: [ITK] [ITK-users] Switching between debug and release libaraies in Visual Studio Hi D?enan, Thank you for your reply. Here is the details: I assume that I have to have something like this in my application cmake file: set( ITK_DIR "${CMAKE_SOURCE_DIR}/build/external/ITK/ Debug /lib/cmake/ITK-4.9" ) find_package(ITK REQUIRED) include(${ITK_USE_FILE}) This works for debug version, but does not adapt to release when I build Release in Visual Studio. I believe this is a pretty common need and there must be a solution. Thanks, Tao From: D?enan Zuki? [mailto:dzenanz at gmail.com] Sent: Friday, May 20, 2016 6:59 AM To: Tao Zhao Cc: insight-users at itk.org Subject: Re: [ITK-users] Switching between debug and release libaraies in Visual Studio Hi Tao, with standard ITK setup, you don't have to do anything special. CMake takes care of setting up paths so you just switch between Debug and Release in your application which uses ITK. Regards, D?enan On Thu, May 19, 2016 at 11:40 PM, Tao Zhao < Tao.Zhao at intusurg.com > wrote: Hi, This might be a cmake question but it is related on how to use itk. I built ITK in both debug and release modes and had them installed under ITK - Debug - Release I would like my application to link against ITK debug libs in debug mode and release libs in release mode. I can easily do this under qtcreator. However when I am using Visual Studio, ${CMAKE_BUILD_TYPE} does not take effect. I know there is a way if the libs are in one folder but have different names. I was wondering how can I achieve this with standard ITK set up (i.e., not using different names but using different path for debug and release libs). Thank you very much! Tao _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users NOTE THAT THIS EMAIL ORIGINATED FROM OUTSIDE OF INTUITIVE SURGICAL.. Be alert for fraudulent emails that spoof internal ?@intusurg.com? email addresses. Report these or other security threats to: ITRequest at intusurg.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 scapegoat.sarthak at gmail.com Fri May 20 12:10:32 2016 From: scapegoat.sarthak at gmail.com (Scapegoat Sarthak) Date: Fri, 20 May 2016 12:10:32 -0400 Subject: [ITK-users] [ITK] Switching between debug and release libaraies in Visual Studio In-Reply-To: <1553502143.61574075.1463760391386.JavaMail.zimbra@enst.fr> References: <1553502143.61574075.1463760391386.JavaMail.zimbra@enst.fr> Message-ID: Building up on Tim's answer: When you build ITK, let's say the binary folder is present in ${ITK_BUILD_DIR}. Here you have built both the Debug and Release variants of the library (basically, ${ITK_BUILD_DIR}/lib/Debug and ${ITK_BUILD_DIR}/lib/Release folders are populated with the required libraries). In this setup, when you trying link your project to ITK, you will need to set ITK_DIR in your CMake configuration to ${ITK_BUILD_DIR} and CMake will take care of everything. Cheers and all the best! On 20 May 2016 at 12:06, Timothee Evain wrote: > Hello Tao, > > Have you tried the package finder which comes with cmake? It will > automatically do the job of taking different builds. > Something like this in your cmake file: > FIND_PACKAGE ( ITK ) > IF ( ITK_FOUND ) > INCLUDE( ${ITK_USE_FILE} ) > ENDIF( ITK_FOUND ) > > [...] > > TARGET_LINK_LIBRARIES ( MyProject ${ITK_LIBRARIES} ) > > HTH, > > Tim > > ----- Mail original ----- > De: "Tao Zhao" > ?: "D?enan Zuki?" > Cc: insight-users at itk.org > Envoy?: Vendredi 20 Mai 2016 17:57:03 > Objet: Re: [ITK] [ITK-users] Switching between debug and release libaraies > in Visual Studio > > > > Hi D?enan, > > > Thank you for your reply. Here is the details: > > > > I assume that I have to have something like this in my application cmake > file: > > > > set( ITK_DIR "${CMAKE_SOURCE_DIR}/build/external/ITK/ Debug > /lib/cmake/ITK-4.9" ) > > find_package(ITK REQUIRED) > > include(${ITK_USE_FILE}) > > > > This works for debug version, but does not adapt to release when I build > Release in Visual Studio. I believe this is a pretty common need and there > must be a solution. > > > > Thanks, > Tao > > > > From: D?enan Zuki? [mailto:dzenanz at gmail.com] > Sent: Friday, May 20, 2016 6:59 AM > To: Tao Zhao > Cc: insight-users at itk.org > Subject: Re: [ITK-users] Switching between debug and release libaraies in > Visual Studio > > > > > Hi Tao, > > > > > > with standard ITK setup, you don't have to do anything special. CMake > takes care of setting up paths so you just switch between Debug and Release > in your application which uses ITK. > > > > > > Regards, > > > D?enan > > > > > > On Thu, May 19, 2016 at 11:40 PM, Tao Zhao < Tao.Zhao at intusurg.com > > wrote: > > > Hi, > > > > This might be a cmake question but it is related on how to use itk. > > > > I built ITK in both debug and release modes and had them installed under > > ITK > > - Debug > > - Release > > > > I would like my application to link against ITK debug libs in debug mode > and release libs in release mode. I can easily do this under qtcreator. > However when I am using Visual Studio, ${CMAKE_BUILD_TYPE} does not take > effect. I know there is a way if the libs are in one folder but have > different names. I was wondering how can I achieve this with standard ITK > set up (i.e., not using different names but using different path for debug > and release libs). > > > > Thank you very much! > > > Tao > > > > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > > > > > > NOTE THAT THIS EMAIL ORIGINATED FROM OUTSIDE OF INTUITIVE SURGICAL.. > Be alert for fraudulent emails that spoof internal ?@intusurg.com? email > addresses. Report these or other security threats to: > ITRequest at intusurg.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 > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 scorpiuni at gmail.com Sun May 22 16:16:36 2016 From: scorpiuni at gmail.com (Robert) Date: Sun, 22 May 2016 13:16:36 -0700 (MST) Subject: [ITK-users] PCA on 3D Data Message-ID: <1463948196197-7588879.post@n2.nabble.com> Hello, I have a set of masked anatomical structures on a CT/MRT/... Scan. It basically is segmented Volume Data, and I want a Shape model based on those files. So I used the ImagePCAShapeModelEstimator, which I input my data to. I've read that you need to provide distance maps, so I used SignedDanielssonDistanceMapImageFilter on my thresholded, binarized data. Now when I write the mean image as well as the different components as .nrrd volume, I get a "mean distance map" as mean image. This output as distance map however is not the result that I need. I then tried to generate some actual shape models using the previous mean image with corresponding eigenvalues, but the result is not really helpful. I guess I could get better results here when experimenting more with the lower and upper threshold values of my final thresholding filter, but I first wanted to ask if there is a better alternative way to create a mean image and shape models, and to ask if my approach is even correct at all. Thanks for your attention, Robert -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/PCA-on-3D-Data-tp7588879.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From zhuangming.shen at sphic.org.cn Sun May 22 20:20:48 2016 From: zhuangming.shen at sphic.org.cn (=?gb2312?B?yfLXr8P3?=) Date: Mon, 23 May 2016 00:20:48 +0000 Subject: [ITK-users] Iterator for python supported ITK In-Reply-To: References: <1463734848567.2024@sphic.org.cn>, Message-ID: <1463962845332.70502@sphic.org.cn> Hi Matt, Thanks for your prompt reply. Actually, I'd like to know how to further improve the performance when I need to get each pixel value from an image using python supported ITK. Regards, Zhuangming Shen ________________________________________ From: Matt McCormick Sent: Friday, May 20, 2016 8:00 PM To: ??? Cc: insight-users at itk.org Subject: Re: [ITK-users] Iterator for python supported ITK Hi Zhuangming, Iterating through pixels is slow in Python -- the iterators may not be wrapped because it is always a good idea to use C++ in this case. HTH, Matt On Fri, May 20, 2016 at 5:00 AM, ??? wrote: > Hi all, > > > Could anyone give me an example on "itk::ImageRegionIterator" using Python > supported ITK? I can't find the wrapped "iterator". Thanks in advance. > > > > Regards, > > > Zhuangming Shen > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 tevain at telecom-paristech.fr Mon May 23 04:02:38 2016 From: tevain at telecom-paristech.fr (Timothee Evain) Date: Mon, 23 May 2016 10:02:38 +0200 (CEST) Subject: [ITK-users] [ITK] PCA on 3D Data In-Reply-To: <1463948196197-7588879.post@n2.nabble.com> References: <1463948196197-7588879.post@n2.nabble.com> Message-ID: <1318805807.63708890.1463990558977.JavaMail.zimbra@enst.fr> Hi Robert, That's quite difficult to help you without more insight on what you are expecting to get or to do with this shape model. When you use ImagePCAShapeModelEstimator to generate your model, you should expect a mean image as a signed distance map (i.e. the mean shape is the set of pixels <0), and some "variation" images corresponding to the principal components. These images can multiplied to some magnitude and then added/subtracted to the mean image to get a particular instance of your model as a new distance map. To see the new shape, just threshold to get all pixels <0. You can refer to: https://itk.org/Doxygen/html/classitk_1_1PCAShapeSignedDistanceFunction.html which is the function used by itk in the geodesic level set segmentation with shape prior. HTH, Tim ----- Mail original ----- De: "Robert" ?: insight-users at itk.org Envoy?: Dimanche 22 Mai 2016 22:16:36 Objet: [ITK] [ITK-users] PCA on 3D Data Hello, I have a set of masked anatomical structures on a CT/MRT/... Scan. It basically is segmented Volume Data, and I want a Shape model based on those files. So I used the ImagePCAShapeModelEstimator, which I input my data to. I've read that you need to provide distance maps, so I used SignedDanielssonDistanceMapImageFilter on my thresholded, binarized data. Now when I write the mean image as well as the different components as .nrrd volume, I get a "mean distance map" as mean image. This output as distance map however is not the result that I need. I then tried to generate some actual shape models using the previous mean image with corresponding eigenvalues, but the result is not really helpful. I guess I could get better results here when experimenting more with the lower and upper threshold values of my final thresholding filter, but I first wanted to ask if there is a better alternative way to create a mean image and shape models, and to ask if my approach is even correct at all. Thanks for your attention, Robert -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/PCA-on-3D-Data-tp7588879.html Sent from the ITK Insight Users mailing list archive at Nabble.com. _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users _______________________________________________ Community mailing list Community at itk.org http://public.kitware.com/mailman/listinfo/community From scorpiuni at gmail.com Mon May 23 04:43:54 2016 From: scorpiuni at gmail.com (Robert) Date: Mon, 23 May 2016 01:43:54 -0700 (MST) Subject: [ITK-users] [ITK] PCA on 3D Data In-Reply-To: <1318805807.63708890.1463990558977.JavaMail.zimbra@enst.fr> References: <1463948196197-7588879.post@n2.nabble.com> <1318805807.63708890.1463990558977.JavaMail.zimbra@enst.fr> Message-ID: <1463993034231-7588882.post@n2.nabble.com> Hello, Thanks for your input, that's what I did so far. The result, however, in my opinion, does not look anything like I'd imagine the result looking like. It works fine with 2D Images, but the third dimension (or maybe the Pixel Value range?) seem to destroy the result. >From your response however I think that my approach is correct. I want to create the different shapes in order to use them as an input in the Geodesic Active Contour with Shape Guidance filter. My problem is that, if I use the filter without shape guidance, or if I use simple fastmarching, the segmented result is too big, it bleeds into structures that are not part of my current project. I hope that with shape guidance, those regions won't be affected (at least not that much as they currently are). -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/PCA-on-3D-Data-tp7588879p7588882.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From tevain at telecom-paristech.fr Mon May 23 05:44:12 2016 From: tevain at telecom-paristech.fr (Timothee Evain) Date: Mon, 23 May 2016 11:44:12 +0200 (CEST) Subject: [ITK-users] [ITK] PCA on 3D Data In-Reply-To: <1463993034231-7588882.post@n2.nabble.com> References: <1463948196197-7588879.post@n2.nabble.com> <1318805807.63708890.1463990558977.JavaMail.zimbra@enst.fr> <1463993034231-7588882.post@n2.nabble.com> Message-ID: <1416565469.63846234.1463996652180.JavaMail.zimbra@enst.fr> Well, that's the good way to do it. I've used the estimator to get models of 3D shapes without particular troubles. Have you registered your binary training data to get a true PCA response ? Here a link to a kitware blog post about creating ASM (in 2D but the application in 3D is trivial): https://blog.kitware.com/creating-a-2d-active-shape-model-in-itk/ HTH, Tim ----- Mail original ----- De: "Robert" ?: insight-users at itk.org Envoy?: Lundi 23 Mai 2016 10:43:54 Objet: Re: [ITK] [ITK-users] PCA on 3D Data Hello, Thanks for your input, that's what I did so far. The result, however, in my opinion, does not look anything like I'd imagine the result looking like. It works fine with 2D Images, but the third dimension (or maybe the Pixel Value range?) seem to destroy the result. >From your response however I think that my approach is correct. I want to create the different shapes in order to use them as an input in the Geodesic Active Contour with Shape Guidance filter. My problem is that, if I use the filter without shape guidance, or if I use simple fastmarching, the segmented result is too big, it bleeds into structures that are not part of my current project. I hope that with shape guidance, those regions won't be affected (at least not that much as they currently are). -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/PCA-on-3D-Data-tp7588879p7588882.html Sent from the ITK Insight Users mailing list archive at Nabble.com. _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users _______________________________________________ Community mailing list Community at itk.org http://public.kitware.com/mailman/listinfo/community From blowekamp at mail.nih.gov Mon May 23 08:46:43 2016 From: blowekamp at mail.nih.gov (Lowekamp, Bradley (NIH/NLM/LHC) [C]) Date: Mon, 23 May 2016 12:46:43 +0000 Subject: [ITK-users] Iterator for python supported ITK In-Reply-To: <1463962845332.70502@sphic.org.cn> References: <1463734848567.2024@sphic.org.cn> <1463962845332.70502@sphic.org.cn> Message-ID: Hello, This is an intrinsic problem with using an interpretive language to perform per-element operations with many elements. Fundamentally these type of operation in C++ involve just a few CPU instructions, while in native python it will involve 100X more with string compares and symbol table look ups. There is the same problem if you tries to index your way through a numpy array. In numpy there are many optimization frameworks such a cython and numba implemented to optimize and ?compile? these types of operations. But sometimes if your image is small and performance doesn?t matter the ITK iterators would be OK. You could look into wrapping them following the instructions in the ITK Software guide. Brad > On May 22, 2016, at 8:20 PM, ??? wrote: > > Hi Matt, > > Thanks for your prompt reply. Actually, I'd like to know how to further improve the performance when I need to get each pixel value from an image using python supported ITK. > > > Regards, > > Zhuangming Shen > ________________________________________ > From: Matt McCormick > Sent: Friday, May 20, 2016 8:00 PM > To: ??? > Cc: insight-users at itk.org > Subject: Re: [ITK-users] Iterator for python supported ITK > > Hi Zhuangming, > > Iterating through pixels is slow in Python -- the iterators may not be > wrapped because it is always a good idea to use C++ in this case. > > HTH, > Matt > > On Fri, May 20, 2016 at 5:00 AM, ??? wrote: >> Hi all, >> >> >> Could anyone give me an example on "itk::ImageRegionIterator" using Python >> supported ITK? I can't find the wrapped "iterator". Thanks in advance. >> >> >> >> Regards, >> >> >> Zhuangming Shen >> >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the 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 mrguilfoyle at gmail.com Mon May 23 15:31:11 2016 From: mrguilfoyle at gmail.com (Mathew Guilfoyle) Date: Mon, 23 May 2016 20:31:11 +0100 Subject: [ITK-users] Access DICOM private tags using SimpleITK Message-ID: <3781B509-3DAA-4888-B6EC-94984E74E5D5@gmail.com> In ITK the GDCMSeriesFileNames class (equivalently the ImageSeriesReader$GetGDCMSeriesFileNames method from Simple ITK) can both take arguments to read private DICOM tags (typically manufacturer specific info that does not follow the general standard.) I cannot figure out how to use this function to actually read in a series of images or a volume with the hidden tags (I know they are there as I can see them in Osirix!) The list of filenames that the two methods above return as no different whether the 'loadPrivateTags' attribute is set on or off. Any ideas how I can access the private tags? Cheers From blowekamp at mail.nih.gov Mon May 23 15:47:28 2016 From: blowekamp at mail.nih.gov (Lowekamp, Bradley (NIH/NLM/LHC) [C]) Date: Mon, 23 May 2016 19:47:28 +0000 Subject: [ITK-users] Access DICOM private tags using SimpleITK In-Reply-To: <3781B509-3DAA-4888-B6EC-94984E74E5D5@gmail.com> References: <3781B509-3DAA-4888-B6EC-94984E74E5D5@gmail.com> Message-ID: Hello, To get all the tags from the dicom files you need to load them individually. Something along these lines, but iterating over the list generated by GetGDCMSeriesFileNames: from __future__ import print_function import SimpleITK as sitk import sys, os if len ( sys.argv ) < 2: print( "Usage: DicomImagePrintTags " ) sys.exit ( 1 ) inputImage = sitk.ReadImage( sys.argv[1] ) for k in inputImage.GetMetaDataKeys(): v = inputImage.GetMetaData(k) print("({0}) = = \"{2}\"".format(k,v)) HTH, Brad > On May 23, 2016, at 3:31 PM, Mathew Guilfoyle wrote: > > In ITK the GDCMSeriesFileNames class (equivalently the ImageSeriesReader$GetGDCMSeriesFileNames method from Simple ITK) can both take arguments to read private DICOM tags (typically manufacturer specific info that does not follow the general standard.) > > I cannot figure out how to use this function to actually read in a series of images or a volume with the hidden tags (I know they are there as I can see them in Osirix!) > > The list of filenames that the two methods above return as no different whether the 'loadPrivateTags' attribute is set on or off. > > Any ideas how I can access the private tags? > > Cheers > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 mrguilfoyle at gmail.com Mon May 23 15:59:43 2016 From: mrguilfoyle at gmail.com (Mathew Guilfoyle) Date: Mon, 23 May 2016 20:59:43 +0100 Subject: [ITK-users] Access DICOM private tags using SimpleITK In-Reply-To: References: <3781B509-3DAA-4888-B6EC-94984E74E5D5@gmail.com> Message-ID: Thanks Brad - the trouble I'm having is that some of the keys are private/hidden. For instance, in my images when I use the image.GetMetaDataKeys() method it returns a list of 107 keys but the one I need is a private manufacturer-specific timing tag that is not part of the standard meta-data dictionary. I know the tag I need because OsiriX viewer shows all the standard and private tags and it is in there with associated data. However, if I run image.HasMetaDataKey(my_private_key) it returns FALSE. Reading various sources, including the ITK docs, it seems GDCM library has a setting that needs to be turned on to read private DICOM tags. However, the only reference I can see to this setting in SimpleITK is as an argument to the GetGDCMSeriesFileNames method and I'm not clear what function it serves there as the list of files is the same irrespective. What I need somehow is to tell ReadImage or ImageSeriesReader to parse the private tags...?? Thanks Mat > On 23 May 2016, at 20:47, Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote: > > Hello, > > To get all the tags from the dicom files you need to load them individually. Something along these lines, but iterating over the list generated by GetGDCMSeriesFileNames: > > from __future__ import print_function > > import SimpleITK as sitk > import sys, os > > if len ( sys.argv ) < 2: > print( "Usage: DicomImagePrintTags " ) > sys.exit ( 1 ) > > inputImage = sitk.ReadImage( sys.argv[1] ) > > for k in inputImage.GetMetaDataKeys(): > v = inputImage.GetMetaData(k) > print("({0}) = = \"{2}\"".format(k,v)) > > > HTH, > Brad > > > >> On May 23, 2016, at 3:31 PM, Mathew Guilfoyle wrote: >> >> In ITK the GDCMSeriesFileNames class (equivalently the ImageSeriesReader$GetGDCMSeriesFileNames method from Simple ITK) can both take arguments to read private DICOM tags (typically manufacturer specific info that does not follow the general standard.) >> >> I cannot figure out how to use this function to actually read in a series of images or a volume with the hidden tags (I know they are there as I can see them in Osirix!) >> >> The list of filenames that the two methods above return as no different whether the 'loadPrivateTags' attribute is set on or off. >> >> Any ideas how I can access the private tags? >> >> Cheers >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users > From sebastian.ordas at gmail.com Mon May 23 16:29:51 2016 From: sebastian.ordas at gmail.com (Sebastian Ordas) Date: Mon, 23 May 2016 17:29:51 -0300 Subject: [ITK-users] cannot save transform to file: Can't Create IO object Message-ID: <9d8c22ce-801c-11a2-a6f4-917c475271bb@gmail.com> Hello, I am trying to run the code bellow from my application (using ITK 4.9) but I get the following error : ERROR: Caught exception: itk::ERROR: TransformFileWriterTemplate(000000000CD770E0): Can't Create IO object for file test.tfm I am sure that if I test it from a simple test application this should work, but I am trying to understand what I am missing from within my project (maybe some factory not yet registered or even some registration-related module not yet enabled in cmake?) typedef itk::VersorRigid3DTransform< double > TransformType; TransformType::Pointer trf = TransformType::New(); trf->SetIdentity(); itk::TransformFileWriterTemplate::Pointer writer = itk::TransformFileWriterTemplate::New(); writer->SetFileName("test.tfm"); writer->SetInput(trf); try { writer->Update(); } catch (itk::ExceptionObject& e) { std::cerr << "Caught exception: " << e.GetDescription() << std::endl; } -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Mon May 23 16:35:32 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 23 May 2016 16:35:32 -0400 Subject: [ITK-users] cannot save transform to file: Can't Create IO object In-Reply-To: <9d8c22ce-801c-11a2-a6f4-917c475271bb@gmail.com> References: <9d8c22ce-801c-11a2-a6f4-917c475271bb@gmail.com> Message-ID: Hello Sebastian, By running against ITK with this patch checked out: http://review.source.kitware.com/#/c/21115/ the error message will state what transform IO classes are registered. HTH, Matt On Mon, May 23, 2016 at 4:29 PM, Sebastian Ordas wrote: > Hello, I am trying to run the code bellow from my application (using ITK > 4.9) but I get the following error : > > ERROR: Caught exception: itk::ERROR: > TransformFileWriterTemplate(000000000CD770E0): Can't Create IO object > for file test.tfm > > I am sure that if I test it from a simple test application this should work, > but I am trying to understand what I am missing from within my project > (maybe some factory not yet registered or even some registration-related > module not yet enabled in cmake?) > > typedef itk::VersorRigid3DTransform< double > TransformType; > TransformType::Pointer trf = TransformType::New(); > trf->SetIdentity(); > > itk::TransformFileWriterTemplate::Pointer writer = > itk::TransformFileWriterTemplate::New(); > > writer->SetFileName("test.tfm"); > writer->SetInput(trf); > > try > { > writer->Update(); > } > catch (itk::ExceptionObject& e) > { > std::cerr << "Caught exception: " << e.GetDescription() << std::endl; > } > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 j.plumat at auckland.ac.nz Mon May 23 17:54:58 2016 From: j.plumat at auckland.ac.nz (Jerome Plumat) Date: Tue, 24 May 2016 09:54:58 +1200 Subject: [ITK-users] reading 3D temporal MRA dicom: miss ordered Message-ID: <57437C32.4030301@auckland.ac.nz> Dear all, I'm facing to a problem while reading a 3D Angiography dicom data set and transforming it in MHA with ITK 4.8.1. The angiography is a TWIST generated by a 3T Siemens scanner. Each slice is a projection of the head at a specific time after the contrast agent injection. The dicom is detected as 3D (0018,0023) CS [3D] # 2, 1 MRAcquisitionType While I try to load the whole dicom with ITK (using the lines below) it creates a volume but the slices are not well ordered. Indeed, each slice has a timer tag and the generated sequence has is not in the proper order. Has anyone faced this problem? Thanks a lot. Jerome Plumat Reading the DCM Angiography with: const unsigned int Dimension = 3; typedef float PixelType; typedef itk::Image ImageType; typedef unsigned short DcmPixelType; typedef typename itk::Image DCMImageType; typedef typename itk::Image OutputImageType; typedef itk::ImageSeriesReader< DCMImageType > DCMReaderType; typedef itk::GDCMSeriesFileNames NamesGeneratorType; typedef itk::GDCMImageIO ImageIOType; typedef std::vector< std::string > SeriesIdContainer; typedef std::vector< std::string > FileNamesContainer; ImageIOType::Pointer dicomIO = ImageIOType::New(); NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New(); DCMReaderType::Pointer reader = DCMReaderType::New(); reader->SetImageIO( dicomIO ); nameGenerator->SetUseSeriesDetails( true ); // restrict to the serie date nameGenerator->AddSeriesRestriction("0008|0021" ); nameGenerator->SetDirectory( inputPath ); // m_path designates the DCM folder const SeriesIdContainer & seriesUID = nameGenerator->GetSeriesUIDs(); std::string seriesIdentifier = seriesUID.begin()->c_str(); FileNamesContainer fileNames; fileNames = nameGenerator->GetFileNames( seriesIdentifier ); reader->SetFileNames( fileNames ); typedef itk::CastImageFilter< DCMImageType, OutputImageType > CastFilterType; typename CastFilterType::Pointer caster = CastFilterType::New(); caster->SetInput( reader->GetOutput() ); // write the volume typedef itk::ImageFileWriter< OutputImageType > MetaWriterType; MetaWriterType::Pointer writer = MetaWriterType::New(); writer->SetFileName( outputPath ); // volume.mha writer->SetInput( caster->GetOutput() ); try{ writer->Update(); }catch( itk::ExceptionObject &err){ std::cerr << "Error while writing the volume as: " << outputPath << std::endl; std::cerr << err << std::endl; exit( EXIT_FAILURE ); } From sebastian.ordas at gmail.com Mon May 23 20:42:38 2016 From: sebastian.ordas at gmail.com (Sebastian Ordas) Date: Mon, 23 May 2016 21:42:38 -0300 Subject: [ITK-users] cannot save transform to file: Can't Create IO object In-Reply-To: References: <9d8c22ce-801c-11a2-a6f4-917c475271bb@gmail.com> Message-ID: Thanks Matt, The retrieved transformIO is null I looked into my ITK 4.9 build and I am trying something like this: itk::TransformFileWriterTemplate::Pointer writer = itk::TransformFileWriterTemplate::New(); // are .tfm and .txt the right file extensions? itk::TransformIOFactoryTemplate::TransformIOBasePointer tranformIO = itk::TransformIOFactoryTemplate::CreateTransformIO( "fiducials_transform.tfm", itk::TransformIOFactoryFileModeType::WriteMode ); if (tranformIO.IsNull()) { MITK_ERROR << "transform IO is null"; return; } writer->SetTransformIO(tranformIO); writer->SetFileName("fiducials_transform.tfm"); writer->SetInput(transform); try { writer->Update(); } catch (itk::ExceptionObject& e) { MITK_ERROR << "Caught exception: " << e.GetDescription(); QMessageBox::information( this, "Save transform", "Could not save transform. See error log for details." ); } thank you sebastian On 23/05/2016 05:35 p.m., Matt McCormick wrote: > Hello Sebastian, > > By running against ITK with this patch checked out: > > http://review.source.kitware.com/#/c/21115/ > > the error message will state what transform IO classes are registered. > > HTH, > Matt > > On Mon, May 23, 2016 at 4:29 PM, Sebastian Ordas > wrote: >> Hello, I am trying to run the code bellow from my application (using ITK >> 4.9) but I get the following error : >> >> ERROR: Caught exception: itk::ERROR: >> TransformFileWriterTemplate(000000000CD770E0): Can't Create IO object >> for file test.tfm >> >> I am sure that if I test it from a simple test application this should work, >> but I am trying to understand what I am missing from within my project >> (maybe some factory not yet registered or even some registration-related >> module not yet enabled in cmake?) >> >> typedef itk::VersorRigid3DTransform< double > TransformType; >> TransformType::Pointer trf = TransformType::New(); >> trf->SetIdentity(); >> >> itk::TransformFileWriterTemplate::Pointer writer = >> itk::TransformFileWriterTemplate::New(); >> >> writer->SetFileName("test.tfm"); >> writer->SetInput(trf); >> >> try >> { >> writer->Update(); >> } >> catch (itk::ExceptionObject& e) >> { >> std::cerr << "Caught exception: " << e.GetDescription() << std::endl; >> } >> >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the 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 basafa at clearguidemedical.com Mon May 23 20:54:40 2016 From: basafa at clearguidemedical.com (ebasafa) Date: Mon, 23 May 2016 17:54:40 -0700 (MST) Subject: [ITK-users] reading 3D temporal MRA dicom: miss ordered In-Reply-To: <57437C32.4030301@auckland.ac.nz> References: <57437C32.4030301@auckland.ac.nz> Message-ID: <1464051280226-7588892.post@n2.nabble.com> Does this mean that all slices have the same location information and you want them to be ordered based on the time stamp? If so, I am afraid GDCM might not be able to sort them properly. If all slices have the same location (Image Position Patient) and orientation (Image Orientation Patient), the sorting might fail. Take a look at how GDCM sorts DICOM slices (https://itk.org/Doxygen/html/classitk_1_1GDCMSeriesFileNames.html): "This class generates a sequence of files whose filenames point to a DICOM file. The ordering is based on the following strategy: Read all images in the directory (assuming there is only one study/series) 1) Extract Image Orientation & Image Position from DICOM images, and then calculate the ordering based on the 3D coordinate of the slice. 2) If for some reason this information is not found or failed, another strategy is used: the ordering is based on 'Image Number'. 3) If this strategy also failed, then the filenames are ordered by lexicographical order." HTH Ehsan -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-users-reading-3D-temporal-MRA-dicom-miss-ordered-tp7588890p7588892.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From Roy.Harnish at ucsf.edu Mon May 23 21:56:31 2016 From: Roy.Harnish at ucsf.edu (Harnish, Roy) Date: Tue, 24 May 2016 01:56:31 +0000 Subject: [ITK-users] suppressing print statements when using Python wrappers Message-ID: Hi, I'm wondering if anyone else is getting lots output to the console when using the Python wrappers? If I try to run the SNIPPET below with an itkImage: > I get many lines of print statements. Would like to know how to suppress. Thanks for any info. Roy SNIPPET: def itkImage_orient_to_axial(itkImage, itkImageType): orienterType = itk.OrientImageFilter[ itkImageType, itkImageType ] orienter = orienterType.New() orienter.UseImageDirectionOn() orienter.SetGivenCoordinateDirection(itkImage.GetDirection()) orienter.SetInput( itkImage ) orienter.SetDesiredCoordinateOrientationToAxial() orienter.Update() return orienter.GetOutput() itkImage_axial = itkImage_orient_to_axial(itkImage,imageType) OUTPUT: itkOrientImageFilterISS3ISS3: 0.343294itkOrientImageFilterISS3ISS3: 0.346615itkOrientImageFilterISS3ISS3: 0.349935itkOrientImageFilterISS3ISS3: 0.353255itkOrientImageFilterISS3ISS3: 0.356575itkOrientImageFilterISS3ISS3: 0.359896itkOrientImageFilterISS3ISS3: 0.363216itkOrientImageFilterISS3ISS3: 0.366536itkOrientImageFilterISS3ISS3: 0.369857itkOrientImageFilterISS3ISS3: 0.373177itkOrientImageFilterISS3ISS3: 0.376497itkOrientImageFilterISS3ISS3: 0.379818itkOrientImageFilterISS3ISS3: 0.383138itkOrientImageFilterISS3ISS3: 0.386458itkOrientImageFilterISS3ISS3: 0.389779itkOrientImageFilterISS3ISS3: 0.393099itkOrientImageFilterISS3ISS3: 0.396419itkOrientImageFilterISS3ISS3: 0.399740itkOrientImageFilterISS3ISS3: 0.403060itkOrientImageFilterISS3ISS3: 0.406380itkOrientImageFilterISS3ISS3: 0.409701itkOrientImageFilterISS3ISS3: 0.413021itkOrientImageFilterISS3ISS3: 0.416341itkOrientImageFilterISS3ISS3: 0.419661itkOrientImageFilterISS3ISS3: 0.422982itkOrientImageFilterISS3ISS3: 0.426302itkOrientImageFilterISS3ISS3: 0.429622itkOrientImageFilterISS3ISS3: 0.432943itkOrientImageFilterISS3ISS3: 0.436263itkOrientImageFilterISS3ISS3: 0.439583itkOrientImageFilterISS3ISS3: 0.442904itkOrientImageFilterISS3ISS3: 0.446224itkOrientImageFilterISS3ISS3: 0.449544itkOrientImageFilterISS3ISS3: 0.452865itkOrientImageFilterISS3ISS3: 0.456185itkOrientImageFilterISS3ISS3: 0.459505itkOrientImageFilterISS3ISS3: 0.462825itkOrientImageFilterISS3ISS3: 0.466146itkOrientImageFilterISS3ISS3: 0.469466itkOrientImageFilterISS3ISS3: 0.472786itkOrientImageFilterISS3ISS3: 0.476107itkOrientImageFilterISS3ISS3: 0.479427itkOrientImageFilterISS3ISS3: 0.482747itkOrientImageFilterISS3ISS3: 0.486068itkOrientImageFilterISS3ISS3: 0.489388itkOrientImageFilterISS3ISS3: 0.492708itkOrientImageFilterISS3ISS3: 0.496029itkOrientImageFilterISS3ISS3: 0.499349itkOrientImageFilterISS3ISS3: 0.502669itkOrientImageFilterISS3ISS3: 0.505990itkOrientImageFilterISS3ISS3: 0.509310itkOrientImageFilterISS3ISS3: 0.512630itkOrientImageFilterISS3ISS3: 0.515951itkOrientImageFilterISS3ISS3: 0.519271itkOrientImageFilterISS3ISS3: 0.522591itkOrientImageFilterISS3ISS3: 0.525911itkOrientImageFilterISS3ISS3: 0.529232itkOrientImageFilterISS3ISS3: 0.532552itkOrientImageFilterISS3ISS3: 0.535872itkOrientImageFilterISS3ISS3: 0.539193itkOrientImageFilterISS3ISS3: 0.542513itkOrientImageFilterISS3ISS3: 0.545833itkOrientImageFilterISS3ISS3: 0.549154itkOrientImageFilterISS3ISS3: 0.552474itkOrientImageFilterISS3ISS3: 0.555794itkOrientImageFilterISS3ISS3: 0.559115itkOrientImageFilterISS3ISS3: 0.562435itkOrientImageFilterISS3ISS3: 0.565755itkOrientImageFilterISS3ISS3: 0.569075itkOrientImageFilterISS3ISS3: 0.572396itkOrientImageFilterISS3ISS3: 0.575716itkOrientImageFilterISS3ISS3: 0.579036itkOrientImageFilterISS3ISS3: 0.582357itkOrientImageFilterISS3ISS3: 0.585677itkOrientImageFilterISS3ISS3: 0.588997itkOrientImageFilterISS3ISS3: 0.592318itkOrientImageFilterISS3ISS3: 0.595638itkOrientImageFilterISS3ISS3: 0.598958itkOrientImageFilterISS3ISS3: 0.602279itkOrientImageFilterISS3ISS3: 0.605599itkOrientImageFilterISS3ISS3: 0.608919itkOrientImageFilterISS3ISS3: 0.612240itkOrientImageFilterISS3ISS3: 0.615560itkOrientImageFilterISS3ISS3: 0.618880itkOrientImageFilterISS3ISS3: 0.622200itkOrientImageFilterISS3ISS3: 0.625521itkOrientImageFilterISS3ISS3: 0.628841itkOrientImageFilterISS3ISS3: 0.632161itkOrientImageFilterISS3ISS3: 0.635482itkOrientImageFilterISS3ISS3: 0.638802itkOrientImageFilterISS3ISS3: 0.642122itkOrientImageFilterISS3ISS3: 0.645443itkOrientImageFilterISS3ISS3: 0.648763itkOrientImageFilterISS3ISS3: 0.652083itkOrientImageFilterISS3ISS3: 0.655404itkOrientImageFilterISS3ISS3: 0.658724itkOrientImageFilterISS3ISS3: 0.662044itkOrientImageFilterISS3ISS3: 0.665365itkOrientImageFilterISS3ISS3: 0.666667itkOrientImageFilterISS3ISS3: 0.666667itkOrientImageFilterISS3ISS3: 1.000000 -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Mon May 23 22:33:11 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 23 May 2016 22:33:11 -0400 Subject: [ITK-users] suppressing print statements when using Python wrappers In-Reply-To: References: Message-ID: Hi Roy, Does import itkConfig itkConfig.ProgressCallback = None address the issue? HTH, Matt On Mon, May 23, 2016 at 9:56 PM, Harnish, Roy wrote: > Hi, > > I'm wondering if anyone else is getting lots output to the console when > using the Python wrappers? If I try to run the SNIPPET below with an > itkImage: > > at 0x7f1ec3bc5060> > > > I get many lines of print statements. Would like to know how to suppress. > > Thanks for any info. > > Roy > > > SNIPPET: > > def itkImage_orient_to_axial(itkImage, itkImageType): > orienterType = itk.OrientImageFilter[ itkImageType, itkImageType ] > orienter = orienterType.New() > orienter.UseImageDirectionOn() > orienter.SetGivenCoordinateDirection(itkImage.GetDirection()) > orienter.SetInput( itkImage ) > orienter.SetDesiredCoordinateOrientationToAxial() > orienter.Update() > return orienter.GetOutput() > > itkImage_axial = itkImage_orient_to_axial(itkImage,imageType) > > > OUTPUT: > > itkOrientImageFilterISS3ISS3: 0.343294itkOrientImageFilterISS3ISS3: > 0.346615itkOrientImageFilterISS3ISS3: 0.349935itkOrientImageFilterISS3ISS3: > 0.353255itkOrientImageFilterISS3ISS3: 0.356575itkOrientImageFilterISS3ISS3: > 0.359896itkOrientImageFilterISS3ISS3: 0.363216itkOrientImageFilterISS3ISS3: > 0.366536itkOrientImageFilterISS3ISS3: 0.369857itkOrientImageFilterISS3ISS3: > 0.373177itkOrientImageFilterISS3ISS3: 0.376497itkOrientImageFilterISS3ISS3: > 0.379818itkOrientImageFilterISS3ISS3: 0.383138itkOrientImageFilterISS3ISS3: > 0.386458itkOrientImageFilterISS3ISS3: 0.389779itkOrientImageFilterISS3ISS3: > 0.393099itkOrientImageFilterISS3ISS3: 0.396419itkOrientImageFilterISS3ISS3: > 0.399740itkOrientImageFilterISS3ISS3: 0.403060itkOrientImageFilterISS3ISS3: > 0.406380itkOrientImageFilterISS3ISS3: 0.409701itkOrientImageFilterISS3ISS3: > 0.413021itkOrientImageFilterISS3ISS3: 0.416341itkOrientImageFilterISS3ISS3: > 0.419661itkOrientImageFilterISS3ISS3: 0.422982itkOrientImageFilterISS3ISS3: > 0.426302itkOrientImageFilterISS3ISS3: 0.429622itkOrientImageFilterISS3ISS3: > 0.432943itkOrientImageFilterISS3ISS3: 0.436263itkOrientImageFilterISS3ISS3: > 0.439583itkOrientImageFilterISS3ISS3: 0.442904itkOrientImageFilterISS3ISS3: > 0.446224itkOrientImageFilterISS3ISS3: 0.449544itkOrientImageFilterISS3ISS3: > 0.452865itkOrientImageFilterISS3ISS3: 0.456185itkOrientImageFilterISS3ISS3: > 0.459505itkOrientImageFilterISS3ISS3: 0.462825itkOrientImageFilterISS3ISS3: > 0.466146itkOrientImageFilterISS3ISS3: 0.469466itkOrientImageFilterISS3ISS3: > 0.472786itkOrientImageFilterISS3ISS3: 0.476107itkOrientImageFilterISS3ISS3: > 0.479427itkOrientImageFilterISS3ISS3: 0.482747itkOrientImageFilterISS3ISS3: > 0.486068itkOrientImageFilterISS3ISS3: 0.489388itkOrientImageFilterISS3ISS3: > 0.492708itkOrientImageFilterISS3ISS3: 0.496029itkOrientImageFilterISS3ISS3: > 0.499349itkOrientImageFilterISS3ISS3: 0.502669itkOrientImageFilterISS3ISS3: > 0.505990itkOrientImageFilterISS3ISS3: 0.509310itkOrientImageFilterISS3ISS3: > 0.512630itkOrientImageFilterISS3ISS3: 0.515951itkOrientImageFilterISS3ISS3: > 0.519271itkOrientImageFilterISS3ISS3: 0.522591itkOrientImageFilterISS3ISS3: > 0.525911itkOrientImageFilterISS3ISS3: 0.529232itkOrientImageFilterISS3ISS3: > 0.532552itkOrientImageFilterISS3ISS3: 0.535872itkOrientImageFilterISS3ISS3: > 0.539193itkOrientImageFilterISS3ISS3: 0.542513itkOrientImageFilterISS3ISS3: > 0.545833itkOrientImageFilterISS3ISS3: 0.549154itkOrientImageFilterISS3ISS3: > 0.552474itkOrientImageFilterISS3ISS3: 0.555794itkOrientImageFilterISS3ISS3: > 0.559115itkOrientImageFilterISS3ISS3: 0.562435itkOrientImageFilterISS3ISS3: > 0.565755itkOrientImageFilterISS3ISS3: 0.569075itkOrientImageFilterISS3ISS3: > 0.572396itkOrientImageFilterISS3ISS3: 0.575716itkOrientImageFilterISS3ISS3: > 0.579036itkOrientImageFilterISS3ISS3: 0.582357itkOrientImageFilterISS3ISS3: > 0.585677itkOrientImageFilterISS3ISS3: 0.588997itkOrientImageFilterISS3ISS3: > 0.592318itkOrientImageFilterISS3ISS3: 0.595638itkOrientImageFilterISS3ISS3: > 0.598958itkOrientImageFilterISS3ISS3: 0.602279itkOrientImageFilterISS3ISS3: > 0.605599itkOrientImageFilterISS3ISS3: 0.608919itkOrientImageFilterISS3ISS3: > 0.612240itkOrientImageFilterISS3ISS3: 0.615560itkOrientImageFilterISS3ISS3: > 0.618880itkOrientImageFilterISS3ISS3: 0.622200itkOrientImageFilterISS3ISS3: > 0.625521itkOrientImageFilterISS3ISS3: 0.628841itkOrientImageFilterISS3ISS3: > 0.632161itkOrientImageFilterISS3ISS3: 0.635482itkOrientImageFilterISS3ISS3: > 0.638802itkOrientImageFilterISS3ISS3: 0.642122itkOrientImageFilterISS3ISS3: > 0.645443itkOrientImageFilterISS3ISS3: 0.648763itkOrientImageFilterISS3ISS3: > 0.652083itkOrientImageFilterISS3ISS3: 0.655404itkOrientImageFilterISS3ISS3: > 0.658724itkOrientImageFilterISS3ISS3: 0.662044itkOrientImageFilterISS3ISS3: > 0.665365itkOrientImageFilterISS3ISS3: 0.666667itkOrientImageFilterISS3ISS3: > 0.666667itkOrientImageFilterISS3ISS3: 1.000000 > > > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 Roy.Harnish at ucsf.edu Mon May 23 23:31:21 2016 From: Roy.Harnish at ucsf.edu (Harnish, Roy) Date: Tue, 24 May 2016 03:31:21 +0000 Subject: [ITK-users] suppressing print statements when using Python wrappers In-Reply-To: References: , Message-ID: Hi Matt, That did it! Many thanks. Roy ________________________________________ From: Matt McCormick [matt.mccormick at kitware.com] Sent: Monday, May 23, 2016 7:33 PM To: Harnish, Roy Cc: insight-users at itk.org Subject: Re: [ITK-users] suppressing print statements when using Python wrappers Hi Roy, Does import itkConfig itkConfig.ProgressCallback = None address the issue? HTH, Matt On Mon, May 23, 2016 at 9:56 PM, Harnish, Roy wrote: > Hi, > > I'm wondering if anyone else is getting lots output to the console when > using the Python wrappers? If I try to run the SNIPPET below with an > itkImage: > > at 0x7f1ec3bc5060> > > > I get many lines of print statements. Would like to know how to suppress. > > Thanks for any info. > > Roy > > > SNIPPET: > > def itkImage_orient_to_axial(itkImage, itkImageType): > orienterType = itk.OrientImageFilter[ itkImageType, itkImageType ] > orienter = orienterType.New() > orienter.UseImageDirectionOn() > orienter.SetGivenCoordinateDirection(itkImage.GetDirection()) > orienter.SetInput( itkImage ) > orienter.SetDesiredCoordinateOrientationToAxial() > orienter.Update() > return orienter.GetOutput() > > itkImage_axial = itkImage_orient_to_axial(itkImage,imageType) > > > OUTPUT: > > itkOrientImageFilterISS3ISS3: 0.343294itkOrientImageFilterISS3ISS3: > 0.346615itkOrientImageFilterISS3ISS3: 0.349935itkOrientImageFilterISS3ISS3: > 0.353255itkOrientImageFilterISS3ISS3: 0.356575itkOrientImageFilterISS3ISS3: > 0.359896itkOrientImageFilterISS3ISS3: 0.363216itkOrientImageFilterISS3ISS3: > 0.366536itkOrientImageFilterISS3ISS3: 0.369857itkOrientImageFilterISS3ISS3: > 0.373177itkOrientImageFilterISS3ISS3: 0.376497itkOrientImageFilterISS3ISS3: > 0.379818itkOrientImageFilterISS3ISS3: 0.383138itkOrientImageFilterISS3ISS3: > 0.386458itkOrientImageFilterISS3ISS3: 0.389779itkOrientImageFilterISS3ISS3: > 0.393099itkOrientImageFilterISS3ISS3: 0.396419itkOrientImageFilterISS3ISS3: > 0.399740itkOrientImageFilterISS3ISS3: 0.403060itkOrientImageFilterISS3ISS3: > 0.406380itkOrientImageFilterISS3ISS3: 0.409701itkOrientImageFilterISS3ISS3: > 0.413021itkOrientImageFilterISS3ISS3: 0.416341itkOrientImageFilterISS3ISS3: > 0.419661itkOrientImageFilterISS3ISS3: 0.422982itkOrientImageFilterISS3ISS3: > 0.426302itkOrientImageFilterISS3ISS3: 0.429622itkOrientImageFilterISS3ISS3: > 0.432943itkOrientImageFilterISS3ISS3: 0.436263itkOrientImageFilterISS3ISS3: > 0.439583itkOrientImageFilterISS3ISS3: 0.442904itkOrientImageFilterISS3ISS3: > 0.446224itkOrientImageFilterISS3ISS3: 0.449544itkOrientImageFilterISS3ISS3: > 0.452865itkOrientImageFilterISS3ISS3: 0.456185itkOrientImageFilterISS3ISS3: > 0.459505itkOrientImageFilterISS3ISS3: 0.462825itkOrientImageFilterISS3ISS3: > 0.466146itkOrientImageFilterISS3ISS3: 0.469466itkOrientImageFilterISS3ISS3: > 0.472786itkOrientImageFilterISS3ISS3: 0.476107itkOrientImageFilterISS3ISS3: > 0.479427itkOrientImageFilterISS3ISS3: 0.482747itkOrientImageFilterISS3ISS3: > 0.486068itkOrientImageFilterISS3ISS3: 0.489388itkOrientImageFilterISS3ISS3: > 0.492708itkOrientImageFilterISS3ISS3: 0.496029itkOrientImageFilterISS3ISS3: > 0.499349itkOrientImageFilterISS3ISS3: 0.502669itkOrientImageFilterISS3ISS3: > 0.505990itkOrientImageFilterISS3ISS3: 0.509310itkOrientImageFilterISS3ISS3: > 0.512630itkOrientImageFilterISS3ISS3: 0.515951itkOrientImageFilterISS3ISS3: > 0.519271itkOrientImageFilterISS3ISS3: 0.522591itkOrientImageFilterISS3ISS3: > 0.525911itkOrientImageFilterISS3ISS3: 0.529232itkOrientImageFilterISS3ISS3: > 0.532552itkOrientImageFilterISS3ISS3: 0.535872itkOrientImageFilterISS3ISS3: > 0.539193itkOrientImageFilterISS3ISS3: 0.542513itkOrientImageFilterISS3ISS3: > 0.545833itkOrientImageFilterISS3ISS3: 0.549154itkOrientImageFilterISS3ISS3: > 0.552474itkOrientImageFilterISS3ISS3: 0.555794itkOrientImageFilterISS3ISS3: > 0.559115itkOrientImageFilterISS3ISS3: 0.562435itkOrientImageFilterISS3ISS3: > 0.565755itkOrientImageFilterISS3ISS3: 0.569075itkOrientImageFilterISS3ISS3: > 0.572396itkOrientImageFilterISS3ISS3: 0.575716itkOrientImageFilterISS3ISS3: > 0.579036itkOrientImageFilterISS3ISS3: 0.582357itkOrientImageFilterISS3ISS3: > 0.585677itkOrientImageFilterISS3ISS3: 0.588997itkOrientImageFilterISS3ISS3: > 0.592318itkOrientImageFilterISS3ISS3: 0.595638itkOrientImageFilterISS3ISS3: > 0.598958itkOrientImageFilterISS3ISS3: 0.602279itkOrientImageFilterISS3ISS3: > 0.605599itkOrientImageFilterISS3ISS3: 0.608919itkOrientImageFilterISS3ISS3: > 0.612240itkOrientImageFilterISS3ISS3: 0.615560itkOrientImageFilterISS3ISS3: > 0.618880itkOrientImageFilterISS3ISS3: 0.622200itkOrientImageFilterISS3ISS3: > 0.625521itkOrientImageFilterISS3ISS3: 0.628841itkOrientImageFilterISS3ISS3: > 0.632161itkOrientImageFilterISS3ISS3: 0.635482itkOrientImageFilterISS3ISS3: > 0.638802itkOrientImageFilterISS3ISS3: 0.642122itkOrientImageFilterISS3ISS3: > 0.645443itkOrientImageFilterISS3ISS3: 0.648763itkOrientImageFilterISS3ISS3: > 0.652083itkOrientImageFilterISS3ISS3: 0.655404itkOrientImageFilterISS3ISS3: > 0.658724itkOrientImageFilterISS3ISS3: 0.662044itkOrientImageFilterISS3ISS3: > 0.665365itkOrientImageFilterISS3ISS3: 0.666667itkOrientImageFilterISS3ISS3: > 0.666667itkOrientImageFilterISS3ISS3: 1.000000 > > > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 kolin9105 at gmail.com Tue May 24 03:24:21 2016 From: kolin9105 at gmail.com (meikolin saimara) Date: Tue, 24 May 2016 14:24:21 +0700 Subject: [ITK-users] My Problem Message-ID: I have a Question what are the function of SeedX and SeedY in connected thershold and can you give me what is the conncected thershold algorithm.. -------------- next part -------------- An HTML attachment was scrubbed... URL: From abenchaaben at histalim.com Tue May 24 04:39:38 2016 From: abenchaaben at histalim.com (abenchaaben) Date: Tue, 24 May 2016 01:39:38 -0700 (MST) Subject: [ITK-users] Deform/warp an object in an image Message-ID: <1464079178302-7588897.post@n2.nabble.com> I'm trying to warp/deform a contour of an image to fit another contour in another images (i want to have the two images side by side in one images) As the images shows, i want to fit the two side of the contours in the two images. Is they a method to do that (i try to do a registration with landmarks using ITK, but it didn't give me a good result). I'm opened to any opinions. -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Deform-warp-an-object-in-an-image-tp7588897.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From dzenanz at gmail.com Tue May 24 08:56:46 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Tue, 24 May 2016 08:56:46 -0400 Subject: [ITK-users] Deform/warp an object in an image In-Reply-To: <1464079178302-7588897.post@n2.nabble.com> References: <1464079178302-7588897.post@n2.nabble.com> Message-ID: If you want to append the left side of the right image onto the right side of the left image, you might have more luck if you inverted one of the images. You should also initialize registration with a bit of overlap. And providing more details about why and how landmark registration failed, or at least what you did would not hurt. Regards, D?enan On Tue, May 24, 2016 at 4:39 AM, abenchaaben wrote: > I'm trying to warp/deform a contour of an image to fit another contour in > another images (i want to have the two images side by side in one images) > > As the images shows, i want to fit the two side of the contours in the two > images. Is they a method to do that (i try to do a registration with > landmarks using ITK, but it didn't give me a good result). I'm opened to > any > opinions. > > > > > > -- > View this message in context: > http://itk-insight-users.2283740.n2.nabble.com/Deform-warp-an-object-in-an-image-tp7588897.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 blowekamp at mail.nih.gov Tue May 24 09:04:12 2016 From: blowekamp at mail.nih.gov (Lowekamp, Bradley (NIH/NLM/LHC) [C]) Date: Tue, 24 May 2016 13:04:12 +0000 Subject: [ITK-users] My Problem In-Reply-To: References: Message-ID: <0E569D8C-54AC-49C3-B903-EEFC42E4C9B0@mail.nih.gov> Hello, ITK is an open source project! So you can look at the source code to determine what parameters do an how the algorithm is implemented. https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Segmentation/RegionGrowing/include/itkConnectedThresholdImageFilter.hxx HTH, Brad On May 24, 2016, at 3:24 AM, meikolin saimara > wrote: I have a Question what are the function of SeedX and SeedY in connected thershold and can you give me what is the conncected thershold algorithm.. _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Tue May 24 09:44:09 2016 From: blowekamp at mail.nih.gov (Lowekamp, Bradley (NIH/NLM/LHC) [C]) Date: Tue, 24 May 2016 13:44:09 +0000 Subject: [ITK-users] Access DICOM private tags using SimpleITK In-Reply-To: References: <3781B509-3DAA-4888-B6EC-94984E74E5D5@gmail.com> Message-ID: Hello, Please find a patch here in Gerrit [1], which adds the option to load these private data tags. You should be able to download and compile to get the feature. Also note that itk::GDCMImageIO loads the private tags and encodes the with Base64 into strings [2]. I am working on finding some test data to verify behavior and write some tests and documentation. HTH, Brad [1] http://review.source.kitware.com/#/c/21160/ [2] https://github.com/InsightSoftwareConsortium/ITK/blob/bf3f02c6b75a26da3987afc296af140259215e85/Modules/IO/GDCM/src/itkGDCMImageIO.cxx#L567-L587 > On May 23, 2016, at 3:59 PM, Mathew Guilfoyle wrote: > > Thanks Brad - the trouble I'm having is that some of the keys are private/hidden. > > For instance, in my images when I use the image.GetMetaDataKeys() method it returns a list of 107 keys but the one I need is a private manufacturer-specific timing tag that is not part of the standard meta-data dictionary. I know the tag I need because OsiriX viewer shows all the standard and private tags and it is in there with associated data. However, if I run image.HasMetaDataKey(my_private_key) it returns FALSE. > > Reading various sources, including the ITK docs, it seems GDCM library has a setting that needs to be turned on to read private DICOM tags. However, the only reference I can see to this setting in SimpleITK is as an argument to the GetGDCMSeriesFileNames method and I'm not clear what function it serves there as the list of files is the same irrespective. What I need somehow is to tell ReadImage or ImageSeriesReader to parse the private tags...?? > > Thanks > Mat > >> On 23 May 2016, at 20:47, Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote: >> >> Hello, >> >> To get all the tags from the dicom files you need to load them individually. Something along these lines, but iterating over the list generated by GetGDCMSeriesFileNames: >> >> from __future__ import print_function >> >> import SimpleITK as sitk >> import sys, os >> >> if len ( sys.argv ) < 2: >> print( "Usage: DicomImagePrintTags " ) >> sys.exit ( 1 ) >> >> inputImage = sitk.ReadImage( sys.argv[1] ) >> >> for k in inputImage.GetMetaDataKeys(): >> v = inputImage.GetMetaData(k) >> print("({0}) = = \"{2}\"".format(k,v)) >> >> >> HTH, >> Brad >> >> >> >>> On May 23, 2016, at 3:31 PM, Mathew Guilfoyle wrote: >>> >>> In ITK the GDCMSeriesFileNames class (equivalently the ImageSeriesReader$GetGDCMSeriesFileNames method from Simple ITK) can both take arguments to read private DICOM tags (typically manufacturer specific info that does not follow the general standard.) >>> >>> I cannot figure out how to use this function to actually read in a series of images or a volume with the hidden tags (I know they are there as I can see them in Osirix!) >>> >>> The list of filenames that the two methods above return as no different whether the 'loadPrivateTags' attribute is set on or off. >>> >>> Any ideas how I can access the private tags? >>> >>> Cheers >>> _____________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://www.kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the ITK FAQ at: >>> http://www.itk.org/Wiki/ITK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/insight-users >> > From scapegoat.sarthak at gmail.com Tue May 24 09:48:48 2016 From: scapegoat.sarthak at gmail.com (Scapegoat Sarthak) Date: Tue, 24 May 2016 09:48:48 -0400 Subject: [ITK-users] Vectorize/Linearize itk::Image Message-ID: Hello All, What would be the fastest way to convert an itk::Image< DataType, Dimensions > to a single vector of intensities? Ideally, I would like to concatenate multiple such vectors and pass them to machine learning algorithms. Thanks, Sarthak -------------- next part -------------- An HTML attachment was scrubbed... URL: From dzenanz at gmail.com Tue May 24 09:54:22 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Tue, 24 May 2016 09:54:22 -0400 Subject: [ITK-users] Vectorize/Linearize itk::Image In-Reply-To: References: Message-ID: Hi Sarthak, use iterators to go through all the pixels, and add each of them to a vector of your choice. HTH On Tue, May 24, 2016 at 9:48 AM, Scapegoat Sarthak < scapegoat.sarthak at gmail.com> wrote: > Hello All, > > What would be the fastest way to convert an itk::Image< DataType, > Dimensions > to a single vector of intensities? Ideally, I would like to > concatenate multiple such vectors and pass them to machine learning > algorithms. > > Thanks, > Sarthak > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From blowekamp at mail.nih.gov Tue May 24 09:55:18 2016 From: blowekamp at mail.nih.gov (Lowekamp, Bradley (NIH/NLM/LHC) [C]) Date: Tue, 24 May 2016 13:55:18 +0000 Subject: [ITK-users] Vectorize/Linearize itk::Image In-Reply-To: References: Message-ID: <60BA2C5F-6C09-49AD-9774-46337FFDAF9E@mail.nih.gov> Hello, You want to look at the ImportImageContainer[1]. Every itk::Image has one of these object to hold the buffer. The fastest way to ?convert? the image, is not to do any work and just get a pointer to the buffer. HTH, Brad [1] https://itk.org/Doxygen/html/classitk_1_1ImportImageContainer.html > On May 24, 2016, at 9:48 AM, Scapegoat Sarthak wrote: > > Hello All, > > What would be the fastest way to convert an itk::Image< DataType, Dimensions > to a single vector of intensities? Ideally, I would like to concatenate multiple such vectors and pass them to machine learning algorithms. > > Thanks, > Sarthak > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users From scapegoat.sarthak at gmail.com Tue May 24 10:05:28 2016 From: scapegoat.sarthak at gmail.com (Scapegoat Sarthak) Date: Tue, 24 May 2016 10:05:28 -0400 Subject: [ITK-users] Vectorize/Linearize itk::Image In-Reply-To: <60BA2C5F-6C09-49AD-9774-46337FFDAF9E@mail.nih.gov> References: <60BA2C5F-6C09-49AD-9774-46337FFDAF9E@mail.nih.gov> Message-ID: Hi Bradley, Dzenan, Thanks for your replies. The main idea is the following: 1. Read image from file -- inputImage 2. Generate a mask to remove background information (either using Otsu or reading another image with this information) -- inputMask 3. Vectorize the inputImage in the region defined by inputMask -- tempColMat or tempRowMat 4. Concatenate multiple tempColMat/tempRowMat -- trainingData 5. Pass trainingData to classifier of choice. I have tried both the solutions presented and neither work as optimally as I would like. Ideally, I would like to use a single multi-threaded filter which takes a mask as input along with the mask and extracts pixel values as a vector in return. Best, Sarthak On 24 May 2016 at 09:55, Lowekamp, Bradley (NIH/NLM/LHC) [C] < blowekamp at mail.nih.gov> wrote: > Hello, > > You want to look at the ImportImageContainer[1]. Every itk::Image has one > of these object to hold the buffer. The fastest way to ?convert? the image, > is not to do any work and just get a pointer to the buffer. > > HTH, > Brad > > [1] https://itk.org/Doxygen/html/classitk_1_1ImportImageContainer.html > > > On May 24, 2016, at 9:48 AM, Scapegoat Sarthak < > scapegoat.sarthak at gmail.com> wrote: > > > > Hello All, > > > > What would be the fastest way to convert an itk::Image< DataType, > Dimensions > to a single vector of intensities? Ideally, I would like to > concatenate multiple such vectors and pass them to machine learning > algorithms. > > > > Thanks, > > Sarthak > > _____________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Kitware offers ITK Training Courses, for more information visit: > > http://www.kitware.com/products/protraining.php > > > > Please keep messages on-topic and check the ITK FAQ at: > > http://www.itk.org/Wiki/ITK_FAQ > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/insight-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tevain at telecom-paristech.fr Tue May 24 10:56:22 2016 From: tevain at telecom-paristech.fr (Timothee Evain) Date: Tue, 24 May 2016 16:56:22 +0200 (CEST) Subject: [ITK-users] [ITK] Vectorize/Linearize itk::Image In-Reply-To: References: <60BA2C5F-6C09-49AD-9774-46337FFDAF9E@mail.nih.gov> Message-ID: <569712495.65270291.1464101782479.JavaMail.zimbra@enst.fr> Hi Sarthak, That's not really a generic framework so I doubt you will find a ready-to-use filter to do that. If you want to hide all the processing code you may want to write your own filter. On a side note, if you're only interested in intensities as output, and willing to discard the correspondance between position and value, why not just compute the otsu threshold, then parse the buffer, adding the value to your vector when it's over/under this threshold (depending on what you consider as background)? That would be less hassle than a full mask image. HTH Tim ----- Mail original ----- De: "Scapegoat Sarthak" ?: "Bradley Lowekamp (NIH/NLM/LHC) [C]" , dzenanz at gmail.com Cc: insight-users at itk.org Envoy?: Mardi 24 Mai 2016 16:05:28 Objet: Re: [ITK] [ITK-users] Vectorize/Linearize itk::Image Hi Bradley, Dzenan, Thanks for your replies. The main idea is the following: 1. Read image from file -- inputImage 2. Generate a mask to remove background information (either using Otsu or reading another image with this information) -- inputMask 3. Vectorize the inputImage in the region defined by inputMask -- tempColMat or tempRowMat 4. Concatenate multiple tempColMat/tempRowMat -- trainingData 5. Pass trainingData to classifier of choice. I have tried both the solutions presented and neither work as optimally as I would like. Ideally, I would like to use a single multi-threaded filter which takes a mask as input along with the mask and extracts pixel values as a vector in return. Best, Sarthak On 24 May 2016 at 09:55, Lowekamp, Bradley (NIH/NLM/LHC) [C] < blowekamp at mail.nih.gov > wrote: Hello, You want to look at the ImportImageContainer[1]. Every itk::Image has one of these object to hold the buffer. The fastest way to ?convert? the image, is not to do any work and just get a pointer to the buffer. HTH, Brad [1] https://itk.org/Doxygen/html/classitk_1_1ImportImageContainer.html > On May 24, 2016, at 9:48 AM, Scapegoat Sarthak < scapegoat.sarthak at gmail.com > wrote: > > Hello All, > > What would be the fastest way to convert an itk::Image< DataType, Dimensions > to a single vector of intensities? Ideally, I would like to concatenate multiple such vectors and pass them to machine learning algorithms. > > Thanks, > Sarthak > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 scapegoat.sarthak at gmail.com Tue May 24 11:11:04 2016 From: scapegoat.sarthak at gmail.com (Scapegoat Sarthak) Date: Tue, 24 May 2016 11:11:04 -0400 Subject: [ITK-users] [ITK] Vectorize/Linearize itk::Image In-Reply-To: <569712495.65270291.1464101782479.JavaMail.zimbra@enst.fr> References: <60BA2C5F-6C09-49AD-9774-46337FFDAF9E@mail.nih.gov> <569712495.65270291.1464101782479.JavaMail.zimbra@enst.fr> Message-ID: Hi Tim, Thanks for your reply. That is what I could expect - I was planning on starting with ResampleFilter and put in the option of setting a mask in the filter and do modifications accordingly... The thing is, since I know the image to be fairly large (in the order of 150x250x120), having this as a multi-threaded filter would be an efficient solution instead of checking for threshold linearly. Also, I would like the flexibility to input the mask from a separate image and not having to do the computation in the main filter, if it can be avoided. Best, Sarthak On 24 May 2016 at 10:56, Timothee Evain wrote: > Hi Sarthak, > > That's not really a generic framework so I doubt you will find a > ready-to-use filter to do that. > If you want to hide all the processing code you may want to write your own > filter. > On a side note, if you're only interested in intensities as output, and > willing to discard the correspondance between position and value, why not > just compute the otsu threshold, then parse the buffer, adding the value to > your vector when it's over/under this threshold (depending on what you > consider as background)? > That would be less hassle than a full mask image. > > HTH > Tim > > > ----- Mail original ----- > De: "Scapegoat Sarthak" > ?: "Bradley Lowekamp (NIH/NLM/LHC) [C]" , > dzenanz at gmail.com > Cc: insight-users at itk.org > Envoy?: Mardi 24 Mai 2016 16:05:28 > Objet: Re: [ITK] [ITK-users] Vectorize/Linearize itk::Image > > Hi Bradley, Dzenan, > > Thanks for your replies. The main idea is the following: > > 1. Read image from file -- inputImage > 2. Generate a mask to remove background information (either using Otsu or > reading another image with this information) -- inputMask > 3. Vectorize the inputImage in the region defined by inputMask -- > tempColMat or tempRowMat > 4. Concatenate multiple tempColMat/tempRowMat -- trainingData > 5. Pass trainingData to classifier of choice. > > I have tried both the solutions presented and neither work as optimally as > I would like. Ideally, I would like to use a single multi-threaded filter > which takes a mask as input along with the mask and extracts pixel values > as a vector in return. > > Best, > Sarthak > > > On 24 May 2016 at 09:55, Lowekamp, Bradley (NIH/NLM/LHC) [C] < > blowekamp at mail.nih.gov > wrote: > > > Hello, > > You want to look at the ImportImageContainer[1]. Every itk::Image has one > of these object to hold the buffer. The fastest way to ?convert? the image, > is not to do any work and just get a pointer to the buffer. > > HTH, > Brad > > [1] https://itk.org/Doxygen/html/classitk_1_1ImportImageContainer.html > > > On May 24, 2016, at 9:48 AM, Scapegoat Sarthak < > scapegoat.sarthak at gmail.com > wrote: > > > > Hello All, > > > > What would be the fastest way to convert an itk::Image< DataType, > Dimensions > to a single vector of intensities? Ideally, I would like to > concatenate multiple such vectors and pass them to machine learning > algorithms. > > > > Thanks, > > Sarthak > > _____________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Kitware offers ITK Training Courses, for more information visit: > > http://www.kitware.com/products/protraining.php > > > > Please keep messages on-topic and check the ITK FAQ at: > > http://www.itk.org/Wiki/ITK_FAQ > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/insight-users > > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 olivier.commowick at inria.fr Tue May 24 13:13:37 2016 From: olivier.commowick at inria.fr (Olivier Commowick) Date: Tue, 24 May 2016 19:13:37 +0200 Subject: [ITK-users] VXL compilation in ITK 4.10 RC2 Message-ID: Hello, I am writing this email about a small problem for compiling in the latest RCs on Fedora. VXL has been updated recently and does not compile when setting CMAKE_CXX_STANDARD to 11 on that OS. Looking into it, this is because a cmake test is not yet accounting for that variable in VXL introspection file. And since on fedora C++11 is not activated by default in gcc, the compilation fails or a fpermissive flag has to be set for the compilation. I had submitted a small, yet not robust and ad-hoc patch, on gerrit and was told it has actually been corrected in a more recent version of VXL github. Since I do not know how this repo is merged / updated into ITK, would it be possible for someone to update VXL to its latest version in ITK master and release branches? Of course, this is definitely not urgent since a workaround exists but I feel that would be great for the rest of us on fedoras. Thanks a lot in advance. Olivier From hans-johnson at uiowa.edu Tue May 24 13:25:30 2016 From: hans-johnson at uiowa.edu (Johnson, Hans J) Date: Tue, 24 May 2016 17:25:30 +0000 Subject: [ITK-users] VXL compilation in ITK 4.10 RC2 In-Reply-To: References: Message-ID: This will hopefully be fixed in the next RC release: See: http://review.source.kitware.com/#/c/21161/ Hans -- On 5/24/16, 12:13 PM, "Insight-users on behalf of Olivier Commowick" wrote: >Hello, > >I am writing this email about a small problem for compiling in the latest RCs on Fedora. VXL has been updated recently and does not compile when setting CMAKE_CXX_STANDARD to 11 on that OS. Looking into it, this is because a cmake test is not yet accounting for that variable in VXL introspection file. And since on fedora C++11 is not activated by default in gcc, the compilation fails or a fpermissive flag has to be set for the compilation. > >I had submitted a small, yet not robust and ad-hoc patch, on gerrit and was told it has actually been corrected in a more recent version of VXL github. Since I do not know how this repo is merged / updated into ITK, would it be possible for someone to update VXL to its latest version in ITK master and release branches? Of course, this is definitely not urgent since a workaround exists but I feel that would be great for the rest of us on fedoras. > >Thanks a lot in advance. >Olivier >_____________________________________ >Powered by www.kitware.com > >Visit other Kitware open-source projects at >http://www.kitware.com/opensource/opensource.html > >Kitware offers ITK Training Courses, for more information visit: >http://www.kitware.com/products/protraining.php > >Please keep messages on-topic and check the 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 Tue May 24 23:38:40 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 24 May 2016 23:38:40 -0400 Subject: [ITK-users] cannot save transform to file: Can't Create IO object In-Reply-To: References: <9d8c22ce-801c-11a2-a6f4-917c475271bb@gmail.com> Message-ID: Hi Sebastian, Is this in a plugin? There are significant issues when dealing with dynamic_cast's of the templates in plugins. Does building against ITK with this branch checked out help?: http://review.source.kitware.com/#/c/21102 Thanks, Matt On Mon, May 23, 2016 at 8:42 PM, Sebastian Ordas wrote: > Thanks Matt, > > The retrieved transformIO is null > > I looked into my ITK 4.9 build and I am trying something like this: > > itk::TransformFileWriterTemplate::Pointer writer = > itk::TransformFileWriterTemplate::New(); > > // are .tfm and .txt the right file extensions? > > itk::TransformIOFactoryTemplate::TransformIOBasePointer tranformIO = > itk::TransformIOFactoryTemplate::CreateTransformIO( > "fiducials_transform.tfm", itk::TransformIOFactoryFileModeType::WriteMode ); > > if (tranformIO.IsNull()) > { > MITK_ERROR << "transform IO is null"; > return; > } > > writer->SetTransformIO(tranformIO); > > writer->SetFileName("fiducials_transform.tfm"); > > writer->SetInput(transform); > > try > { > writer->Update(); > } > catch (itk::ExceptionObject& e) > { > MITK_ERROR << "Caught exception: " << e.GetDescription(); > QMessageBox::information( this, "Save transform", "Could not save > transform. See error log for details." ); > } > > thank you > sebastian > > > On 23/05/2016 05:35 p.m., Matt McCormick wrote: >> >> Hello Sebastian, >> >> By running against ITK with this patch checked out: >> >> http://review.source.kitware.com/#/c/21115/ >> >> the error message will state what transform IO classes are registered. >> >> HTH, >> Matt >> >> On Mon, May 23, 2016 at 4:29 PM, Sebastian Ordas >> wrote: >>> >>> Hello, I am trying to run the code bellow from my application (using ITK >>> 4.9) but I get the following error : >>> >>> ERROR: Caught exception: itk::ERROR: >>> TransformFileWriterTemplate(000000000CD770E0): Can't Create IO object >>> for file test.tfm >>> >>> I am sure that if I test it from a simple test application this should >>> work, >>> but I am trying to understand what I am missing from within my project >>> (maybe some factory not yet registered or even some registration-related >>> module not yet enabled in cmake?) >>> >>> typedef itk::VersorRigid3DTransform< double > TransformType; >>> TransformType::Pointer trf = TransformType::New(); >>> trf->SetIdentity(); >>> >>> itk::TransformFileWriterTemplate::Pointer writer = >>> itk::TransformFileWriterTemplate::New(); >>> >>> writer->SetFileName("test.tfm"); >>> writer->SetInput(trf); >>> >>> try >>> { >>> writer->Update(); >>> } >>> catch (itk::ExceptionObject& e) >>> { >>> std::cerr << "Caught exception: " << e.GetDescription() << >>> std::endl; >>> } >>> >>> >>> _____________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://www.kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the 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 suneezahanif02 at gmail.com Wed May 25 09:09:01 2016 From: suneezahanif02 at gmail.com (suneeza hanif) Date: Wed, 25 May 2016 15:09:01 +0200 Subject: [ITK-users] 3D Registration Message-ID: Hi Everyone, I am reading two different sets of DICOM image series in two different folders to perform a registration. Everything is working fine but when I write the registration output again as DICOM series images some of the slices appear as black empty images. Does anyone know the cause of this problem and how to fix it? Thanks in advance. Best Regards, Suneeza -------------- next part -------------- An HTML attachment was scrubbed... URL: From matimontg at gmail.com Wed May 25 09:21:43 2016 From: matimontg at gmail.com (Matias Montroull) Date: Wed, 25 May 2016 10:21:43 -0300 Subject: [ITK-users] 3D Registration In-Reply-To: References: Message-ID: Can you send us the dcm series? I have a working affine registration (CT-MR) that I can test with your images. I have been using it and works just fine. Sometimes is up to what parameters you select. Matias On May 25, 2016 10:09 AM, "suneeza hanif" wrote: > Hi Everyone, > > I am reading two different sets of DICOM image series in two different > folders to perform a registration. Everything is working fine but when I > write the registration output again as DICOM series images some of the > slices appear as black empty images. > > Does anyone know the cause of this problem and how to fix it? > > Thanks in advance. > > 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 sebastian.ordas at gmail.com Wed May 25 18:38:03 2016 From: sebastian.ordas at gmail.com (Sebastian Ordas) Date: Wed, 25 May 2016 19:38:03 -0300 Subject: [ITK-users] cannot save transform to file: Can't Create IO object In-Reply-To: References: <9d8c22ce-801c-11a2-a6f4-917c475271bb@gmail.com> Message-ID: <0ba2cb09-284e-0ec4-49f5-d4dad25a3cf2@gmail.com> Yes, this is within a plugin in a very complex framework (MITK) I will try to use that ITK branch but will take some time. Before that, I will try to do the save/load functionality from a MITK module. Anyway, I will share your hint with the MITK team and come back to the ITK list thank you, sebastian On 25/05/2016 12:38 a.m., Matt McCormick wrote: > Hi Sebastian, > > Is this in a plugin? There are significant issues when dealing with > dynamic_cast's of the templates in plugins. > > Does building against ITK with this branch checked out help?: > > http://review.source.kitware.com/#/c/21102 > > Thanks, > Matt > > On Mon, May 23, 2016 at 8:42 PM, Sebastian Ordas > wrote: >> Thanks Matt, >> >> The retrieved transformIO is null >> >> I looked into my ITK 4.9 build and I am trying something like this: >> >> itk::TransformFileWriterTemplate::Pointer writer = >> itk::TransformFileWriterTemplate::New(); >> >> // are .tfm and .txt the right file extensions? >> >> itk::TransformIOFactoryTemplate::TransformIOBasePointer tranformIO = >> itk::TransformIOFactoryTemplate::CreateTransformIO( >> "fiducials_transform.tfm", itk::TransformIOFactoryFileModeType::WriteMode ); >> >> if (tranformIO.IsNull()) >> { >> MITK_ERROR << "transform IO is null"; >> return; >> } >> >> writer->SetTransformIO(tranformIO); >> >> writer->SetFileName("fiducials_transform.tfm"); >> >> writer->SetInput(transform); >> >> try >> { >> writer->Update(); >> } >> catch (itk::ExceptionObject& e) >> { >> MITK_ERROR << "Caught exception: " << e.GetDescription(); >> QMessageBox::information( this, "Save transform", "Could not save >> transform. See error log for details." ); >> } >> >> thank you >> sebastian >> >> >> On 23/05/2016 05:35 p.m., Matt McCormick wrote: >>> Hello Sebastian, >>> >>> By running against ITK with this patch checked out: >>> >>> http://review.source.kitware.com/#/c/21115/ >>> >>> the error message will state what transform IO classes are registered. >>> >>> HTH, >>> Matt >>> >>> On Mon, May 23, 2016 at 4:29 PM, Sebastian Ordas >>> wrote: >>>> Hello, I am trying to run the code bellow from my application (using ITK >>>> 4.9) but I get the following error : >>>> >>>> ERROR: Caught exception: itk::ERROR: >>>> TransformFileWriterTemplate(000000000CD770E0): Can't Create IO object >>>> for file test.tfm >>>> >>>> I am sure that if I test it from a simple test application this should >>>> work, >>>> but I am trying to understand what I am missing from within my project >>>> (maybe some factory not yet registered or even some registration-related >>>> module not yet enabled in cmake?) >>>> >>>> typedef itk::VersorRigid3DTransform< double > TransformType; >>>> TransformType::Pointer trf = TransformType::New(); >>>> trf->SetIdentity(); >>>> >>>> itk::TransformFileWriterTemplate::Pointer writer = >>>> itk::TransformFileWriterTemplate::New(); >>>> >>>> writer->SetFileName("test.tfm"); >>>> writer->SetInput(trf); >>>> >>>> try >>>> { >>>> writer->Update(); >>>> } >>>> catch (itk::ExceptionObject& e) >>>> { >>>> std::cerr << "Caught exception: " << e.GetDescription() << >>>> std::endl; >>>> } >>>> >>>> >>>> _____________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Kitware offers ITK Training Courses, for more information visit: >>>> http://www.kitware.com/products/protraining.php >>>> >>>> Please keep messages on-topic and check the 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 Thu May 26 08:31:50 2016 From: blowekamp at mail.nih.gov (Lowekamp, Bradley (NIH/NLM/LHC) [C]) Date: Thu, 26 May 2016 12:31:50 +0000 Subject: [ITK-users] cannot save transform to file: Can't Create IO object In-Reply-To: <0ba2cb09-284e-0ec4-49f5-d4dad25a3cf2@gmail.com> References: <9d8c22ce-801c-11a2-a6f4-917c475271bb@gmail.com> <0ba2cb09-284e-0ec4-49f5-d4dad25a3cf2@gmail.com> Message-ID: <89164634-8978-4676-83E3-30E235467C1B@mail.nih.gov> Hello, That branch makes some improvements, but there really does need a redesign of a few key initializations and shared library policies to work correctly. Brad > On May 25, 2016, at 6:38 PM, Sebastian Ordas wrote: > > Yes, this is within a plugin in a very complex framework (MITK) > > I will try to use that ITK branch but will take some time. Before that, I will try to do the save/load functionality from a MITK module. > > Anyway, I will share your hint with the MITK team and come back to the ITK list > > thank you, > > sebastian > > > On 25/05/2016 12:38 a.m., Matt McCormick wrote: >> Hi Sebastian, >> >> Is this in a plugin? There are significant issues when dealing with >> dynamic_cast's of the templates in plugins. >> >> Does building against ITK with this branch checked out help?: >> >> http://review.source.kitware.com/#/c/21102 >> >> Thanks, >> Matt >> >> On Mon, May 23, 2016 at 8:42 PM, Sebastian Ordas >> wrote: >>> Thanks Matt, >>> >>> The retrieved transformIO is null >>> >>> I looked into my ITK 4.9 build and I am trying something like this: >>> >>> itk::TransformFileWriterTemplate::Pointer writer = >>> itk::TransformFileWriterTemplate::New(); >>> >>> // are .tfm and .txt the right file extensions? >>> >>> itk::TransformIOFactoryTemplate::TransformIOBasePointer tranformIO = >>> itk::TransformIOFactoryTemplate::CreateTransformIO( >>> "fiducials_transform.tfm", itk::TransformIOFactoryFileModeType::WriteMode ); >>> >>> if (tranformIO.IsNull()) >>> { >>> MITK_ERROR << "transform IO is null"; >>> return; >>> } >>> >>> writer->SetTransformIO(tranformIO); >>> >>> writer->SetFileName("fiducials_transform.tfm"); >>> >>> writer->SetInput(transform); >>> >>> try >>> { >>> writer->Update(); >>> } >>> catch (itk::ExceptionObject& e) >>> { >>> MITK_ERROR << "Caught exception: " << e.GetDescription(); >>> QMessageBox::information( this, "Save transform", "Could not save >>> transform. See error log for details." ); >>> } >>> >>> thank you >>> sebastian >>> >>> >>> On 23/05/2016 05:35 p.m., Matt McCormick wrote: >>>> Hello Sebastian, >>>> >>>> By running against ITK with this patch checked out: >>>> >>>> http://review.source.kitware.com/#/c/21115/ >>>> >>>> the error message will state what transform IO classes are registered. >>>> >>>> HTH, >>>> Matt >>>> >>>> On Mon, May 23, 2016 at 4:29 PM, Sebastian Ordas >>>> wrote: >>>>> Hello, I am trying to run the code bellow from my application (using ITK >>>>> 4.9) but I get the following error : >>>>> >>>>> ERROR: Caught exception: itk::ERROR: >>>>> TransformFileWriterTemplate(000000000CD770E0): Can't Create IO object >>>>> for file test.tfm >>>>> >>>>> I am sure that if I test it from a simple test application this should >>>>> work, >>>>> but I am trying to understand what I am missing from within my project >>>>> (maybe some factory not yet registered or even some registration-related >>>>> module not yet enabled in cmake?) >>>>> >>>>> typedef itk::VersorRigid3DTransform< double > TransformType; >>>>> TransformType::Pointer trf = TransformType::New(); >>>>> trf->SetIdentity(); >>>>> >>>>> itk::TransformFileWriterTemplate::Pointer writer = >>>>> itk::TransformFileWriterTemplate::New(); >>>>> >>>>> writer->SetFileName("test.tfm"); >>>>> writer->SetInput(trf); >>>>> >>>>> try >>>>> { >>>>> writer->Update(); >>>>> } >>>>> catch (itk::ExceptionObject& e) >>>>> { >>>>> std::cerr << "Caught exception: " << e.GetDescription() << >>>>> std::endl; >>>>> } >>>>> >>>>> >>>>> _____________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Kitware offers ITK Training Courses, for more information visit: >>>>> http://www.kitware.com/products/protraining.php >>>>> >>>>> Please keep messages on-topic and check the 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 pip010 at gmail.com Thu May 26 09:26:47 2016 From: pip010 at gmail.com (Petar Petrov) Date: Thu, 26 May 2016 15:26:47 +0200 Subject: [ITK-users] image transform in worldspace Message-ID: Hello ITK community, I would really like to know how to perform any transformation (like rotation) of an image so that only the header information is modified. So far I understand a typical registration pipeline is supposed to do exactly that. However, can I simply use ResampleImageFilter with some itk transform object? It seems it will actually reorient the voxels and not the image-to-world matrix in the headers of various file formats? Please any direction will be appreciated, cheers, Petar -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 26 09:40:47 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 26 May 2016 15:40:47 +0200 Subject: [ITK-users] C++11 compiler warnings with cuda <6.5 Message-ID: Hi, I have upgraded to ITK 4.11 (compiled with gcc 5.3.1) and I now get a lot of warnings with my GPU code compiled with nvcc (cuda 6.5) (see RTK dashboard, e.g., here ) due to this itkConfigure.h.in commit . I can see two workarounds: - disable the warning when including itkConfigure.h.in when I compile CUDA code. This can be done with pragmas (like explained here ) but it is a bit of work to make it cross platform. Note that I don't fear a problem since I only include this ITK file to know the configuration, the rest is independent from ITK because, in my experience, nvcc doesn't compile ITK code... Are you sure this warning is required and, if yes, would there be a better way to disable this warning in my specific case? - disable c++11 when compiling ITK and RTK but that's a pity. Has anyone else experienced such a problem? Would there be a better solution? Thanks in advance, Simon -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at gmail.com Thu May 26 09:44:02 2016 From: simon.rit at gmail.com (Simon Rit) Date: Thu, 26 May 2016 15:44:02 +0200 Subject: [ITK-users] C++11 compiler warnings with cuda <6.5 Message-ID: Hi, I have upgraded to ITK 4.11 (compiled with gcc 5.3.1) and I now get a lot of warnings with my GPU code compiled with nvcc (cuda 6.5) (see RTK dashboard, e.g., here ) due to this itkConfigure.h.in commit . I can see two workarounds: - disable the warning when including itkConfigure.h.in when I compile CUDA code. This can be done with pragmas (like explained here ) but it is a bit of work to make it cross platform. Note that I don't fear a problem since I only include this ITK file to know the configuration, the rest is independent from ITK because, in my experience, nvcc doesn't compile ITK code... Are you sure this warning is required and, if yes, would there be a better way to disable this warning in my specific case? - disable c++11 when compiling ITK and RTK but that's a pity. Has anyone else experienced such a problem? Would there be a better solution? Thanks in advance, Simon -------------- next part -------------- An HTML attachment was scrubbed... URL: From dzenanz at gmail.com Thu May 26 09:49:37 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Thu, 26 May 2016 09:49:37 -0400 Subject: [ITK-users] image transform in worldspace In-Reply-To: References: Message-ID: Hi Petar, rigid+scaling transformation can be accomplished with header only changes by modifying header information (origin, spacing, directions). Resample image filter will re-orient the voxels. If you want to avoid voxel resampling, you need to apply transformation to the header information and change it accordingly. I don't think there is an existing solution for that. Regards, D?enan On Thu, May 26, 2016 at 9:26 AM, Petar Petrov wrote: > Hello ITK community, > > I would really like to know how to perform any transformation (like > rotation) > of an image so that only the header information is modified. > > So far I understand a typical registration pipeline is supposed to do > exactly that. > > However, can I simply use ResampleImageFilter with some itk transform > object? > It seems it will actually reorient the voxels and not the image-to-world > matrix in the headers of various file formats? > > Please any direction will be appreciated, > > cheers, > Petar > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Thu May 26 12:36:44 2016 From: lasso at queensu.ca (Andras Lasso) Date: Thu, 26 May 2016 16:36:44 +0000 Subject: [ITK-users] [ITK] cannot save transform to file: Can't Create IO object In-Reply-To: <89164634-8978-4676-83E3-30E235467C1B@mail.nih.gov> References: <9d8c22ce-801c-11a2-a6f4-917c475271bb@gmail.com> <0ba2cb09-284e-0ec4-49f5-d4dad25a3cf2@gmail.com> <89164634-8978-4676-83E3-30E235467C1B@mail.nih.gov> Message-ID: You can have a look at the workaround that has been implemented in 3D Slicer: https://github.com/Slicer/Slicer/commit/12743c6fcebb67ff9b22319cbe52a322a3738134 Some more background information: http://slicer-devel.65872.n3.nabble.com/Empty-deformable-transforms-with-Mac-build-td4036248.html I think it's unacceptable in the long term that dynamic_cast is broken for ITK transform objects but at least we have a workaround for now. It would be nice if somebody could implement a proper solution. Andras -----Original Message----- From: Community [mailto:community-bounces at itk.org] On Behalf Of Lowekamp, Bradley (NIH/NLM/LHC) [C] Sent: May 26, 2016 8:32 AM To: Sebastian Ordas Cc: insight-users at itk.org Subject: Re: [ITK] [ITK-users] cannot save transform to file: Can't Create IO object Hello, That branch makes some improvements, but there really does need a redesign of a few key initializations and shared library policies to work correctly. Brad > On May 25, 2016, at 6:38 PM, Sebastian Ordas wrote: > > Yes, this is within a plugin in a very complex framework (MITK) > > I will try to use that ITK branch but will take some time. Before that, I will try to do the save/load functionality from a MITK module. > > Anyway, I will share your hint with the MITK team and come back to the > ITK list > > thank you, > > sebastian > > > On 25/05/2016 12:38 a.m., Matt McCormick wrote: >> Hi Sebastian, >> >> Is this in a plugin? There are significant issues when dealing with >> dynamic_cast's of the templates in plugins. >> >> Does building against ITK with this branch checked out help?: >> >> http://review.source.kitware.com/#/c/21102 >> >> Thanks, >> Matt >> >> On Mon, May 23, 2016 at 8:42 PM, Sebastian Ordas >> wrote: >>> Thanks Matt, >>> >>> The retrieved transformIO is null >>> >>> I looked into my ITK 4.9 build and I am trying something like this: >>> >>> itk::TransformFileWriterTemplate::Pointer writer = >>> itk::TransformFileWriterTemplate::New(); >>> >>> // are .tfm and .txt the right file extensions? >>> >>> itk::TransformIOFactoryTemplate::TransformIOBasePointer >>> tranformIO = >>> itk::TransformIOFactoryTemplate::CreateTransformIO( >>> "fiducials_transform.tfm", >>> itk::TransformIOFactoryFileModeType::WriteMode ); >>> >>> if (tranformIO.IsNull()) >>> { >>> MITK_ERROR << "transform IO is null"; >>> return; >>> } >>> >>> writer->SetTransformIO(tranformIO); >>> >>> writer->SetFileName("fiducials_transform.tfm"); >>> >>> writer->SetInput(transform); >>> >>> try >>> { >>> writer->Update(); >>> } >>> catch (itk::ExceptionObject& e) >>> { >>> MITK_ERROR << "Caught exception: " << e.GetDescription(); >>> QMessageBox::information( this, "Save transform", "Could not >>> save transform. See error log for details." ); >>> } >>> >>> thank you >>> sebastian >>> >>> >>> On 23/05/2016 05:35 p.m., Matt McCormick wrote: >>>> Hello Sebastian, >>>> >>>> By running against ITK with this patch checked out: >>>> >>>> http://review.source.kitware.com/#/c/21115/ >>>> >>>> the error message will state what transform IO classes are registered. >>>> >>>> HTH, >>>> Matt >>>> >>>> On Mon, May 23, 2016 at 4:29 PM, Sebastian Ordas >>>> wrote: >>>>> Hello, I am trying to run the code bellow from my application >>>>> (using ITK >>>>> 4.9) but I get the following error : >>>>> >>>>> ERROR: Caught exception: itk::ERROR: >>>>> TransformFileWriterTemplate(000000000CD770E0): Can't Create IO >>>>> object for file test.tfm >>>>> >>>>> I am sure that if I test it from a simple test application this >>>>> should work, but I am trying to understand what I am missing from >>>>> within my project (maybe some factory not yet registered or even >>>>> some registration-related module not yet enabled in cmake?) >>>>> >>>>> typedef itk::VersorRigid3DTransform< double > TransformType; >>>>> TransformType::Pointer trf = TransformType::New(); >>>>> trf->SetIdentity(); >>>>> >>>>> itk::TransformFileWriterTemplate::Pointer writer = >>>>> itk::TransformFileWriterTemplate::New(); >>>>> >>>>> writer->SetFileName("test.tfm"); >>>>> writer->SetInput(trf); >>>>> >>>>> try >>>>> { >>>>> writer->Update(); >>>>> } >>>>> catch (itk::ExceptionObject& e) >>>>> { >>>>> std::cerr << "Caught exception: " << e.GetDescription() << >>>>> std::endl; >>>>> } >>>>> >>>>> >>>>> _____________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Kitware offers ITK Training Courses, for more information visit: >>>>> http://www.kitware.com/products/protraining.php >>>>> >>>>> Please keep messages on-topic and check the 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 _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 sebastian.ordas at gmail.com Thu May 26 16:08:26 2016 From: sebastian.ordas at gmail.com (Sebastian Ordas) Date: Thu, 26 May 2016 17:08:26 -0300 Subject: [ITK-users] [ITK] cannot save transform to file: Can't Create IO object In-Reply-To: References: <9d8c22ce-801c-11a2-a6f4-917c475271bb@gmail.com> <0ba2cb09-284e-0ec4-49f5-d4dad25a3cf2@gmail.com> <89164634-8978-4676-83E3-30E235467C1B@mail.nih.gov> Message-ID: <44d5e0c3-bbb2-6308-5be1-595cc2989508@gmail.com> thank you all. I will let you know if I can apply the same approach Sebastian On 26/05/2016 01:36 p.m., Andras Lasso wrote: > You can have a look at the workaround that has been implemented in 3D Slicer: > https://github.com/Slicer/Slicer/commit/12743c6fcebb67ff9b22319cbe52a322a3738134 > > Some more background information: > http://slicer-devel.65872.n3.nabble.com/Empty-deformable-transforms-with-Mac-build-td4036248.html > > I think it's unacceptable in the long term that dynamic_cast is broken for ITK transform objects but at least we have a workaround for now. It would be nice if somebody could implement a proper solution. > > Andras > > -----Original Message----- > From: Community [mailto:community-bounces at itk.org] On Behalf Of Lowekamp, Bradley (NIH/NLM/LHC) [C] > Sent: May 26, 2016 8:32 AM > To: Sebastian Ordas > Cc: insight-users at itk.org > Subject: Re: [ITK] [ITK-users] cannot save transform to file: Can't Create IO object > > Hello, > > That branch makes some improvements, but there really does need a redesign of a few key initializations and shared library policies to work correctly. > > Brad > >> On May 25, 2016, at 6:38 PM, Sebastian Ordas wrote: >> >> Yes, this is within a plugin in a very complex framework (MITK) >> >> I will try to use that ITK branch but will take some time. Before that, I will try to do the save/load functionality from a MITK module. >> >> Anyway, I will share your hint with the MITK team and come back to the >> ITK list >> >> thank you, >> >> sebastian >> >> >> On 25/05/2016 12:38 a.m., Matt McCormick wrote: >>> Hi Sebastian, >>> >>> Is this in a plugin? There are significant issues when dealing with >>> dynamic_cast's of the templates in plugins. >>> >>> Does building against ITK with this branch checked out help?: >>> >>> http://review.source.kitware.com/#/c/21102 >>> >>> Thanks, >>> Matt >>> >>> On Mon, May 23, 2016 at 8:42 PM, Sebastian Ordas >>> wrote: >>>> Thanks Matt, >>>> >>>> The retrieved transformIO is null >>>> >>>> I looked into my ITK 4.9 build and I am trying something like this: >>>> >>>> itk::TransformFileWriterTemplate::Pointer writer = >>>> itk::TransformFileWriterTemplate::New(); >>>> >>>> // are .tfm and .txt the right file extensions? >>>> >>>> itk::TransformIOFactoryTemplate::TransformIOBasePointer >>>> tranformIO = >>>> itk::TransformIOFactoryTemplate::CreateTransformIO( >>>> "fiducials_transform.tfm", >>>> itk::TransformIOFactoryFileModeType::WriteMode ); >>>> >>>> if (tranformIO.IsNull()) >>>> { >>>> MITK_ERROR << "transform IO is null"; >>>> return; >>>> } >>>> >>>> writer->SetTransformIO(tranformIO); >>>> >>>> writer->SetFileName("fiducials_transform.tfm"); >>>> >>>> writer->SetInput(transform); >>>> >>>> try >>>> { >>>> writer->Update(); >>>> } >>>> catch (itk::ExceptionObject& e) >>>> { >>>> MITK_ERROR << "Caught exception: " << e.GetDescription(); >>>> QMessageBox::information( this, "Save transform", "Could not >>>> save transform. See error log for details." ); >>>> } >>>> >>>> thank you >>>> sebastian >>>> >>>> >>>> On 23/05/2016 05:35 p.m., Matt McCormick wrote: >>>>> Hello Sebastian, >>>>> >>>>> By running against ITK with this patch checked out: >>>>> >>>>> http://review.source.kitware.com/#/c/21115/ >>>>> >>>>> the error message will state what transform IO classes are registered. >>>>> >>>>> HTH, >>>>> Matt >>>>> >>>>> On Mon, May 23, 2016 at 4:29 PM, Sebastian Ordas >>>>> wrote: >>>>>> Hello, I am trying to run the code bellow from my application >>>>>> (using ITK >>>>>> 4.9) but I get the following error : >>>>>> >>>>>> ERROR: Caught exception: itk::ERROR: >>>>>> TransformFileWriterTemplate(000000000CD770E0): Can't Create IO >>>>>> object for file test.tfm >>>>>> >>>>>> I am sure that if I test it from a simple test application this >>>>>> should work, but I am trying to understand what I am missing from >>>>>> within my project (maybe some factory not yet registered or even >>>>>> some registration-related module not yet enabled in cmake?) >>>>>> >>>>>> typedef itk::VersorRigid3DTransform< double > TransformType; >>>>>> TransformType::Pointer trf = TransformType::New(); >>>>>> trf->SetIdentity(); >>>>>> >>>>>> itk::TransformFileWriterTemplate::Pointer writer = >>>>>> itk::TransformFileWriterTemplate::New(); >>>>>> >>>>>> writer->SetFileName("test.tfm"); >>>>>> writer->SetInput(trf); >>>>>> >>>>>> try >>>>>> { >>>>>> writer->Update(); >>>>>> } >>>>>> catch (itk::ExceptionObject& e) >>>>>> { >>>>>> std::cerr << "Caught exception: " << e.GetDescription() << >>>>>> std::endl; >>>>>> } >>>>>> >>>>>> >>>>>> _____________________________________ >>>>>> Powered by www.kitware.com >>>>>> >>>>>> Visit other Kitware open-source projects at >>>>>> http://www.kitware.com/opensource/opensource.html >>>>>> >>>>>> Kitware offers ITK Training Courses, for more information visit: >>>>>> http://www.kitware.com/products/protraining.php >>>>>> >>>>>> Please keep messages on-topic and check the 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 > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community From j.plumat at auckland.ac.nz Thu May 26 21:27:27 2016 From: j.plumat at auckland.ac.nz (Jerome Plumat) Date: Fri, 27 May 2016 13:27:27 +1200 Subject: [ITK-users] reading 3D temporal MRA dicom: miss ordered [SOLVED] In-Reply-To: <1464051280226-7588892.post@n2.nabble.com> References: <57437C32.4030301@auckland.ac.nz> <1464051280226-7588892.post@n2.nabble.com> Message-ID: <5747A27F.4040209@auckland.ac.nz> Hi Ehsan, Thanks a lot for your answer. Your indication guided me to the solution. Below is the core part of the code to load the DCM angiography with MRI (MRA) on Siemens. Hope it may help further. Jerome Note: DCMDate is an object storing the acquisition content and the pointer to the image, sortByAcquisitionDate is a simple ordering function see http://www.cplusplus.com/articles/NhA0RXSz/ // .... // order the angiography capture using Content Time const std::string entry_id = "0008|0033"; ImageIOType::Pointer dicomIO = ImageIOType::New(); NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New(); DCMReaderType::Pointer reader = DCMReaderType::New(); reader->SetImageIO( dicomIO ); // get all the dicom slices in the pointing folder nameGenerator->SetDirectory( inputPath ); // point to the folder containing the dcm files const SeriesIdContainer & seriesUID = nameGenerator->GetSeriesUIDs(); std::string seriesIdentifier = seriesUID.begin()->c_str(); FileNamesContainer fileNames; fileNames = nameGenerator->GetFileNames( seriesIdentifier ); std::vector dcm_list = std::vector(fileNames.size()); // Read all the DCM files and find the content time for( int i=0; iSetFileName( fileNames.at(i)); // read the slice DCMImageType::Pointer im; try{ f_reader->Update(); im = f_reader->GetOutput(); }catch(itk::ExceptionObject &err ){ std::cerr << err << std::endl; return EXIT_FAILURE; } // find the acquisition date const DictionaryType & dictionary = im->GetMetaDataDictionary(); DictionaryType::ConstIterator tagItr = dictionary.Find( entry_id ); if( tagItr == dictionary.End() ){ std::cerr << ">> Tag " << entry_id; std::cerr << " not found in the DICOM header" << std::endl; return EXIT_FAILURE; } MetaDataStringType::ConstPointer entryvalue = dynamic_cast( tagItr->second.GetPointer() ); // if we find the value, create an object if( entryvalue ){ std::string tagkey = tagItr->first; std::string labelId; bool found = itk::GDCMImageIO::GetLabelFromTag( tagkey, labelId ); std::string tagvalue = entryvalue->GetMetaDataObjectValue(); if(found){ if(verbose){ std::cout.precision(16); std::cout << "(" << tagkey << ") "; std::cout << labelId << " = " << atof(tagvalue.c_str()); std::cout << std::endl; } dcm_list.at(i) = DCMDate(atof(tagvalue.c_str()), im.GetPointer()); } }else{ std::cerr << "Entry not found." << std::endl; return EXIT_FAILURE; } im = DCMImageType::New(); } // order all the slice by acquisition time std::sort(dcm_list.begin(), dcm_list.end(), sortByAcquisitionDate); // then, save each element of the list on a slice of a volume and write the volume on HD. On 24/05/16 12:54, ebasafa wrote: > Does this mean that all slices have the same location information and you > want them to be ordered based on the time stamp? If so, I am afraid GDCM > might not be able to sort them properly. If all slices have the same > location (Image Position Patient) and orientation (Image Orientation > Patient), the sorting might fail. Take a look at how GDCM sorts DICOM slices > (https://itk.org/Doxygen/html/classitk_1_1GDCMSeriesFileNames.html): > > "This class generates a sequence of files whose filenames point to a DICOM > file. The ordering is based on the following strategy: Read all images in > the directory (assuming there is only one study/series) > > 1) Extract Image Orientation & Image Position from DICOM images, and then > calculate the ordering based on the 3D coordinate of the slice. > 2) If for some reason this information is not found or failed, another > strategy is used: the ordering is based on 'Image Number'. > 3) If this strategy also failed, then the filenames are ordered by > lexicographical order." > > HTH > Ehsan > > > > > -- > View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-users-reading-3D-temporal-MRA-dicom-miss-ordered-tp7588890p7588892.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 mrguilfoyle at gmail.com Fri May 27 11:29:19 2016 From: mrguilfoyle at gmail.com (Mathew Guilfoyle) Date: Fri, 27 May 2016 16:29:19 +0100 Subject: [ITK-users] Access DICOM private tags using SimpleITK In-Reply-To: References: <3781B509-3DAA-4888-B6EC-94984E74E5D5@gmail.com> Message-ID: <97FF68E7-091E-4B45-B5B3-FBE81C35505E@gmail.com> Dear Brad Thanks for the patch - I have successfully recompiled and the private tag functions are exposed in the R wrapping to SimpleITK. For instance I can do the following: reader = ImageFileReader() reader$LoadPrivateTagsOn() or reader$SetLoadPrivateTags(TRUE) However, neither of the above seem to have an effect i.e. a call to reader$GetLoadPrivateTags() returns FALSE after both of the above and the summary of my reader object has the 'loadPrivateTag' attribute at 0 irrespective. If I execute the reader I get an image with only the 107 public tags I had before. There are now errors reports with any of the commands. Any ideas on how to get this working? Cheers Mathew > On 24 May 2016, at 14:44, Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote: > > Hello, > > Please find a patch here in Gerrit [1], which adds the option to load these private data tags. You should be able to download and compile to get the feature. Also note that itk::GDCMImageIO loads the private tags and encodes the with Base64 into strings [2]. I am working on finding some test data to verify behavior and write some tests and documentation. > > HTH, > Brad > > [1] http://review.source.kitware.com/#/c/21160/ > [2] https://github.com/InsightSoftwareConsortium/ITK/blob/bf3f02c6b75a26da3987afc296af140259215e85/Modules/IO/GDCM/src/itkGDCMImageIO.cxx#L567-L587 > >> On May 23, 2016, at 3:59 PM, Mathew Guilfoyle wrote: >> >> Thanks Brad - the trouble I'm having is that some of the keys are private/hidden. >> >> For instance, in my images when I use the image.GetMetaDataKeys() method it returns a list of 107 keys but the one I need is a private manufacturer-specific timing tag that is not part of the standard meta-data dictionary. I know the tag I need because OsiriX viewer shows all the standard and private tags and it is in there with associated data. However, if I run image.HasMetaDataKey(my_private_key) it returns FALSE. >> >> Reading various sources, including the ITK docs, it seems GDCM library has a setting that needs to be turned on to read private DICOM tags. However, the only reference I can see to this setting in SimpleITK is as an argument to the GetGDCMSeriesFileNames method and I'm not clear what function it serves there as the list of files is the same irrespective. What I need somehow is to tell ReadImage or ImageSeriesReader to parse the private tags...?? >> >> Thanks >> Mat >> >>> On 23 May 2016, at 20:47, Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote: >>> >>> Hello, >>> >>> To get all the tags from the dicom files you need to load them individually. Something along these lines, but iterating over the list generated by GetGDCMSeriesFileNames: >>> >>> from __future__ import print_function >>> >>> import SimpleITK as sitk >>> import sys, os >>> >>> if len ( sys.argv ) < 2: >>> print( "Usage: DicomImagePrintTags " ) >>> sys.exit ( 1 ) >>> >>> inputImage = sitk.ReadImage( sys.argv[1] ) >>> >>> for k in inputImage.GetMetaDataKeys(): >>> v = inputImage.GetMetaData(k) >>> print("({0}) = = \"{2}\"".format(k,v)) >>> >>> >>> HTH, >>> Brad >>> >>> >>> >>>> On May 23, 2016, at 3:31 PM, Mathew Guilfoyle wrote: >>>> >>>> In ITK the GDCMSeriesFileNames class (equivalently the ImageSeriesReader$GetGDCMSeriesFileNames method from Simple ITK) can both take arguments to read private DICOM tags (typically manufacturer specific info that does not follow the general standard.) >>>> >>>> I cannot figure out how to use this function to actually read in a series of images or a volume with the hidden tags (I know they are there as I can see them in Osirix!) >>>> >>>> The list of filenames that the two methods above return as no different whether the 'loadPrivateTags' attribute is set on or off. >>>> >>>> Any ideas how I can access the private tags? >>>> >>>> Cheers >>>> _____________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Kitware offers ITK Training Courses, for more information visit: >>>> http://www.kitware.com/products/protraining.php >>>> >>>> Please keep messages on-topic and check the 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 Fri May 27 16:08:31 2016 From: blowekamp at mail.nih.gov (Lowekamp, Bradley (NIH/NLM/LHC) [C]) Date: Fri, 27 May 2016 20:08:31 +0000 Subject: [ITK-users] Access DICOM private tags using SimpleITK In-Reply-To: <97FF68E7-091E-4B45-B5B3-FBE81C35505E@gmail.com> References: <3781B509-3DAA-4888-B6EC-94984E74E5D5@gmail.com> <97FF68E7-091E-4B45-B5B3-FBE81C35505E@gmail.com> Message-ID: <9643D292-09B9-4021-B665-2722E4C4E10A@mail.nih.gov> Hi, Sorry that didn?t work. I was able to get some dicom data with private tags. I have updated the patch with more commits in the topic: http://review.source.kitware.com/#/q/status:open+project:SimpleITK+branch:master+topic:AddLoadPrivateTagsOptions Now that I have tested it with data, I have merged it into the ?next? branch. What are these ?error reports? with any command? Brad > On May 27, 2016, at 11:29 AM, Mathew Guilfoyle wrote: > > Dear Brad > > Thanks for the patch - I have successfully recompiled and the private tag functions are exposed in the R wrapping to SimpleITK. For instance I can do the following: > > reader = ImageFileReader() > reader$LoadPrivateTagsOn() > > or reader$SetLoadPrivateTags(TRUE) > > However, neither of the above seem to have an effect i.e. a call to reader$GetLoadPrivateTags() returns FALSE after both of the above and the summary of my reader object has the 'loadPrivateTag' attribute at 0 irrespective. If I execute the reader I get an image with only the 107 public tags I had before. There are now errors reports with any of the commands. > > Any ideas on how to get this working? > > Cheers > Mathew > >> On 24 May 2016, at 14:44, Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote: >> >> Hello, >> >> Please find a patch here in Gerrit [1], which adds the option to load these private data tags. You should be able to download and compile to get the feature. Also note that itk::GDCMImageIO loads the private tags and encodes the with Base64 into strings [2]. I am working on finding some test data to verify behavior and write some tests and documentation. >> >> HTH, >> Brad >> >> [1] http://review.source.kitware.com/#/c/21160/ >> [2] https://github.com/InsightSoftwareConsortium/ITK/blob/bf3f02c6b75a26da3987afc296af140259215e85/Modules/IO/GDCM/src/itkGDCMImageIO.cxx#L567-L587 >> >>> On May 23, 2016, at 3:59 PM, Mathew Guilfoyle wrote: >>> >>> Thanks Brad - the trouble I'm having is that some of the keys are private/hidden. >>> >>> For instance, in my images when I use the image.GetMetaDataKeys() method it returns a list of 107 keys but the one I need is a private manufacturer-specific timing tag that is not part of the standard meta-data dictionary. I know the tag I need because OsiriX viewer shows all the standard and private tags and it is in there with associated data. However, if I run image.HasMetaDataKey(my_private_key) it returns FALSE. >>> >>> Reading various sources, including the ITK docs, it seems GDCM library has a setting that needs to be turned on to read private DICOM tags. However, the only reference I can see to this setting in SimpleITK is as an argument to the GetGDCMSeriesFileNames method and I'm not clear what function it serves there as the list of files is the same irrespective. What I need somehow is to tell ReadImage or ImageSeriesReader to parse the private tags...?? >>> >>> Thanks >>> Mat >>> >>>> On 23 May 2016, at 20:47, Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote: >>>> >>>> Hello, >>>> >>>> To get all the tags from the dicom files you need to load them individually. Something along these lines, but iterating over the list generated by GetGDCMSeriesFileNames: >>>> >>>> from __future__ import print_function >>>> >>>> import SimpleITK as sitk >>>> import sys, os >>>> >>>> if len ( sys.argv ) < 2: >>>> print( "Usage: DicomImagePrintTags " ) >>>> sys.exit ( 1 ) >>>> >>>> inputImage = sitk.ReadImage( sys.argv[1] ) >>>> >>>> for k in inputImage.GetMetaDataKeys(): >>>> v = inputImage.GetMetaData(k) >>>> print("({0}) = = \"{2}\"".format(k,v)) >>>> >>>> >>>> HTH, >>>> Brad >>>> >>>> >>>> >>>>> On May 23, 2016, at 3:31 PM, Mathew Guilfoyle wrote: >>>>> >>>>> In ITK the GDCMSeriesFileNames class (equivalently the ImageSeriesReader$GetGDCMSeriesFileNames method from Simple ITK) can both take arguments to read private DICOM tags (typically manufacturer specific info that does not follow the general standard.) >>>>> >>>>> I cannot figure out how to use this function to actually read in a series of images or a volume with the hidden tags (I know they are there as I can see them in Osirix!) >>>>> >>>>> The list of filenames that the two methods above return as no different whether the 'loadPrivateTags' attribute is set on or off. >>>>> >>>>> Any ideas how I can access the private tags? >>>>> >>>>> Cheers >>>>> _____________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Kitware offers ITK Training Courses, for more information visit: >>>>> http://www.kitware.com/products/protraining.php >>>>> >>>>> Please keep messages on-topic and check the 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 piotpia124 at student.polsl.pl Fri May 27 17:24:04 2016 From: piotpia124 at student.polsl.pl (Piotr Piasecki) Date: Fri, 27 May 2016 23:24:04 +0200 Subject: [ITK-users] Problems with image results from simple:itk. Message-ID: Hello Everyone. I have a problem with using itk and more specifically simpleitk. DICOM files after processing and saving in .dcm format can not be correctly opened in programs such as MicroDicom, and stored in Orthanc Dicom server. I tried to load the image using ImageFileReader, and then I wrote it without any changes, using ImageFileWriter. I could open newly created file only in ITK-SNAP. What could be the reason for such errors, and how can they be solved? Best, and thanks, Peter. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrguilfoyle at gmail.com Sun May 29 08:50:20 2016 From: mrguilfoyle at gmail.com (Mathew Guilfoyle) Date: Sun, 29 May 2016 13:50:20 +0100 Subject: [ITK-users] Access DICOM private tags using SimpleITK In-Reply-To: <9643D292-09B9-4021-B665-2722E4C4E10A@mail.nih.gov> References: <3781B509-3DAA-4888-B6EC-94984E74E5D5@gmail.com> <97FF68E7-091E-4B45-B5B3-FBE81C35505E@gmail.com> <9643D292-09B9-4021-B665-2722E4C4E10A@mail.nih.gov> Message-ID: <21E9C3F1-1DC7-42E4-B1A7-FF812A3BC5CC@gmail.com> This works perfectly now: I can extract the time stamp I need. Sorry for the typo in the previous message, should have read 'There are no error reports...' Many thanks > On 27 May 2016, at 21:08, Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote: > > Hi, > > Sorry that didn?t work. I was able to get some dicom data with private tags. I have updated the patch with more commits in the topic: > > http://review.source.kitware.com/#/q/status:open+project:SimpleITK+branch:master+topic:AddLoadPrivateTagsOptions > > Now that I have tested it with data, I have merged it into the ?next? branch. > > What are these ?error reports? with any command? > > Brad > > >> On May 27, 2016, at 11:29 AM, Mathew Guilfoyle wrote: >> >> Dear Brad >> >> Thanks for the patch - I have successfully recompiled and the private tag functions are exposed in the R wrapping to SimpleITK. For instance I can do the following: >> >> reader = ImageFileReader() >> reader$LoadPrivateTagsOn() >> >> or reader$SetLoadPrivateTags(TRUE) >> >> However, neither of the above seem to have an effect i.e. a call to reader$GetLoadPrivateTags() returns FALSE after both of the above and the summary of my reader object has the 'loadPrivateTag' attribute at 0 irrespective. If I execute the reader I get an image with only the 107 public tags I had before. There are now errors reports with any of the commands. >> >> Any ideas on how to get this working? >> >> Cheers >> Mathew >> >>> On 24 May 2016, at 14:44, Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote: >>> >>> Hello, >>> >>> Please find a patch here in Gerrit [1], which adds the option to load these private data tags. You should be able to download and compile to get the feature. Also note that itk::GDCMImageIO loads the private tags and encodes the with Base64 into strings [2]. I am working on finding some test data to verify behavior and write some tests and documentation. >>> >>> HTH, >>> Brad >>> >>> [1] http://review.source.kitware.com/#/c/21160/ >>> [2] https://github.com/InsightSoftwareConsortium/ITK/blob/bf3f02c6b75a26da3987afc296af140259215e85/Modules/IO/GDCM/src/itkGDCMImageIO.cxx#L567-L587 >>> >>>> On May 23, 2016, at 3:59 PM, Mathew Guilfoyle wrote: >>>> >>>> Thanks Brad - the trouble I'm having is that some of the keys are private/hidden. >>>> >>>> For instance, in my images when I use the image.GetMetaDataKeys() method it returns a list of 107 keys but the one I need is a private manufacturer-specific timing tag that is not part of the standard meta-data dictionary. I know the tag I need because OsiriX viewer shows all the standard and private tags and it is in there with associated data. However, if I run image.HasMetaDataKey(my_private_key) it returns FALSE. >>>> >>>> Reading various sources, including the ITK docs, it seems GDCM library has a setting that needs to be turned on to read private DICOM tags. However, the only reference I can see to this setting in SimpleITK is as an argument to the GetGDCMSeriesFileNames method and I'm not clear what function it serves there as the list of files is the same irrespective. What I need somehow is to tell ReadImage or ImageSeriesReader to parse the private tags...?? >>>> >>>> Thanks >>>> Mat >>>> >>>>> On 23 May 2016, at 20:47, Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote: >>>>> >>>>> Hello, >>>>> >>>>> To get all the tags from the dicom files you need to load them individually. Something along these lines, but iterating over the list generated by GetGDCMSeriesFileNames: >>>>> >>>>> from __future__ import print_function >>>>> >>>>> import SimpleITK as sitk >>>>> import sys, os >>>>> >>>>> if len ( sys.argv ) < 2: >>>>> print( "Usage: DicomImagePrintTags " ) >>>>> sys.exit ( 1 ) >>>>> >>>>> inputImage = sitk.ReadImage( sys.argv[1] ) >>>>> >>>>> for k in inputImage.GetMetaDataKeys(): >>>>> v = inputImage.GetMetaData(k) >>>>> print("({0}) = = \"{2}\"".format(k,v)) >>>>> >>>>> >>>>> HTH, >>>>> Brad >>>>> >>>>> >>>>> >>>>>> On May 23, 2016, at 3:31 PM, Mathew Guilfoyle wrote: >>>>>> >>>>>> In ITK the GDCMSeriesFileNames class (equivalently the ImageSeriesReader$GetGDCMSeriesFileNames method from Simple ITK) can both take arguments to read private DICOM tags (typically manufacturer specific info that does not follow the general standard.) >>>>>> >>>>>> I cannot figure out how to use this function to actually read in a series of images or a volume with the hidden tags (I know they are there as I can see them in Osirix!) >>>>>> >>>>>> The list of filenames that the two methods above return as no different whether the 'loadPrivateTags' attribute is set on or off. >>>>>> >>>>>> Any ideas how I can access the private tags? >>>>>> >>>>>> Cheers >>>>>> _____________________________________ >>>>>> Powered by www.kitware.com >>>>>> >>>>>> Visit other Kitware open-source projects at >>>>>> http://www.kitware.com/opensource/opensource.html >>>>>> >>>>>> Kitware offers ITK Training Courses, for more information visit: >>>>>> http://www.kitware.com/products/protraining.php >>>>>> >>>>>> Please keep messages on-topic and check the 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 scorpiuni at gmail.com Mon May 30 11:06:15 2016 From: scorpiuni at gmail.com (Robert) Date: Mon, 30 May 2016 08:06:15 -0700 (MST) Subject: [ITK-users] Geodesic 3D Shape guidance Message-ID: <1464620775546-7588926.post@n2.nabble.com> Dear Community, I encountered an error which I really can't get fixed. I wrote some code in order to do a segmentation with the geodesic function with shape guidance, but in 3D. I got my shape models, PCA data, etc, all done. Now in the geodesic code, I preprocess my image in which I want to find my structure (I need shape guidance, as the structure kind of melts to the background at one point, so I need the shape to restrict this). Preprocessing etc is all done, I now give my preprocessed image, and a levelset as well as the mean image and pc-images to my geodesic function (see link to code below). At one point, when testing my code, this error occurs: Description: itk::ERROR: GeodesicActiveContourShapePriorLevelSetImageFilter(0x115f970): Inputs do not occupy the same physical space! Now, as I already encountered this error once, I checked ALL the directions of ANY image in the pipeline (see code, console output usually marked with //*****DEBUG*****). They all give the same, correct value to the console. I really am at my wits end, I can't explain this error. I think it crashed at the writer called "writer", writer->SetInput( thresholder->GetOutput() );, as this one gets as input the output from the geodesic function (so, basically, the writer that will produce the final result). I commented this part out for testing purposes, and there is still a crash even later: "evalOutput5.nrrd" and "paraOutput6.nrrd" can never be reached, the same error message occurs here. I really cant find a solution, and the worst part is that due to this error I can't even test if the result is useful at all. Like I mentioned before, without shape guidance, the result is not satisfying, as "too much" of the structure is being segmented. Any help would be really appreciated. Greetings, Robert -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Geodesic-3D-Shape-guidance-tp7588926.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From scorpiuni at gmail.com Mon May 30 11:45:57 2016 From: scorpiuni at gmail.com (Robert) Date: Mon, 30 May 2016 08:45:57 -0700 (MST) Subject: [ITK-users] Shape function not present Message-ID: <1464623157605-7588927.post@n2.nabble.com> Hello, sorry for my last post, that was an older note I already solved(forgot an ->Update()), I therefore deleted it. However, where I can't progress, is the following: my code tells me that the "shape function is not present", and therefore the code is aborted. I however read my meanshape, modes etc, and a PCAShapeSignedDistanceFunction is also initialized. What exactely am I doing wrong here? The error looks kind of werid... terminate called after throwing an instance of 'itk::ExceptionObject' what(): /usr/local/include/ITK-4.9/itkShapePriorSegmentationLevelSetImageFilter.hxx:114: itk::ERROR: GeodesicActiveContourShapePriorLevelSetImageFilter(0x285f970): ShapeFunction is not present Aborted (core dumped) Everything that is needed should be there already... How can there be an error? https://www.dropbox.com/s/ot8gn0i38mh83ql/GeodesicActiveContourShapePriorLevelSetImageFilter.cxx?dl=0 -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Shape-function-not-present-tp7588927.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From scorpiuni at gmail.com Mon May 30 11:57:58 2016 From: scorpiuni at gmail.com (Robert) Date: Mon, 30 May 2016 08:57:58 -0700 (MST) Subject: [ITK-users] Processing 3D data question. In-Reply-To: <1464606770304-7588925.post@n2.nabble.com> References: <1464606770304-7588925.post@n2.nabble.com> Message-ID: <1464623878095-7588928.post@n2.nabble.com> I guess, as you have your data as an ITK Image now, you can initialize the filter you want to use kind of like this: typedef itk::Image ImageType; //pixel type is float(?), and you have a 3d matrix as you converted your dataset // to ITK typedef itk::ImageFileReader ReaderType; //here, add reader/writer if you need it typedef itk::MedianImageFilter FilterType; FilterType::Pointer medianFilter = FilterType::New(); medianFilter->SetRadius(radius); medianFilter->SetInput( reader->GetOutput() ); I don't think that there's any difference between using filters on an already prepared volume dataset (.nrrd for example), or on a dataset you converted from DICOM. I hope I could help you, however, I'm not too sure. But I honestly can't imaging that you need to "crop" slice by slice like you described. Please correct me if I'm wrong. Greetings, Robert -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Processing-3D-data-question-tp7588925p7588928.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From scorpiuni at gmail.com Mon May 30 12:00:59 2016 From: scorpiuni at gmail.com (Robert) Date: Mon, 30 May 2016 09:00:59 -0700 (MST) Subject: [ITK-users] Shape function not present In-Reply-To: <1464623157605-7588927.post@n2.nabble.com> References: <1464623157605-7588927.post@n2.nabble.com> Message-ID: <1464624059338-7588929.post@n2.nabble.com> Oh god, Im so sorry, I will delete this as well, I called an Update earlier to debug that is too early... very sorry. -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Shape-function-not-present-tp7588927p7588929.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From scorpiuni at gmail.com Mon May 30 12:07:32 2016 From: scorpiuni at gmail.com (Robert) Date: Mon, 30 May 2016 09:07:32 -0700 (MST) Subject: [ITK-users] Segmentation fault (core dumped) Geodesic Active Shape guidance 3D Message-ID: <1464624452928-7588930.post@n2.nabble.com> Hello, I finally managed to finish my 3-dimensional Geodesic Active Shape guidance. However, this error simply occurs, without any other output/ message: Segmentation fault (core dumped) How can I possibly fix this? Does anyone have any experience with this specific crash/ error? I can provide my code here: https://www.dropbox.com/s/ot8gn0i38mh83ql/GeodesicActiveContourShapePriorLevelSetImageFilter.cxx?dl=0 Any help is greatly appreciated. Many thanks, Robert -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Segmentation-fault-core-dumped-Geodesic-Active-Shape-guidance-3D-tp7588930.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From bill.lorensen at gmail.com Mon May 30 12:14:39 2016 From: bill.lorensen at gmail.com (Bill Lorensen) Date: Mon, 30 May 2016 12:14:39 -0400 Subject: [ITK-users] Segmentation fault (core dumped) Geodesic Active Shape guidance 3D In-Reply-To: <1464624452928-7588930.post@n2.nabble.com> References: <1464624452928-7588930.post@n2.nabble.com> Message-ID: Have you run within a debugger? What is the traceback? If you have a linux system, have you tried running valgrind? Can you provide a link to sample data and the command line you use? On Mon, May 30, 2016 at 12:07 PM, Robert wrote: > Hello, > I finally managed to finish my 3-dimensional Geodesic Active Shape guidance. > However, this error simply occurs, without any other output/ message: > > Segmentation fault (core dumped) > > How can I possibly fix this? Does anyone have any experience with this > specific crash/ error? > I can provide my code here: > https://www.dropbox.com/s/ot8gn0i38mh83ql/GeodesicActiveContourShapePriorLevelSetImageFilter.cxx?dl=0 > > Any help is greatly appreciated. > > Many thanks, > Robert > > > > -- > View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Segmentation-fault-core-dumped-Geodesic-Active-Shape-guidance-3D-tp7588930.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 -- Unpaid intern in BillsBasement at noware dot com From scorpiuni at gmail.com Mon May 30 12:37:04 2016 From: scorpiuni at gmail.com (Robert) Date: Mon, 30 May 2016 09:37:04 -0700 (MST) Subject: [ITK-users] Segmentation fault (core dumped) Geodesic Active Shape guidance 3D In-Reply-To: References: <1464624452928-7588930.post@n2.nabble.com> Message-ID: <1464626224580-7588932.post@n2.nabble.com> Thanks for the quick reply. I so far only used several DebugOn commands within ITK in order to monitor the progress, this one is the last before the crash. Debug: In /usr/local/include/ITK-4.9/itkPCAShapeSignedDistanceFunction.hxx, line 201 PCAShapeSignedDistanceFunction (0x1c62070): use extrapolator I will try valgrind now, using ubuntu 14. There is a dropbox folder with some minor data that I currently use for debugging as well: https://www.dropbox.com/sh/j2ognv5y5zv61wu/AABOAn-w4PIlYAq-WSW_lPOMa?dl=0 Simply use these arguments, as I used them as well, they are pretty mindless/ I gues not the best ones yet, I just want to get it to work: ./GeodesicActiveContourShapePriorLevelSetImageFilter CochleaCropped.nrrd out.nrrd 25 21 16 16 24 15 16 28 13 3 0.6 0.5 0.02 meanImage.nrrd 3 pcImage*.nrrd 10 10 10 Thanks. -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Segmentation-fault-core-dumped-Geodesic-Active-Shape-guidance-3D-tp7588930p7588932.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From scorpiuni at gmail.com Mon May 30 12:52:24 2016 From: scorpiuni at gmail.com (Robert) Date: Mon, 30 May 2016 09:52:24 -0700 (MST) Subject: [ITK-users] Segmentation fault (core dumped) Geodesic Active Shape guidance 3D In-Reply-To: <1464626224580-7588932.post@n2.nabble.com> References: <1464624452928-7588930.post@n2.nabble.com> <1464626224580-7588932.post@n2.nabble.com> Message-ID: <1464627144506-7588933.post@n2.nabble.com> Following is the valgrind output, after the last itk debug message: ==22787== Invalid read of size 4 ==22787== at 0x570006: itk::NearestNeighborExtrapolateImageFunction, double>::EvaluateAtContinuousIndex(itk::ContinuousIndex const&) const (in /home/scorpi/Desktop/GeoDesic3DShapeGuidance/build/GeodesicActiveContourShapePriorLevelSetImageFilter) ==22787== by 0x52C15A: itk::ExtrapolateImageFunction, double>::Evaluate(itk::Point const&) const (in /home/scorpi/Desktop/GeoDesic3DShapeGuidance/build/GeodesicActiveContourShapePriorLevelSetImageFilter) ==22787== by 0x4FF675: itk::PCAShapeSignedDistanceFunction >::Evaluate(itk::Point const&) const (in /home/scorpi/Desktop/GeoDesic3DShapeGuidance/build/GeodesicActiveContourShapePriorLevelSetImageFilter) ==22787== by 0x4F9DAF: itk::ShapePriorMAPCostFunction, float>::ComputeLogInsideTerm(itk::OptimizerParameters const&) const (in /home/scorpi/Desktop/GeoDesic3DShapeGuidance/build/GeodesicActiveContourShapePriorLevelSetImageFilter) ==22787== by 0x4F9389: itk::ShapePriorMAPCostFunctionBase, float>::GetValue(itk::OptimizerParameters const&) const (in /home/scorpi/Desktop/GeoDesic3DShapeGuidance/build/GeodesicActiveContourShapePriorLevelSetImageFilter) ==22787== by 0x71A7C10: itk::OnePlusOneEvolutionaryOptimizer::StartOptimization() (in /usr/local/lib/libITKOptimizers-4.9.so.1) ==22787== by 0x509838: itk::ShapePriorSegmentationLevelSetImageFilter, itk::Image, float>::InitializeIteration() (in /home/scorpi/Desktop/GeoDesic3DShapeGuidance/build/GeodesicActiveContourShapePriorLevelSetImageFilter) ==22787== by 0x513000: itk::FiniteDifferenceImageFilter, itk::Image >::GenerateData() (in /home/scorpi/Desktop/GeoDesic3DShapeGuidance/build/GeodesicActiveContourShapePriorLevelSetImageFilter) ==22787== by 0x50E846: itk::SegmentationLevelSetImageFilter, itk::Image, float>::GenerateData() (in /home/scorpi/Desktop/GeoDesic3DShapeGuidance/build/GeodesicActiveContourShapePriorLevelSetImageFilter) ==22787== by 0x50DA52: itk::ShapePriorSegmentationLevelSetImageFilter, itk::Image, float>::GenerateData() (in /home/scorpi/Desktop/GeoDesic3DShapeGuidance/build/GeodesicActiveContourShapePriorLevelSetImageFilter) ==22787== by 0x507341: itk::GeodesicActiveContourShapePriorLevelSetImageFilter, itk::Image, float>::GenerateData() (in /home/scorpi/Desktop/GeoDesic3DShapeGuidance/build/GeodesicActiveContourShapePriorLevelSetImageFilter) ==22787== by 0x78A89CF: itk::ProcessObject::UpdateOutputData(itk::DataObject*) (in /usr/local/lib/libITKCommon-4.9.so.1) ==22787== Address 0xfffffffffffffffc is not stack'd, malloc'd or (recently) free'd ==22787== ==22787== ==22787== Process terminating with default action of signal 11 (SIGSEGV) ==22787== Access not within mapped region at address 0xFFFFFFFFFFFFFFFC ==22787== at 0x570006: itk::NearestNeighborExtrapolateImageFunction, double>::EvaluateAtContinuousIndex(itk::ContinuousIndex const&) const (in /home/scorpi/Desktop/GeoDesic3DShapeGuidance/build/GeodesicActiveContourShapePriorLevelSetImageFilter) ==22787== by 0x52C15A: itk::ExtrapolateImageFunction, double>::Evaluate(itk::Point const&) const (in /home/scorpi/Desktop/GeoDesic3DShapeGuidance/build/GeodesicActiveContourShapePriorLevelSetImageFilter) ==22787== by 0x4FF675: itk::PCAShapeSignedDistanceFunction >::Evaluate(itk::Point const&) const (in /home/scorpi/Desktop/GeoDesic3DShapeGuidance/build/GeodesicActiveContourShapePriorLevelSetImageFilter) ==22787== by 0x4F9DAF: itk::ShapePriorMAPCostFunction, float>::ComputeLogInsideTerm(itk::OptimizerParameters const&) const (in /home/scorpi/Desktop/GeoDesic3DShapeGuidance/build/GeodesicActiveContourShapePriorLevelSetImageFilter) ==22787== by 0x4F9389: itk::ShapePriorMAPCostFunctionBase, float>::GetValue(itk::OptimizerParameters const&) const (in /home/scorpi/Desktop/GeoDesic3DShapeGuidance/build/GeodesicActiveContourShapePriorLevelSetImageFilter) ==22787== by 0x71A7C10: itk::OnePlusOneEvolutionaryOptimizer::StartOptimization() (in /usr/local/lib/libITKOptimizers-4.9.so.1) ==22787== by 0x509838: itk::ShapePriorSegmentationLevelSetImageFilter, itk::Image, float>::InitializeIteration() (in /home/scorpi/Desktop/GeoDesic3DShapeGuidance/build/GeodesicActiveContourShapePriorLevelSetImageFilter) ==22787== by 0x513000: itk::FiniteDifferenceImageFilter, itk::Image >::GenerateData() (in /home/scorpi/Desktop/GeoDesic3DShapeGuidance/build/GeodesicActiveContourShapePriorLevelSetImageFilter) ==22787== by 0x50E846: itk::SegmentationLevelSetImageFilter, itk::Image, float>::GenerateData() (in /home/scorpi/Desktop/GeoDesic3DShapeGuidance/build/GeodesicActiveContourShapePriorLevelSetImageFilter) ==22787== by 0x50DA52: itk::ShapePriorSegmentationLevelSetImageFilter, itk::Image, float>::GenerateData() (in /home/scorpi/Desktop/GeoDesic3DShapeGuidance/build/GeodesicActiveContourShapePriorLevelSetImageFilter) ==22787== by 0x507341: itk::GeodesicActiveContourShapePriorLevelSetImageFilter, itk::Image, float>::GenerateData() (in /home/scorpi/Desktop/GeoDesic3DShapeGuidance/build/GeodesicActiveContourShapePriorLevelSetImageFilter) ==22787== by 0x78A89CF: itk::ProcessObject::UpdateOutputData(itk::DataObject*) (in /usr/local/lib/libITKCommon-4.9.so.1) ==22787== If you believe this happened as a result of a stack ==22787== overflow in your program's main thread (unlikely but ==22787== possible), you can try to increase the size of the ==22787== main thread stack using the --main-stacksize= flag. ==22787== The main thread stack size used in this run was 8388608. ==22787== ==22787== HEAP SUMMARY: ==22787== in use at exit: 10,936,003 bytes in 71,849 blocks ==22787== total heap usage: 108,116 allocs, 36,267 frees, 19,278,417 bytes allocated ==22787== ==22787== LEAK SUMMARY: ==22787== definitely lost: 0 bytes in 0 blocks ==22787== indirectly lost: 0 bytes in 0 blocks ==22787== possibly lost: 0 bytes in 0 blocks ==22787== still reachable: 10,936,003 bytes in 71,849 blocks ==22787== of which reachable via heuristic: ==22787== stdstring : 1,975,699 bytes in 45,818 blocks ==22787== suppressed: 0 bytes in 0 blocks ==22787== Reachable blocks (those to which a pointer was found) are not shown. ==22787== To see them, rerun with: --leak-check=full --show-leak-kinds=all ==22787== ==22787== For counts of detected and suppressed errors, rerun with: -v ==22787== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) Segmentation fault (core dumped) -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Segmentation-fault-core-dumped-Geodesic-Active-Shape-guidance-3D-tp7588930p7588933.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From scorpiuni at gmail.com Mon May 30 13:02:06 2016 From: scorpiuni at gmail.com (Robert) Date: Mon, 30 May 2016 10:02:06 -0700 (MST) Subject: [ITK-users] Segmentation fault (core dumped) Geodesic Active Shape guidance 3D In-Reply-To: <1464627144506-7588933.post@n2.nabble.com> References: <1464624452928-7588930.post@n2.nabble.com> <1464626224580-7588932.post@n2.nabble.com> <1464627144506-7588933.post@n2.nabble.com> Message-ID: <1464627726480-7588934.post@n2.nabble.com> I guess it must use a local variable somewhere, after the variable is not there anymore... Now to find it... -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Segmentation-fault-core-dumped-Geodesic-Active-Shape-guidance-3D-tp7588930p7588934.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From dzenanz at gmail.com Mon May 30 13:18:40 2016 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Mon, 30 May 2016 13:18:40 -0400 Subject: [ITK-users] Geodesic 3D Shape guidance In-Reply-To: <1464620775546-7588926.post@n2.nabble.com> References: <1464620775546-7588926.post@n2.nabble.com> Message-ID: Hi Robert, by default the precision for output does not include all digits in floats and doubles. If there is a difference on 7th decimal place, it will cause the exception but will not be visible in cout. Can you examine origin, spacing and directions on the input images? I had that problem recently (1.99999999 was different from 2.0). HTH, D?enan On Mon, May 30, 2016 at 11:06 AM, Robert wrote: > Dear Community, > I encountered an error which I really can't get fixed. > I wrote some code in order to do a segmentation with the geodesic function > with shape guidance, but in 3D. > I got my shape models, PCA data, etc, all done. > Now in the geodesic code, I preprocess my image in which I want to find my > structure (I need shape guidance, as the structure kind of melts to the > background at one point, so I need the shape to restrict this). > Preprocessing etc is all done, I now give my preprocessed image, and a > levelset as well as the mean image and pc-images to my geodesic function > (see link to code below). > At one point, when testing my code, this error occurs: > Description: itk::ERROR: > GeodesicActiveContourShapePriorLevelSetImageFilter(0x115f970): Inputs do > not > occupy the same physical space! > Now, as I already encountered this error once, I checked ALL the directions > of ANY image in the pipeline (see code, console output usually marked with > //*****DEBUG*****). They all give the same, correct value to the console. > I really am at my wits end, I can't explain this error. > I think it crashed at the writer called "writer", writer->SetInput( > thresholder->GetOutput() );, as this one gets as input the output from the > geodesic function (so, basically, the writer that will produce the final > result). > I commented this part out for testing purposes, and there is still a crash > even later: > "evalOutput5.nrrd" > and > "paraOutput6.nrrd" can never be reached, the same error message occurs > here. > I really cant find a solution, and the worst part is that due to this error > I can't even test if the result is useful at all. Like I mentioned before, > without shape guidance, the result is not satisfying, as "too much" of the > structure is being segmented. > Any help would be really appreciated. > Greetings, > Robert > > > > -- > View this message in context: > http://itk-insight-users.2283740.n2.nabble.com/Geodesic-3D-Shape-guidance-tp7588926.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 scorpiuni at gmail.com Mon May 30 13:28:50 2016 From: scorpiuni at gmail.com (Robert) Date: Mon, 30 May 2016 10:28:50 -0700 (MST) Subject: [ITK-users] Geodesic 3D Shape guidance In-Reply-To: References: Message-ID: <1464629330364-7588936.post@n2.nabble.com> Thanks for your reply, I deleted the thread as I already figured it out: I simply forgot to add one Update() function, so the old values were not overwritten at all. Thanks for your reply anyway! -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Re-ITK-users-Geodesic-3D-Shape-guidance-tp7588935p7588936.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From jaroslawlobaza at gmail.com Mon May 30 15:46:47 2016 From: jaroslawlobaza at gmail.com (Krakers) Date: Mon, 30 May 2016 12:46:47 -0700 (MST) Subject: [ITK-users] Processing 3D data question. In-Reply-To: <1464623878095-7588928.post@n2.nabble.com> References: <1464606770304-7588925.post@n2.nabble.com> <1464623878095-7588928.post@n2.nabble.com> Message-ID: <1464637607958-7588937.post@n2.nabble.com> Firstly thanks for your response. I wrote a function which takes image data as input and should return "medianized" picture, but it crushed when gets to medianFilter->Update(); // typedef itk::Image< unsigned char, 3 > ImageType3D; median3D(ImageType3D::Pointer img) { ImageType3D::Pointer bin = 0; ImageType3D::SizeType indexRadius; indexRadius[0] = 1; // radius along x indexRadius[1] = 1; // radius along y indexRadius[2] = 0; // radius along z typedef itk::MedianImageFilter< ImageType3D, ImageType3D > MedianFilterType; typedef itk::MedianImageFilter FilterType; FilterType::Pointer medianFilter = FilterType::New(); medianFilter->SetRadius(indexRadius); medianFilter->SetInput(img); try { medianFilter->Update(); } catch (itk::ExceptionObject & error) { std::cerr << "Error: " << error << std::endl; //return EXIT_FAILURE; } bin = medianFilter->GetOutput(); return bin; } -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Processing-3D-data-question-tp7588925p7588937.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From scorpiuni at gmail.com Mon May 30 15:59:46 2016 From: scorpiuni at gmail.com (Robert) Date: Mon, 30 May 2016 12:59:46 -0700 (MST) Subject: [ITK-users] Processing 3D data question. In-Reply-To: <1464637607958-7588937.post@n2.nabble.com> References: <1464606770304-7588925.post@n2.nabble.com> <1464623878095-7588928.post@n2.nabble.com> <1464637607958-7588937.post@n2.nabble.com> Message-ID: <1464638386832-7588938.post@n2.nabble.com> Do you really need this? indexRadius[0] = 1; // radius along x indexRadius[1] = 1; // radius along y indexRadius[2] = 0; // radius along z Usually, in ITK, you define filters like this: First your Imagetype, which is composed from PixelType and Dimension. Your Dimension is 3, Pixeltype is probably float. This is what I meant by this: typedef itk::Image< unsigned char, 3 > ImageType3D; (you got this commented in your code, was that your intention? you use ImageType3D late, so I guess you already got that defined somewhere else) Your filter initialization should work. However, about the radius: Like I said, you work on a 3D image, so you initialize your filter to work with 3D images (your defined type, just like you did it). You usually won't need to kind of iterate slice by slice like if you'd write a "normal" c++ filter. I think this mindset causes your error (judging from using an array as radius). radius can be an integer value. ITK now uses this value in all needed dimensions. There is no need for an array as far as I know. Try using medianFilter->SetRadius(indexRadius); with indexRadius being a single number. Like I said, I never worked with data extracted from dicom slices, but I think it should work if you change the radius. -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Processing-3D-data-question-tp7588925p7588938.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From jaroslawlobaza at gmail.com Mon May 30 16:20:25 2016 From: jaroslawlobaza at gmail.com (Krakers) Date: Mon, 30 May 2016 13:20:25 -0700 (MST) Subject: [ITK-users] Processing 3D data question. In-Reply-To: <1464638386832-7588938.post@n2.nabble.com> References: <1464606770304-7588925.post@n2.nabble.com> <1464623878095-7588928.post@n2.nabble.com> <1464637607958-7588937.post@n2.nabble.com> <1464638386832-7588938.post@n2.nabble.com> Message-ID: <1464639625300-7588939.post@n2.nabble.com> Yeah by comment I tried to tell it was defined before with Pixel type as unsigned char (now I know it is best to write it) Change you've mentioned unfortunately didn't help and it still breaks when I invoke that function. The worst is that no error is signalized when program hungs, perhaps I have to build in debug to see where is the problem. THANKS. -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Processing-3D-data-question-tp7588925p7588939.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From scorpiuni at gmail.com Mon May 30 16:30:09 2016 From: scorpiuni at gmail.com (Robert) Date: Mon, 30 May 2016 13:30:09 -0700 (MST) Subject: [ITK-users] Processing 3D data question. In-Reply-To: <1464639625300-7588939.post@n2.nabble.com> References: <1464606770304-7588925.post@n2.nabble.com> <1464623878095-7588928.post@n2.nabble.com> <1464637607958-7588937.post@n2.nabble.com> <1464638386832-7588938.post@n2.nabble.com> <1464639625300-7588939.post@n2.nabble.com> Message-ID: <1464640209908-7588940.post@n2.nabble.com> Your return statement, I don't know what you want to achieve with that. Try initializing a writer with your imagetype as well in the beginning, and then do something like writer->SetFilename("median_out.ENDING");, ENDING being whatever imagetype you use (.nrrd for example) and writer->SetInput(median->GetOutput()); and inside the try/catch block, after you called update on median, call writer->Update();. I don't know what you want to do with bin after returning it, but with the method above you'll write the median filtered image to a file. Have a look at this: https://itk.org/Wiki/ITK/Examples/Smoothing/MedianImageFilter Greetings, Robert -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Processing-3D-data-question-tp7588925p7588940.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From jaroslawlobaza at gmail.com Mon May 30 17:57:51 2016 From: jaroslawlobaza at gmail.com (Krakers) Date: Mon, 30 May 2016 14:57:51 -0700 (MST) Subject: [ITK-users] Processing 3D data question. In-Reply-To: <1464640209908-7588940.post@n2.nabble.com> References: <1464606770304-7588925.post@n2.nabble.com> <1464623878095-7588928.post@n2.nabble.com> <1464637607958-7588937.post@n2.nabble.com> <1464638386832-7588938.post@n2.nabble.com> <1464639625300-7588939.post@n2.nabble.com> <1464640209908-7588940.post@n2.nabble.com> Message-ID: <1464645471668-7588941.post@n2.nabble.com> I left behind idea with using special function and simply connected my code with output of VTKImageToImageFilter at place that was invoked. Now it works and saves data :) Thanks once again :) -- View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Processing-3D-data-question-tp7588925p7588941.html Sent from the ITK Insight Users mailing list archive at Nabble.com. From coyarzunlaura at googlemail.com Tue May 31 05:45:22 2016 From: coyarzunlaura at googlemail.com (Cristina Oyarzun) Date: Tue, 31 May 2016 11:45:22 +0200 Subject: [ITK-users] CFP: MICCAI CLIP 2016 Workshop on Clinical Image-based Procedures: Translational Research in Medical Imaging Message-ID: CALL FOR PAPERS MICCAI 2016 Workshop on Clinical Image-based Procedures: Translational Research in Medical Imaging October 17, 2016 Athens, Greece Website:http://miccai-clip.org/ ============================== ========================================== SCOPE The outstanding proliferation of medical image applications has created a need for greater study and scrutiny of the clinical application and validation of such methods. New strategies are essential to ensure a smooth and effective translation of computational image-based techniques into the clinic. For these reasons CLIP 2015?s major focus is on translational research filling the gaps between basic science and clinical applications. A highlight of the workshop is the subject of strategies for personalized medicine to enhance diagnosis, treatment and interventions. Authors are encouraged to submit work centered on specific clinical applications, including techniques and procedures based on comprehensive clinical image data. Submissions related to applications already in use and evaluated by clinical users are particularly encouraged. The event will bring together world-class specialists to present ways to strengthen links between computer scientists and engineers, and clinicians. TOPICS *Strategies for patient-specific and anatomical modeling to support planning and interventions *Clinical studies employing advanced image-guided methods *Clinical translation and validation of image-guided systems *Current challenges and emerging techniques in image-based procedures *Identification of parameters and error analysis in image-based procedures *Multimodal image integration for modeling, planning and guidance *Clinical applications in open and minimally invasive procedures PAPER SUBMISSION Papers will be limited to eight pages following the MICCAI submission guidelines. Prospective authors should refer to the Paper Submission section on the workshop website for details on how to submit papers to be presented at the workshop. All submissions will be peer-reviewed by at least 2 members of the program committee. The selection of the papers will be based on the significance of results, novelty, technical merit, relevance and clarity of presentation. Papers will be presented in a day long single track workshop starting with plenary sessions. Accepted papers will be published as a proceedings volume in the Springer Lecture Notes in Computer Science (LNCS) series after the workshop. WORKSHOP FORMAT Accepted papers will be presented in a day long single track workshop. The final program will consist of invited speakers and original papers with time allocated for discussions. Electronic proceedings will be arranged for all of the papers presented at the workshop. IMPORTANT DATES * June 10, 2016: Paper submission due date * July 10, 2016: Notification of acceptance * July 17, 2016: Final camera-ready paper submission deadline CONTACT Inquires about the workshop should be sent to the Information Desk ( info at miccai-clip.org). ORGANIZERS (in alphabetical order) Klaus Drechsler (Fraunhofer IGD, Germany) Marius Erdt (Fraunhofer IDM at NTU, Singapore) Miguel Gonz?lez Ballester (ICREA - Universitat Pompeu Fabra, Spain) Marius George Linguraru (Children's National Medical Center, USA) Cristina Oyarzun Laura (Fraunhofer IGD, Germany) Yoshinobu Sato (Nara Institute of Science and Technology, Japan) Raj Shekhar (Children's National Medical Center, USA) Stefan Wesarg (Fraunhofer IGD, Germany) ======================================================================== -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Tue May 31 23:02:01 2016 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 31 May 2016 23:02:01 -0400 Subject: [ITK-users] C++11 compiler warnings with cuda <6.5 In-Reply-To: References: Message-ID: Hi Simon, Thanks for reporting the issue. From this page: https://devblogs.nvidia.com/parallelforall/developing-portable-cuda-cc-code-hemi/ it looks like the __NVCC__ macro could be used in this fashion: // Cuda does not need the same C++ standard version #if !defined(__NVCC__) #if ITK_COMPILED_CXX_VERSION > __cplusplus #warning "WARNING: The current project is configured to use a C++ standard version older than the C++ standard used for this build of ITK" #endif #endif Could you please test and submit a patch as documented here?: https://itk.org/Wiki/ITK/Git/Develop Thanks, Matt On Thu, May 26, 2016 at 9:44 AM, Simon Rit wrote: > Hi, > I have upgraded to ITK 4.11 (compiled with gcc 5.3.1) and I now get a lot of > warnings with my GPU code compiled with nvcc (cuda 6.5) (see RTK dashboard, > e.g., here) due to this itkConfigure.h.in commit. I can see two workarounds: > - disable the warning when including itkConfigure.h.in when I compile CUDA > code. This can be done with pragmas (like explained here) but it is a bit of > work to make it cross platform. Note that I don't fear a problem since I > only include this ITK file to know the configuration, the rest is > independent from ITK because, in my experience, nvcc doesn't compile ITK > code... Are you sure this warning is required and, if yes, would there be a > better way to disable this warning in my specific case? > - disable c++11 when compiling ITK and RTK but that's a pity. > Has anyone else experienced such a problem? Would there be a better > solution? > Thanks in advance, > Simon > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users >