From matt.mccormick at kitware.com Fri Sep 1 14:51:01 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Fri, 1 Sep 2017 14:51:01 -0400 Subject: [ITK] [ITK-dev] Patches for 4.12.2 release Message-ID: Hi folks, Let's release 4.12.2 next week. This will be a patch release that fixes critical issues, regressions, documentation, and compiler support. Patches currently on the release branch are: Edwin Bennink (1): BUG: Fixed cylinder bbox, fixed and enhanced IsInside func Jean-Christophe Fillion-Robin (2): COMP: Update MINC to set MACOSX_RPATH property based on CMAKE_MACOSX_RPATH COMP: Update KWsys to set MACOSX_RPATH property based on CMAKE_MACOSX_RPATH Niels Dekker (1): COMP: Fixed leak into user code To be added: - AnisotropicDiffusionLBR example build fix: http://review.source.kitware.com/#/c/22567/ Possibly also the GPU fixes: http://review.source.kitware.com/#/q/status:open+project:ITK+branch:master+topic:gpu-mean-filters Are there any other patches we are missing? Thanks, Matt _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers From niels-xtk at xs4all.nl Tue Sep 5 11:29:05 2017 From: niels-xtk at xs4all.nl (Niels Dekker) Date: Tue, 05 Sep 2017 17:29:05 +0200 Subject: [ITK] [ITK-dev] Patches for 4.12.2 release In-Reply-To: References: Message-ID: Hi Matt, Thank you very much for including my fix, "Fixed leak into user code"! Can you please also include the following one? Floris Berendsen: COMP: add symbol name mangling for niftilib in ITK https://github.com/InsightSoftwareConsortium/ITK/commit/b33d9978a2864aaf7c58de3c51e181bb7ef757e7 You already merged this fix to the master on June 20: https://github.com/InsightSoftwareConsortium/ITK/commit/370c3116d3edac3a3bc36e03e1b1b655df0f04af Kind regards, Niels On 2017-09-01 20:51, Matt McCormick wrote: > Hi folks, > > Let's release 4.12.2 next week. This will be a patch release that > fixes critical issues, regressions, documentation, and compiler > support. Patches currently on the release branch are: > > > Edwin Bennink (1): > BUG: Fixed cylinder bbox, fixed and enhanced IsInside func > > Jean-Christophe Fillion-Robin (2): > COMP: Update MINC to set MACOSX_RPATH property based on > CMAKE_MACOSX_RPATH > COMP: Update KWsys to set MACOSX_RPATH property based on > CMAKE_MACOSX_RPATH > > Niels Dekker (1): > COMP: Fixed leak into user code > > > To be added: > > - AnisotropicDiffusionLBR example build fix: > http://review.source.kitware.com/#/c/22567/ > > Possibly also the GPU fixes: > > > http://review.source.kitware.com/#/q/status:open+project:ITK+branch:master+topic:gpu-mean-filters > > > Are there any other patches we are missing? > > > Thanks, > Matt > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-developers > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community -- Niels Dekker Scientific programmer LKEB, Leiden University Medical Center, Netherlands _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers From matt.mccormick at kitware.com Tue Sep 5 12:48:54 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 5 Sep 2017 12:48:54 -0400 Subject: [ITK] [ITK-dev] Patches for 4.12.2 release In-Reply-To: References: Message-ID: Dear Niels, Thanks for the note! The patch has been added to the release branch for 4.12.2. Thanks, Matt On Tue, Sep 5, 2017 at 11:29 AM, Niels Dekker wrote: > Hi Matt, > > Thank you very much for including my fix, "Fixed leak into > user code"! Can you please also include the following one? > > Floris Berendsen: > COMP: add symbol name mangling for niftilib in ITK > > https://github.com/InsightSoftwareConsortium/ITK/commit/b33d9978a2864aaf7c58de3c51e181bb7ef757e7 > > You already merged this fix to the master on June 20: > https://github.com/InsightSoftwareConsortium/ITK/commit/370c3116d3edac3a3bc36e03e1b1b655df0f04af > > Kind regards, Niels > > > On 2017-09-01 20:51, Matt McCormick wrote: >> >> Hi folks, >> >> Let's release 4.12.2 next week. This will be a patch release that >> fixes critical issues, regressions, documentation, and compiler >> support. Patches currently on the release branch are: >> >> >> Edwin Bennink (1): >> BUG: Fixed cylinder bbox, fixed and enhanced IsInside func >> >> Jean-Christophe Fillion-Robin (2): >> COMP: Update MINC to set MACOSX_RPATH property based on >> CMAKE_MACOSX_RPATH >> COMP: Update KWsys to set MACOSX_RPATH property based on >> CMAKE_MACOSX_RPATH >> >> Niels Dekker (1): >> COMP: Fixed leak into user code >> >> >> To be added: >> >> - AnisotropicDiffusionLBR example build fix: >> http://review.source.kitware.com/#/c/22567/ >> >> Possibly also the GPU fixes: >> >> >> >> http://review.source.kitware.com/#/q/status:open+project:ITK+branch:master+topic:gpu-mean-filters >> >> >> Are there any other patches we are missing? >> >> >> Thanks, >> Matt >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-developers >> _______________________________________________ >> Community mailing list >> Community at itk.org >> http://public.kitware.com/mailman/listinfo/community > > > -- > Niels Dekker > Scientific programmer > LKEB, Leiden University Medical Center, Netherlands > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-developers > _______________________________________________ > 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://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers From e.a.g.pfaehler at umcg.nl Fri Sep 8 08:32:57 2017 From: e.a.g.pfaehler at umcg.nl (Pfaehler, EAG (ngmb)) Date: Fri, 8 Sep 2017 12:32:57 +0000 Subject: [ITK] [ITK-dev] problems itk resample filter Message-ID: Dear all, I would need some help to resample so that it has isotropic voxels in the end. For this, I wanted to use the Nearest Neighbor Interpolator and the ResampleFilterType. My code is running, but the output of the filter has always the dimensions [0 0 0], so is not existent. What am I doing wrong? (see code below) Thanks in advance! Elli typedef itk::NearestNeighborInterpolateImageFunction NearestNeighborInterpolatorType; typedef itk::ResampleImageFilter ResampleFilterType; typedef itk::AffineTransform TransformType; //use nearest neighbor interpolation typename NearestNeighborInterpolatorType::Pointer nearestNeighborInterpolator = NearestNeighborInterpolatorType::New(); typename ImageType::DirectionType direction; typename TransformType::Pointer transform = TransformType::New(); //transform->SetIdentity(); typedef itk::NearestNeighborInterpolateImageFunction InterpolatorType; //typedef itk::LinearInterpolateImageFunction InterpolatorType; typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); typename ResampleFilterType::Pointer resizeFilter2 = ResampleFilterType::New(); resizeFilter2->SetTransform(transform); resizeFilter2->SetInterpolator( interpolator ); resizeFilter2->SetDefaultPixelValue(0); //resizeFilter2->SetInterpolator(); const typename ImageType::SpacingType& inputSpacing = image->GetSpacing(); //sampling double outputSpacing[3]; // Fetch original image size const typename ImageType::RegionType& inputRegion = image->GetLargestPossibleRegion(); const typename ImageType::SizeType& inputSize = inputRegion.GetSize(); unsigned int oldWidth = inputSize[0]; unsigned int oldHeight = inputSize[1]; unsigned int oldDepth = inputSize[2]; unsigned int newWidth; unsigned int newHeight; unsigned int newDepth; //get the new height etc of image double minimum = inputSpacing[0]; if (inputSpacing[1]SetOutputSpacing(outputSpacing); // Set the computed size itk::Size<3> outputSize = { {newWidth, newHeight, newDepth} }; resizeFilter2->SetSize(outputSize); // Specify the input for the resamplers resizeFilter2->SetInput(image); ImageType::Pointer imageNew = resizeFilter2->GetOutput(); const typename ImageType::RegionType& outputRegion = imageNew->GetLargestPossibleRegion(); const typename ImageType::SizeType& outputSize2 = outputRegion.GetSize(); ________________________________ De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken van dit bericht, het niet openbaar maken of op enige wijze verspreiden of vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een incomplete aankomst of vertraging van dit verzonden bericht. The contents of this message are confidential and only intended for the eyes of the addressee(s). Others than the addressee(s) are not allowed to use this message, to make it public or to distribute or multiply this message in any way. The UMCG cannot be held responsible for incomplete reception or delay of this transferred message. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers From e.a.g.pfaehler at umcg.nl Fri Sep 8 09:13:34 2017 From: e.a.g.pfaehler at umcg.nl (Pfaehler, EAG (ngmb)) Date: Fri, 8 Sep 2017 13:13:34 +0000 Subject: [ITK] [ITK-dev] problems itk resample filter In-Reply-To: References: Message-ID: Thanks, I did this. Now I get an image, with the desired size, but there all image values are 0. I get the same when I use linear interpolation? Does someone know, what could be the reason? Thanks in advance, Regards Elli Van: Samuel Gerber [mailto:samuel.gerber at kitware.com] Verzonden: vrijdag 8 september 2017 14:51 Aan: Pfaehler, EAG (ngmb) CC: insight-developers at itk.org Onderwerp: Re: [ITK] [ITK-dev] problems itk resample filter I believe you might need to call resizeFilter2->Update() On Fri, Sep 8, 2017 at 8:32 AM, Pfaehler, EAG (ngmb) > wrote: Dear all, I would need some help to resample so that it has isotropic voxels in the end. For this, I wanted to use the Nearest Neighbor Interpolator and the ResampleFilterType. My code is running, but the output of the filter has always the dimensions [0 0 0], so is not existent. What am I doing wrong? (see code below) Thanks in advance! Elli typedef itk::NearestNeighborInterpolateImageFunction NearestNeighborInterpolatorType; typedef itk::ResampleImageFilter ResampleFilterType; typedef itk::AffineTransform TransformType; //use nearest neighbor interpolation typename NearestNeighborInterpolatorType::Pointer nearestNeighborInterpolator = NearestNeighborInterpolatorType::New(); typename ImageType::DirectionType direction; typename TransformType::Pointer transform = TransformType::New(); //transform->SetIdentity(); typedef itk::NearestNeighborInterpolateImageFunction InterpolatorType; //typedef itk::LinearInterpolateImageFunction InterpolatorType; typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); typename ResampleFilterType::Pointer resizeFilter2 = ResampleFilterType::New(); resizeFilter2->SetTransform(transform); resizeFilter2->SetInterpolator( interpolator ); resizeFilter2->SetDefaultPixelValue(0); //resizeFilter2->SetInterpolator(); const typename ImageType::SpacingType& inputSpacing = image->GetSpacing(); //sampling double outputSpacing[3]; // Fetch original image size const typename ImageType::RegionType& inputRegion = image->GetLargestPossibleRegion(); const typename ImageType::SizeType& inputSize = inputRegion.GetSize(); unsigned int oldWidth = inputSize[0]; unsigned int oldHeight = inputSize[1]; unsigned int oldDepth = inputSize[2]; unsigned int newWidth; unsigned int newHeight; unsigned int newDepth; //get the new height etc of image double minimum = inputSpacing[0]; if (inputSpacing[1]SetOutputSpacing(outputSpacing); // Set the computed size itk::Size<3> outputSize = { {newWidth, newHeight, newDepth} }; resizeFilter2->SetSize(outputSize); // Specify the input for the resamplers resizeFilter2->SetInput(image); ImageType::Pointer imageNew = resizeFilter2->GetOutput(); const typename ImageType::RegionType& outputRegion = imageNew->GetLargestPossibleRegion(); const typename ImageType::SizeType& outputSize2 = outputRegion.GetSize(); ________________________________ De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken van dit bericht, het niet openbaar maken of op enige wijze verspreiden of vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een incomplete aankomst of vertraging van dit verzonden bericht. The contents of this message are confidential and only intended for the eyes of the addressee(s). Others than the addressee(s) are not allowed to use this message, to make it public or to distribute or multiply this message in any way. The UMCG cannot be held responsible for incomplete reception or delay of this transferred message. _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers _______________________________________________ Community mailing list Community at itk.org http://public.kitware.com/mailman/listinfo/community -- Samuel Gerber R&D Engineer Kitware, Inc. ________________________________ De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken van dit bericht, het niet openbaar maken of op enige wijze verspreiden of vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een incomplete aankomst of vertraging van dit verzonden bericht. The contents of this message are confidential and only intended for the eyes of the addressee(s). Others than the addressee(s) are not allowed to use this message, to make it public or to distribute or multiply this message in any way. The UMCG cannot be held responsible for incomplete reception or delay of this transferred message. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers From matt.mccormick at kitware.com Fri Sep 8 09:32:13 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Fri, 8 Sep 2017 09:32:13 -0400 Subject: [ITK] [ITK-dev] problems itk resample filter In-Reply-To: References: Message-ID: Hi Elli, The OutputOrigin and OutputDirection may need to be set so the sampling grids overlap. HTH, Matt On Fri, Sep 8, 2017 at 9:13 AM, Pfaehler, EAG (ngmb) wrote: > Thanks, I did this. Now I get an image, with the desired size, but there all > image values are 0. I get the same when I use linear interpolation? > > Does someone know, what could be the reason? > > > > Thanks in advance, > > > > Regards > > > > Elli > > > > Van: Samuel Gerber [mailto:samuel.gerber at kitware.com] > Verzonden: vrijdag 8 september 2017 14:51 > Aan: Pfaehler, EAG (ngmb) > CC: insight-developers at itk.org > Onderwerp: Re: [ITK] [ITK-dev] problems itk resample filter > > > > I believe you might need to call resizeFilter2->Update() > > > > > > > > On Fri, Sep 8, 2017 at 8:32 AM, Pfaehler, EAG (ngmb) > wrote: > > Dear all, > > > > I would need some help to resample so that it has isotropic voxels in the > end. > > For this, I wanted to use the Nearest Neighbor Interpolator and the > ResampleFilterType. > > My code is running, but the output of the filter has always the dimensions > [0 0 0], so is not existent. > > What am I doing wrong? (see code below) > > > > Thanks in advance! > > Elli > > > > typedef itk::NearestNeighborInterpolateImageFunction > NearestNeighborInterpolatorType; > > typedef itk::ResampleImageFilter > ResampleFilterType; > > typedef itk::AffineTransform TransformType; > > //use nearest neighbor interpolation > > typename NearestNeighborInterpolatorType::Pointer > nearestNeighborInterpolator = NearestNeighborInterpolatorType::New(); > > typename ImageType::DirectionType direction; > > typename TransformType::Pointer transform = TransformType::New(); > > //transform->SetIdentity(); > > typedef itk::NearestNeighborInterpolateImageFunction > InterpolatorType; > > //typedef itk::LinearInterpolateImageFunction > InterpolatorType; > > typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); > > > > typename ResampleFilterType::Pointer resizeFilter2 = > ResampleFilterType::New(); > > resizeFilter2->SetTransform(transform); > > > > resizeFilter2->SetInterpolator( interpolator ); > > resizeFilter2->SetDefaultPixelValue(0); > > //resizeFilter2->SetInterpolator(); > > > > const typename ImageType::SpacingType& inputSpacing = image->GetSpacing(); > > //sampling > > double outputSpacing[3]; > > // Fetch original image size > > const typename ImageType::RegionType& inputRegion = > image->GetLargestPossibleRegion(); > > const typename ImageType::SizeType& inputSize = inputRegion.GetSize(); > > unsigned int oldWidth = inputSize[0]; > > unsigned int oldHeight = inputSize[1]; > > unsigned int oldDepth = inputSize[2]; > > unsigned int newWidth; > > unsigned int newHeight; > > unsigned int newDepth; > > //get the new height etc of image > > double minimum = inputSpacing[0]; > > if (inputSpacing[1] > minimum = inputSpacing[1]; > > } > > if (inputSpacing[2] < minimum){ > > minimum = inputSpacing[2]; > > } > > outputSpacing[0] = minimum; > > outputSpacing[1] = minimum; > > outputSpacing[2] = minimum; > > newWidth = (double) oldWidth * inputSpacing[0]/minimum; > > ewHeight = (double) oldHeight * inputSpacing[1]/minimum; > > newDepth = (double) oldDepth * inputSpacing[2]/minimum; > > // Set the output spacing as specified on the command line > > resizeFilter2->SetOutputSpacing(outputSpacing); > > // Set the computed size > > itk::Size<3> outputSize = { {newWidth, newHeight, newDepth} }; > > resizeFilter2->SetSize(outputSize); > > // Specify the input for the resamplers > > resizeFilter2->SetInput(image); > > ImageType::Pointer imageNew = resizeFilter2->GetOutput(); > > const typename ImageType::RegionType& outputRegion = > imageNew->GetLargestPossibleRegion(); > > const typename ImageType::SizeType& outputSize2 = > outputRegion.GetSize(); > > > > ________________________________ > > De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de > geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken > van dit bericht, het niet openbaar maken of op enige wijze verspreiden of > vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een > incomplete aankomst of vertraging van dit verzonden bericht. > > The contents of this message are confidential and only intended for the eyes > of the addressee(s). Others than the addressee(s) are not allowed to use > this message, to make it public or to distribute or multiply this message in > any way. The UMCG cannot be held responsible for incomplete reception or > delay of this transferred message. > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-developers > > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > > > > > > -- > > Samuel Gerber > R&D Engineer > Kitware, Inc. > > ________________________________ > De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de > geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken > van dit bericht, het niet openbaar maken of op enige wijze verspreiden of > vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een > incomplete aankomst of vertraging van dit verzonden bericht. > > The contents of this message are confidential and only intended for the eyes > of the addressee(s). Others than the addressee(s) are not allowed to use > this message, to make it public or to distribute or multiply this message in > any way. The UMCG cannot be held responsible for incomplete reception or > delay of this transferred message. > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-developers > _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers From fredrik.hellman at gmail.com Fri Sep 8 09:31:31 2017 From: fredrik.hellman at gmail.com (hellman) Date: Fri, 8 Sep 2017 06:31:31 -0700 (MST) Subject: [ITK] [ITK-users] Can I alter the way SliceBySliceImageFilter defines the origin of the internal slices? Message-ID: <1504877491197-0.post@n7.nabble.com> Hi, I am using the SliceBySliceImageFilter (to slice against the last dimension) on a 3D image with the following meta data and region settings: orign = [0, 0, 0] direction = identity spacing = [0.3, 0.3, 1] all regions: index = [5, 5, 0] and size = [770, 710, 200] The internal 2D images that are produced after slicing (let's call such an image A) have the following meta data orign = [1.5, 1.5] direction = identity spacing = [0.3, 0.3] regions: index = [5, 5] and size = [770, 710] The filter thus **redefines the origin** but keeps the index for the internal images. This is a problem for me since the filter that I tell SliceBySliceImageFilter to apply to the slices is a BinaryFunctorImageFilter where the second input has been set to an image (let's call it B) with meta-data: orign = [0, 0] direction = identity spacing = [0.3, 0.3] regions: index = [5, 5] and size = [770, 710]. I would like the the images A and B to have the same physical extent after slicing. The BinaryFunctorImageFilter is an ImageToImageFilter where the physical extent of the two images are verified to be the same by comparing Origin, Direction, and Spacing (in function ImageToImageFilter::VerifyInputInformation()). In my case, A and B do not have matching origins (since SliceBySliceImageFilter redefined it), and thus this verification fails. Now, if SliceBySliceImageFilter would set the new origin to the projection of the 3D origin onto the new 2D plane passing through the 3D origin, I believe this would have worked. Can I make it not to have this default behavior? It does not appear like that from the code. The relevant code is on line 216 in SliceBySliceImageFilter.hxx for ITK 4.12.0: Then, inputOrigin (except for the its last component in my case) is set as the origin of the new internal inputs. I would like something like: Perhaps there is a better way to do what I want to do? I am happy to hear any thoughts on this. Best regards, Fredrik Hellman -- Sent from: http://itk-users.7.n7.nabble.com/ _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From matt.mccormick at kitware.com Fri Sep 8 09:45:36 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Fri, 8 Sep 2017 09:45:36 -0400 Subject: [ITK] [ITK-users] Can I alter the way SliceBySliceImageFilter defines the origin of the internal slices? In-Reply-To: <1504877491197-0.post@n7.nabble.com> References: <1504877491197-0.post@n7.nabble.com> Message-ID: Hi Fredrik, The Origin set by SlicerBySlicerImageFilter ensures that the slice keeps its position in physical space. An alternative approach to the issue encountered is to inherit from BinaryFunctorImageFilter or SlicerBySliceImageFilter and override VerifyInputInformation so it does not check the Origin. HTH, Matt On Fri, Sep 8, 2017 at 9:31 AM, hellman wrote: > Hi, > > I am using the SliceBySliceImageFilter (to slice against the last dimension) > on a 3D image with the following meta data and region settings: > > orign = [0, 0, 0] > direction = identity > spacing = [0.3, 0.3, 1] > > all regions: index = [5, 5, 0] and size = [770, 710, 200] > > The internal 2D images that are produced after slicing (let's call such an > image A) have the following meta data > > orign = [1.5, 1.5] > direction = identity > spacing = [0.3, 0.3] > > regions: index = [5, 5] and size = [770, 710] > > The filter thus **redefines the origin** but keeps the index for the > internal images. This is a problem for me since the filter that I tell > SliceBySliceImageFilter to apply to the slices is a BinaryFunctorImageFilter > where the second input has been set to an image (let's call it B) with > meta-data: > > orign = [0, 0] > direction = identity > spacing = [0.3, 0.3] > > regions: index = [5, 5] and size = [770, 710]. > > I would like the the images A and B to have the same physical extent after > slicing. The BinaryFunctorImageFilter is an ImageToImageFilter where the > physical extent of the two images are verified to be the same by comparing > Origin, Direction, and Spacing (in function > ImageToImageFilter::VerifyInputInformation()). In my case, A and B do not > have matching origins (since SliceBySliceImageFilter redefined it), and thus > this verification fails. > > Now, if SliceBySliceImageFilter would set the new origin to the projection > of the 3D origin onto the new 2D plane passing through the 3D origin, I > believe this would have worked. Can I make it not to have this default > behavior? > > It does not appear like that from the code. The relevant code is on line 216 > in SliceBySliceImageFilter.hxx for ITK 4.12.0: > > > > Then, inputOrigin (except for the its last component in my case) is set as > the origin of the new internal inputs. I would like something like: > > > > Perhaps there is a better way to do what I want to do? I am happy to hear > any thoughts on this. > > Best regards, > Fredrik Hellman > > > > -- > Sent from: http://itk-users.7.n7.nabble.com/ > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From fredrik.hellman at gmail.com Fri Sep 8 10:38:47 2017 From: fredrik.hellman at gmail.com (hellman) Date: Fri, 8 Sep 2017 07:38:47 -0700 (MST) Subject: [ITK] [ITK-users] Can I alter the way SliceBySliceImageFilter defines the origin of the internal slices? In-Reply-To: References: <1504877491197-0.post@n7.nabble.com> Message-ID: <1504881527156-0.post@n7.nabble.com> Thanks for the quick reply! (Btw, some code snippets disappeared from my first post, but they are not so important). Perhaps I missed something about the transformation to physical coordinates, but this is my understanding: The physical position P of the [5,5,0]-index pixel in the 3D volume (according to my meta-data above) is: P = O + D*diag(S)*Index = (0, 0, 0) + (0.3*5, 0.3*5, 1*0) = (1.5, 1.5, 0). For a pixel in a different slice, say pixel [5, 5, 20], the physical point is (1.5, 1.5, 20) Now after slicing, the physical position (according to SliceBySliceImageFilter) of the [5, 5]-pixel of any internal image created by slicing is: (recall new origin is (1.5, 1.5)) (1.5, 1.5) + (0.3*5, 0.3*5) = (3, 3). The position of the [5, 5, 0]-pixel is thus (3, 3) after slicing, while it was at (1.5, 1.5, 0) before slicing. Similarly: The position of the [5, 5, 20]-pixel at (3, 3) after slicing, while it was at (1.5, 1.5, 20) before slicing. To me, it would make more sense for them to be at (1.5, 1.5). -- Sent from: http://itk-users.7.n7.nabble.com/ _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From matt.mccormick at kitware.com Fri Sep 8 10:56:11 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Fri, 8 Sep 2017 10:56:11 -0400 Subject: [ITK] [ITK-users] Can I alter the way SliceBySliceImageFilter defines the origin of the internal slices? In-Reply-To: <1504881527156-0.post@n7.nabble.com> References: <1504877491197-0.post@n7.nabble.com> <1504881527156-0.post@n7.nabble.com> Message-ID: Yes, that description is correct, but the index of the slice set to [0, 0] instead of [5, 5]. HTH, Matt On Fri, Sep 8, 2017 at 10:38 AM, hellman wrote: > Thanks for the quick reply! > > (Btw, some code snippets disappeared from my first post, but they are not so > important). > > Perhaps I missed something about the transformation to physical coordinates, > but this is my understanding: > > The physical position P of the [5,5,0]-index pixel in the 3D volume > (according to my meta-data above) is: > > P = O + D*diag(S)*Index = (0, 0, 0) + (0.3*5, 0.3*5, 1*0) = (1.5, 1.5, 0). > > For a pixel in a different slice, say pixel [5, 5, 20], the physical point > is (1.5, 1.5, 20) > > Now after slicing, the physical position (according to > SliceBySliceImageFilter) of the [5, 5]-pixel of any internal image created > by slicing is: > > (recall new origin is (1.5, 1.5)) > > (1.5, 1.5) + (0.3*5, 0.3*5) = (3, 3). > > The position of the [5, 5, 0]-pixel is thus (3, 3) after slicing, while it > was at (1.5, 1.5, 0) before slicing. > Similarly: The position of the [5, 5, 20]-pixel at (3, 3) after slicing, > while it was at (1.5, 1.5, 20) before slicing. > > To me, it would make more sense for them to be at (1.5, 1.5). > > > > > -- > Sent from: http://itk-users.7.n7.nabble.com/ > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From fredrik.hellman at gmail.com Fri Sep 8 11:13:24 2017 From: fredrik.hellman at gmail.com (hellman) Date: Fri, 8 Sep 2017 08:13:24 -0700 (MST) Subject: [ITK] [ITK-users] Can I alter the way SliceBySliceImageFilter defines the origin of the internal slices? In-Reply-To: References: <1504877491197-0.post@n7.nabble.com> <1504881527156-0.post@n7.nabble.com> Message-ID: <1504883604903-0.post@n7.nabble.com> I am not sure. In SliceBySliceImageFilter.hxx for ITK 4.12.0, on line 188, it says: // copy the requested region to the internal slice region in // dimension order unsigned int internal_i = 0; for ( unsigned int i = 0; internal_i < InternalImageDimension; ++i, ++internal_i ) { if ( i == this->m_Dimension ) { ++i; } internalOutputRegion.SetSize( internal_i, requestedSize[i] ); internalOutputRegion.SetIndex( internal_i, requestedIndex[i] ); internalInputRegion.SetSize( internal_i, this->GetInput(0)->GetRequestedRegion().GetSize(i) ); internalInputRegion.SetIndex( internal_i, this->GetInput(0)->GetRequestedRegion().GetIndex(i) ); } This will copy all indices (except the slicing dimension) of input 0 to internalInputRegion, which is set as the regions for the internal image further down. In my case, the 5s get copied here. I have also stopped in a debugger in ImageToImageFilter (of my BinaryFunctorImageFilter) where the check that the physical regions overlap is performed. At this point, both images have the same region index [5, 5], but one image has origin (0, 0) and the sliced image has origin (1.5, 1.5). -- Sent from: http://itk-users.7.n7.nabble.com/ _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From matt.mccormick at kitware.com Fri Sep 8 14:30:53 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Fri, 8 Sep 2017 14:30:53 -0400 Subject: [ITK] [ITK-users] Cardiac Deformation using Segmentation and Registration of Ultrasound Images In-Reply-To: References: Message-ID: Hello Thanos, Yes, to add support for additional image formats, add the corresponding ITK module to the find_package(ITK COMPONENTS ... call: https://github.com/InsightSoftwareConsortium/ITKAnisotropicDiffusionLBR/blob/50acf46da9fa1480eb502a0bb550c36d518893eb/examples/CMakeLists.txt#L8 Thank you for the suggested correction to the usage documentation. It is added here: https://github.com/InsightSoftwareConsortium/ITKAnisotropicDiffusionLBR/pull/12 A Python package is now available for the module. It can be installed via python -m pip install --upgrade pip python -m pip install itk-anisotropicdiffusionlbr Thanks, Matt On Mon, Aug 14, 2017 at 12:42 PM, thanos thanos wrote: > Hello again, > > Matt, thank you for solving the example issue. I tried to use the filter and > although it worked great for a 2D png image, it failed for a 2D jpg and > dicom images as well as for a 3D nrrd volume. I got the error "Could not > create ImageIO" so maybe that has to do with the ImageIOFactory. > > I liked the suggested and accepted values when I run the .exe but maybe to > avoid confusion you could replace the > "Weickert diffusion type. Accepted values: Edge, Coherence. Default: Edge." > with > Weickert diffusion type. Accepted values: EED cEED CED cCED Isotropic" > > Best regards, > Thanos > > On Fri, Aug 11, 2017 at 6:55 PM, Matt McCormick > wrote: >> >> On Fri, Aug 4, 2017 at 9:36 AM, Matt McCormick >> wrote: >> > Hi Thanos, >> > >> > On Thu, Aug 3, 2017 at 1:00 PM, thanos thanos >> > wrote: >> >> Hello everyone, >> >> >> >> D?enan, Andras and Matt thank you very much for your answers. >> >> To be honest I've tried already in the past registration with Slicer >> >> using >> >> Demons, B-Splines and also Elastix and Plastimach. >> >> >> >> D?enan, I read your last sentence already many times but I can't really >> >> understand what you mean by "initializing registration of time point >> >> n+1 by >> >> resulting transform from time point n." >> >> >> >> Matt, thank you for sharing your thoughts. I already looked at the >> >> AnisotropicDiffusionLBR paper and I have also tried the online >> >> interactive >> >> figures >> >> >> >> (https://insightsoftwareconsortium.github.io/ITKAnisotropicDiffusionLBR/). >> >> Seems to work nicely, but I wasn't sure how to build the project. I >> >> already >> >> configured my ITK by setting the Module_AnisotropicDiffusionLBR at the >> >> CMake >> >> and then I tried to build the CoherenceEnhancingDiffusion from the >> >> C:\ITK\src\Modules\Remote\AnisotropicDiffusionLBR\examples but I got " >> >> Cannot open include file: 'CoherenceEnhancingDiffusionFilter.h': No >> >> such >> >> file or directory " so I guess I am missing something.. >> > >> > Thanks for the note. I will look into this issue and address it next >> > week. >> >> This is addressed here: >> >> http://review.source.kitware.com/#/c/22567/ >> >> https://github.com/InsightSoftwareConsortium/ITKAnisotropicDiffusionLBR/commit/3d9880d5f52c4c37e3b658abc607a13f3c3d9545 >> >> I will also create a Python package for the module. >> >> Thanks, >> Matt > > _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From matt.mccormick at kitware.com Fri Sep 8 14:34:50 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Fri, 8 Sep 2017 14:34:50 -0400 Subject: [ITK] [ITK-users] Problems Using GPU Filters In-Reply-To: References: <1498789176254-7590036.post@n2.nabble.com> <1501002308962-7590057.post@n2.nabble.com> <1501611311517-7590114.post@n2.nabble.com> <1501626181039-7590122.post@n2.nabble.com> Message-ID: The failing tests I observed may have been due to local driver issues. These fixes will be available in the 4.12.2 release. Thanks, Matt On Fri, Aug 11, 2017 at 12:22 PM, Matt McCormick wrote: > Following up, I did not have a chance to fully address this. Progress > is started here: > > http://review.source.kitware.com/#/q/topic:gpu-mean-filters > > The GPUMeanImageFilter tests are failing: > > itkGPUMeanImageFilterTest2D > itkGPUMeanImageFilterTest3D > > I will take another look in a few weeks. > > Thanks, > Matt > > On Fri, Aug 4, 2017 at 9:38 AM, Matt McCormick > wrote: >> Hi Andaharoo, >> >> You may have identified a bug. I am also seeing local failures in the >> regression tests for the referenced classes. I will investigate >> further next week. >> >> Thanks, >> Matt >> >> On Tue, Aug 1, 2017 at 6:23 PM, Andaharoo wrote: >>> I can't get the images to go from CPU to GPU on GPUMeanImageFilter, >>> GPUBinaryThresholdImageFilter, and GPUDiscreteGaussianImageFilter. So I >>> can't start my gpu pipeline with these filters. If I apply something like >>> GPUGradientAnisotropicImageFilter (which does work) then I can apply the >>> other filters confirming that it can go GPU to GPU but not CPU to GPU on >>> those 3 filters. Do these 3 filters not support conversion? >>> >>> GPUInputImage::Pointer inPtr = >>> dynamic_cast(this->ProcessObject::GetInput(0)); >>> inPtr was null when I debugged GPUMeanImageFilter. This line also doesn't >>> make sense in terms of using an Image since it would just return null if you >>> gave it an Image that wasn't allocated as a GPUImage. Unless the cpu image >>> gets converted to a gpu image elsewhere beforehand? >>> >>> It seems as though only GPUInPlaceImageFilters work with CPU - GPU >>> conversion for me? I can't quite understand the GPUInPlaceImageFilters >>> source yet so I'm not so sure why GPUGradientAnisotropicImageFilter works. >>> They are, of course, different in terms of how they manage memory. >>> >>> >>> >>> -- >>> View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Problems-Using-GPU-Filters-tp7590036p7590122.html >>> Sent from the ITK Insight Users mailing list archive at Nabble.com. >>> _____________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://www.kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the ITK FAQ at: >>> http://www.itk.org/Wiki/ITK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/insight-users _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From lasso at queensu.ca Fri Sep 8 14:55:17 2017 From: lasso at queensu.ca (Andras Lasso) Date: Fri, 8 Sep 2017 18:55:17 +0000 Subject: [ITK] [ITK-users] Cardiac Deformation using Segmentation and Registration of Ultrasound Images In-Reply-To: References: Message-ID: FYI, a few weeks ago we added a nice 4D (3D+t) image registration extension to 3D Slicer. It works very well for cardiac volume sequences: it produces a motion-compensated volume sequence and a displacement field sequence. Sequence Registration extension can be installed by a few clicks from the extension manager in recent 3D Slicer nightly versions. See more information and tutorial here: https://github.com/moselhy/SlicerSequenceRegistration Andras -----Original Message----- From: Community [mailto:community-bounces at itk.org] On Behalf Of Matt McCormick Sent: Friday, September 8, 2017 2:31 PM To: thanos thanos Cc: insight-users at itk.org Subject: Re: [ITK] [ITK-users] Cardiac Deformation using Segmentation and Registration of Ultrasound Images Hello Thanos, Yes, to add support for additional image formats, add the corresponding ITK module to the find_package(ITK COMPONENTS ... call: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FInsightSoftwareConsortium%2FITKAnisotropicDiffusionLBR%2Fblob%2F50acf46da9fa1480eb502a0bb550c36d518893eb%2Fexamples%2FCMakeLists.txt%23L8&data=02%7C01%7Classo%40queensu.ca%7C3d7f50e0df534e04dfe708d4f6e7cd61%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636404922819639139&sdata=Vqviuh1be7etykTVE1mHIBzmrdv40KfVrsyinYJUKNw%3D&reserved=0 Thank you for the suggested correction to the usage documentation. It is added here: https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FInsightSoftwareConsortium%2FITKAnisotropicDiffusionLBR%2Fpull%2F12&data=02%7C01%7Classo%40queensu.ca%7C3d7f50e0df534e04dfe708d4f6e7cd61%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636404922819639139&sdata=uZf%2FlQ0EGne0tyyx6v58G%2Bqhh8jKJMgXE%2FYenk%2F4wls%3D&reserved=0 A Python package is now available for the module. It can be installed via python -m pip install --upgrade pip python -m pip install itk-anisotropicdiffusionlbr Thanks, Matt On Mon, Aug 14, 2017 at 12:42 PM, thanos thanos wrote: > Hello again, > > Matt, thank you for solving the example issue. I tried to use the > filter and although it worked great for a 2D png image, it failed for > a 2D jpg and dicom images as well as for a 3D nrrd volume. I got the > error "Could not create ImageIO" so maybe that has to do with the ImageIOFactory. > > I liked the suggested and accepted values when I run the .exe but > maybe to avoid confusion you could replace the "Weickert diffusion > type. Accepted values: Edge, Coherence. Default: Edge." > with > Weickert diffusion type. Accepted values: EED cEED CED cCED Isotropic" > > Best regards, > Thanos > > On Fri, Aug 11, 2017 at 6:55 PM, Matt McCormick > > wrote: >> >> On Fri, Aug 4, 2017 at 9:36 AM, Matt McCormick >> wrote: >> > Hi Thanos, >> > >> > On Thu, Aug 3, 2017 at 1:00 PM, thanos thanos >> > >> > wrote: >> >> Hello everyone, >> >> >> >> D?enan, Andras and Matt thank you very much for your answers. >> >> To be honest I've tried already in the past registration with >> >> Slicer using Demons, B-Splines and also Elastix and Plastimach. >> >> >> >> D?enan, I read your last sentence already many times but I can't >> >> really understand what you mean by "initializing registration of >> >> time point >> >> n+1 by >> >> resulting transform from time point n." >> >> >> >> Matt, thank you for sharing your thoughts. I already looked at the >> >> AnisotropicDiffusionLBR paper and I have also tried the online >> >> interactive figures >> >> >> >> (https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Finsightsoftwareconsortium.github.io%2FITKAnisotropicDiffusionLBR%2F&data=02%7C01%7Classo%40queensu.ca%7C3d7f50e0df534e04dfe708d4f6e7cd61%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636404922819639139&sdata=CYJJaN1M6zQUHs9HAlWipN2PrWEZlTL%2Fx4Ad%2FLVZMxk%3D&reserved=0). >> >> Seems to work nicely, but I wasn't sure how to build the project. >> >> I already configured my ITK by setting the >> >> Module_AnisotropicDiffusionLBR at the CMake and then I tried to >> >> build the CoherenceEnhancingDiffusion from the >> >> C:\ITK\src\Modules\Remote\AnisotropicDiffusionLBR\examples but I got " >> >> Cannot open include file: 'CoherenceEnhancingDiffusionFilter.h': >> >> No such file or directory " so I guess I am missing something.. >> > >> > Thanks for the note. I will look into this issue and address it >> > next week. >> >> This is addressed here: >> >> >> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Frevie >> w.source.kitware.com%2F%23%2Fc%2F22567%2F&data=02%7C01%7Classo%40quee >> nsu.ca%7C3d7f50e0df534e04dfe708d4f6e7cd61%7Cd61ecb3b38b142d582c4efb28 >> 38b925c%7C1%7C0%7C636404922819639139&sdata=XjWsPDq1Z%2BxvDcVUm9MFDDLa >> BY%2BQHkuuuAgDhyKwQYg%3D&reserved=0 >> >> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith >> ub.com%2FInsightSoftwareConsortium%2FITKAnisotropicDiffusionLBR%2Fcom >> mit%2F3d9880d5f52c4c37e3b658abc607a13f3c3d9545&data=02%7C01%7Classo%4 >> 0queensu.ca%7C3d7f50e0df534e04dfe708d4f6e7cd61%7Cd61ecb3b38b142d582c4 >> efb2838b925c%7C1%7C0%7C636404922819639139&sdata=NN9XhKvMpJDHHL4DK1g2k >> THZViGfwo6o%2B6wSOJAI7bo%3D&reserved=0 >> >> I will also create a Python package for the module. >> >> Thanks, >> Matt > > _____________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C3d7f50e0df534e04dfe708d4f6e7cd61%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636404922819639139&sdata=eK3g%2BnV4Y1xllgOs7u8Wj3VJMHSVeOEKRmYkRWVgerY%3D&reserved=0 Visit other Kitware open-source projects at https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7C3d7f50e0df534e04dfe708d4f6e7cd61%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636404922819639139&sdata=pktiA7zEmkEVs33%2BkmjL2zGqnwb3QgiyljFcFVfNlGk%3D&reserved=0 Kitware offers ITK Training Courses, for more information visit: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fproducts%2Fprotraining.php&data=02%7C01%7Classo%40queensu.ca%7C3d7f50e0df534e04dfe708d4f6e7cd61%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636404922819639139&sdata=QPw5ZfDHLfSojDX%2FZa7xGaVVqahv0Sr9e0HXGp9nyHk%3D&reserved=0 Please keep messages on-topic and check the ITK FAQ at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.itk.org%2FWiki%2FITK_FAQ&data=02%7C01%7Classo%40queensu.ca%7C3d7f50e0df534e04dfe708d4f6e7cd61%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636404922819639139&sdata=MSlPFevAsLgMK1h1RQKZ2Db8gVGQtcvanhoC%2Bhycpl4%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Finsight-users&data=02%7C01%7Classo%40queensu.ca%7C3d7f50e0df534e04dfe708d4f6e7cd61%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636404922819639139&sdata=291h4yTpF4VbYSsxzlVgZK2t5iFe0S2Tq6EOcwE2Y5Y%3D&reserved=0 _______________________________________________ Community mailing list Community at itk.org https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fcommunity&data=02%7C01%7Classo%40queensu.ca%7C3d7f50e0df534e04dfe708d4f6e7cd61%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636404922819639139&sdata=quNQl4jX7Mm1%2BnF1Mxgjln4W7oZAryrY5OSds3jButw%3D&reserved=0 _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From matt.mccormick at kitware.com Fri Sep 8 15:08:52 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Fri, 8 Sep 2017 15:08:52 -0400 Subject: [ITK] [ITK-users] Can I alter the way SliceBySliceImageFilter defines the origin of the internal slices? In-Reply-To: <1504883604903-0.post@n7.nabble.com> References: <1504877491197-0.post@n7.nabble.com> <1504881527156-0.post@n7.nabble.com> <1504883604903-0.post@n7.nabble.com> Message-ID: Yes, that is an issue -- good catch! If we change: internalOutputRegion.SetIndex( internal_i, requestedIndex[i] ); to: internalOutputRegion.SetIndex( internal_i, 0 ); and internalInputRegion.SetIndex( internal_i, this->GetInput(0)->GetRequestedRegion().GetIndex(i) ); to: internalInputRegion.SetIndex( internal_i, 0 ); is the behavior corrected? Thanks, Matt On Fri, Sep 8, 2017 at 11:13 AM, hellman wrote: > I am not sure. In SliceBySliceImageFilter.hxx for ITK 4.12.0, on line 188, it > says: > > // copy the requested region to the internal slice region in > // dimension order > unsigned int internal_i = 0; > for ( unsigned int i = 0; internal_i < InternalImageDimension; ++i, > ++internal_i ) > { > if ( i == this->m_Dimension ) > { > ++i; > } > internalOutputRegion.SetSize( internal_i, requestedSize[i] ); > internalOutputRegion.SetIndex( internal_i, requestedIndex[i] ); > > internalInputRegion.SetSize( internal_i, > this->GetInput(0)->GetRequestedRegion().GetSize(i) ); > internalInputRegion.SetIndex( internal_i, > this->GetInput(0)->GetRequestedRegion().GetIndex(i) ); > > } > > This will copy all indices (except the slicing dimension) of input 0 to > internalInputRegion, which is set as the regions for the internal image > further down. In my case, the 5s get copied here. > > I have also stopped in a debugger in ImageToImageFilter (of my > BinaryFunctorImageFilter) where the check that the physical regions overlap > is performed. At this point, both images have the same region index [5, 5], > but one image has origin (0, 0) and the sliced image has origin (1.5, 1.5). > > > > > -- > Sent from: http://itk-users.7.n7.nabble.com/ > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From e.a.g.pfaehler at umcg.nl Fri Sep 8 15:12:30 2017 From: e.a.g.pfaehler at umcg.nl (Pfaehler, EAG (ngmb)) Date: Fri, 8 Sep 2017 19:12:30 +0000 Subject: [ITK] [ITK-dev] problems itk resample filter In-Reply-To: References: , Message-ID: Thanks Samuel and Matt for the help. However, it is unfortunatly still not working. I deleted the line resizeFilter->SetTransform, but unfortunately it did not change anything. Then I tried to set the direction and the origin. But maybe here is the problem. I set as direction the same direction as in the original image because I do not want to have any rotation. But I am a bit insecure how to set the origin. First I set the origin in the resampled image to the same as in the original image, what did not work. Then I tried different things, e.g origin[0] = origin[0] + inputSpacing[0] * (newWidth - oldWidth); origin[1] = origin[1] + inputSpacing[1] * (newHeight - oldHeight); origin[2] = origin[2] + inputSpacing[2] * (newDepth - oldDepth); where newWidth etc is the width of the new image and oldWidth of the original image. And origin[0] is the x value of the original origin etc. But this was also not working. ( In all of these cases I get an image full of zeros. If I make originalImage->Print(std::cout) I get the following: Image (000000000282A800) RTTI typeinfo: class itk::Image Reference Count: 3 Modified Time: 705 Debug: Off Object Name: Observers: none Source: (none) Source output name: (none) Release Data: Off Data Released: False Global Release Data: Off PipelineMTime: 692 UpdateMTime: 704 RealTimeStamp: 0 seconds LargestPossibleRegion: Dimension: 3 Index: [0, 0, 0] Size: [11, 11, 19] BufferedRegion: Dimension: 3 Index: [0, 0, 0] Size: [11, 11, 19] RequestedRegion: Dimension: 3 Index: [0, 0, 0] Size: [11, 11, 19] Spacing: [3.1819, 3.1819, 2] Origin: [48.5757, -171.979, 20.5] Direction: 1 0 0 0 1 0 0 0 1 IndexToPointMatrix: 3.1819 0 0 0 3.1819 0 0 0 2 PointToIndexMatrix: 0.314278 0 0 0 0.314278 0 0 0 0.5 Inverse Direction: 1 0 0 0 1 0 0 0 1 PixelContainer: ImportImageContainer (00000000027B59F0) RTTI typeinfo: class itk::ImportImageContainer Reference Count: 1 Modified Time: 701 Debug: Off Object Name: Observers: none Pointer: 00000000028542E0 Container manages memory: true Size: 2299 Capacity: 2299 If I do the same for the resampled image I get: Image (000000000282B100) RTTI typeinfo: class itk::Image Reference Count: 2 Modified Time: 11626 Debug: Off Object Name: Observers: none Source: (000000000282BB80) Source output name: Primary Release Data: Off Data Released: False Global Release Data: Off PipelineMTime: 11614 UpdateMTime: 11627 RealTimeStamp: 0 seconds LargestPossibleRegion: Dimension: 3 Index: [0, 0, 0] Size: [17, 17, 19] BufferedRegion: Dimension: 3 Index: [0, 0, 0] Size: [17, 17, 19] RequestedRegion: Dimension: 3 Index: [0, 0, 0] Size: [17, 17, 19] Spacing: [2, 2, 2] Origin: [67.6671, -152.888, 20.5] Direction: 1 0 0 0 1 0 0 0 1 IndexToPointMatrix: 2 0 0 0 2 0 0 0 2 PointToIndexMatrix: 0.5 0 0 0 0.5 0 0 0 0.5 Inverse Direction: 1 0 0 0 1 0 0 0 1 PixelContainer: ImportImageContainer (00000000027B5EC0) RTTI typeinfo: class itk::ImportImageContainer Reference Count: 1 Modified Time: 11625 Debug: Off Object Name: Observers: none Pointer: 0000000002A8D520 Container manages memory: true Size: 5491 Capacity: 5491 Does that maybe help to find out whats going wrong? Thanks in advance ________________________________________ Van: Matt McCormick [matt.mccormick at kitware.com] Verzonden: vrijdag 8 september 2017 15:32 Aan: Pfaehler, EAG (ngmb) CC: Samuel Gerber; insight-developers at itk.org Onderwerp: Re: [ITK-dev] [ITK] problems itk resample filter Hi Elli, The OutputOrigin and OutputDirection may need to be set so the sampling grids overlap. HTH, Matt On Fri, Sep 8, 2017 at 9:13 AM, Pfaehler, EAG (ngmb) wrote: > Thanks, I did this. Now I get an image, with the desired size, but there all > image values are 0. I get the same when I use linear interpolation? > > Does someone know, what could be the reason? > > > > Thanks in advance, > > > > Regards > > > > Elli > > > > Van: Samuel Gerber [mailto:samuel.gerber at kitware.com] > Verzonden: vrijdag 8 september 2017 14:51 > Aan: Pfaehler, EAG (ngmb) > CC: insight-developers at itk.org > Onderwerp: Re: [ITK] [ITK-dev] problems itk resample filter > > > > I believe you might need to call resizeFilter2->Update() > > > > > > > > On Fri, Sep 8, 2017 at 8:32 AM, Pfaehler, EAG (ngmb) > wrote: > > Dear all, > > > > I would need some help to resample so that it has isotropic voxels in the > end. > > For this, I wanted to use the Nearest Neighbor Interpolator and the > ResampleFilterType. > > My code is running, but the output of the filter has always the dimensions > [0 0 0], so is not existent. > > What am I doing wrong? (see code below) > > > > Thanks in advance! > > Elli > > > > typedef itk::NearestNeighborInterpolateImageFunction > NearestNeighborInterpolatorType; > > typedef itk::ResampleImageFilter > ResampleFilterType; > > typedef itk::AffineTransform TransformType; > > //use nearest neighbor interpolation > > typename NearestNeighborInterpolatorType::Pointer > nearestNeighborInterpolator = NearestNeighborInterpolatorType::New(); > > typename ImageType::DirectionType direction; > > typename TransformType::Pointer transform = TransformType::New(); > > //transform->SetIdentity(); > > typedef itk::NearestNeighborInterpolateImageFunction > InterpolatorType; > > //typedef itk::LinearInterpolateImageFunction > InterpolatorType; > > typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); > > > > typename ResampleFilterType::Pointer resizeFilter2 = > ResampleFilterType::New(); > > resizeFilter2->SetTransform(transform); > > > > resizeFilter2->SetInterpolator( interpolator ); > > resizeFilter2->SetDefaultPixelValue(0); > > //resizeFilter2->SetInterpolator(); > > > > const typename ImageType::SpacingType& inputSpacing = image->GetSpacing(); > > //sampling > > double outputSpacing[3]; > > // Fetch original image size > > const typename ImageType::RegionType& inputRegion = > image->GetLargestPossibleRegion(); > > const typename ImageType::SizeType& inputSize = inputRegion.GetSize(); > > unsigned int oldWidth = inputSize[0]; > > unsigned int oldHeight = inputSize[1]; > > unsigned int oldDepth = inputSize[2]; > > unsigned int newWidth; > > unsigned int newHeight; > > unsigned int newDepth; > > //get the new height etc of image > > double minimum = inputSpacing[0]; > > if (inputSpacing[1] > minimum = inputSpacing[1]; > > } > > if (inputSpacing[2] < minimum){ > > minimum = inputSpacing[2]; > > } > > outputSpacing[0] = minimum; > > outputSpacing[1] = minimum; > > outputSpacing[2] = minimum; > > newWidth = (double) oldWidth * inputSpacing[0]/minimum; > > ewHeight = (double) oldHeight * inputSpacing[1]/minimum; > > newDepth = (double) oldDepth * inputSpacing[2]/minimum; > > // Set the output spacing as specified on the command line > > resizeFilter2->SetOutputSpacing(outputSpacing); > > // Set the computed size > > itk::Size<3> outputSize = { {newWidth, newHeight, newDepth} }; > > resizeFilter2->SetSize(outputSize); > > // Specify the input for the resamplers > > resizeFilter2->SetInput(image); > > ImageType::Pointer imageNew = resizeFilter2->GetOutput(); > > const typename ImageType::RegionType& outputRegion = > imageNew->GetLargestPossibleRegion(); > > const typename ImageType::SizeType& outputSize2 = > outputRegion.GetSize(); > > > > ________________________________ > > De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de > geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken > van dit bericht, het niet openbaar maken of op enige wijze verspreiden of > vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een > incomplete aankomst of vertraging van dit verzonden bericht. > > The contents of this message are confidential and only intended for the eyes > of the addressee(s). Others than the addressee(s) are not allowed to use > this message, to make it public or to distribute or multiply this message in > any way. The UMCG cannot be held responsible for incomplete reception or > delay of this transferred message. > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-developers > > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > > > > > > -- > > Samuel Gerber > R&D Engineer > Kitware, Inc. > > ________________________________ > De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de > geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken > van dit bericht, het niet openbaar maken of op enige wijze verspreiden of > vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een > incomplete aankomst of vertraging van dit verzonden bericht. > > The contents of this message are confidential and only intended for the eyes > of the addressee(s). Others than the addressee(s) are not allowed to use > this message, to make it public or to distribute or multiply this message in > any way. The UMCG cannot be held responsible for incomplete reception or > delay of this transferred message. > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-developers > ________________________________ De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken van dit bericht, het niet openbaar maken of op enige wijze verspreiden of vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een incomplete aankomst of vertraging van dit verzonden bericht. The contents of this message are confidential and only intended for the eyes of the addressee(s). Others than the addressee(s) are not allowed to use this message, to make it public or to distribute or multiply this message in any way. The UMCG cannot be held responsible for incomplete reception or delay of this transferred message. _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers From matt.mccormick at kitware.com Fri Sep 8 15:27:16 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Fri, 8 Sep 2017 15:27:16 -0400 Subject: [ITK] [ITK-dev] problems itk resample filter In-Reply-To: References: Message-ID: Hi, The Origin should be the same in the resampled image. HTH, Matt On Fri, Sep 8, 2017 at 3:12 PM, Pfaehler, EAG (ngmb) wrote: > Thanks Samuel and Matt for the help. However, it is unfortunatly still not working. > > I deleted the line resizeFilter->SetTransform, but unfortunately it did not change anything. > > Then I tried to set the direction and the origin. But maybe here is the problem. I set as direction the same direction as in the original image because I do not want to have any rotation. > > But I am a bit insecure how to set the origin. First I set the origin in the resampled image to the same as in the original image, what did not work. > Then I tried different things, e.g > > origin[0] = origin[0] + inputSpacing[0] * (newWidth - oldWidth); > origin[1] = origin[1] + inputSpacing[1] * (newHeight - oldHeight); > origin[2] = origin[2] + inputSpacing[2] * (newDepth - oldDepth); > > where newWidth etc is the width of the new image and oldWidth of the original image. And origin[0] is the x value of the original origin etc. > > But this was also not working. ( In all of these cases I get an image full of zeros. > > If I make originalImage->Print(std::cout) I get the following: > > Image (000000000282A800) > RTTI typeinfo: class itk::Image > Reference Count: 3 > Modified Time: 705 > Debug: Off > Object Name: > Observers: > none > Source: (none) > Source output name: (none) > Release Data: Off > Data Released: False > Global Release Data: Off > PipelineMTime: 692 > UpdateMTime: 704 > RealTimeStamp: 0 seconds > LargestPossibleRegion: > Dimension: 3 > Index: [0, 0, 0] > Size: [11, 11, 19] > BufferedRegion: > Dimension: 3 > Index: [0, 0, 0] > Size: [11, 11, 19] > RequestedRegion: > Dimension: 3 > Index: [0, 0, 0] > Size: [11, 11, 19] > Spacing: [3.1819, 3.1819, 2] > Origin: [48.5757, -171.979, 20.5] > Direction: > 1 0 0 > 0 1 0 > 0 0 1 > > IndexToPointMatrix: > 3.1819 0 0 > 0 3.1819 0 > 0 0 2 > > PointToIndexMatrix: > 0.314278 0 0 > 0 0.314278 0 > 0 0 0.5 > > Inverse Direction: > 1 0 0 > 0 1 0 > 0 0 1 > > PixelContainer: > ImportImageContainer (00000000027B59F0) > RTTI typeinfo: class itk::ImportImageContainer > Reference Count: 1 > Modified Time: 701 > Debug: Off > Object Name: > Observers: > none > Pointer: 00000000028542E0 > Container manages memory: true > Size: 2299 > Capacity: 2299 > > If I do the same for the resampled image I get: > > Image (000000000282B100) > RTTI typeinfo: class itk::Image > Reference Count: 2 > Modified Time: 11626 > Debug: Off > Object Name: > Observers: > none > Source: (000000000282BB80) > Source output name: Primary > Release Data: Off > Data Released: False > Global Release Data: Off > PipelineMTime: 11614 > UpdateMTime: 11627 > RealTimeStamp: 0 seconds > LargestPossibleRegion: > Dimension: 3 > Index: [0, 0, 0] > Size: [17, 17, 19] > BufferedRegion: > Dimension: 3 > Index: [0, 0, 0] > Size: [17, 17, 19] > RequestedRegion: > Dimension: 3 > Index: [0, 0, 0] > Size: [17, 17, 19] > Spacing: [2, 2, 2] > Origin: [67.6671, -152.888, 20.5] > Direction: > 1 0 0 > 0 1 0 > 0 0 1 > > IndexToPointMatrix: > 2 0 0 > 0 2 0 > 0 0 2 > > PointToIndexMatrix: > 0.5 0 0 > 0 0.5 0 > 0 0 0.5 > > Inverse Direction: > 1 0 0 > 0 1 0 > 0 0 1 > > PixelContainer: > ImportImageContainer (00000000027B5EC0) > RTTI typeinfo: class itk::ImportImageContainer > Reference Count: 1 > Modified Time: 11625 > Debug: Off > Object Name: > Observers: > none > Pointer: 0000000002A8D520 > Container manages memory: true > Size: 5491 > Capacity: 5491 > > Does that maybe help to find out whats going wrong? > > Thanks in advance > > > > ________________________________________ > Van: Matt McCormick [matt.mccormick at kitware.com] > Verzonden: vrijdag 8 september 2017 15:32 > Aan: Pfaehler, EAG (ngmb) > CC: Samuel Gerber; insight-developers at itk.org > Onderwerp: Re: [ITK-dev] [ITK] problems itk resample filter > > Hi Elli, > > The OutputOrigin and OutputDirection may need to be set so the > sampling grids overlap. > > HTH, > Matt > > On Fri, Sep 8, 2017 at 9:13 AM, Pfaehler, EAG (ngmb) > wrote: >> Thanks, I did this. Now I get an image, with the desired size, but there all >> image values are 0. I get the same when I use linear interpolation? >> >> Does someone know, what could be the reason? >> >> >> >> Thanks in advance, >> >> >> >> Regards >> >> >> >> Elli >> >> >> >> Van: Samuel Gerber [mailto:samuel.gerber at kitware.com] >> Verzonden: vrijdag 8 september 2017 14:51 >> Aan: Pfaehler, EAG (ngmb) >> CC: insight-developers at itk.org >> Onderwerp: Re: [ITK] [ITK-dev] problems itk resample filter >> >> >> >> I believe you might need to call resizeFilter2->Update() >> >> >> >> >> >> >> >> On Fri, Sep 8, 2017 at 8:32 AM, Pfaehler, EAG (ngmb) >> wrote: >> >> Dear all, >> >> >> >> I would need some help to resample so that it has isotropic voxels in the >> end. >> >> For this, I wanted to use the Nearest Neighbor Interpolator and the >> ResampleFilterType. >> >> My code is running, but the output of the filter has always the dimensions >> [0 0 0], so is not existent. >> >> What am I doing wrong? (see code below) >> >> >> >> Thanks in advance! >> >> Elli >> >> >> >> typedef itk::NearestNeighborInterpolateImageFunction >> NearestNeighborInterpolatorType; >> >> typedef itk::ResampleImageFilter >> ResampleFilterType; >> >> typedef itk::AffineTransform TransformType; >> >> //use nearest neighbor interpolation >> >> typename NearestNeighborInterpolatorType::Pointer >> nearestNeighborInterpolator = NearestNeighborInterpolatorType::New(); >> >> typename ImageType::DirectionType direction; >> >> typename TransformType::Pointer transform = TransformType::New(); >> >> //transform->SetIdentity(); >> >> typedef itk::NearestNeighborInterpolateImageFunction >> InterpolatorType; >> >> //typedef itk::LinearInterpolateImageFunction >> InterpolatorType; >> >> typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); >> >> >> >> typename ResampleFilterType::Pointer resizeFilter2 = >> ResampleFilterType::New(); >> >> resizeFilter2->SetTransform(transform); >> >> >> >> resizeFilter2->SetInterpolator( interpolator ); >> >> resizeFilter2->SetDefaultPixelValue(0); >> >> //resizeFilter2->SetInterpolator(); >> >> >> >> const typename ImageType::SpacingType& inputSpacing = image->GetSpacing(); >> >> //sampling >> >> double outputSpacing[3]; >> >> // Fetch original image size >> >> const typename ImageType::RegionType& inputRegion = >> image->GetLargestPossibleRegion(); >> >> const typename ImageType::SizeType& inputSize = inputRegion.GetSize(); >> >> unsigned int oldWidth = inputSize[0]; >> >> unsigned int oldHeight = inputSize[1]; >> >> unsigned int oldDepth = inputSize[2]; >> >> unsigned int newWidth; >> >> unsigned int newHeight; >> >> unsigned int newDepth; >> >> //get the new height etc of image >> >> double minimum = inputSpacing[0]; >> >> if (inputSpacing[1]> >> minimum = inputSpacing[1]; >> >> } >> >> if (inputSpacing[2] < minimum){ >> >> minimum = inputSpacing[2]; >> >> } >> >> outputSpacing[0] = minimum; >> >> outputSpacing[1] = minimum; >> >> outputSpacing[2] = minimum; >> >> newWidth = (double) oldWidth * inputSpacing[0]/minimum; >> >> ewHeight = (double) oldHeight * inputSpacing[1]/minimum; >> >> newDepth = (double) oldDepth * inputSpacing[2]/minimum; >> >> // Set the output spacing as specified on the command line >> >> resizeFilter2->SetOutputSpacing(outputSpacing); >> >> // Set the computed size >> >> itk::Size<3> outputSize = { {newWidth, newHeight, newDepth} }; >> >> resizeFilter2->SetSize(outputSize); >> >> // Specify the input for the resamplers >> >> resizeFilter2->SetInput(image); >> >> ImageType::Pointer imageNew = resizeFilter2->GetOutput(); >> >> const typename ImageType::RegionType& outputRegion = >> imageNew->GetLargestPossibleRegion(); >> >> const typename ImageType::SizeType& outputSize2 = >> outputRegion.GetSize(); >> >> >> >> ________________________________ >> >> De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de >> geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken >> van dit bericht, het niet openbaar maken of op enige wijze verspreiden of >> vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een >> incomplete aankomst of vertraging van dit verzonden bericht. >> >> The contents of this message are confidential and only intended for the eyes >> of the addressee(s). Others than the addressee(s) are not allowed to use >> this message, to make it public or to distribute or multiply this message in >> any way. The UMCG cannot be held responsible for incomplete reception or >> delay of this transferred message. >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-developers >> >> _______________________________________________ >> Community mailing list >> Community at itk.org >> http://public.kitware.com/mailman/listinfo/community >> >> >> >> >> >> -- >> >> Samuel Gerber >> R&D Engineer >> Kitware, Inc. >> >> ________________________________ >> De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de >> geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken >> van dit bericht, het niet openbaar maken of op enige wijze verspreiden of >> vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een >> incomplete aankomst of vertraging van dit verzonden bericht. >> >> The contents of this message are confidential and only intended for the eyes >> of the addressee(s). Others than the addressee(s) are not allowed to use >> this message, to make it public or to distribute or multiply this message in >> any way. The UMCG cannot be held responsible for incomplete reception or >> delay of this transferred message. >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-developers >> > ________________________________ > De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken van dit bericht, het niet openbaar maken of op enige wijze verspreiden of vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een incomplete aankomst of vertraging van dit verzonden bericht. > > The contents of this message are confidential and only intended for the eyes of the addressee(s). Others than the addressee(s) are not allowed to use this message, to make it public or to distribute or multiply this message in any way. The UMCG cannot be held responsible for incomplete reception or delay of this transferred message. _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers From e.a.g.pfaehler at umcg.nl Sat Sep 9 01:49:05 2017 From: e.a.g.pfaehler at umcg.nl (Pfaehler, EAG (ngmb)) Date: Sat, 9 Sep 2017 05:49:05 +0000 Subject: [ITK] [ITK-dev] problems itk resample filter In-Reply-To: References: , Message-ID: Hey, thanks. I did this, but it did not change anything. However, I used another image (with some higher intensity values) and then I got an image with only 1s. Can it be the problem that my images have only values from 0-5? I also tried an image with only 0 and 1, but als here I get only zeros after interpolation. ________________________________________ Van: Matt McCormick [matt.mccormick at kitware.com] Verzonden: vrijdag 8 september 2017 21:27 Aan: Pfaehler, EAG (ngmb) CC: Samuel Gerber; insight-developers at itk.org Onderwerp: Re: [ITK-dev] [ITK] problems itk resample filter Hi, The Origin should be the same in the resampled image. HTH, Matt On Fri, Sep 8, 2017 at 3:12 PM, Pfaehler, EAG (ngmb) wrote: > Thanks Samuel and Matt for the help. However, it is unfortunatly still not working. > > I deleted the line resizeFilter->SetTransform, but unfortunately it did not change anything. > > Then I tried to set the direction and the origin. But maybe here is the problem. I set as direction the same direction as in the original image because I do not want to have any rotation. > > But I am a bit insecure how to set the origin. First I set the origin in the resampled image to the same as in the original image, what did not work. > Then I tried different things, e.g > > origin[0] = origin[0] + inputSpacing[0] * (newWidth - oldWidth); > origin[1] = origin[1] + inputSpacing[1] * (newHeight - oldHeight); > origin[2] = origin[2] + inputSpacing[2] * (newDepth - oldDepth); > > where newWidth etc is the width of the new image and oldWidth of the original image. And origin[0] is the x value of the original origin etc. > > But this was also not working. ( In all of these cases I get an image full of zeros. > > If I make originalImage->Print(std::cout) I get the following: > > Image (000000000282A800) > RTTI typeinfo: class itk::Image > Reference Count: 3 > Modified Time: 705 > Debug: Off > Object Name: > Observers: > none > Source: (none) > Source output name: (none) > Release Data: Off > Data Released: False > Global Release Data: Off > PipelineMTime: 692 > UpdateMTime: 704 > RealTimeStamp: 0 seconds > LargestPossibleRegion: > Dimension: 3 > Index: [0, 0, 0] > Size: [11, 11, 19] > BufferedRegion: > Dimension: 3 > Index: [0, 0, 0] > Size: [11, 11, 19] > RequestedRegion: > Dimension: 3 > Index: [0, 0, 0] > Size: [11, 11, 19] > Spacing: [3.1819, 3.1819, 2] > Origin: [48.5757, -171.979, 20.5] > Direction: > 1 0 0 > 0 1 0 > 0 0 1 > > IndexToPointMatrix: > 3.1819 0 0 > 0 3.1819 0 > 0 0 2 > > PointToIndexMatrix: > 0.314278 0 0 > 0 0.314278 0 > 0 0 0.5 > > Inverse Direction: > 1 0 0 > 0 1 0 > 0 0 1 > > PixelContainer: > ImportImageContainer (00000000027B59F0) > RTTI typeinfo: class itk::ImportImageContainer > Reference Count: 1 > Modified Time: 701 > Debug: Off > Object Name: > Observers: > none > Pointer: 00000000028542E0 > Container manages memory: true > Size: 2299 > Capacity: 2299 > > If I do the same for the resampled image I get: > > Image (000000000282B100) > RTTI typeinfo: class itk::Image > Reference Count: 2 > Modified Time: 11626 > Debug: Off > Object Name: > Observers: > none > Source: (000000000282BB80) > Source output name: Primary > Release Data: Off > Data Released: False > Global Release Data: Off > PipelineMTime: 11614 > UpdateMTime: 11627 > RealTimeStamp: 0 seconds > LargestPossibleRegion: > Dimension: 3 > Index: [0, 0, 0] > Size: [17, 17, 19] > BufferedRegion: > Dimension: 3 > Index: [0, 0, 0] > Size: [17, 17, 19] > RequestedRegion: > Dimension: 3 > Index: [0, 0, 0] > Size: [17, 17, 19] > Spacing: [2, 2, 2] > Origin: [67.6671, -152.888, 20.5] > Direction: > 1 0 0 > 0 1 0 > 0 0 1 > > IndexToPointMatrix: > 2 0 0 > 0 2 0 > 0 0 2 > > PointToIndexMatrix: > 0.5 0 0 > 0 0.5 0 > 0 0 0.5 > > Inverse Direction: > 1 0 0 > 0 1 0 > 0 0 1 > > PixelContainer: > ImportImageContainer (00000000027B5EC0) > RTTI typeinfo: class itk::ImportImageContainer > Reference Count: 1 > Modified Time: 11625 > Debug: Off > Object Name: > Observers: > none > Pointer: 0000000002A8D520 > Container manages memory: true > Size: 5491 > Capacity: 5491 > > Does that maybe help to find out whats going wrong? > > Thanks in advance > > > > ________________________________________ > Van: Matt McCormick [matt.mccormick at kitware.com] > Verzonden: vrijdag 8 september 2017 15:32 > Aan: Pfaehler, EAG (ngmb) > CC: Samuel Gerber; insight-developers at itk.org > Onderwerp: Re: [ITK-dev] [ITK] problems itk resample filter > > Hi Elli, > > The OutputOrigin and OutputDirection may need to be set so the > sampling grids overlap. > > HTH, > Matt > > On Fri, Sep 8, 2017 at 9:13 AM, Pfaehler, EAG (ngmb) > wrote: >> Thanks, I did this. Now I get an image, with the desired size, but there all >> image values are 0. I get the same when I use linear interpolation? >> >> Does someone know, what could be the reason? >> >> >> >> Thanks in advance, >> >> >> >> Regards >> >> >> >> Elli >> >> >> >> Van: Samuel Gerber [mailto:samuel.gerber at kitware.com] >> Verzonden: vrijdag 8 september 2017 14:51 >> Aan: Pfaehler, EAG (ngmb) >> CC: insight-developers at itk.org >> Onderwerp: Re: [ITK] [ITK-dev] problems itk resample filter >> >> >> >> I believe you might need to call resizeFilter2->Update() >> >> >> >> >> >> >> >> On Fri, Sep 8, 2017 at 8:32 AM, Pfaehler, EAG (ngmb) >> wrote: >> >> Dear all, >> >> >> >> I would need some help to resample so that it has isotropic voxels in the >> end. >> >> For this, I wanted to use the Nearest Neighbor Interpolator and the >> ResampleFilterType. >> >> My code is running, but the output of the filter has always the dimensions >> [0 0 0], so is not existent. >> >> What am I doing wrong? (see code below) >> >> >> >> Thanks in advance! >> >> Elli >> >> >> >> typedef itk::NearestNeighborInterpolateImageFunction >> NearestNeighborInterpolatorType; >> >> typedef itk::ResampleImageFilter >> ResampleFilterType; >> >> typedef itk::AffineTransform TransformType; >> >> //use nearest neighbor interpolation >> >> typename NearestNeighborInterpolatorType::Pointer >> nearestNeighborInterpolator = NearestNeighborInterpolatorType::New(); >> >> typename ImageType::DirectionType direction; >> >> typename TransformType::Pointer transform = TransformType::New(); >> >> //transform->SetIdentity(); >> >> typedef itk::NearestNeighborInterpolateImageFunction >> InterpolatorType; >> >> //typedef itk::LinearInterpolateImageFunction >> InterpolatorType; >> >> typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); >> >> >> >> typename ResampleFilterType::Pointer resizeFilter2 = >> ResampleFilterType::New(); >> >> resizeFilter2->SetTransform(transform); >> >> >> >> resizeFilter2->SetInterpolator( interpolator ); >> >> resizeFilter2->SetDefaultPixelValue(0); >> >> //resizeFilter2->SetInterpolator(); >> >> >> >> const typename ImageType::SpacingType& inputSpacing = image->GetSpacing(); >> >> //sampling >> >> double outputSpacing[3]; >> >> // Fetch original image size >> >> const typename ImageType::RegionType& inputRegion = >> image->GetLargestPossibleRegion(); >> >> const typename ImageType::SizeType& inputSize = inputRegion.GetSize(); >> >> unsigned int oldWidth = inputSize[0]; >> >> unsigned int oldHeight = inputSize[1]; >> >> unsigned int oldDepth = inputSize[2]; >> >> unsigned int newWidth; >> >> unsigned int newHeight; >> >> unsigned int newDepth; >> >> //get the new height etc of image >> >> double minimum = inputSpacing[0]; >> >> if (inputSpacing[1]> >> minimum = inputSpacing[1]; >> >> } >> >> if (inputSpacing[2] < minimum){ >> >> minimum = inputSpacing[2]; >> >> } >> >> outputSpacing[0] = minimum; >> >> outputSpacing[1] = minimum; >> >> outputSpacing[2] = minimum; >> >> newWidth = (double) oldWidth * inputSpacing[0]/minimum; >> >> ewHeight = (double) oldHeight * inputSpacing[1]/minimum; >> >> newDepth = (double) oldDepth * inputSpacing[2]/minimum; >> >> // Set the output spacing as specified on the command line >> >> resizeFilter2->SetOutputSpacing(outputSpacing); >> >> // Set the computed size >> >> itk::Size<3> outputSize = { {newWidth, newHeight, newDepth} }; >> >> resizeFilter2->SetSize(outputSize); >> >> // Specify the input for the resamplers >> >> resizeFilter2->SetInput(image); >> >> ImageType::Pointer imageNew = resizeFilter2->GetOutput(); >> >> const typename ImageType::RegionType& outputRegion = >> imageNew->GetLargestPossibleRegion(); >> >> const typename ImageType::SizeType& outputSize2 = >> outputRegion.GetSize(); >> >> >> >> ________________________________ >> >> De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de >> geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken >> van dit bericht, het niet openbaar maken of op enige wijze verspreiden of >> vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een >> incomplete aankomst of vertraging van dit verzonden bericht. >> >> The contents of this message are confidential and only intended for the eyes >> of the addressee(s). Others than the addressee(s) are not allowed to use >> this message, to make it public or to distribute or multiply this message in >> any way. The UMCG cannot be held responsible for incomplete reception or >> delay of this transferred message. >> >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-developers >> >> _______________________________________________ >> Community mailing list >> Community at itk.org >> http://public.kitware.com/mailman/listinfo/community >> >> >> >> >> >> -- >> >> Samuel Gerber >> R&D Engineer >> Kitware, Inc. >> >> ________________________________ >> De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de >> geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken >> van dit bericht, het niet openbaar maken of op enige wijze verspreiden of >> vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een >> incomplete aankomst of vertraging van dit verzonden bericht. >> >> The contents of this message are confidential and only intended for the eyes >> of the addressee(s). Others than the addressee(s) are not allowed to use >> this message, to make it public or to distribute or multiply this message in >> any way. The UMCG cannot be held responsible for incomplete reception or >> delay of this transferred message. >> >> _______________________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-developers >> > ________________________________ > De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken van dit bericht, het niet openbaar maken of op enige wijze verspreiden of vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een incomplete aankomst of vertraging van dit verzonden bericht. > > The contents of this message are confidential and only intended for the eyes of the addressee(s). Others than the addressee(s) are not allowed to use this message, to make it public or to distribute or multiply this message in any way. The UMCG cannot be held responsible for incomplete reception or delay of this transferred message. ________________________________ De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken van dit bericht, het niet openbaar maken of op enige wijze verspreiden of vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een incomplete aankomst of vertraging van dit verzonden bericht. The contents of this message are confidential and only intended for the eyes of the addressee(s). Others than the addressee(s) are not allowed to use this message, to make it public or to distribute or multiply this message in any way. The UMCG cannot be held responsible for incomplete reception or delay of this transferred message. _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers From fredrik.hellman at gmail.com Mon Sep 11 05:39:41 2017 From: fredrik.hellman at gmail.com (hellman) Date: Mon, 11 Sep 2017 02:39:41 -0700 (MST) Subject: [ITK] [ITK-users] Can I alter the way SliceBySliceImageFilter defines the origin of the internal slices? In-Reply-To: References: <1504877491197-0.post@n7.nabble.com> <1504881527156-0.post@n7.nabble.com> <1504883604903-0.post@n7.nabble.com> Message-ID: <1505122781018-0.post@n7.nabble.com> I have been thinking a bit about this and realized this is slightly more complex problem than I first thought. Yes, as far as I can see, your suggested solution would (in my case) make the physical extents of the internal image and the image input projected to the XY 2D plane the same. But the current implementation ((even) with this bugfix) has two problems: 1. The projection of the original 3D origin onto the XY plane does not coincide with the new internal origin (there is nothing that says it should be, but to me it seems natural). 2. If the Direction matrix if the input would not be identity, the physical interpretation is unclear. It would be nice to have a procedure to compute the internal image meta-data that has some interpretation also when the Direction matrix is not identity. There are some conceptual problems the whole procedure of going to a 3D-origin to a 2D-origin: The input image 3D origin is defined in the physical frame of reference (FoR), while the image data is indexed in a different FoR that can be arbitrarily rotated with respect to the physical one, through the direction matrix. The SliceBySliceImageFilter slices in the index FoR and not in the physical FoR. This means that any plane (or line for 2D input, or hyperplane for higher dimensions) in the physical FoR can be the slicing plane. This in turn means it makes no sense to favor certain physical dimensions as is done in the current code. For example, just because we slice _index dimension 3_, does not mean we should (as is done today) compute the origin coordinates of the first pixel in physical coordinates and keep all physical coordinates except the one corresponding to _physical dimension 3_ in the new origin. I fail to see what is the physical interpretation of this. One solution that has a clear physical interpretation is the following. Consider the plane P orthogonal to the slicing dimension (spanned by the all columns of the input Direction matrix except the sliced dimension) intersecting the physical origin. The Direction matrix for the internal image would be Identity. This means we choose the _index FoR_ as slice FoR for expressing points in plane P in the slice. When considering a slice, the Origin of this slice would be projected onto this plane P and it would be expressed in the coordinates of the slice FoR. The Region from the input can simply be copied to the internal image (except for the sliced dimension), since it is just a matter of collapsing the sliced dimension. -- Sent from: http://itk-users.7.n7.nabble.com/ _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From matt.mccormick at kitware.com Mon Sep 11 11:24:28 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 11 Sep 2017 11:24:28 -0400 Subject: [ITK] [ITK-users] Can I alter the way SliceBySliceImageFilter defines the origin of the internal slices? In-Reply-To: <1505122781018-0.post@n7.nabble.com> References: <1504877491197-0.post@n7.nabble.com> <1504881527156-0.post@n7.nabble.com> <1504883604903-0.post@n7.nabble.com> <1505122781018-0.post@n7.nabble.com> Message-ID: Yes, there are many ways handle the direction dimension collapse, and it should be handled with care. If possible, we should follow the behavior in ExtractImageFilter: https://itk.org/Doxygen/html/classitk_1_1ExtractImageFilter.html which has multiple options. Thanks, Matt On Mon, Sep 11, 2017 at 5:39 AM, hellman wrote: > I have been thinking a bit about this and realized this is slightly more > complex problem than I first thought. > > Yes, as far as I can see, your suggested solution would (in my case) make > the physical extents of the internal image and the image input projected to > the XY 2D plane the same. > > But the current implementation ((even) with this bugfix) has two problems: > > 1. The projection of the original 3D origin onto the XY plane does not > coincide with the new internal origin (there is nothing that says it should > be, but to me it seems natural). > 2. If the Direction matrix if the input would not be identity, the physical > interpretation is unclear. > > It would be nice to have a procedure to compute the internal image meta-data > that has some interpretation also when the Direction matrix is not identity. > There are some conceptual problems the whole procedure of going to a > 3D-origin to a 2D-origin: > > The input image 3D origin is defined in the physical frame of reference > (FoR), while the image data is indexed in a different FoR that can be > arbitrarily rotated with respect to the physical one, through the direction > matrix. > > The SliceBySliceImageFilter slices in the index FoR and not in the physical > FoR. This means that any plane (or line for 2D input, or hyperplane for > higher dimensions) in the physical FoR can be the slicing plane. This in > turn means it makes no sense to favor certain physical dimensions as is done > in the current code. For example, just because we slice _index dimension 3_, > does not mean we should (as is done today) compute the origin coordinates of > the first pixel in physical coordinates and keep all physical coordinates > except the one corresponding to _physical dimension 3_ in the new origin. I > fail to see what is the physical interpretation of this. > > One solution that has a clear physical interpretation is the following. > Consider the plane P orthogonal to the slicing dimension (spanned by the all > columns of the input Direction matrix except the sliced dimension) > intersecting the physical origin. The Direction matrix for the internal > image would be Identity. This means we choose the _index FoR_ as slice FoR > for expressing points in plane P in the slice. When considering a slice, the > Origin of this slice would be projected onto this plane P and it would be > expressed in the coordinates of the slice FoR. The Region from the input can > simply be copied to the internal image (except for the sliced dimension), > since it is just a matter of collapsing the sliced dimension. > > > > -- > Sent from: http://itk-users.7.n7.nabble.com/ > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From blowekamp at mail.nih.gov Mon Sep 11 11:31:50 2017 From: blowekamp at mail.nih.gov (Lowekamp, Bradley (NIH/NLM/LHC) [C]) Date: Mon, 11 Sep 2017 15:31:50 +0000 Subject: [ITK] [ITK-users] Can I alter the way SliceBySliceImageFilter defines the origin of the internal slices? In-Reply-To: <1505122781018-0.post@n7.nabble.com> References: <1504877491197-0.post@n7.nabble.com> <1504881527156-0.post@n7.nabble.com> <1504883604903-0.post@n7.nabble.com> <1505122781018-0.post@n7.nabble.com> Message-ID: Hello, I few years ago I spent a bit of time with the SliceBySliceImageFilter to get the filter to ?stream?. The way it was implemented was to expand the requested region of the output to the full size of the input?s in the non-slice-by-slice dimensions so that whole slices could be streamed through the filter. From your post, it may be the case that if the input image?s largest possible region starts with a non-zero index, then the computation of the origin per-slice is not proper. Can you please try to the filter with a zero-indexed input image? I am not certain the previous prosed fix will work properly with streaming, and it may change the number of pixels in the regions? However, for your case with an input image and an identity direction cosine matrix but with an non-zero largest possible index, it appears that the origin for the internal images is not correct. The non-zero index is a case that is not often checked by the ITK testing infrastructure, so I am not surprised it has a bug. Generally, it?s best to avoid such complex images with complex filters such as the SliceBySliceImageFilter. I have a proposed fix which may solve the problem for your case: http://review.source.kitware.com/#/c/22601/ I need to add tests and verify this is proper. Perhaps, you can test it to see if it meets your needs and behaves as expected for you? Also for reference here is the Slicer module I implemented which streams the SliceBySliceImageFilter. The streaming and proper geometry are critical for this application, so any changes made to this filter, I?ll need to ensure it still operates correctly. https://github.com/blowekamp/Slicer-IASEM/blob/master/IASEMImportSeries/IASEMImportSeries.cxx Brad On 9/11/17, 5:40 AM, "hellman" wrote: I have been thinking a bit about this and realized this is slightly more complex problem than I first thought. Yes, as far as I can see, your suggested solution would (in my case) make the physical extents of the internal image and the image input projected to the XY 2D plane the same. But the current implementation ((even) with this bugfix) has two problems: 1. The projection of the original 3D origin onto the XY plane does not coincide with the new internal origin (there is nothing that says it should be, but to me it seems natural). 2. If the Direction matrix if the input would not be identity, the physical interpretation is unclear. It would be nice to have a procedure to compute the internal image meta-data that has some interpretation also when the Direction matrix is not identity. There are some conceptual problems the whole procedure of going to a 3D-origin to a 2D-origin: The input image 3D origin is defined in the physical frame of reference (FoR), while the image data is indexed in a different FoR that can be arbitrarily rotated with respect to the physical one, through the direction matrix. The SliceBySliceImageFilter slices in the index FoR and not in the physical FoR. This means that any plane (or line for 2D input, or hyperplane for higher dimensions) in the physical FoR can be the slicing plane. This in turn means it makes no sense to favor certain physical dimensions as is done in the current code. For example, just because we slice _index dimension 3_, does not mean we should (as is done today) compute the origin coordinates of the first pixel in physical coordinates and keep all physical coordinates except the one corresponding to _physical dimension 3_ in the new origin. I fail to see what is the physical interpretation of this. One solution that has a clear physical interpretation is the following. Consider the plane P orthogonal to the slicing dimension (spanned by the all columns of the input Direction matrix except the sliced dimension) intersecting the physical origin. The Direction matrix for the internal image would be Identity. This means we choose the _index FoR_ as slice FoR for expressing points in plane P in the slice. When considering a slice, the Origin of this slice would be projected onto this plane P and it would be expressed in the coordinates of the slice FoR. The Region from the input can simply be copied to the internal image (except for the sliced dimension), since it is just a matter of collapsing the sliced dimension. -- Sent from: http://itk-users.7.n7.nabble.com/ _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From francois.budin at kitware.com Mon Sep 11 13:37:47 2017 From: francois.budin at kitware.com (Francois Budin) Date: Mon, 11 Sep 2017 13:37:47 -0400 Subject: [ITK] [ITK-users] Variable Matrix Access Violiotation In-Reply-To: References: Message-ID: Hello Fabian, You are most likely allocating more memory than what your computer can allocates. If you compute the memory required for your matrix, it will be at least: 8 (long doubles on Visual Studio C++ are the same size as doubles) * 2*100*100*2*100*100 = 3 200 000 000 Bytes This means that you need to have at least that much memory available. If your computer does not have this amount of memory available, you will run into errors. Hope this helps, Francois On Wed, Aug 30, 2017 at 12:24 PM, Fabian Torres wrote: > Hi evryone. > > I?m using itk VariableMatrix to do some image processing. But I have some > problems initializing my matrices. > When I use small sizes like this I do not have any problem > > //matrix A > regionSize[0] = 15; > regionSze[1] = 15; > VariableSizeMatrix matA; > matA.SetSize(2*regionSize[0]*regionSize[1],2*regionSize[0]*regionSize[1]); > matA.Fill(0.0); > > But when I use bigger sizes like: > > regionSize[0] = 100; > regionSze[1] = 100; > > I get an Acces Violation exception > Access violation reading location 0xcdcdcdc1. > > I'm using Visualstudio 2008 and ITK 4.4 > > Does this has something to do with memory allocation? > Is there a way a could verify if I have enough memory to allocate my > matrix? > > Thanks. > > -- > Fabi?n Torres Robles > Maestr?a en Ciencias en Ingenier?a Electr?nica > Ingenier?a en Sistemas Electr?nicos > Tel. 58081280, 0445534661338 > E-mail fabian.trobles at gmail.com, dae.wong at gmail.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: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From blowekamp at mail.nih.gov Mon Sep 11 13:47:53 2017 From: blowekamp at mail.nih.gov (Lowekamp, Bradley (NIH/NLM/LHC) [C]) Date: Mon, 11 Sep 2017 17:47:53 +0000 Subject: [ITK] [ITK-users] Variable Matrix Access Violiotation In-Reply-To: References: Message-ID: Oh! I think you are experiencing integer overflow with that size of a matrix. The value Francois (correctly) computed 3,200,000,000 is ~3GB which is greater than numeric_traits::max(), which for 32-bit singed integers is 2,147,483,647. The internal implementation of this class is vnl_matrix, so the integer limitation lies within that library. So you matrix is too big for this library. When I looked at this e-mail earlier I miss computed the size, so I didn?t realized this problem. HTH, Brad From: Francois Budin Date: Monday, September 11, 2017 at 1:38 PM To: Fabian Torres Cc: "insight-users at itk.org" Subject: Re: [ITK-users] Variable Matrix Access Violiotation Hello Fabian, You are most likely allocating more memory than what your computer can allocates. If you compute the memory required for your matrix, it will be at least: 8 (long doubles on Visual Studio C++ are the same size as doubles) * 2*100*100*2*100*100 = 3 200 000 000 Bytes This means that you need to have at least that much memory available. If your computer does not have this amount of memory available, you will run into errors. Hope this helps, Francois On Wed, Aug 30, 2017 at 12:24 PM, Fabian Torres > wrote: Hi evryone. I?m using itk VariableMatrix to do some image processing. But I have some problems initializing my matrices. When I use small sizes like this I do not have any problem //matrix A regionSize[0] = 15; regionSze[1] = 15; VariableSizeMatrix matA; matA.SetSize(2*regionSize[0]*regionSize[1],2*regionSize[0]*regionSize[1]); matA.Fill(0.0); But when I use bigger sizes like: regionSize[0] = 100; regionSze[1] = 100; I get an Acces Violation exception Access violation reading location 0xcdcdcdc1. I'm using Visualstudio 2008 and ITK 4.4 Does this has something to do with memory allocation? Is there a way a could verify if I have enough memory to allocate my matrix? Thanks. -- Fabi?n Torres Robles Maestr?a en Ciencias en Ingenier?a Electr?nica Ingenier?a en Sistemas Electr?nicos Tel. 58081280, 0445534661338 E-mail fabian.trobles at gmail.com, dae.wong at gmail.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: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 francois.budin at kitware.com Mon Sep 11 13:56:28 2017 From: francois.budin at kitware.com (Francois Budin) Date: Mon, 11 Sep 2017 13:56:28 -0400 Subject: [ITK] [ITK-users] Variable Matrix Access Violiotation In-Reply-To: References: Message-ID: @Brad: I looked in the source code and the types of the column and row size variables are "unsigned int" which should allow up to 2^32-1 so 4GB, isn't that correct? On Mon, Sep 11, 2017 at 1:47 PM, Lowekamp, Bradley (NIH/NLM/LHC) [C] < blowekamp at mail.nih.gov> wrote: > Oh! I think you are experiencing integer overflow with that size of a > matrix. The value Francois (correctly) computed 3,200,000,000 is ~3GB which > is greater than numeric_traits::max(), which for 32-bit singed > integers is 2,147,483,647. The internal implementation of this class is > vnl_matrix, so the integer limitation lies within that library. So you > matrix is too big for this library. > > > > When I looked at this e-mail earlier I miss computed the size, so I didn?t > realized this problem. > > > > HTH, > > Brad > > > > > > *From: *Francois Budin > *Date: *Monday, September 11, 2017 at 1:38 PM > *To: *Fabian Torres > *Cc: *"insight-users at itk.org" > *Subject: *Re: [ITK-users] Variable Matrix Access Violiotation > > > > Hello Fabian, > > You are most likely allocating more memory than what your computer can > allocates. If you compute the memory required for your matrix, it will be > at least: > > 8 (long doubles on Visual Studio C++ are the same size as doubles) * > 2*100*100*2*100*100 = 3 200 000 000 Bytes > > This means that you need to have at least that much memory available. > > If your computer does not have this amount of memory available, you will > run into errors. > > Hope this helps, > > Francois > > > > > > On Wed, Aug 30, 2017 at 12:24 PM, Fabian Torres > wrote: > > Hi evryone. > > > > I?m using itk VariableMatrix to do some image processing. But I have some > problems initializing my matrices. > > When I use small sizes like this I do not have any problem > > > > //matrix A > > regionSize[0] = 15; > > regionSze[1] = 15; > > VariableSizeMatrix matA; > > matA.SetSize(2*regionSize[0]*regionSize[1],2*regionSize[0]*regionSize[1]); > > matA.Fill(0.0); > > > > But when I use bigger sizes like: > > > > regionSize[0] = 100; > > regionSze[1] = 100; > > > > I get an Acces Violation exception > > Access violation reading location 0xcdcdcdc1. > > > > I'm using Visualstudio 2008 and ITK 4.4 > > > > Does this has something to do with memory allocation? > > Is there a way a could verify if I have enough memory to allocate my > matrix? > > > > Thanks. > > > > -- > > Fabi?n Torres Robles > Maestr?a en Ciencias en Ingenier?a Electr?nica > Ingenier?a en Sistemas Electr?nicos > Tel. 58081280, 0445534661338 > E-mail fabian.trobles at gmail.com, dae.wong at gmail.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: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From blowekamp at mail.nih.gov Mon Sep 11 13:58:41 2017 From: blowekamp at mail.nih.gov (Lowekamp, Bradley (NIH/NLM/LHC) [C]) Date: Mon, 11 Sep 2017 17:58:41 +0000 Subject: [ITK] [ITK-users] Can I alter the way SliceBySliceImageFilter defines the origin of the internal slices? In-Reply-To: References: <1504877491197-0.post@n7.nabble.com> <1504881527156-0.post@n7.nabble.com> <1504883604903-0.post@n7.nabble.com> <1505122781018-0.post@n7.nabble.com> Message-ID: I agree that filter has a nice option set for how to reduce the dimension of direction cosine matrix and update the physical coordinates. However, I would not try to re-implement or copy all those options and their implementations. If a new version of the filter was to be created, I?d recommend just reusing this recommended ExtractImageFilter in a mini-pipeline style composite filter. Brad On 9/11/17, 11:25 AM, "Matt McCormick" wrote: Yes, there are many ways handle the direction dimension collapse, and it should be handled with care. If possible, we should follow the behavior in ExtractImageFilter: https://itk.org/Doxygen/html/classitk_1_1ExtractImageFilter.html which has multiple options. Thanks, Matt On Mon, Sep 11, 2017 at 5:39 AM, hellman wrote: > I have been thinking a bit about this and realized this is slightly more > complex problem than I first thought. > > Yes, as far as I can see, your suggested solution would (in my case) make > the physical extents of the internal image and the image input projected to > the XY 2D plane the same. > > But the current implementation ((even) with this bugfix) has two problems: > > 1. The projection of the original 3D origin onto the XY plane does not > coincide with the new internal origin (there is nothing that says it should > be, but to me it seems natural). > 2. If the Direction matrix if the input would not be identity, the physical > interpretation is unclear. > > It would be nice to have a procedure to compute the internal image meta-data > that has some interpretation also when the Direction matrix is not identity. > There are some conceptual problems the whole procedure of going to a > 3D-origin to a 2D-origin: > > The input image 3D origin is defined in the physical frame of reference > (FoR), while the image data is indexed in a different FoR that can be > arbitrarily rotated with respect to the physical one, through the direction > matrix. > > The SliceBySliceImageFilter slices in the index FoR and not in the physical > FoR. This means that any plane (or line for 2D input, or hyperplane for > higher dimensions) in the physical FoR can be the slicing plane. This in > turn means it makes no sense to favor certain physical dimensions as is done > in the current code. For example, just because we slice _index dimension 3_, > does not mean we should (as is done today) compute the origin coordinates of > the first pixel in physical coordinates and keep all physical coordinates > except the one corresponding to _physical dimension 3_ in the new origin. I > fail to see what is the physical interpretation of this. > > One solution that has a clear physical interpretation is the following. > Consider the plane P orthogonal to the slicing dimension (spanned by the all > columns of the input Direction matrix except the sliced dimension) > intersecting the physical origin. The Direction matrix for the internal > image would be Identity. This means we choose the _index FoR_ as slice FoR > for expressing points in plane P in the slice. When considering a slice, the > Origin of this slice would be projected onto this plane P and it would be > expressed in the coordinates of the slice FoR. The Region from the input can > simply be copied to the internal image (except for the sliced dimension), > since it is just a matter of collapsing the sliced dimension. > > > > -- > Sent from: http://itk-users.7.n7.nabble.com/ > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From blowekamp at mail.nih.gov Mon Sep 11 14:08:11 2017 From: blowekamp at mail.nih.gov (Lowekamp, Bradley (NIH/NLM/LHC) [C]) Date: Mon, 11 Sep 2017 18:08:11 +0000 Subject: [ITK] [ITK-users] Variable Matrix Access Violiotation In-Reply-To: References: Message-ID: Yes, unsigned int?s max is ~4GB, so it ?could? work. But working with unsigned integers in the 2GB-3GB range is problematic and trick when subtraction and offsets need to be computed. It is a big red flag to me. Another possibility, is that the program was just compiled in 32-bit mode. I don?t think a win32 application can allocate that much memory. Brad From: Francois Budin Date: Monday, September 11, 2017 at 1:57 PM To: "Lowekamp, Bradley (NIH/NLM/LHC) [C]" Cc: Fabian Torres , "insight-users at itk.org" Subject: Re: [ITK-users] Variable Matrix Access Violiotation @Brad: I looked in the source code and the types of the column and row size variables are "unsigned int" which should allow up to 2^32-1 so 4GB, isn't that correct? On Mon, Sep 11, 2017 at 1:47 PM, Lowekamp, Bradley (NIH/NLM/LHC) [C] > wrote: Oh! I think you are experiencing integer overflow with that size of a matrix. The value Francois (correctly) computed 3,200,000,000 is ~3GB which is greater than numeric_traits::max(), which for 32-bit singed integers is 2,147,483,647. The internal implementation of this class is vnl_matrix, so the integer limitation lies within that library. So you matrix is too big for this library. When I looked at this e-mail earlier I miss computed the size, so I didn?t realized this problem. HTH, Brad From: Francois Budin > Date: Monday, September 11, 2017 at 1:38 PM To: Fabian Torres > Cc: "insight-users at itk.org" > Subject: Re: [ITK-users] Variable Matrix Access Violiotation Hello Fabian, You are most likely allocating more memory than what your computer can allocates. If you compute the memory required for your matrix, it will be at least: 8 (long doubles on Visual Studio C++ are the same size as doubles) * 2*100*100*2*100*100 = 3 200 000 000 Bytes This means that you need to have at least that much memory available. If your computer does not have this amount of memory available, you will run into errors. Hope this helps, Francois On Wed, Aug 30, 2017 at 12:24 PM, Fabian Torres > wrote: Hi evryone. I?m using itk VariableMatrix to do some image processing. But I have some problems initializing my matrices. When I use small sizes like this I do not have any problem //matrix A regionSize[0] = 15; regionSze[1] = 15; VariableSizeMatrix matA; matA.SetSize(2*regionSize[0]*regionSize[1],2*regionSize[0]*regionSize[1]); matA.Fill(0.0); But when I use bigger sizes like: regionSize[0] = 100; regionSze[1] = 100; I get an Acces Violation exception Access violation reading location 0xcdcdcdc1. I'm using Visualstudio 2008 and ITK 4.4 Does this has something to do with memory allocation? Is there a way a could verify if I have enough memory to allocate my matrix? Thanks. -- Fabi?n Torres Robles Maestr?a en Ciencias en Ingenier?a Electr?nica Ingenier?a en Sistemas Electr?nicos Tel. 58081280, 0445534661338 E-mail fabian.trobles at gmail.com, dae.wong at gmail.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: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From matt.mccormick at kitware.com Mon Sep 11 14:23:13 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 11 Sep 2017 14:23:13 -0400 Subject: [ITK] [ITK-dev] problems itk resample filter In-Reply-To: References: Message-ID: Hi, One possible issue - make sure that the image viewer applied is displaying the correct dynamic range so it does just not appear that there are only zeros after interpolation. 3D Slicer, ITK-SNAP, etc. support this. HTH, Matt On Sat, Sep 9, 2017 at 1:49 AM, Pfaehler, EAG (ngmb) wrote: > Hey, > > thanks. I did this, but it did not change anything. However, I used another image (with some higher intensity values) and then I got an image with only 1s. > > Can it be the problem that my images have only values from 0-5? > I also tried an image with only 0 and 1, but als here I get only zeros after interpolation. > > ________________________________________ > Van: Matt McCormick [matt.mccormick at kitware.com] > Verzonden: vrijdag 8 september 2017 21:27 > Aan: Pfaehler, EAG (ngmb) > CC: Samuel Gerber; insight-developers at itk.org > Onderwerp: Re: [ITK-dev] [ITK] problems itk resample filter > > Hi, > > The Origin should be the same in the resampled image. > > HTH, > Matt > > On Fri, Sep 8, 2017 at 3:12 PM, Pfaehler, EAG (ngmb) > wrote: >> Thanks Samuel and Matt for the help. However, it is unfortunatly still not working. >> >> I deleted the line resizeFilter->SetTransform, but unfortunately it did not change anything. >> >> Then I tried to set the direction and the origin. But maybe here is the problem. I set as direction the same direction as in the original image because I do not want to have any rotation. >> >> But I am a bit insecure how to set the origin. First I set the origin in the resampled image to the same as in the original image, what did not work. >> Then I tried different things, e.g >> >> origin[0] = origin[0] + inputSpacing[0] * (newWidth - oldWidth); >> origin[1] = origin[1] + inputSpacing[1] * (newHeight - oldHeight); >> origin[2] = origin[2] + inputSpacing[2] * (newDepth - oldDepth); >> >> where newWidth etc is the width of the new image and oldWidth of the original image. And origin[0] is the x value of the original origin etc. >> >> But this was also not working. ( In all of these cases I get an image full of zeros. >> >> If I make originalImage->Print(std::cout) I get the following: >> >> Image (000000000282A800) >> RTTI typeinfo: class itk::Image >> Reference Count: 3 >> Modified Time: 705 >> Debug: Off >> Object Name: >> Observers: >> none >> Source: (none) >> Source output name: (none) >> Release Data: Off >> Data Released: False >> Global Release Data: Off >> PipelineMTime: 692 >> UpdateMTime: 704 >> RealTimeStamp: 0 seconds >> LargestPossibleRegion: >> Dimension: 3 >> Index: [0, 0, 0] >> Size: [11, 11, 19] >> BufferedRegion: >> Dimension: 3 >> Index: [0, 0, 0] >> Size: [11, 11, 19] >> RequestedRegion: >> Dimension: 3 >> Index: [0, 0, 0] >> Size: [11, 11, 19] >> Spacing: [3.1819, 3.1819, 2] >> Origin: [48.5757, -171.979, 20.5] >> Direction: >> 1 0 0 >> 0 1 0 >> 0 0 1 >> >> IndexToPointMatrix: >> 3.1819 0 0 >> 0 3.1819 0 >> 0 0 2 >> >> PointToIndexMatrix: >> 0.314278 0 0 >> 0 0.314278 0 >> 0 0 0.5 >> >> Inverse Direction: >> 1 0 0 >> 0 1 0 >> 0 0 1 >> >> PixelContainer: >> ImportImageContainer (00000000027B59F0) >> RTTI typeinfo: class itk::ImportImageContainer >> Reference Count: 1 >> Modified Time: 701 >> Debug: Off >> Object Name: >> Observers: >> none >> Pointer: 00000000028542E0 >> Container manages memory: true >> Size: 2299 >> Capacity: 2299 >> >> If I do the same for the resampled image I get: >> >> Image (000000000282B100) >> RTTI typeinfo: class itk::Image >> Reference Count: 2 >> Modified Time: 11626 >> Debug: Off >> Object Name: >> Observers: >> none >> Source: (000000000282BB80) >> Source output name: Primary >> Release Data: Off >> Data Released: False >> Global Release Data: Off >> PipelineMTime: 11614 >> UpdateMTime: 11627 >> RealTimeStamp: 0 seconds >> LargestPossibleRegion: >> Dimension: 3 >> Index: [0, 0, 0] >> Size: [17, 17, 19] >> BufferedRegion: >> Dimension: 3 >> Index: [0, 0, 0] >> Size: [17, 17, 19] >> RequestedRegion: >> Dimension: 3 >> Index: [0, 0, 0] >> Size: [17, 17, 19] >> Spacing: [2, 2, 2] >> Origin: [67.6671, -152.888, 20.5] >> Direction: >> 1 0 0 >> 0 1 0 >> 0 0 1 >> >> IndexToPointMatrix: >> 2 0 0 >> 0 2 0 >> 0 0 2 >> >> PointToIndexMatrix: >> 0.5 0 0 >> 0 0.5 0 >> 0 0 0.5 >> >> Inverse Direction: >> 1 0 0 >> 0 1 0 >> 0 0 1 >> >> PixelContainer: >> ImportImageContainer (00000000027B5EC0) >> RTTI typeinfo: class itk::ImportImageContainer >> Reference Count: 1 >> Modified Time: 11625 >> Debug: Off >> Object Name: >> Observers: >> none >> Pointer: 0000000002A8D520 >> Container manages memory: true >> Size: 5491 >> Capacity: 5491 >> >> Does that maybe help to find out whats going wrong? >> >> Thanks in advance >> >> >> >> ________________________________________ >> Van: Matt McCormick [matt.mccormick at kitware.com] >> Verzonden: vrijdag 8 september 2017 15:32 >> Aan: Pfaehler, EAG (ngmb) >> CC: Samuel Gerber; insight-developers at itk.org >> Onderwerp: Re: [ITK-dev] [ITK] problems itk resample filter >> >> Hi Elli, >> >> The OutputOrigin and OutputDirection may need to be set so the >> sampling grids overlap. >> >> HTH, >> Matt >> >> On Fri, Sep 8, 2017 at 9:13 AM, Pfaehler, EAG (ngmb) >> wrote: >>> Thanks, I did this. Now I get an image, with the desired size, but there all >>> image values are 0. I get the same when I use linear interpolation? >>> >>> Does someone know, what could be the reason? >>> >>> >>> >>> Thanks in advance, >>> >>> >>> >>> Regards >>> >>> >>> >>> Elli >>> >>> >>> >>> Van: Samuel Gerber [mailto:samuel.gerber at kitware.com] >>> Verzonden: vrijdag 8 september 2017 14:51 >>> Aan: Pfaehler, EAG (ngmb) >>> CC: insight-developers at itk.org >>> Onderwerp: Re: [ITK] [ITK-dev] problems itk resample filter >>> >>> >>> >>> I believe you might need to call resizeFilter2->Update() >>> >>> >>> >>> >>> >>> >>> >>> On Fri, Sep 8, 2017 at 8:32 AM, Pfaehler, EAG (ngmb) >>> wrote: >>> >>> Dear all, >>> >>> >>> >>> I would need some help to resample so that it has isotropic voxels in the >>> end. >>> >>> For this, I wanted to use the Nearest Neighbor Interpolator and the >>> ResampleFilterType. >>> >>> My code is running, but the output of the filter has always the dimensions >>> [0 0 0], so is not existent. >>> >>> What am I doing wrong? (see code below) >>> >>> >>> >>> Thanks in advance! >>> >>> Elli >>> >>> >>> >>> typedef itk::NearestNeighborInterpolateImageFunction >>> NearestNeighborInterpolatorType; >>> >>> typedef itk::ResampleImageFilter >>> ResampleFilterType; >>> >>> typedef itk::AffineTransform TransformType; >>> >>> //use nearest neighbor interpolation >>> >>> typename NearestNeighborInterpolatorType::Pointer >>> nearestNeighborInterpolator = NearestNeighborInterpolatorType::New(); >>> >>> typename ImageType::DirectionType direction; >>> >>> typename TransformType::Pointer transform = TransformType::New(); >>> >>> //transform->SetIdentity(); >>> >>> typedef itk::NearestNeighborInterpolateImageFunction >>> InterpolatorType; >>> >>> //typedef itk::LinearInterpolateImageFunction >>> InterpolatorType; >>> >>> typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); >>> >>> >>> >>> typename ResampleFilterType::Pointer resizeFilter2 = >>> ResampleFilterType::New(); >>> >>> resizeFilter2->SetTransform(transform); >>> >>> >>> >>> resizeFilter2->SetInterpolator( interpolator ); >>> >>> resizeFilter2->SetDefaultPixelValue(0); >>> >>> //resizeFilter2->SetInterpolator(); >>> >>> >>> >>> const typename ImageType::SpacingType& inputSpacing = image->GetSpacing(); >>> >>> //sampling >>> >>> double outputSpacing[3]; >>> >>> // Fetch original image size >>> >>> const typename ImageType::RegionType& inputRegion = >>> image->GetLargestPossibleRegion(); >>> >>> const typename ImageType::SizeType& inputSize = inputRegion.GetSize(); >>> >>> unsigned int oldWidth = inputSize[0]; >>> >>> unsigned int oldHeight = inputSize[1]; >>> >>> unsigned int oldDepth = inputSize[2]; >>> >>> unsigned int newWidth; >>> >>> unsigned int newHeight; >>> >>> unsigned int newDepth; >>> >>> //get the new height etc of image >>> >>> double minimum = inputSpacing[0]; >>> >>> if (inputSpacing[1]>> >>> minimum = inputSpacing[1]; >>> >>> } >>> >>> if (inputSpacing[2] < minimum){ >>> >>> minimum = inputSpacing[2]; >>> >>> } >>> >>> outputSpacing[0] = minimum; >>> >>> outputSpacing[1] = minimum; >>> >>> outputSpacing[2] = minimum; >>> >>> newWidth = (double) oldWidth * inputSpacing[0]/minimum; >>> >>> ewHeight = (double) oldHeight * inputSpacing[1]/minimum; >>> >>> newDepth = (double) oldDepth * inputSpacing[2]/minimum; >>> >>> // Set the output spacing as specified on the command line >>> >>> resizeFilter2->SetOutputSpacing(outputSpacing); >>> >>> // Set the computed size >>> >>> itk::Size<3> outputSize = { {newWidth, newHeight, newDepth} }; >>> >>> resizeFilter2->SetSize(outputSize); >>> >>> // Specify the input for the resamplers >>> >>> resizeFilter2->SetInput(image); >>> >>> ImageType::Pointer imageNew = resizeFilter2->GetOutput(); >>> >>> const typename ImageType::RegionType& outputRegion = >>> imageNew->GetLargestPossibleRegion(); >>> >>> const typename ImageType::SizeType& outputSize2 = >>> outputRegion.GetSize(); >>> >>> >>> >>> ________________________________ >>> >>> De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de >>> geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken >>> van dit bericht, het niet openbaar maken of op enige wijze verspreiden of >>> vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een >>> incomplete aankomst of vertraging van dit verzonden bericht. >>> >>> The contents of this message are confidential and only intended for the eyes >>> of the addressee(s). Others than the addressee(s) are not allowed to use >>> this message, to make it public or to distribute or multiply this message in >>> any way. The UMCG cannot be held responsible for incomplete reception or >>> delay of this transferred message. >>> >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the ITK FAQ at: >>> http://www.itk.org/Wiki/ITK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/insight-developers >>> >>> _______________________________________________ >>> Community mailing list >>> Community at itk.org >>> http://public.kitware.com/mailman/listinfo/community >>> >>> >>> >>> >>> >>> -- >>> >>> Samuel Gerber >>> R&D Engineer >>> Kitware, Inc. >>> >>> ________________________________ >>> De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de >>> geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken >>> van dit bericht, het niet openbaar maken of op enige wijze verspreiden of >>> vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een >>> incomplete aankomst of vertraging van dit verzonden bericht. >>> >>> The contents of this message are confidential and only intended for the eyes >>> of the addressee(s). Others than the addressee(s) are not allowed to use >>> this message, to make it public or to distribute or multiply this message in >>> any way. The UMCG cannot be held responsible for incomplete reception or >>> delay of this transferred message. >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the ITK FAQ at: >>> http://www.itk.org/Wiki/ITK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/insight-developers >>> >> ________________________________ >> De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken van dit bericht, het niet openbaar maken of op enige wijze verspreiden of vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een incomplete aankomst of vertraging van dit verzonden bericht. >> >> The contents of this message are confidential and only intended for the eyes of the addressee(s). Others than the addressee(s) are not allowed to use this message, to make it public or to distribute or multiply this message in any way. The UMCG cannot be held responsible for incomplete reception or delay of this transferred message. > ________________________________ > De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken van dit bericht, het niet openbaar maken of op enige wijze verspreiden of vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een incomplete aankomst of vertraging van dit verzonden bericht. > > The contents of this message are confidential and only intended for the eyes of the addressee(s). Others than the addressee(s) are not allowed to use this message, to make it public or to distribute or multiply this message in any way. The UMCG cannot be held responsible for incomplete reception or delay of this transferred message. _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers From antoine.letouzey at gmail.com Tue Sep 12 05:41:24 2017 From: antoine.letouzey at gmail.com (g2) Date: Tue, 12 Sep 2017 02:41:24 -0700 (MST) Subject: [ITK] [ITK-users] Rotation of anisotropic 3D image Message-ID: <1505209284609-0.post@n2.nabble.com> Hi all, I am trying to rotate in 3D with a arbitrary rotation matrix a 3D image with non uniform spacing (0.15, 0.15, 0.19). I am currently using itk::AffineTransform because at some point in the future I would like to introduce a translation. My question is about the spacing of the output image. Since my rotation matrix can be anything, I cannot just re-use the spacing of my original image. I actually do not care to much about the output spacing, it can be the same, it can be isotropic, whatever as long as the data makes sense. here is a bit of code of what I've done so far: typedef itk::Image Image3d; Image3d::Pointer itkImage = getImageSomehow(); typedef itk::AffineTransform TransformType; TransformType::Pointer Rt = TransformType::New(); TransformType::ParametersType params(12); for (int i = 0; i < 9; i++){ params[i] = R[i/3][i%3]; // R is the rotation matrix of type double[3][3] } params[9] = 0; params[10] = 0; params[11] = 0; Rt->SetParameters(params); typedef itk::ResampleImageFilter FilterType; FilterType::Pointer filter = FilterType::New(); typedef itk::NearestNeighborInterpolateImageFunction InterpolatorType; InterpolatorType::Pointer interpolator = InterpolatorType::New(); filter->SetInterpolator(interpolator); filter->SetDefaultPixelValue(255); filter->SetOutputOrigin(itkImage->GetOrigin()); filter->SetOutputSpacing(itkImage->GetSpacing()); //double outSpacing[3] = { 0.1, 0.1, 0.1 }; //filter->SetOutputSpacing(outSpacing); filter->SetSize(itkImage->GetLargestPossibleRegion().GetSize()); filter->SetOutputDirection(itkImage->GetDirection()); filter->SetInput(itkImage); filter->SetTransform(Rt); filter->Update(); After this when I save filter->GetOutput() and open it with IKT-Snap I can see my new image properly rotated. But it has the same spacing as the input image, as specified with filter->SetOutputSpacing(itkImage->GetSpacing()); and to me this doesn't make sense. The axes are rotated and so should be the spacing. When I try to put some other values, such as (0.1, 0.1, 0.1). The output image is all black. I'm confused because to me those values are not more erroneous than a plain copy of the input spacing. Questions : I want to rotate a generic 3D image with anisotropic spacing with a generic rotation matrix (i.e. not around a single axis and not with a n*90? angle) so that any physical point P in the original volumes maps to R*P in the final one. How should I proceed ? thanks -- Sent from: http://itk-insight-users.2283740.n2.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 fredrik.hellman at gmail.com Tue Sep 12 06:39:22 2017 From: fredrik.hellman at gmail.com (hellman) Date: Tue, 12 Sep 2017 03:39:22 -0700 (MST) Subject: [ITK] [ITK-users] Can I alter the way SliceBySliceImageFilter defines the origin of the internal slices? In-Reply-To: References: <1504877491197-0.post@n7.nabble.com> <1504881527156-0.post@n7.nabble.com> <1504883604903-0.post@n7.nabble.com> <1505122781018-0.post@n7.nabble.com> Message-ID: <1505212762750-0.post@n7.nabble.com> I tried shifting the origin such that the input image had region index 0 and then it worked. I also applied the patch http://review.source.kitware.com/#/c/22601/ and now it works also with non-zero region index in my case, so my particular problem is solved by this patch. -- Sent from: http://itk-users.7.n7.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 francois.budin at kitware.com Tue Sep 12 08:42:27 2017 From: francois.budin at kitware.com (Francois Budin) Date: Tue, 12 Sep 2017 08:42:27 -0400 Subject: [ITK] [ITK-users] Variable Matrix Access Violiotation In-Reply-To: References: Message-ID: Hello Fabian, In your case the limitation is really the fact that you compile your project in 32bits. Using another kind of structure will lead to the same issue as long as it is build in 32bits. So my advice is to compile your project (and ITK) in 64 bits. It will work then (it works on my computer). Hope this helps, Fran?ois On Mon, Sep 11, 2017 at 5:30 PM, Fabian Torres wrote: > Hi. > > > > Thanks for your responses; all of them gave me some perspective on the > problem. > > Indeed the size of my matrix is around 3GB and I do have enough memory > space to allocate it. > > > > So I think the problem lies in the integer overflow and that my program is > compiled in 32-bit mode, so my win32 cannot allocate that size of matrix. > > > > So what do you recommend? use another kind of structure that it is not an > itk matrix and compiling this project in 64bits? > > > > Thank you very much. I do appreciate the time you took for this subject. > > On Mon, Sep 11, 2017 at 1:08 PM, Lowekamp, Bradley (NIH/NLM/LHC) [C] < > blowekamp at mail.nih.gov> wrote: > >> Yes, unsigned int?s max is ~4GB, so it ?could? work. But working with >> unsigned integers in the 2GB-3GB range is problematic and trick when >> subtraction and offsets need to be computed. It is a big red flag to me. >> >> >> >> Another possibility, is that the program was just compiled in 32-bit >> mode. I don?t think a win32 application can allocate that much memory. >> >> >> >> Brad >> >> >> >> >> >> >> >> *From: *Francois Budin >> *Date: *Monday, September 11, 2017 at 1:57 PM >> *To: *"Lowekamp, Bradley (NIH/NLM/LHC) [C]" >> *Cc: *Fabian Torres , "insight-users at itk.org" < >> insight-users at itk.org> >> >> *Subject: *Re: [ITK-users] Variable Matrix Access Violiotation >> >> >> >> @Brad: I looked in the source code and the types of the column and row >> size variables are "unsigned int" which should allow up to 2^32-1 so 4GB, >> isn't that correct? >> >> >> >> On Mon, Sep 11, 2017 at 1:47 PM, Lowekamp, Bradley (NIH/NLM/LHC) [C] < >> blowekamp at mail.nih.gov> wrote: >> >> Oh! I think you are experiencing integer overflow with that size of a >> matrix. The value Francois (correctly) computed 3,200,000,000 is ~3GB which >> is greater than numeric_traits::max(), which for 32-bit singed >> integers is 2,147,483,647. The internal implementation of this class is >> vnl_matrix, so the integer limitation lies within that library. So you >> matrix is too big for this library. >> >> >> >> When I looked at this e-mail earlier I miss computed the size, so I >> didn?t realized this problem. >> >> >> >> HTH, >> >> Brad >> >> >> >> >> >> *From: *Francois Budin >> *Date: *Monday, September 11, 2017 at 1:38 PM >> *To: *Fabian Torres >> *Cc: *"insight-users at itk.org" >> *Subject: *Re: [ITK-users] Variable Matrix Access Violiotation >> >> >> >> Hello Fabian, >> >> You are most likely allocating more memory than what your computer can >> allocates. If you compute the memory required for your matrix, it will be >> at least: >> >> 8 (long doubles on Visual Studio C++ are the same size as doubles) * >> 2*100*100*2*100*100 = 3 200 000 000 Bytes >> >> This means that you need to have at least that much memory available. >> >> If your computer does not have this amount of memory available, you will >> run into errors. >> >> Hope this helps, >> >> Francois >> >> >> >> >> >> On Wed, Aug 30, 2017 at 12:24 PM, Fabian Torres >> wrote: >> >> Hi evryone. >> >> >> >> I?m using itk VariableMatrix to do some image processing. But I have some >> problems initializing my matrices. >> >> When I use small sizes like this I do not have any problem >> >> >> >> //matrix A >> >> regionSize[0] = 15; >> >> regionSze[1] = 15; >> >> VariableSizeMatrix matA; >> >> matA.SetSize(2*regionSize[0]*regionSize[1],2*regionSize[0]*r >> egionSize[1]); >> >> matA.Fill(0.0); >> >> >> >> But when I use bigger sizes like: >> >> >> >> regionSize[0] = 100; >> >> regionSze[1] = 100; >> >> >> >> I get an Acces Violation exception >> >> Access violation reading location 0xcdcdcdc1. >> >> >> >> I'm using Visualstudio 2008 and ITK 4.4 >> >> >> >> Does this has something to do with memory allocation? >> >> Is there a way a could verify if I have enough memory to allocate my >> matrix? >> >> >> >> Thanks. >> >> >> >> -- >> >> Fabi?n Torres Robles >> Maestr?a en Ciencias en Ingenier?a Electr?nica >> Ingenier?a en Sistemas Electr?nicos >> Tel. 58081280, 0445534661338 >> E-mail fabian.trobles at gmail.com, dae.wong at gmail.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 >> >> >> >> >> > > > > -- > Fabi?n Torres Robles > Maestr?a en Ciencias en Ingenier?a Electr?nica > Ingenier?a en Sistemas Electr?nicos > Tel. 58081280, 0445534661338 > E-mail fabian.trobles at gmail.com, dae.wong at gmail.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 francois.budin at kitware.com Tue Sep 12 08:55:03 2017 From: francois.budin at kitware.com (Francois Budin) Date: Tue, 12 Sep 2017 08:55:03 -0400 Subject: [ITK] [ITK-users] Rotation of anisotropic 3D image In-Reply-To: <1505209284609-0.post@n2.nabble.com> References: <1505209284609-0.post@n2.nabble.com> Message-ID: Hello Antoine, What you are doing is correct. What I would do is that I would use the smallest value of the spacing and create an isotropic output image (similar to what you are doing with setting your output spacing to {0.1,0.1,0.1}, but in an automatic manner. The only reason I can think of why you are getting an enterely black output image is maybe because your output image space does not cover your transformed image. If you decrease the spacing, you also need to adjust the image size to make sure that your transformed image will be contained in the output image space. I created a project a long time ago that computes the output image space based on an input image and a transform [1]. Maybe looking at that project will help you. Hope this helps, Francois [1] https://github.com/fbudin69500/ITKTransformTools/blob/master/GetNewSizeAndOrigin.cxx On Tue, Sep 12, 2017 at 5:41 AM, g2 wrote: > Hi all, > > I am trying to rotate in 3D with a arbitrary rotation matrix a 3D image > with > non uniform spacing (0.15, 0.15, 0.19). I am currently using > itk::AffineTransform because at some point in the future I would like to > introduce a translation. My question is about the spacing of the output > image. Since my rotation matrix can be anything, I cannot just re-use the > spacing of my original image. I actually do not care to much about the > output spacing, it can be the same, it can be isotropic, whatever as long > as > the data makes sense. > > here is a bit of code of what I've done so far: > > typedef itk::Image Image3d; > Image3d::Pointer itkImage = getImageSomehow(); > typedef itk::AffineTransform TransformType; > TransformType::Pointer Rt = TransformType::New(); > TransformType::ParametersType params(12); > for (int i = 0; i < 9; i++){ > params[i] = R[i/3][i%3]; // R is the rotation matrix of type > double[3][3] > } > params[9] = 0; > params[10] = 0; > params[11] = 0; > > Rt->SetParameters(params); > > typedef itk::ResampleImageFilter FilterType; > FilterType::Pointer filter = FilterType::New(); > typedef itk::NearestNeighborInterpolateImageFunction > InterpolatorType; > InterpolatorType::Pointer interpolator = InterpolatorType::New(); > filter->SetInterpolator(interpolator); > filter->SetDefaultPixelValue(255); > filter->SetOutputOrigin(itkImage->GetOrigin()); > filter->SetOutputSpacing(itkImage->GetSpacing()); > //double outSpacing[3] = { 0.1, 0.1, 0.1 }; > //filter->SetOutputSpacing(outSpacing); > filter->SetSize(itkImage->GetLargestPossibleRegion().GetSize()); > filter->SetOutputDirection(itkImage->GetDirection()); > filter->SetInput(itkImage); > filter->SetTransform(Rt); > filter->Update(); > > > After this when I save filter->GetOutput() and open it with IKT-Snap I can > see my new image properly rotated. But it has the same spacing as the input > image, as specified with filter->SetOutputSpacing(itkImage->GetSpacing()); > and to me this doesn't make sense. The axes are rotated and so should be > the > spacing. When I try to put some other values, such as (0.1, 0.1, 0.1). The > output image is all black. I'm confused because to me those values are not > more erroneous than a plain copy of the input spacing. > > Questions : > I want to rotate a generic 3D image with anisotropic spacing with a generic > rotation matrix (i.e. not around a single axis and not with a n*90? angle) > so that any physical point P in the original volumes maps to R*P in the > final one. How should I proceed ? > > thanks > > > > -- > Sent from: http://itk-insight-users.2283740.n2.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: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 antoine.letouzey at gmail.com Tue Sep 12 10:43:15 2017 From: antoine.letouzey at gmail.com (Antoine) Date: Tue, 12 Sep 2017 16:43:15 +0200 Subject: [ITK] [ITK-users] Rotation of anisotropic 3D image In-Reply-To: References: <1505209284609-0.post@n2.nabble.com> Message-ID: Hi Francois, This was an issue indeed. Varying the isotropic spacing to from {0.1,0.1,0.1} to {0.5, 0.5, 0.5} I can see the corresponding output images "drift" as the spacing increase. That covers the black image. My next issue is to get pixel coordinates of a 3d point P'_pix in physical space after transformation, when all I know about that point is its physical position P_phys before rotation. Mathematically it's quite straightforward in physical space: P'_phys = R*P_phys But then I need to convert this to pixel coordinates. I tried using filter->GetOutput()->TransformPhysicalPointToIndex(Pp, Pp_pix); but the result unsatisfactory, the output coordinates is far from what I read by pointing at the same point in ITK-Snap. The result I get are not off by much but they are not close either. ie (21,891,1027) against (319, 22, 210). compare to the code shown above I've tried setting filter output origin and direction not to the ones of the input image but to their rotated variant. Bellow is some pseudo-code that illustrate this. filter->SetOutputOrigin(R*itkImage->GetOrigin()); filter->SetOutputDirection(R*itkImage->GetDirection()); Ultimately my goal is to crop a region of 1cm around a arbitrary 3D segment. Knowing only the physical position of the segment end points. See my awesome drawing for a 2D example of what I try to achieve. https://i.imgur.com/39l3raP.png Before cropping the image I need to re-orient it so that the segment aligns with one of the image axis, I chose X (1,0,0) but it doesn't matter. I got that part working, as I can see my segment aligned with the chosen axis in the temporary output image. Also I know computing such a rotation is an under-constrained problem and there are an infinity of solutions, but I'm fine with any of those. But now I struggle getting proper "start" and "size" values for this piece of code coming afterward: Image3d::IndexType start; Image3d::SizeType size; //--- // missing code to get start and size right, in pixel space. //--- Image3d::RegionType desiredRegion(start, size); typedef itk::ExtractImageFilter< Image3d, Image3d > CropFilterType; CropFilterType::Pointer cropFilter = CropFilterType::New(); cropFilter->SetExtractionRegion(desiredRegion); cropFilter->SetInput(filter->GetOutput()); cropFilter->SetDirectionCollapseToIdentity(); cropFilter->Update(); Image3d::Pointer cropOut = cropFilter->GetOutput(); when I set by hand pixel values I read from ITK-snap for start and size, this works like a charm. But I struggle to get those values automatiocally. Cheers, A. https://i.imgur.com/39l3raP.png 2017-09-12 14:55 GMT+02:00 Francois Budin : > Hello Antoine, > > What you are doing is correct. What I would do is that I would use the > smallest value of the spacing and create an isotropic output image (similar > to what you are doing with setting your output spacing to {0.1,0.1,0.1}, > but in an automatic manner. > The only reason I can think of why you are getting an enterely black > output image is maybe because your output image space does not cover your > transformed image. If you decrease the spacing, you also need to adjust the > image size to make sure that your transformed image will be contained in > the output image space. > I created a project a long time ago that computes the output image space > based on an input image and a transform [1]. Maybe looking at that project > will help you. > > Hope this helps, > Francois > > [1] https://github.com/fbudin69500/ITKTransformTools/blob/master/ > GetNewSizeAndOrigin.cxx > > On Tue, Sep 12, 2017 at 5:41 AM, g2 wrote: > >> Hi all, >> >> I am trying to rotate in 3D with a arbitrary rotation matrix a 3D image >> with >> non uniform spacing (0.15, 0.15, 0.19). I am currently using >> itk::AffineTransform because at some point in the future I would like to >> introduce a translation. My question is about the spacing of the output >> image. Since my rotation matrix can be anything, I cannot just re-use the >> spacing of my original image. I actually do not care to much about the >> output spacing, it can be the same, it can be isotropic, whatever as long >> as >> the data makes sense. >> >> here is a bit of code of what I've done so far: >> >> typedef itk::Image Image3d; >> Image3d::Pointer itkImage = getImageSomehow(); >> typedef itk::AffineTransform TransformType; >> TransformType::Pointer Rt = TransformType::New(); >> TransformType::ParametersType params(12); >> for (int i = 0; i < 9; i++){ >> params[i] = R[i/3][i%3]; // R is the rotation matrix of type >> double[3][3] >> } >> params[9] = 0; >> params[10] = 0; >> params[11] = 0; >> >> Rt->SetParameters(params); >> >> typedef itk::ResampleImageFilter FilterType; >> FilterType::Pointer filter = FilterType::New(); >> typedef itk::NearestNeighborInterpolateImageFunction >> InterpolatorType; >> InterpolatorType::Pointer interpolator = InterpolatorType::New(); >> filter->SetInterpolator(interpolator); >> filter->SetDefaultPixelValue(255); >> filter->SetOutputOrigin(itkImage->GetOrigin()); >> filter->SetOutputSpacing(itkImage->GetSpacing()); >> //double outSpacing[3] = { 0.1, 0.1, 0.1 }; >> //filter->SetOutputSpacing(outSpacing); >> filter->SetSize(itkImage->GetLargestPossibleRegion().GetSize()); >> filter->SetOutputDirection(itkImage->GetDirection()); >> filter->SetInput(itkImage); >> filter->SetTransform(Rt); >> filter->Update(); >> >> >> After this when I save filter->GetOutput() and open it with IKT-Snap I can >> see my new image properly rotated. But it has the same spacing as the >> input >> image, as specified with filter->SetOutputSpacing(itkIm >> age->GetSpacing()); >> and to me this doesn't make sense. The axes are rotated and so should be >> the >> spacing. When I try to put some other values, such as (0.1, 0.1, 0.1). The >> output image is all black. I'm confused because to me those values are not >> more erroneous than a plain copy of the input spacing. >> >> Questions : >> I want to rotate a generic 3D image with anisotropic spacing with a >> generic >> rotation matrix (i.e. not around a single axis and not with a n*90? angle) >> so that any physical point P in the original volumes maps to R*P in the >> final one. How should I proceed ? >> >> thanks >> >> >> >> -- >> Sent from: http://itk-insight-users.2283740.n2.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: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From dzenanz at gmail.com Tue Sep 12 11:13:02 2017 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Tue, 12 Sep 2017 11:13:02 -0400 Subject: [ITK] [ITK-users] Rotation of anisotropic 3D image In-Reply-To: References: <1505209284609-0.post@n2.nabble.com> Message-ID: Hi Antoine, filter->GetOutput()->TransformPhysicalPointToIndex(Pp, Pp_pix); should work, but it can only be called after filter->Update(); If this does not resolve your issue, can you provide a complete example with some data? Regards, D?enan Zuki?, PhD, Senior R&D Engineer, Kitware (Carrboro, N.C.) On Tue, Sep 12, 2017 at 10:43 AM, Antoine wrote: > Hi Francois, > > This was an issue indeed. Varying the isotropic spacing to from > {0.1,0.1,0.1} to {0.5, 0.5, 0.5} I can see the corresponding output images > "drift" as the spacing increase. That covers the black image. > > > My next issue is to get pixel coordinates of a 3d point P'_pix in physical > space after transformation, when all I know about that point is its > physical position P_phys before rotation. > > Mathematically it's quite straightforward in physical space: > P'_phys = R*P_phys > > But then I need to convert this to pixel coordinates. I tried > using filter->GetOutput()->TransformPhysicalPointToIndex(Pp, Pp_pix); > but the result unsatisfactory, the output coordinates is far from what I > read by pointing at the same point in ITK-Snap. > The result I get are not off by much but they are not close either. ie > (21,891,1027) against (319, 22, 210). > > compare to the code shown above I've tried setting filter output origin > and direction not to the ones of the input image but to their rotated > variant. Bellow is some pseudo-code that illustrate this. > filter->SetOutputOrigin(R*itkImage->GetOrigin()); > filter->SetOutputDirection(R*itkImage->GetDirection()); > > > Ultimately my goal is to crop a region of 1cm around a arbitrary 3D > segment. Knowing only the physical position of the segment end points. See > my awesome drawing for a 2D example of what I try to achieve. > https://i.imgur.com/39l3raP.png > Before cropping the image I need to re-orient it so that the segment > aligns with one of the image axis, I chose X (1,0,0) but it doesn't > matter. I got that part working, as I can see my segment aligned with the > chosen axis in the temporary output image. Also I know computing such a > rotation is an under-constrained problem and there are an infinity of > solutions, but I'm fine with any of those. > > But now I struggle getting proper "start" and "size" values for this piece > of code coming afterward: > > Image3d::IndexType start; > Image3d::SizeType size; > > //--- > // missing code to get start and size right, in pixel space. > //--- > > Image3d::RegionType desiredRegion(start, size); > typedef itk::ExtractImageFilter< Image3d, Image3d > CropFilterType; > CropFilterType::Pointer cropFilter = CropFilterType::New(); > cropFilter->SetExtractionRegion(desiredRegion); > cropFilter->SetInput(filter->GetOutput()); > cropFilter->SetDirectionCollapseToIdentity(); > cropFilter->Update(); > Image3d::Pointer cropOut = cropFilter->GetOutput(); > > > when I set by hand pixel values I read from ITK-snap for start and size, > this works like a charm. But I struggle to get those values automatiocally. > > > Cheers, > > A. > > https://i.imgur.com/39l3raP.png > > > 2017-09-12 14:55 GMT+02:00 Francois Budin : > >> Hello Antoine, >> >> What you are doing is correct. What I would do is that I would use the >> smallest value of the spacing and create an isotropic output image (similar >> to what you are doing with setting your output spacing to {0.1,0.1,0.1}, >> but in an automatic manner. >> The only reason I can think of why you are getting an enterely black >> output image is maybe because your output image space does not cover your >> transformed image. If you decrease the spacing, you also need to adjust the >> image size to make sure that your transformed image will be contained in >> the output image space. >> I created a project a long time ago that computes the output image space >> based on an input image and a transform [1]. Maybe looking at that project >> will help you. >> >> Hope this helps, >> Francois >> >> [1] https://github.com/fbudin69500/ITKTransformTools/blob/ >> master/GetNewSizeAndOrigin.cxx >> >> On Tue, Sep 12, 2017 at 5:41 AM, g2 wrote: >> >>> Hi all, >>> >>> I am trying to rotate in 3D with a arbitrary rotation matrix a 3D image >>> with >>> non uniform spacing (0.15, 0.15, 0.19). I am currently using >>> itk::AffineTransform because at some point in the future I would like to >>> introduce a translation. My question is about the spacing of the output >>> image. Since my rotation matrix can be anything, I cannot just re-use the >>> spacing of my original image. I actually do not care to much about the >>> output spacing, it can be the same, it can be isotropic, whatever as >>> long as >>> the data makes sense. >>> >>> here is a bit of code of what I've done so far: >>> >>> typedef itk::Image Image3d; >>> Image3d::Pointer itkImage = getImageSomehow(); >>> typedef itk::AffineTransform TransformType; >>> TransformType::Pointer Rt = TransformType::New(); >>> TransformType::ParametersType params(12); >>> for (int i = 0; i < 9; i++){ >>> params[i] = R[i/3][i%3]; // R is the rotation matrix of type >>> double[3][3] >>> } >>> params[9] = 0; >>> params[10] = 0; >>> params[11] = 0; >>> >>> Rt->SetParameters(params); >>> >>> typedef itk::ResampleImageFilter FilterType; >>> FilterType::Pointer filter = FilterType::New(); >>> typedef itk::NearestNeighborInterpolateImageFunction >>> InterpolatorType; >>> InterpolatorType::Pointer interpolator = InterpolatorType::New(); >>> filter->SetInterpolator(interpolator); >>> filter->SetDefaultPixelValue(255); >>> filter->SetOutputOrigin(itkImage->GetOrigin()); >>> filter->SetOutputSpacing(itkImage->GetSpacing()); >>> //double outSpacing[3] = { 0.1, 0.1, 0.1 }; >>> //filter->SetOutputSpacing(outSpacing); >>> filter->SetSize(itkImage->GetLargestPossibleRegion().GetSize()); >>> filter->SetOutputDirection(itkImage->GetDirection()); >>> filter->SetInput(itkImage); >>> filter->SetTransform(Rt); >>> filter->Update(); >>> >>> >>> After this when I save filter->GetOutput() and open it with IKT-Snap I >>> can >>> see my new image properly rotated. But it has the same spacing as the >>> input >>> image, as specified with filter->SetOutputSpacing(itkIm >>> age->GetSpacing()); >>> and to me this doesn't make sense. The axes are rotated and so should be >>> the >>> spacing. When I try to put some other values, such as (0.1, 0.1, 0.1). >>> The >>> output image is all black. I'm confused because to me those values are >>> not >>> more erroneous than a plain copy of the input spacing. >>> >>> Questions : >>> I want to rotate a generic 3D image with anisotropic spacing with a >>> generic >>> rotation matrix (i.e. not around a single axis and not with a n*90? >>> angle) >>> so that any physical point P in the original volumes maps to R*P in the >>> final one. How should I proceed ? >>> >>> thanks >>> >>> >>> >>> -- >>> Sent from: http://itk-insight-users.2283740.n2.nabble.com/ >>> _____________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://www.kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the ITK FAQ at: >>> http://www.itk.org/Wiki/ITK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/insight-users >>> >> >> > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 antoine.letouzey at gmail.com Tue Sep 12 11:33:46 2017 From: antoine.letouzey at gmail.com (Antoine) Date: Tue, 12 Sep 2017 17:33:46 +0200 Subject: [ITK] [ITK-users] Rotation of anisotropic 3D image In-Reply-To: References: <1505209284609-0.post@n2.nabble.com> Message-ID: Hi D?enan, I do call filter->Update() before filter->GetOutput()-> TransformPhysicalPointToIndex(Pp, Pp_pix). I'll try to get you a meaningful volume data along with a standalone piece of code by tomorrow. (company code + anonymous medical data = cannot share as is). And I guess it's going to help me get things straight and clean. thanks for your interest. A. 2017-09-12 17:13 GMT+02:00 D?enan Zuki? : > Hi Antoine, > > filter->GetOutput()->TransformPhysicalPointToIndex(Pp, Pp_pix); should > work, but it can only be called after filter->Update(); > > If this does not resolve your issue, can you provide a complete example > with some data? > > Regards, > D?enan Zuki?, PhD, Senior R&D Engineer, Kitware (Carrboro, N.C.) > > On Tue, Sep 12, 2017 at 10:43 AM, Antoine > wrote: > >> Hi Francois, >> >> This was an issue indeed. Varying the isotropic spacing to from >> {0.1,0.1,0.1} to {0.5, 0.5, 0.5} I can see the corresponding output images >> "drift" as the spacing increase. That covers the black image. >> >> >> My next issue is to get pixel coordinates of a 3d point P'_pix in >> physical space after transformation, when all I know about that point is >> its physical position P_phys before rotation. >> >> Mathematically it's quite straightforward in physical space: >> P'_phys = R*P_phys >> >> But then I need to convert this to pixel coordinates. I tried >> using filter->GetOutput()->TransformPhysicalPointToIndex(Pp, Pp_pix); >> but the result unsatisfactory, the output coordinates is far from what I >> read by pointing at the same point in ITK-Snap. >> The result I get are not off by much but they are not close either. ie >> (21,891,1027) against (319, 22, 210). >> >> compare to the code shown above I've tried setting filter output origin >> and direction not to the ones of the input image but to their rotated >> variant. Bellow is some pseudo-code that illustrate this. >> filter->SetOutputOrigin(R*itkImage->GetOrigin()); >> filter->SetOutputDirection(R*itkImage->GetDirection()); >> >> >> Ultimately my goal is to crop a region of 1cm around a arbitrary 3D >> segment. Knowing only the physical position of the segment end points. See >> my awesome drawing for a 2D example of what I try to achieve. >> https://i.imgur.com/39l3raP.png >> Before cropping the image I need to re-orient it so that the segment >> aligns with one of the image axis, I chose X (1,0,0) but it doesn't >> matter. I got that part working, as I can see my segment aligned with the >> chosen axis in the temporary output image. Also I know computing such a >> rotation is an under-constrained problem and there are an infinity of >> solutions, but I'm fine with any of those. >> >> But now I struggle getting proper "start" and "size" values for this >> piece of code coming afterward: >> >> Image3d::IndexType start; >> Image3d::SizeType size; >> >> //--- >> // missing code to get start and size right, in pixel space. >> //--- >> >> Image3d::RegionType desiredRegion(start, size); >> typedef itk::ExtractImageFilter< Image3d, Image3d > CropFilterType; >> CropFilterType::Pointer cropFilter = CropFilterType::New(); >> cropFilter->SetExtractionRegion(desiredRegion); >> cropFilter->SetInput(filter->GetOutput()); >> cropFilter->SetDirectionCollapseToIdentity(); >> cropFilter->Update(); >> Image3d::Pointer cropOut = cropFilter->GetOutput(); >> >> >> when I set by hand pixel values I read from ITK-snap for start and size, >> this works like a charm. But I struggle to get those values automatiocally. >> >> >> Cheers, >> >> A. >> >> https://i.imgur.com/39l3raP.png >> >> >> 2017-09-12 14:55 GMT+02:00 Francois Budin : >> >>> Hello Antoine, >>> >>> What you are doing is correct. What I would do is that I would use the >>> smallest value of the spacing and create an isotropic output image (similar >>> to what you are doing with setting your output spacing to {0.1,0.1,0.1}, >>> but in an automatic manner. >>> The only reason I can think of why you are getting an enterely black >>> output image is maybe because your output image space does not cover your >>> transformed image. If you decrease the spacing, you also need to adjust the >>> image size to make sure that your transformed image will be contained in >>> the output image space. >>> I created a project a long time ago that computes the output image space >>> based on an input image and a transform [1]. Maybe looking at that project >>> will help you. >>> >>> Hope this helps, >>> Francois >>> >>> [1] https://github.com/fbudin69500/ITKTransformTools/blob/master >>> /GetNewSizeAndOrigin.cxx >>> >>> On Tue, Sep 12, 2017 at 5:41 AM, g2 wrote: >>> >>>> Hi all, >>>> >>>> I am trying to rotate in 3D with a arbitrary rotation matrix a 3D image >>>> with >>>> non uniform spacing (0.15, 0.15, 0.19). I am currently using >>>> itk::AffineTransform because at some point in the future I would like to >>>> introduce a translation. My question is about the spacing of the output >>>> image. Since my rotation matrix can be anything, I cannot just re-use >>>> the >>>> spacing of my original image. I actually do not care to much about the >>>> output spacing, it can be the same, it can be isotropic, whatever as >>>> long as >>>> the data makes sense. >>>> >>>> here is a bit of code of what I've done so far: >>>> >>>> typedef itk::Image Image3d; >>>> Image3d::Pointer itkImage = getImageSomehow(); >>>> typedef itk::AffineTransform TransformType; >>>> TransformType::Pointer Rt = TransformType::New(); >>>> TransformType::ParametersType params(12); >>>> for (int i = 0; i < 9; i++){ >>>> params[i] = R[i/3][i%3]; // R is the rotation matrix of type >>>> double[3][3] >>>> } >>>> params[9] = 0; >>>> params[10] = 0; >>>> params[11] = 0; >>>> >>>> Rt->SetParameters(params); >>>> >>>> typedef itk::ResampleImageFilter FilterType; >>>> FilterType::Pointer filter = FilterType::New(); >>>> typedef itk::NearestNeighborInterpolateImageFunction >>>> InterpolatorType; >>>> InterpolatorType::Pointer interpolator = InterpolatorType::New(); >>>> filter->SetInterpolator(interpolator); >>>> filter->SetDefaultPixelValue(255); >>>> filter->SetOutputOrigin(itkImage->GetOrigin()); >>>> filter->SetOutputSpacing(itkImage->GetSpacing()); >>>> //double outSpacing[3] = { 0.1, 0.1, 0.1 }; >>>> //filter->SetOutputSpacing(outSpacing); >>>> filter->SetSize(itkImage->GetLargestPossibleRegion().GetSize()); >>>> filter->SetOutputDirection(itkImage->GetDirection()); >>>> filter->SetInput(itkImage); >>>> filter->SetTransform(Rt); >>>> filter->Update(); >>>> >>>> >>>> After this when I save filter->GetOutput() and open it with IKT-Snap I >>>> can >>>> see my new image properly rotated. But it has the same spacing as the >>>> input >>>> image, as specified with filter->SetOutputSpacing(itkIm >>>> age->GetSpacing()); >>>> and to me this doesn't make sense. The axes are rotated and so should >>>> be the >>>> spacing. When I try to put some other values, such as (0.1, 0.1, 0.1). >>>> The >>>> output image is all black. I'm confused because to me those values are >>>> not >>>> more erroneous than a plain copy of the input spacing. >>>> >>>> Questions : >>>> I want to rotate a generic 3D image with anisotropic spacing with a >>>> generic >>>> rotation matrix (i.e. not around a single axis and not with a n*90? >>>> angle) >>>> so that any physical point P in the original volumes maps to R*P in the >>>> final one. How should I proceed ? >>>> >>>> thanks >>>> >>>> >>>> >>>> -- >>>> Sent from: http://itk-insight-users.2283740.n2.nabble.com/ >>>> _____________________________________ >>>> Powered by www.kitware.com >>>> >>>> Visit other Kitware open-source projects at >>>> http://www.kitware.com/opensource/opensource.html >>>> >>>> Kitware offers ITK Training Courses, for more information visit: >>>> http://www.kitware.com/products/protraining.php >>>> >>>> Please keep messages on-topic and check the ITK FAQ at: >>>> http://www.itk.org/Wiki/ITK_FAQ >>>> >>>> Follow this link to subscribe/unsubscribe: >>>> http://public.kitware.com/mailman/listinfo/insight-users >>>> >>> >>> >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 francois.budin at kitware.com Tue Sep 12 14:11:40 2017 From: francois.budin at kitware.com (Francois Budin) Date: Tue, 12 Sep 2017 14:11:40 -0400 Subject: [ITK] [ITK-users] Rotation of anisotropic 3D image In-Reply-To: References: <1505209284609-0.post@n2.nabble.com> Message-ID: Hello Antoine, I think you are missing a step in your computation: 1) You need to trnasform your point before rotation to find its position after transformation. You can directly use the affine transform for that: affineTransform->TransformPoint(my_point) 2) Compute the index of the transformed point: filter->GetOutput()->TransformPhysicalPointToIndex(Pp, Pp_pix); I think you forgot to compute 1) Hope this helps, Francois On Tue, Sep 12, 2017 at 11:33 AM, Antoine wrote: > Hi D?enan, > I do call filter->Update() before filter->GetOutput()->Tr > ansformPhysicalPointToIndex(Pp, Pp_pix). > > I'll try to get you a meaningful volume data along with a standalone piece > of code by tomorrow. (company code + anonymous medical data = cannot share > as is). And I guess it's going to help me get things straight and clean. > > thanks for your interest. > > A. > > > > 2017-09-12 17:13 GMT+02:00 D?enan Zuki? : > >> Hi Antoine, >> >> filter->GetOutput()->TransformPhysicalPointToIndex(Pp, Pp_pix); should >> work, but it can only be called after filter->Update(); >> >> If this does not resolve your issue, can you provide a complete example >> with some data? >> >> Regards, >> D?enan Zuki?, PhD, Senior R&D Engineer, Kitware (Carrboro, N.C.) >> >> On Tue, Sep 12, 2017 at 10:43 AM, Antoine >> wrote: >> >>> Hi Francois, >>> >>> This was an issue indeed. Varying the isotropic spacing to from >>> {0.1,0.1,0.1} to {0.5, 0.5, 0.5} I can see the corresponding output images >>> "drift" as the spacing increase. That covers the black image. >>> >>> >>> My next issue is to get pixel coordinates of a 3d point P'_pix in >>> physical space after transformation, when all I know about that point is >>> its physical position P_phys before rotation. >>> >>> Mathematically it's quite straightforward in physical space: >>> P'_phys = R*P_phys >>> >>> But then I need to convert this to pixel coordinates. I tried >>> using filter->GetOutput()->TransformPhysicalPointToIndex(Pp, Pp_pix); >>> but the result unsatisfactory, the output coordinates is far from what >>> I read by pointing at the same point in ITK-Snap. >>> The result I get are not off by much but they are not close either. ie >>> (21,891,1027) against (319, 22, 210). >>> >>> compare to the code shown above I've tried setting filter output origin >>> and direction not to the ones of the input image but to their rotated >>> variant. Bellow is some pseudo-code that illustrate this. >>> filter->SetOutputOrigin(R*itkImage->GetOrigin()); >>> filter->SetOutputDirection(R*itkImage->GetDirection()); >>> >>> >>> Ultimately my goal is to crop a region of 1cm around a arbitrary 3D >>> segment. Knowing only the physical position of the segment end points. See >>> my awesome drawing for a 2D example of what I try to achieve. >>> https://i.imgur.com/39l3raP.png >>> Before cropping the image I need to re-orient it so that the segment >>> aligns with one of the image axis, I chose X (1,0,0) but it doesn't >>> matter. I got that part working, as I can see my segment aligned with the >>> chosen axis in the temporary output image. Also I know computing such a >>> rotation is an under-constrained problem and there are an infinity of >>> solutions, but I'm fine with any of those. >>> >>> But now I struggle getting proper "start" and "size" values for this >>> piece of code coming afterward: >>> >>> Image3d::IndexType start; >>> Image3d::SizeType size; >>> >>> //--- >>> // missing code to get start and size right, in pixel space. >>> //--- >>> >>> Image3d::RegionType desiredRegion(start, size); >>> typedef itk::ExtractImageFilter< Image3d, Image3d > CropFilterType; >>> CropFilterType::Pointer cropFilter = CropFilterType::New(); >>> cropFilter->SetExtractionRegion(desiredRegion); >>> cropFilter->SetInput(filter->GetOutput()); >>> cropFilter->SetDirectionCollapseToIdentity(); >>> cropFilter->Update(); >>> Image3d::Pointer cropOut = cropFilter->GetOutput(); >>> >>> >>> when I set by hand pixel values I read from ITK-snap for start and size, >>> this works like a charm. But I struggle to get those values automatiocally. >>> >>> >>> Cheers, >>> >>> A. >>> >>> https://i.imgur.com/39l3raP.png >>> >>> >>> 2017-09-12 14:55 GMT+02:00 Francois Budin : >>> >>>> Hello Antoine, >>>> >>>> What you are doing is correct. What I would do is that I would use the >>>> smallest value of the spacing and create an isotropic output image (similar >>>> to what you are doing with setting your output spacing to {0.1,0.1,0.1}, >>>> but in an automatic manner. >>>> The only reason I can think of why you are getting an enterely black >>>> output image is maybe because your output image space does not cover your >>>> transformed image. If you decrease the spacing, you also need to adjust the >>>> image size to make sure that your transformed image will be contained in >>>> the output image space. >>>> I created a project a long time ago that computes the output image >>>> space based on an input image and a transform [1]. Maybe looking at that >>>> project will help you. >>>> >>>> Hope this helps, >>>> Francois >>>> >>>> [1] https://github.com/fbudin69500/ITKTransformTools/blob/master >>>> /GetNewSizeAndOrigin.cxx >>>> >>>> On Tue, Sep 12, 2017 at 5:41 AM, g2 wrote: >>>> >>>>> Hi all, >>>>> >>>>> I am trying to rotate in 3D with a arbitrary rotation matrix a 3D >>>>> image with >>>>> non uniform spacing (0.15, 0.15, 0.19). I am currently using >>>>> itk::AffineTransform because at some point in the future I would like >>>>> to >>>>> introduce a translation. My question is about the spacing of the output >>>>> image. Since my rotation matrix can be anything, I cannot just re-use >>>>> the >>>>> spacing of my original image. I actually do not care to much about the >>>>> output spacing, it can be the same, it can be isotropic, whatever as >>>>> long as >>>>> the data makes sense. >>>>> >>>>> here is a bit of code of what I've done so far: >>>>> >>>>> typedef itk::Image Image3d; >>>>> Image3d::Pointer itkImage = getImageSomehow(); >>>>> typedef itk::AffineTransform TransformType; >>>>> TransformType::Pointer Rt = TransformType::New(); >>>>> TransformType::ParametersType params(12); >>>>> for (int i = 0; i < 9; i++){ >>>>> params[i] = R[i/3][i%3]; // R is the rotation matrix of type >>>>> double[3][3] >>>>> } >>>>> params[9] = 0; >>>>> params[10] = 0; >>>>> params[11] = 0; >>>>> >>>>> Rt->SetParameters(params); >>>>> >>>>> typedef itk::ResampleImageFilter FilterType; >>>>> FilterType::Pointer filter = FilterType::New(); >>>>> typedef itk::NearestNeighborInterpolateImageFunction >>>>> InterpolatorType; >>>>> InterpolatorType::Pointer interpolator = InterpolatorType::New(); >>>>> filter->SetInterpolator(interpolator); >>>>> filter->SetDefaultPixelValue(255); >>>>> filter->SetOutputOrigin(itkImage->GetOrigin()); >>>>> filter->SetOutputSpacing(itkImage->GetSpacing()); >>>>> //double outSpacing[3] = { 0.1, 0.1, 0.1 }; >>>>> //filter->SetOutputSpacing(outSpacing); >>>>> filter->SetSize(itkImage->GetLargestPossibleRegion().GetSize()); >>>>> filter->SetOutputDirection(itkImage->GetDirection()); >>>>> filter->SetInput(itkImage); >>>>> filter->SetTransform(Rt); >>>>> filter->Update(); >>>>> >>>>> >>>>> After this when I save filter->GetOutput() and open it with IKT-Snap I >>>>> can >>>>> see my new image properly rotated. But it has the same spacing as the >>>>> input >>>>> image, as specified with filter->SetOutputSpacing(itkIm >>>>> age->GetSpacing()); >>>>> and to me this doesn't make sense. The axes are rotated and so should >>>>> be the >>>>> spacing. When I try to put some other values, such as (0.1, 0.1, 0.1). >>>>> The >>>>> output image is all black. I'm confused because to me those values are >>>>> not >>>>> more erroneous than a plain copy of the input spacing. >>>>> >>>>> Questions : >>>>> I want to rotate a generic 3D image with anisotropic spacing with a >>>>> generic >>>>> rotation matrix (i.e. not around a single axis and not with a n*90? >>>>> angle) >>>>> so that any physical point P in the original volumes maps to R*P in the >>>>> final one. How should I proceed ? >>>>> >>>>> thanks >>>>> >>>>> >>>>> >>>>> -- >>>>> Sent from: http://itk-insight-users.2283740.n2.nabble.com/ >>>>> _____________________________________ >>>>> Powered by www.kitware.com >>>>> >>>>> Visit other Kitware open-source projects at >>>>> http://www.kitware.com/opensource/opensource.html >>>>> >>>>> Kitware offers ITK Training Courses, for more information visit: >>>>> http://www.kitware.com/products/protraining.php >>>>> >>>>> Please keep messages on-topic and check the ITK FAQ at: >>>>> http://www.itk.org/Wiki/ITK_FAQ >>>>> >>>>> Follow this link to subscribe/unsubscribe: >>>>> http://public.kitware.com/mailman/listinfo/insight-users >>>>> >>>> >>>> >>> >>> _____________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://www.kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the ITK FAQ at: >>> http://www.itk.org/Wiki/ITK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/insight-users >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 Tue Sep 12 15:09:23 2017 From: blowekamp at mail.nih.gov (Lowekamp, Bradley (NIH/NLM/LHC) [C]) Date: Tue, 12 Sep 2017 19:09:23 +0000 Subject: [ITK] [ITK-users] Can I alter the way SliceBySliceImageFilter defines the origin of the internal slices? In-Reply-To: <1505212762750-0.post@n7.nabble.com> References: <1504877491197-0.post@n7.nabble.com> <1504881527156-0.post@n7.nabble.com> <1504883604903-0.post@n7.nabble.com> <1505122781018-0.post@n7.nabble.com> <1505212762750-0.post@n7.nabble.com> Message-ID: Thank you for testing the patch, and confirming the non-zero index was the cause. The fix has been merged into ITK master. Brad On 9/12/17, 6:40 AM, "hellman" wrote: I tried shifting the origin such that the input image had region index 0 and then it worked. I also applied the patch http://review.source.kitware.com/#/c/22601/ and now it works also with non-zero region index in my case, so my particular problem is solved by this patch. -- Sent from: http://itk-users.7.n7.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 s2atoru at gmail.com Tue Sep 12 19:07:59 2017 From: s2atoru at gmail.com (Satoru Sugimoto) Date: Wed, 13 Sep 2017 08:07:59 +0900 Subject: [ITK] =?utf-8?b?Q29tbXVuaXR5IERpZ2VzdCwgVm9sIDQ4LCDjgIDjgIDjgIA=?= =?utf-8?b?44CASXNzdWUgMTU=?= In-Reply-To: References: Message-ID: 2017/09/12 19:39 : > Send Community mailing list submissions to > community at itk.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://public.kitware.com/mailman/listinfo/community > or, via email, send a message with subject or body 'help' to > community-request at itk.org > > You can reach the person managing the list at > community-owner at itk.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Community digest..." > > > Today's Topics: > > 1. Re: [ITK-dev] problems itk resample filter (Matt McCormick) > 2. [ITK-users] Rotation of anisotropic 3D image (g2) > 3. Re: [ITK-users] Can I alter the way SliceBySliceImageFilter > defines the origin of the internal slices? (hellman) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Mon, 11 Sep 2017 14:23:13 -0400 > From: Matt McCormick > To: "Pfaehler, EAG (ngmb)" > Cc: "insight-developers at itk.org" > Subject: Re: [ITK] [ITK-dev] problems itk resample filter > Message-ID: > mail.gmail.com> > Content-Type: text/plain; charset="utf-8" > > Hi, > > One possible issue - make sure that the image viewer applied is > displaying the correct dynamic range so it does just not appear that > there are only zeros after interpolation. 3D Slicer, ITK-SNAP, etc. > support this. > > HTH, > Matt > > > > On Sat, Sep 9, 2017 at 1:49 AM, Pfaehler, EAG (ngmb) > wrote: > > Hey, > > > > thanks. I did this, but it did not change anything. However, I used > another image (with some higher intensity values) and then I got an image > with only 1s. > > > > Can it be the problem that my images have only values from 0-5? > > I also tried an image with only 0 and 1, but als here I get only zeros > after interpolation. > > > > ________________________________________ > > Van: Matt McCormick [matt.mccormick at kitware.com] > > Verzonden: vrijdag 8 september 2017 21:27 > > Aan: Pfaehler, EAG (ngmb) > > CC: Samuel Gerber; insight-developers at itk.org > > Onderwerp: Re: [ITK-dev] [ITK] problems itk resample filter > > > > Hi, > > > > The Origin should be the same in the resampled image. > > > > HTH, > > Matt > > > > On Fri, Sep 8, 2017 at 3:12 PM, Pfaehler, EAG (ngmb) > > wrote: > >> Thanks Samuel and Matt for the help. However, it is unfortunatly still > not working. > >> > >> I deleted the line resizeFilter->SetTransform, but unfortunately it did > not change anything. > >> > >> Then I tried to set the direction and the origin. But maybe here is the > problem. I set as direction the same direction as in the original image > because I do not want to have any rotation. > >> > >> But I am a bit insecure how to set the origin. First I set the origin > in the resampled image to the same as in the original image, what did not > work. > >> Then I tried different things, e.g > >> > >> origin[0] = origin[0] + inputSpacing[0] * (newWidth - oldWidth); > >> origin[1] = origin[1] + inputSpacing[1] * (newHeight - > oldHeight); > >> origin[2] = origin[2] + inputSpacing[2] * (newDepth - oldDepth); > >> > >> where newWidth etc is the width of the new image and oldWidth of the > original image. And origin[0] is the x value of the original origin etc. > >> > >> But this was also not working. ( In all of these cases I get an image > full of zeros. > >> > >> If I make originalImage->Print(std::cout) I get the following: > >> > >> Image (000000000282A800) > >> RTTI typeinfo: class itk::Image > >> Reference Count: 3 > >> Modified Time: 705 > >> Debug: Off > >> Object Name: > >> Observers: > >> none > >> Source: (none) > >> Source output name: (none) > >> Release Data: Off > >> Data Released: False > >> Global Release Data: Off > >> PipelineMTime: 692 > >> UpdateMTime: 704 > >> RealTimeStamp: 0 seconds > >> LargestPossibleRegion: > >> Dimension: 3 > >> Index: [0, 0, 0] > >> Size: [11, 11, 19] > >> BufferedRegion: > >> Dimension: 3 > >> Index: [0, 0, 0] > >> Size: [11, 11, 19] > >> RequestedRegion: > >> Dimension: 3 > >> Index: [0, 0, 0] > >> Size: [11, 11, 19] > >> Spacing: [3.1819, 3.1819, 2] > >> Origin: [48.5757, -171.979, 20.5] > >> Direction: > >> 1 0 0 > >> 0 1 0 > >> 0 0 1 > >> > >> IndexToPointMatrix: > >> 3.1819 0 0 > >> 0 3.1819 0 > >> 0 0 2 > >> > >> PointToIndexMatrix: > >> 0.314278 0 0 > >> 0 0.314278 0 > >> 0 0 0.5 > >> > >> Inverse Direction: > >> 1 0 0 > >> 0 1 0 > >> 0 0 1 > >> > >> PixelContainer: > >> ImportImageContainer (00000000027B59F0) > >> RTTI typeinfo: class itk::ImportImageContainer __int64,float> > >> Reference Count: 1 > >> Modified Time: 701 > >> Debug: Off > >> Object Name: > >> Observers: > >> none > >> Pointer: 00000000028542E0 > >> Container manages memory: true > >> Size: 2299 > >> Capacity: 2299 > >> > >> If I do the same for the resampled image I get: > >> > >> Image (000000000282B100) > >> RTTI typeinfo: class itk::Image > >> Reference Count: 2 > >> Modified Time: 11626 > >> Debug: Off > >> Object Name: > >> Observers: > >> none > >> Source: (000000000282BB80) > >> Source output name: Primary > >> Release Data: Off > >> Data Released: False > >> Global Release Data: Off > >> PipelineMTime: 11614 > >> UpdateMTime: 11627 > >> RealTimeStamp: 0 seconds > >> LargestPossibleRegion: > >> Dimension: 3 > >> Index: [0, 0, 0] > >> Size: [17, 17, 19] > >> BufferedRegion: > >> Dimension: 3 > >> Index: [0, 0, 0] > >> Size: [17, 17, 19] > >> RequestedRegion: > >> Dimension: 3 > >> Index: [0, 0, 0] > >> Size: [17, 17, 19] > >> Spacing: [2, 2, 2] > >> Origin: [67.6671, -152.888, 20.5] > >> Direction: > >> 1 0 0 > >> 0 1 0 > >> 0 0 1 > >> > >> IndexToPointMatrix: > >> 2 0 0 > >> 0 2 0 > >> 0 0 2 > >> > >> PointToIndexMatrix: > >> 0.5 0 0 > >> 0 0.5 0 > >> 0 0 0.5 > >> > >> Inverse Direction: > >> 1 0 0 > >> 0 1 0 > >> 0 0 1 > >> > >> PixelContainer: > >> ImportImageContainer (00000000027B5EC0) > >> RTTI typeinfo: class itk::ImportImageContainer __int64,float> > >> Reference Count: 1 > >> Modified Time: 11625 > >> Debug: Off > >> Object Name: > >> Observers: > >> none > >> Pointer: 0000000002A8D520 > >> Container manages memory: true > >> Size: 5491 > >> Capacity: 5491 > >> > >> Does that maybe help to find out whats going wrong? > >> > >> Thanks in advance > >> > >> > >> > >> ________________________________________ > >> Van: Matt McCormick [matt.mccormick at kitware.com] > >> Verzonden: vrijdag 8 september 2017 15:32 > >> Aan: Pfaehler, EAG (ngmb) > >> CC: Samuel Gerber; insight-developers at itk.org > >> Onderwerp: Re: [ITK-dev] [ITK] problems itk resample filter > >> > >> Hi Elli, > >> > >> The OutputOrigin and OutputDirection may need to be set so the > >> sampling grids overlap. > >> > >> HTH, > >> Matt > >> > >> On Fri, Sep 8, 2017 at 9:13 AM, Pfaehler, EAG (ngmb) > >> wrote: > >>> Thanks, I did this. Now I get an image, with the desired size, but > there all > >>> image values are 0. I get the same when I use linear interpolation? > >>> > >>> Does someone know, what could be the reason? > >>> > >>> > >>> > >>> Thanks in advance, > >>> > >>> > >>> > >>> Regards > >>> > >>> > >>> > >>> Elli > >>> > >>> > >>> > >>> Van: Samuel Gerber [mailto:samuel.gerber at kitware.com] > >>> Verzonden: vrijdag 8 september 2017 14:51 > >>> Aan: Pfaehler, EAG (ngmb) > >>> CC: insight-developers at itk.org > >>> Onderwerp: Re: [ITK] [ITK-dev] problems itk resample filter > >>> > >>> > >>> > >>> I believe you might need to call resizeFilter2->Update() > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> On Fri, Sep 8, 2017 at 8:32 AM, Pfaehler, EAG (ngmb) > >>> wrote: > >>> > >>> Dear all, > >>> > >>> > >>> > >>> I would need some help to resample so that it has isotropic voxels in > the > >>> end. > >>> > >>> For this, I wanted to use the Nearest Neighbor Interpolator and the > >>> ResampleFilterType. > >>> > >>> My code is running, but the output of the filter has always the > dimensions > >>> [0 0 0], so is not existent. > >>> > >>> What am I doing wrong? (see code below) > >>> > >>> > >>> > >>> Thanks in advance! > >>> > >>> Elli > >>> > >>> > >>> > >>> typedef itk::NearestNeighborInterpolateImageFunction > >>> NearestNeighborInterpolatorType; > >>> > >>> typedef itk::ResampleImageFilter > >>> ResampleFilterType; > >>> > >>> typedef itk::AffineTransform TransformType; > >>> > >>> //use nearest neighbor interpolation > >>> > >>> typename NearestNeighborInterpolatorType::Pointer > >>> nearestNeighborInterpolator = NearestNeighborInterpolatorType::New(); > >>> > >>> typename ImageType::DirectionType direction; > >>> > >>> typename TransformType::Pointer transform = TransformType::New(); > >>> > >>> //transform->SetIdentity(); > >>> > >>> typedef itk::NearestNeighborInterpolateImageFunction double> > >>> InterpolatorType; > >>> > >>> //typedef itk::LinearInterpolateImageFunction > >>> InterpolatorType; > >>> > >>> typename InterpolatorType::Pointer interpolator = > InterpolatorType::New(); > >>> > >>> > >>> > >>> typename ResampleFilterType::Pointer resizeFilter2 = > >>> ResampleFilterType::New(); > >>> > >>> resizeFilter2->SetTransform(transform); > >>> > >>> > >>> > >>> resizeFilter2->SetInterpolator( interpolator ); > >>> > >>> resizeFilter2->SetDefaultPixelValue(0); > >>> > >>> //resizeFilter2->SetInterpolator(); > >>> > >>> > >>> > >>> const typename ImageType::SpacingType& inputSpacing = > image->GetSpacing(); > >>> > >>> //sampling > >>> > >>> double outputSpacing[3]; > >>> > >>> // Fetch original image size > >>> > >>> const typename ImageType::RegionType& inputRegion = > >>> image->GetLargestPossibleRegion(); > >>> > >>> const typename ImageType::SizeType& inputSize = > inputRegion.GetSize(); > >>> > >>> unsigned int oldWidth = inputSize[0]; > >>> > >>> unsigned int oldHeight = inputSize[1]; > >>> > >>> unsigned int oldDepth = inputSize[2]; > >>> > >>> unsigned int newWidth; > >>> > >>> unsigned int newHeight; > >>> > >>> unsigned int newDepth; > >>> > >>> //get the new height etc of image > >>> > >>> double minimum = inputSpacing[0]; > >>> > >>> if (inputSpacing[1] >>> > >>> minimum = inputSpacing[1]; > >>> > >>> } > >>> > >>> if (inputSpacing[2] < minimum){ > >>> > >>> minimum = inputSpacing[2]; > >>> > >>> } > >>> > >>> outputSpacing[0] = minimum; > >>> > >>> outputSpacing[1] = minimum; > >>> > >>> outputSpacing[2] = minimum; > >>> > >>> newWidth = (double) oldWidth * inputSpacing[0]/minimum; > >>> > >>> ewHeight = (double) oldHeight * inputSpacing[1]/minimum; > >>> > >>> newDepth = (double) oldDepth * inputSpacing[2]/minimum; > >>> > >>> // Set the output spacing as specified on the command line > >>> > >>> resizeFilter2->SetOutputSpacing(outputSpacing); > >>> > >>> // Set the computed size > >>> > >>> itk::Size<3> outputSize = { {newWidth, newHeight, newDepth} }; > >>> > >>> resizeFilter2->SetSize(outputSize); > >>> > >>> // Specify the input for the resamplers > >>> > >>> resizeFilter2->SetInput(image); > >>> > >>> ImageType::Pointer imageNew = resizeFilter2->GetOutput(); > >>> > >>> const typename ImageType::RegionType& outputRegion = > >>> imageNew->GetLargestPossibleRegion(); > >>> > >>> const typename ImageType::SizeType& outputSize2 = > >>> outputRegion.GetSize(); > >>> > >>> > >>> > >>> ________________________________ > >>> > >>> De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de > >>> geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik > maken > >>> van dit bericht, het niet openbaar maken of op enige wijze verspreiden > of > >>> vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor > een > >>> incomplete aankomst of vertraging van dit verzonden bericht. > >>> > >>> The contents of this message are confidential and only intended for > the eyes > >>> of the addressee(s). Others than the addressee(s) are not allowed to > use > >>> this message, to make it public or to distribute or multiply this > message in > >>> any way. The UMCG cannot be held responsible for incomplete reception > or > >>> delay of this transferred message. > >>> > >>> > >>> _______________________________________________ > >>> Powered by www.kitware.com > >>> > >>> Visit other Kitware open-source projects at > >>> http://www.kitware.com/opensource/opensource.html > >>> > >>> Kitware offers ITK Training Courses, for more information visit: > >>> http://kitware.com/products/protraining.php > >>> > >>> Please keep messages on-topic and check the ITK FAQ at: > >>> http://www.itk.org/Wiki/ITK_FAQ > >>> > >>> Follow this link to subscribe/unsubscribe: > >>> http://public.kitware.com/mailman/listinfo/insight-developers > >>> > >>> _______________________________________________ > >>> Community mailing list > >>> Community at itk.org > >>> http://public.kitware.com/mailman/listinfo/community > >>> > >>> > >>> > >>> > >>> > >>> -- > >>> > >>> Samuel Gerber > >>> R&D Engineer > >>> Kitware, Inc. > >>> > >>> ________________________________ > >>> De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de > >>> geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik > maken > >>> van dit bericht, het niet openbaar maken of op enige wijze verspreiden > of > >>> vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor > een > >>> incomplete aankomst of vertraging van dit verzonden bericht. > >>> > >>> The contents of this message are confidential and only intended for > the eyes > >>> of the addressee(s). Others than the addressee(s) are not allowed to > use > >>> this message, to make it public or to distribute or multiply this > message in > >>> any way. The UMCG cannot be held responsible for incomplete reception > or > >>> delay of this transferred message. > >>> > >>> _______________________________________________ > >>> Powered by www.kitware.com > >>> > >>> Visit other Kitware open-source projects at > >>> http://www.kitware.com/opensource/opensource.html > >>> > >>> Kitware offers ITK Training Courses, for more information visit: > >>> http://kitware.com/products/protraining.php > >>> > >>> Please keep messages on-topic and check the ITK FAQ at: > >>> http://www.itk.org/Wiki/ITK_FAQ > >>> > >>> Follow this link to subscribe/unsubscribe: > >>> http://public.kitware.com/mailman/listinfo/insight-developers > >>> > >> ________________________________ > >> De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de > geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken > van dit bericht, het niet openbaar maken of op enige wijze verspreiden of > vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een > incomplete aankomst of vertraging van dit verzonden bericht. > >> > >> The contents of this message are confidential and only intended for the > eyes of the addressee(s). Others than the addressee(s) are not allowed to > use this message, to make it public or to distribute or multiply this > message in any way. The UMCG cannot be held responsible for incomplete > reception or delay of this transferred message. > > ________________________________ > > De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de > geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken > van dit bericht, het niet openbaar maken of op enige wijze verspreiden of > vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een > incomplete aankomst of vertraging van dit verzonden bericht. > > > > The contents of this message are confidential and only intended for the > eyes of the addressee(s). Others than the addressee(s) are not allowed to > use this message, to make it public or to distribute or multiply this > message in any way. The UMCG cannot be held responsible for incomplete > reception or delay of this transferred message. > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-developers > > ------------------------------ > > Message: 2 > Date: Tue, 12 Sep 2017 02:41:24 -0700 (MST) > From: g2 > To: insight-users at itk.org > Subject: [ITK] [ITK-users] Rotation of anisotropic 3D image > Message-ID: <1505209284609-0.post at n2.nabble.com> > Content-Type: text/plain; charset="utf-8" > > Hi all, > > I am trying to rotate in 3D with a arbitrary rotation matrix a 3D image > with > non uniform spacing (0.15, 0.15, 0.19). I am currently using > itk::AffineTransform because at some point in the future I would like to > introduce a translation. My question is about the spacing of the output > image. Since my rotation matrix can be anything, I cannot just re-use the > spacing of my original image. I actually do not care to much about the > output spacing, it can be the same, it can be isotropic, whatever as long > as > the data makes sense. > > here is a bit of code of what I've done so far: > > typedef itk::Image Image3d; > Image3d::Pointer itkImage = getImageSomehow(); > typedef itk::AffineTransform TransformType; > TransformType::Pointer Rt = TransformType::New(); > TransformType::ParametersType params(12); > for (int i = 0; i < 9; i++){ > params[i] = R[i/3][i%3]; // R is the rotation matrix of type > double[3][3] > } > params[9] = 0; > params[10] = 0; > params[11] = 0; > > Rt->SetParameters(params); > > typedef itk::ResampleImageFilter FilterType; > FilterType::Pointer filter = FilterType::New(); > typedef itk::NearestNeighborInterpolateImageFunction > InterpolatorType; > InterpolatorType::Pointer interpolator = InterpolatorType::New(); > filter->SetInterpolator(interpolator); > filter->SetDefaultPixelValue(255); > filter->SetOutputOrigin(itkImage->GetOrigin()); > filter->SetOutputSpacing(itkImage->GetSpacing()); > //double outSpacing[3] = { 0.1, 0.1, 0.1 }; > //filter->SetOutputSpacing(outSpacing); > filter->SetSize(itkImage->GetLargestPossibleRegion().GetSize()); > filter->SetOutputDirection(itkImage->GetDirection()); > filter->SetInput(itkImage); > filter->SetTransform(Rt); > filter->Update(); > > > After this when I save filter->GetOutput() and open it with IKT-Snap I can > see my new image properly rotated. But it has the same spacing as the input > image, as specified with filter->SetOutputSpacing(itkImage->GetSpacing()); > and to me this doesn't make sense. The axes are rotated and so should be > the > spacing. When I try to put some other values, such as (0.1, 0.1, 0.1). The > output image is all black. I'm confused because to me those values are not > more erroneous than a plain copy of the input spacing. > > Questions : > I want to rotate a generic 3D image with anisotropic spacing with a generic > rotation matrix (i.e. not around a single axis and not with a n*90? angle) > so that any physical point P in the original volumes maps to R*P in the > final one. How should I proceed ? > > thanks > > > > -- > Sent from: http://itk-insight-users.2283740.n2.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 > > ------------------------------ > > Message: 3 > Date: Tue, 12 Sep 2017 03:39:22 -0700 (MST) > From: hellman > To: insight-users at itk.org > Subject: Re: [ITK] [ITK-users] Can I alter the way > SliceBySliceImageFilter defines the origin of the internal slices? > Message-ID: <1505212762750-0.post at n7.nabble.com> > Content-Type: text/plain; charset="us-ascii" > > I tried shifting the origin such that the input image had region index 0 > and > then it worked. > > I also applied the patch http://review.source.kitware.com/#/c/22601/ and > now > it works also with non-zero region index in my case, so my particular > problem is solved by this patch. > > > > -- > Sent from: http://itk-users.7.n7.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 > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > > > ------------------------------ > > End of Community Digest, Vol 48, Issue 15 > ***************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: From k.dunikowski at pixel.com.pl Wed Sep 13 06:45:48 2017 From: k.dunikowski at pixel.com.pl (Kosma Dunikowski) Date: Wed, 13 Sep 2017 12:45:48 +0200 Subject: [ITK] [ITK-users] Generating compatible Java wrappings of SimpleITK between Windows and Linux (x86-64) Message-ID: <2c2ee563-f6e9-07f1-8fab-8d3ab72cd15e@pixel.com.pl> Hi, I'm having a problem with swig-generated Java wrappings on both Windows and Linux. I'm getting different method signatures all over the place, e.g: Windows: public void add(long x) { SimpleITKJNI.VectorInt64_add(swigCPtr, this, x); } Linux: public void add(int x) { SimpleITKJNI.VectorInt64_add(swigCPtr, this, x); } Windows: public java.math.BigInteger getPixelAsUInt64(VectorUInt32 idx) { return SimpleITKJNI.Image_getPixelAsUInt64(swigCPtr, this, VectorUInt32.getCPtr(idx), idx); } Linux: public long getPixelAsUInt64(VectorUInt32 idx) { return SimpleITKJNI.Image_getPixelAsUInt64(swigCPtr, this, VectorUInt32.getCPtr(idx), idx); } (full diff @ https://drive.google.com/a/pixel.com.pl/file/d/0Bzm8rPONV4SJOTA4R0tHTXFPWms/view?usp=sharing) As you can see there are some differences in data sizes. So far I've tried building it with swig 3.0.8, 3.0.9, 3.0.12 and a patched fork mentioned at https://github.com/swig/swig/pull/649 with similar results. I'm using ITK v4.10.0 and SimpleITK v0.10.0 but I've also tried the latest releases. As for the compilers, I used multiple versions of gcc on Linux and mingw-w64 and Visual Studio on Windows. I've tried manually undefining SWIGWORDSIZE64 on Linux (which is enabled if SITK_ULONG_SAME_AS_UINT64 test passes), which resulted in matching wrappings but also immediate segfaults after I tried using it. If anyone knows how to tackle this problem, I would greatly appreciate it, since I'm unable to maintain separate Java codebases for different platforms. Best regards, Kosma Dunikowski _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 antoine.letouzey at gmail.com Wed Sep 13 07:16:44 2017 From: antoine.letouzey at gmail.com (g2) Date: Wed, 13 Sep 2017 04:16:44 -0700 (MST) Subject: [ITK] [ITK-users] Rotation of anisotropic 3D image In-Reply-To: References: <1505209284609-0.post@n2.nabble.com> Message-ID: <1505301404377-0.post@n7.nabble.com> Hello Francois, D?enan, Francois Budin-3 wrote > I think you are missing a step in your computation: > 1) You need to trnasform your point before rotation to find its position > after transformation. You can directly use the affine transform for that: > affineTransform->TransformPoint(my_point) > 2) Compute the index of the transformed point: > filter->GetOutput()->TransformPhysicalPointToIndex(Pp, Pp_pix); > > I think you forgot to compute 1) I did not use the TransformPoint function but I did transform the points using my own matrix multiplication method before using transformPhysicalPointToIndex. And it gives the same results. While cleaning up the code I discovered that the input 3D point I was getting were actually not in proper physical space, they did not take image origin into account, only pixel position * spacing. I'll try to see the implication of that in my code and I'll come back to you. Cheers, A. -- Sent from: http://itk-users.7.n7.nabble.com/ _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From blowekamp at mail.nih.gov Wed Sep 13 13:14:11 2017 From: blowekamp at mail.nih.gov (Lowekamp, Bradley (NIH/NLM/LHC) [C]) Date: Wed, 13 Sep 2017 17:14:11 +0000 Subject: [ITK] [ITK-users] Generating compatible Java wrappings of SimpleITK between Windows and Linux (x86-64) In-Reply-To: <2c2ee563-f6e9-07f1-8fab-8d3ab72cd15e@pixel.com.pl> References: <2c2ee563-f6e9-07f1-8fab-8d3ab72cd15e@pixel.com.pl> Message-ID: Hello, That you for posting the issue. Can you please create an issue for this problem in SimpleITK?s Github issue tracker: https://github.com/SimpleITK/SimpleITK/issues I recall looking into this problem some time ago and not being happy with this inconsistent interface for Java that SWIG generated. It should be consistent. There is not much to how we specify the interface for Java, so this is really SWIG will need to be fixed to get our interface proper. Unfortunately, the mixture of type long and BinInteger is complicated since the long type cannot be implicitly converted to a BigInteger. In our generated code for testing we added a class to help with this conversion. Depending on your usage this may be a useful approach. Thanks, Brad On 9/13/17, 6:46 AM, "Kosma Dunikowski" wrote: Hi, I'm having a problem with swig-generated Java wrappings on both Windows and Linux. I'm getting different method signatures all over the place, e.g: Windows: public void add(long x) { SimpleITKJNI.VectorInt64_add(swigCPtr, this, x); } Linux: public void add(int x) { SimpleITKJNI.VectorInt64_add(swigCPtr, this, x); } Windows: public java.math.BigInteger getPixelAsUInt64(VectorUInt32 idx) { return SimpleITKJNI.Image_getPixelAsUInt64(swigCPtr, this, VectorUInt32.getCPtr(idx), idx); } Linux: public long getPixelAsUInt64(VectorUInt32 idx) { return SimpleITKJNI.Image_getPixelAsUInt64(swigCPtr, this, VectorUInt32.getCPtr(idx), idx); } (full diff @ https://drive.google.com/a/pixel.com.pl/file/d/0Bzm8rPONV4SJOTA4R0tHTXFPWms/view?usp=sharing) As you can see there are some differences in data sizes. So far I've tried building it with swig 3.0.8, 3.0.9, 3.0.12 and a patched fork mentioned at https://github.com/swig/swig/pull/649 with similar results. I'm using ITK v4.10.0 and SimpleITK v0.10.0 but I've also tried the latest releases. As for the compilers, I used multiple versions of gcc on Linux and mingw-w64 and Visual Studio on Windows. I've tried manually undefining SWIGWORDSIZE64 on Linux (which is enabled if SITK_ULONG_SAME_AS_UINT64 test passes), which resulted in matching wrappings but also immediate segfaults after I tried using it. If anyone knows how to tackle this problem, I would greatly appreciate it, since I'm unable to maintain separate Java codebases for different platforms. Best regards, Kosma Dunikowski _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 andx_roo at live.com Wed Sep 13 21:46:57 2017 From: andx_roo at live.com (Andaharoo) Date: Wed, 13 Sep 2017 18:46:57 -0700 (MST) Subject: [ITK] [ITK-users] Problems Using GPU Filters In-Reply-To: References: <1498789176254-7590036.post@n2.nabble.com> <1501002308962-7590057.post@n2.nabble.com> <1501611311517-7590114.post@n2.nabble.com> <1501626181039-7590122.post@n2.nabble.com> Message-ID: <1505353617689-0.post@n2.nabble.com> I pulled the latest branch on github and this issue is still present on all my systems. Here is a clear example of code that does not work. typedef itk::GPUImage GPUImage; typedef itk::Image Image; // Read image with VTK vtkSmartPointer reader = vtkSmartPointer::New(); reader->SetFileName("test.png"); reader->Update(); // Convert VTK to ITK typedef itk::VTKImageToImageFilter VtkToItkFilter; VtkToItkFilter::Pointer vtkToItkFilter = VtkToItkFilter::New(); vtkToItkFilter->SetInput(cast->GetOutput()); vtkToItkFilter->Update(); // GPU Binary Thresholding typedef itk::GPUBinaryThresholdImageFilter GPUBinaryThresholdFilterType; GPUBinaryThresholdFilterType::Pointer binaryThresholdFilter = GPUBinaryThresholdFilterType::New(); binaryThresholdFilter->SetInput(vtkToItkFilter->GetOutput()); binaryThresholdFilter->SetLowerThreshold(150.0); binaryThresholdFilter->SetUpperThreshold(250.0); binaryThresholdFilter->SetOutsideValue(0); binaryThresholdFilter->SetInsideValue(355.0); binaryThresholdFilter->Update(); GPU Gradient Anisotropic is the only gpu filter that works in this example. Probably because it's the only in place gpu filter. I've tried replacing "" with "" as well. With the scenario I get read access violation as GPUDataManager is null. Expect when using gpu gradient anisotropic. With and on the conversion filter, the conversion filter fails to generate data. And as stated in earlier messages, if I first use gpu gradient anisotropic (only gpu filter that works after vtktoitk) I can then successfully apply gpu binary thresholding. I'd look further into the issue but I'm not really sure where gpu images even get allocated so it would be hard for me to debug. Perhaps I can write my own gpu filters using gradient anisotropic as reference. -- Sent from: http://itk-insight-users.2283740.n2.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 swetha.bsharma at gmail.com Thu Sep 14 06:41:24 2017 From: swetha.bsharma at gmail.com (Swetha Sharma) Date: Thu, 14 Sep 2017 16:11:24 +0530 Subject: [ITK] [ITK-users] Calculate transformation matrix for two vectors Message-ID: Dear All, I would like to calculate a transformation matrix between two vectors using Itk. Right now I am manually calculating the translation parameter between the vector and the angle between the two vectors. Is there any other easy way to find the transformation matrix given the vectors? If not, Is there a function to calculate the rotation matrix given the angle and the axis of rotation is arbitary axis. -swetha -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 Thu Sep 14 09:21:57 2017 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Thu, 14 Sep 2017 09:21:57 -0400 Subject: [ITK] [ITK-users] Calculate transformation matrix for two vectors In-Reply-To: References: Message-ID: Hi Swetha, how are your vectors represented? 3 numbers or a pair of points? There is an angle-axis rotation function, Rotate3D . Regards, D?enan Zuki?, PhD, Senior R&D Engineer, Kitware (Carrboro, N.C.) On Thu, Sep 14, 2017 at 6:41 AM, Swetha Sharma wrote: > Dear All, > > > I would like to calculate a transformation matrix between two vectors > using Itk. Right now I am manually calculating the translation parameter > between the vector and the angle between the two vectors. Is there any > other easy way to find the transformation matrix given the vectors? If not, > Is there a function to calculate the rotation matrix given the angle and > the axis of rotation is arbitary axis. > > -swetha > > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 k.dunikowski at pixel.com.pl Thu Sep 14 11:14:57 2017 From: k.dunikowski at pixel.com.pl (Kosma Dunikowski) Date: Thu, 14 Sep 2017 17:14:57 +0200 Subject: [ITK] [ITK-users] Generating compatible Java wrappings of SimpleITK between Windows and Linux (x86-64) In-Reply-To: References: <2c2ee563-f6e9-07f1-8fab-8d3ab72cd15e@pixel.com.pl> Message-ID: <57971db4-da79-4691-df47-d8cf9fa05aa5@pixel.com.pl> Hi again, Thanks for the response. In the end I got to work properly with the forked swig I mentioned (https://github.com/johnwason/swig/tree/java64), after adding #if defined(SWIGWORDSIZE64) %apply unsigned int { size_t }; %apply const unsigned int & { const size_t & }; #endif as recommended by the patch's author. I asked the swig maintainers to consider pulling these changes in. Kosma On 13.09.2017 19:14, Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote: > Hello, > > That you for posting the issue. > > Can you please create an issue for this problem in SimpleITK?s Github issue tracker: > https://github.com/SimpleITK/SimpleITK/issues > > I recall looking into this problem some time ago and not being happy with this inconsistent interface for Java that SWIG generated. It should be consistent. There is not much to how we specify the interface for Java, so this is really SWIG will need to be fixed to get our interface proper. > > Unfortunately, the mixture of type long and BinInteger is complicated since the long type cannot be implicitly converted to a BigInteger. In our generated code for testing we added a class to help with this conversion. Depending on your usage this may be a useful approach. > > Thanks, > Brad > > On 9/13/17, 6:46 AM, "Kosma Dunikowski" wrote: > > Hi, > > I'm having a problem with swig-generated Java wrappings on both Windows > and Linux. I'm getting different method signatures all over the place, e.g: > > Windows: > public void add(long x) { > SimpleITKJNI.VectorInt64_add(swigCPtr, this, x); > } > > Linux: > public void add(int x) { > SimpleITKJNI.VectorInt64_add(swigCPtr, this, x); > } > > Windows: > public java.math.BigInteger getPixelAsUInt64(VectorUInt32 idx) { > return SimpleITKJNI.Image_getPixelAsUInt64(swigCPtr, this, > VectorUInt32.getCPtr(idx), idx); > } > > Linux: > public long getPixelAsUInt64(VectorUInt32 idx) { > return SimpleITKJNI.Image_getPixelAsUInt64(swigCPtr, this, > VectorUInt32.getCPtr(idx), idx); > } > > (full diff @ > https://drive.google.com/a/pixel.com.pl/file/d/0Bzm8rPONV4SJOTA4R0tHTXFPWms/view?usp=sharing) > > As you can see there are some differences in data sizes. So far I've > tried building it with swig 3.0.8, 3.0.9, 3.0.12 and a patched fork > mentioned at https://github.com/swig/swig/pull/649 with similar results. > I'm using ITK v4.10.0 and SimpleITK v0.10.0 but I've also tried the > latest releases. As for the compilers, I used multiple versions of gcc > on Linux and mingw-w64 and Visual Studio on Windows. > > I've tried manually undefining SWIGWORDSIZE64 on Linux (which is enabled > if SITK_ULONG_SAME_AS_UINT64 test passes), which resulted in matching > wrappings but also immediate segfaults after I tried using it. > > If anyone knows how to tackle this problem, I would greatly appreciate > it, since I'm unable to maintain separate Java codebases for different > platforms. > > Best regards, > > Kosma Dunikowski > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 blowekamp at mail.nih.gov Thu Sep 14 11:19:04 2017 From: blowekamp at mail.nih.gov (Lowekamp, Bradley (NIH/NLM/LHC) [C]) Date: Thu, 14 Sep 2017 15:19:04 +0000 Subject: [ITK] [ITK-users] Generating compatible Java wrappings of SimpleITK between Windows and Linux (x86-64) In-Reply-To: <57971db4-da79-4691-df47-d8cf9fa05aa5@pixel.com.pl> References: <2c2ee563-f6e9-07f1-8fab-8d3ab72cd15e@pixel.com.pl> <57971db4-da79-4691-df47-d8cf9fa05aa5@pixel.com.pl> Message-ID: <9F625F52-E383-4BBC-9A78-732FF800433A@mail.nih.gov> Can you please create an issue on SimpleITK github issue tracker? Where did you add that SWIG code too? Thanks, Brad On 9/14/17, 11:16 AM, "Kosma Dunikowski" wrote: Hi again, Thanks for the response. In the end I got to work properly with the forked swig I mentioned (https://github.com/johnwason/swig/tree/java64), after adding #if defined(SWIGWORDSIZE64) %apply unsigned int { size_t }; %apply const unsigned int & { const size_t & }; #endif as recommended by the patch's author. I asked the swig maintainers to consider pulling these changes in. Kosma On 13.09.2017 19:14, Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote: > Hello, > > That you for posting the issue. > > Can you please create an issue for this problem in SimpleITK?s Github issue tracker: > https://github.com/SimpleITK/SimpleITK/issues > > I recall looking into this problem some time ago and not being happy with this inconsistent interface for Java that SWIG generated. It should be consistent. There is not much to how we specify the interface for Java, so this is really SWIG will need to be fixed to get our interface proper. > > Unfortunately, the mixture of type long and BinInteger is complicated since the long type cannot be implicitly converted to a BigInteger. In our generated code for testing we added a class to help with this conversion. Depending on your usage this may be a useful approach. > > Thanks, > Brad > > On 9/13/17, 6:46 AM, "Kosma Dunikowski" wrote: > > Hi, > > I'm having a problem with swig-generated Java wrappings on both Windows > and Linux. I'm getting different method signatures all over the place, e.g: > > Windows: > public void add(long x) { > SimpleITKJNI.VectorInt64_add(swigCPtr, this, x); > } > > Linux: > public void add(int x) { > SimpleITKJNI.VectorInt64_add(swigCPtr, this, x); > } > > Windows: > public java.math.BigInteger getPixelAsUInt64(VectorUInt32 idx) { > return SimpleITKJNI.Image_getPixelAsUInt64(swigCPtr, this, > VectorUInt32.getCPtr(idx), idx); > } > > Linux: > public long getPixelAsUInt64(VectorUInt32 idx) { > return SimpleITKJNI.Image_getPixelAsUInt64(swigCPtr, this, > VectorUInt32.getCPtr(idx), idx); > } > > (full diff @ > https://drive.google.com/a/pixel.com.pl/file/d/0Bzm8rPONV4SJOTA4R0tHTXFPWms/view?usp=sharing) > > As you can see there are some differences in data sizes. So far I've > tried building it with swig 3.0.8, 3.0.9, 3.0.12 and a patched fork > mentioned at https://github.com/swig/swig/pull/649 with similar results. > I'm using ITK v4.10.0 and SimpleITK v0.10.0 but I've also tried the > latest releases. As for the compilers, I used multiple versions of gcc > on Linux and mingw-w64 and Visual Studio on Windows. > > I've tried manually undefining SWIGWORDSIZE64 on Linux (which is enabled > if SITK_ULONG_SAME_AS_UINT64 test passes), which resulted in matching > wrappings but also immediate segfaults after I tried using it. > > If anyone knows how to tackle this problem, I would greatly appreciate > it, since I'm unable to maintain separate Java codebases for different > platforms. > > Best regards, > > Kosma Dunikowski > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 k.dunikowski at pixel.com.pl Thu Sep 14 11:39:24 2017 From: k.dunikowski at pixel.com.pl (Kosma Dunikowski) Date: Thu, 14 Sep 2017 17:39:24 +0200 Subject: [ITK] [ITK-users] Generating compatible Java wrappings of SimpleITK between Windows and Linux (x86-64) In-Reply-To: <9F625F52-E383-4BBC-9A78-732FF800433A@mail.nih.gov> References: <2c2ee563-f6e9-07f1-8fab-8d3ab72cd15e@pixel.com.pl> <57971db4-da79-4691-df47-d8cf9fa05aa5@pixel.com.pl> <9F625F52-E383-4BBC-9A78-732FF800433A@mail.nih.gov> Message-ID: <688f84a0-8ce8-167e-4e63-8d9c41392f57@pixel.com.pl> I added it to Wrapping/Java/Java.i GitHub issue: https://github.com/SimpleITK/SimpleITK/issues/295 On 14.09.2017 17:19, Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote: > Can you please create an issue on SimpleITK github issue tracker? > > Where did you add that SWIG code too? > > Thanks, > Brad > > On 9/14/17, 11:16 AM, "Kosma Dunikowski" wrote: > > Hi again, > > Thanks for the response. In the end I got to work properly with the > forked swig I mentioned (https://github.com/johnwason/swig/tree/java64), > after adding > > #if defined(SWIGWORDSIZE64) > %apply unsigned int { size_t }; > %apply const unsigned int & { const size_t & }; > #endif > > as recommended by the patch's author. I asked the swig maintainers to > consider pulling these changes in. > > Kosma > > > On 13.09.2017 19:14, Lowekamp, Bradley (NIH/NLM/LHC) [C] wrote: > > Hello, > > > > That you for posting the issue. > > > > Can you please create an issue for this problem in SimpleITK?s Github issue tracker: > > https://github.com/SimpleITK/SimpleITK/issues > > > > I recall looking into this problem some time ago and not being happy with this inconsistent interface for Java that SWIG generated. It should be consistent. There is not much to how we specify the interface for Java, so this is really SWIG will need to be fixed to get our interface proper. > > > > Unfortunately, the mixture of type long and BinInteger is complicated since the long type cannot be implicitly converted to a BigInteger. In our generated code for testing we added a class to help with this conversion. Depending on your usage this may be a useful approach. > > > > Thanks, > > Brad > > > > On 9/13/17, 6:46 AM, "Kosma Dunikowski" wrote: > > > > Hi, > > > > I'm having a problem with swig-generated Java wrappings on both Windows > > and Linux. I'm getting different method signatures all over the place, e.g: > > > > Windows: > > public void add(long x) { > > SimpleITKJNI.VectorInt64_add(swigCPtr, this, x); > > } > > > > Linux: > > public void add(int x) { > > SimpleITKJNI.VectorInt64_add(swigCPtr, this, x); > > } > > > > Windows: > > public java.math.BigInteger getPixelAsUInt64(VectorUInt32 idx) { > > return SimpleITKJNI.Image_getPixelAsUInt64(swigCPtr, this, > > VectorUInt32.getCPtr(idx), idx); > > } > > > > Linux: > > public long getPixelAsUInt64(VectorUInt32 idx) { > > return SimpleITKJNI.Image_getPixelAsUInt64(swigCPtr, this, > > VectorUInt32.getCPtr(idx), idx); > > } > > > > (full diff @ > > https://drive.google.com/a/pixel.com.pl/file/d/0Bzm8rPONV4SJOTA4R0tHTXFPWms/view?usp=sharing) > > > > As you can see there are some differences in data sizes. So far I've > > tried building it with swig 3.0.8, 3.0.9, 3.0.12 and a patched fork > > mentioned at https://github.com/swig/swig/pull/649 with similar results. > > I'm using ITK v4.10.0 and SimpleITK v0.10.0 but I've also tried the > > latest releases. As for the compilers, I used multiple versions of gcc > > on Linux and mingw-w64 and Visual Studio on Windows. > > > > I've tried manually undefining SWIGWORDSIZE64 on Linux (which is enabled > > if SITK_ULONG_SAME_AS_UINT64 test passes), which resulted in matching > > wrappings but also immediate segfaults after I tried using it. > > > > If anyone knows how to tackle this problem, I would greatly appreciate > > it, since I'm unable to maintain separate Java codebases for different > > platforms. > > > > Best regards, > > > > Kosma Dunikowski > > > > _____________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Kitware offers ITK Training Courses, for more information visit: > > http://www.kitware.com/products/protraining.php > > > > Please keep messages on-topic and check the 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 zivrafael.yaniv at nih.gov Thu Sep 14 12:34:07 2017 From: zivrafael.yaniv at nih.gov (Yaniv, Ziv Rafael (NIH/NLM/LHC) [C]) Date: Thu, 14 Sep 2017 16:34:07 +0000 Subject: [ITK] ITK bug or feature Message-ID: Hello ITK developers, I encountered unexpected behavior with ITK parameter settings in degenerate cases for the CenteredSimilarity2DTransform and Similarity3DTransform classes. The degenerate parameter values I am referring to is setting the scale to zero. I encountered this issue when I blindly set all parameters to zero to get an identity transform (obviously scale should be one). It appears that setting the scale factor to zero is acceptable, no exception (arbitrary choice which makes sense for the general SetParameters method ? up to the user to make sure the parameter values make sense). The feature/bug I am referring to has to do with the GetInverse method (ill-defined for this degenerate case): 2D case - when I print the original transformation, it is identified as singular. When I invoke the GetInverse method vnl generates a warning with the resulting ?inverse? transform including Nan and Inf , not identified as singular. 3D case - when I print the original transformation, it is identified as singular. When I invoke the GetInverse method there is no warning and the ?inverse? transform has numbers and is identified as singular. Is this behavior fine and up to the user to deal with? Should the GetInverse generate an exception? thanks Ziv Code for the two cases below: { typedef itk::Similarity3DTransform TransformType3D; // Test degenerate parameter settings TransformType3D::Pointer t1 = TransformType3D::New(); TransformType3D::Pointer t1Inverse = TransformType3D::New(); // Set parameters TransformType3D::ParametersType parameters( t1->GetNumberOfParameters() ); // Degenerate configuration with zero scale parameters[0] = 1.0; parameters[1] = 0.0; parameters[2] = 0.0; parameters[3] = 1.0; parameters[4] = 2.0; parameters[5] = 3.0; parameters[6] = 0.0; //scale t1->SetParameters( parameters ); t1Inverse->SetParameters(parameters); t1->GetInverse( t1Inverse ); std::cout<< "**original**\n"< TransformType2D; TransformType2D::Pointer t1 = TransformType2D::New(); TransformType2D::Pointer t1Inverse = TransformType2D::New(); // Set parameters TransformType2D::ParametersType parameters( t1->GetNumberOfParameters() ); // Degenerate configuration with zero scale parameters[0] = 0.0; //scale parameters[1] = -21.0 / 180.0 * itk::Math::pi; parameters[2] = 12.0; parameters[3] = -8.9; parameters[4] = 67.8; parameters[5] = -0.2; t1->SetParameters( parameters ); t1->GetInverse( t1Inverse ); std::cout<< "**original**\n"< From francois.budin at kitware.com Thu Sep 14 14:48:08 2017 From: francois.budin at kitware.com (Francois Budin) Date: Thu, 14 Sep 2017 14:48:08 -0400 Subject: [ITK] [ITK-dev] Coding Style guide added to the ITKSoftwareGuide Message-ID: Dear ITK developers, I am happy to announce that the ITK Coding Style Guide has been added to the book 1 of the ITKSoftwareGuide as a new appendix (B). You can access the guide in the HTML version of the ITKSoftwareGuide here [1] or download the new ITKSoftwareGuide PDF here [2]. This is the result of the hard work frome by Jon Haitz Legarreta Gorro?o. This addition will be extremely useful not only to new developers but also to experimented developers. The coding style documents all the aspects of the code style: philosophy, naming conventions, error message conventions, tests, and documentation. Enjoy the read and thanks for the wonderful contribution! Francois [1] https://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch12.html#x51-188000B [2] http://www.itk.org/ItkSoftwareGuide.pdf -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers From matt.mccormick at kitware.com Thu Sep 14 14:54:02 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 14 Sep 2017 14:54:02 -0400 Subject: [ITK] [ITK-dev] Coding Style guide added to the ITKSoftwareGuide In-Reply-To: References: Message-ID: Hats off to Jon! There may be omissions or corrections to make as we migrate the content from the wiki and source tree PDF. If you find any areas for improvement, please consider submitting a patch: https://github.com/InsightSoftwareConsortium/ITKSoftwareGuide/blob/b202452cb7f9ad85f471d5acd036bb3bd79a8b18/README.md#how-to-contribute-to-the-itk-software-guide On Thu, Sep 14, 2017 at 2:48 PM, Francois Budin wrote: > Dear ITK developers, > > > I am happy to announce that the ITK Coding Style Guide has been added to the > book 1 of the ITKSoftwareGuide as a new appendix (B). You can access the > guide in the HTML version of the ITKSoftwareGuide here [1] or download the > new ITKSoftwareGuide PDF here [2]. This is the result of the hard work frome > by Jon Haitz Legarreta Gorro?o. > This addition will be extremely useful not only to new developers but also > to experimented developers. The coding style documents all the aspects of > the code style: philosophy, naming conventions, error message conventions, > tests, and documentation. > > Enjoy the read and thanks for the wonderful contribution! > Francois > > [1] > https://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch12.html#x51-188000B > [2] http://www.itk.org/ItkSoftwareGuide.pdf > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-developers > _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers From matt.mccormick at kitware.com Thu Sep 14 15:15:14 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 14 Sep 2017 15:15:14 -0400 Subject: [ITK] [ANN] ITK 4.12.2 has been released! Message-ID: On behalf of the Insight Segmentation and Registration Toolkit (ITK) Community, we are happy to announce the release of ITK 4.12.2! ITK is an open-source, cross-platform library for multidimensional image analysis. Release files can be downloaded from http://itk.org/ITK/resources/software.html. This is a patch release that fixes critical issues, regressions, documentation, and compiler support. This release includes better compatibility when building an application that includes additional NIFTI libraries and also fixes for GPGPU build support. Contributions from the 3D Slicer community improve packaging on macOS. The release also includes an update to the ITK Software Guide that adds the coding style guide among other updates and additions. The next feature release, 4.13.0, is scheduled for mid-December. Enjoy ITK! ITK changes from v4.12.1 to v4.12.2: Edwin Bennink (1): BUG: Fixed cylinder bbox, fixed and enhanced IsInside func Floris Berendsen (1): COMP: add symbol name mangling for niftilib in ITK Jean-Christophe Fillion-Robin (2): COMP: Update MINC to set MACOSX_RPATH property based on CMAKE_MACOSX_RPATH COMP: Update KWsys to set MACOSX_RPATH property based on CMAKE_MACOSX_RPATH Matthew McCormick (6): BUG: Correct GPUMeanImageFilter Superclass BUG: Remove debug code from GPUMeanImageFilter BUG: Do not use static_cast, SmartPointer in GPUImage::GetGPUDataManager BUG: Remove debug code in itkGPUImage.hxx COMP: Fix AnisotropicDiffusionLBR example build ENH: Bump CMakeLists.txt version to 4.12.2 Niels Dekker (1): COMP: Fixed leak into user code ITK Software Guide changes: Jon Haitz Legarreta Gorro?o (8): DOC: Add and reference Coding Style appendix. DOC: Fix typo in Registration chapter files headers. STYLE: Replace tabs with white spaces. DOC: Fix typos in the SW guide LaTeX files. ENH: Add the link to the SW Guide PDF compilation version. DOC: Add missing wrap types to Wrapping section. STYLE: Rework the folder structure and rename files. ENH: Remove \ifitkFullVersion artifact switch. Matt McCormick (2): DOC: Add instructions on how to install the stable Python packages ENH: Bump ITK ExternalProject version to 4.12.2 From matt.mccormick at kitware.com Thu Sep 14 15:32:17 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 14 Sep 2017 15:32:17 -0400 Subject: [ITK] [ITK-users] Problems Using GPU Filters In-Reply-To: <1505353617689-0.post@n2.nabble.com> References: <1498789176254-7590036.post@n2.nabble.com> <1501002308962-7590057.post@n2.nabble.com> <1501611311517-7590114.post@n2.nabble.com> <1501626181039-7590122.post@n2.nabble.com> <1505353617689-0.post@n2.nabble.com> Message-ID: Thank you for example code and description. To improve performance and reduce memory usage, ITK re-uses memory when possible. For example, many filters have an option to run in place on their inputs. The VTK bridge and GPU filters are special cases that may be conflicting here. The GPU data manager moves ITK memory from the CPU to GPU when required. However, the VTK bridge tries to prevent copying the memory allocated by VTK. There are a few approaches that can be taken. First, consider using itk::ImageFileReader instead of vtkPNGReader then VTKImageToImageFilter. This has the added advantage that it will automatically also support many other file formats. Second, place an ITK filter, like CastImageFilter, after the VTK bridge filter and before the GPU filter. However, may sure to call .InPlaceOff(). If you are considering writing your own GPU filters, you may also be interested in this module [1]. This is a work in progress, but it will allow writing filters that use ArrayFire underneath the hood. ArrayFire is easier to program with than OpenCL, and it is optimized for many GPGPU architectures. [1] https://github.com/InsightSoftwareConsortium/ITKArrayFire On Wed, Sep 13, 2017 at 9:46 PM, Andaharoo wrote: > I pulled the latest branch on github and this issue is still present on all > my systems. Here is a clear example of code that does not work. > > typedef itk::GPUImage GPUImage; > typedef itk::Image Image; > > // Read image with VTK > vtkSmartPointer reader = vtkSmartPointer::New(); > reader->SetFileName("test.png"); > reader->Update(); > > // Convert VTK to ITK > typedef itk::VTKImageToImageFilter VtkToItkFilter; > VtkToItkFilter::Pointer vtkToItkFilter = VtkToItkFilter::New(); > vtkToItkFilter->SetInput(cast->GetOutput()); > vtkToItkFilter->Update(); > > // GPU Binary Thresholding > typedef itk::GPUBinaryThresholdImageFilter > GPUBinaryThresholdFilterType; > GPUBinaryThresholdFilterType::Pointer binaryThresholdFilter = > GPUBinaryThresholdFilterType::New(); > binaryThresholdFilter->SetInput(vtkToItkFilter->GetOutput()); > binaryThresholdFilter->SetLowerThreshold(150.0); > binaryThresholdFilter->SetUpperThreshold(250.0); > binaryThresholdFilter->SetOutsideValue(0); > binaryThresholdFilter->SetInsideValue(355.0); > binaryThresholdFilter->Update(); > > GPU Gradient Anisotropic is the only gpu filter that works in this example. > Probably because it's the only in place gpu filter. I've tried replacing > "" with "" as well. > > With the scenario I get read access violation as > GPUDataManager is null. Expect when using gpu gradient anisotropic. > > With and on the conversion filter, the > conversion filter fails to generate data. > > And as stated in earlier messages, if I first use gpu gradient anisotropic > (only gpu filter that works after vtktoitk) I can then successfully apply > gpu binary thresholding. > I'd look further into the issue but I'm not really sure where gpu images > even get allocated so it would be hard for me to debug. Perhaps I can write > my own gpu filters using gradient anisotropic as reference. > > > > -- > Sent from: http://itk-insight-users.2283740.n2.nabble.com/ > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From zhuangming.shen at sphic.org.cn Thu Sep 14 20:46:57 2017 From: zhuangming.shen at sphic.org.cn (=?gb2312?B?yfLXr8P3?=) Date: Fri, 15 Sep 2017 00:46:57 +0000 Subject: [ITK] [ITK-users] Suggestion for itk::BoundingBox Message-ID: <1505436450589.98090@sphic.org.cn> Hi all, Bounding box is a very useful functionality for me. I suggest whether itk::BoundingBox can provide an API which will directly output a binary image. For the binary image, pixels/voxels inside the bounding box are represented as 1, other pixels/voxels outside the bounding box are represented as 0. Regards, Zhuangming Shen -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 e.a.g.pfaehler at umcg.nl Fri Sep 15 03:34:13 2017 From: e.a.g.pfaehler at umcg.nl (Pfaehler, EAG (ngmb)) Date: Fri, 15 Sep 2017 07:34:13 +0000 Subject: [ITK] [ITK-dev] problems itk resample filter In-Reply-To: References: , Message-ID: Thanks a lot, that was the problem. Its working now. ________________________________________ Van: Matt McCormick [matt.mccormick at kitware.com] Verzonden: maandag 11 september 2017 20:23 Aan: Pfaehler, EAG (ngmb) CC: Samuel Gerber; insight-developers at itk.org Onderwerp: Re: [ITK-dev] [ITK] problems itk resample filter Hi, One possible issue - make sure that the image viewer applied is displaying the correct dynamic range so it does just not appear that there are only zeros after interpolation. 3D Slicer, ITK-SNAP, etc. support this. HTH, Matt On Sat, Sep 9, 2017 at 1:49 AM, Pfaehler, EAG (ngmb) wrote: > Hey, > > thanks. I did this, but it did not change anything. However, I used another image (with some higher intensity values) and then I got an image with only 1s. > > Can it be the problem that my images have only values from 0-5? > I also tried an image with only 0 and 1, but als here I get only zeros after interpolation. > > ________________________________________ > Van: Matt McCormick [matt.mccormick at kitware.com] > Verzonden: vrijdag 8 september 2017 21:27 > Aan: Pfaehler, EAG (ngmb) > CC: Samuel Gerber; insight-developers at itk.org > Onderwerp: Re: [ITK-dev] [ITK] problems itk resample filter > > Hi, > > The Origin should be the same in the resampled image. > > HTH, > Matt > > On Fri, Sep 8, 2017 at 3:12 PM, Pfaehler, EAG (ngmb) > wrote: >> Thanks Samuel and Matt for the help. However, it is unfortunatly still not working. >> >> I deleted the line resizeFilter->SetTransform, but unfortunately it did not change anything. >> >> Then I tried to set the direction and the origin. But maybe here is the problem. I set as direction the same direction as in the original image because I do not want to have any rotation. >> >> But I am a bit insecure how to set the origin. First I set the origin in the resampled image to the same as in the original image, what did not work. >> Then I tried different things, e.g >> >> origin[0] = origin[0] + inputSpacing[0] * (newWidth - oldWidth); >> origin[1] = origin[1] + inputSpacing[1] * (newHeight - oldHeight); >> origin[2] = origin[2] + inputSpacing[2] * (newDepth - oldDepth); >> >> where newWidth etc is the width of the new image and oldWidth of the original image. And origin[0] is the x value of the original origin etc. >> >> But this was also not working. ( In all of these cases I get an image full of zeros. >> >> If I make originalImage->Print(std::cout) I get the following: >> >> Image (000000000282A800) >> RTTI typeinfo: class itk::Image >> Reference Count: 3 >> Modified Time: 705 >> Debug: Off >> Object Name: >> Observers: >> none >> Source: (none) >> Source output name: (none) >> Release Data: Off >> Data Released: False >> Global Release Data: Off >> PipelineMTime: 692 >> UpdateMTime: 704 >> RealTimeStamp: 0 seconds >> LargestPossibleRegion: >> Dimension: 3 >> Index: [0, 0, 0] >> Size: [11, 11, 19] >> BufferedRegion: >> Dimension: 3 >> Index: [0, 0, 0] >> Size: [11, 11, 19] >> RequestedRegion: >> Dimension: 3 >> Index: [0, 0, 0] >> Size: [11, 11, 19] >> Spacing: [3.1819, 3.1819, 2] >> Origin: [48.5757, -171.979, 20.5] >> Direction: >> 1 0 0 >> 0 1 0 >> 0 0 1 >> >> IndexToPointMatrix: >> 3.1819 0 0 >> 0 3.1819 0 >> 0 0 2 >> >> PointToIndexMatrix: >> 0.314278 0 0 >> 0 0.314278 0 >> 0 0 0.5 >> >> Inverse Direction: >> 1 0 0 >> 0 1 0 >> 0 0 1 >> >> PixelContainer: >> ImportImageContainer (00000000027B59F0) >> RTTI typeinfo: class itk::ImportImageContainer >> Reference Count: 1 >> Modified Time: 701 >> Debug: Off >> Object Name: >> Observers: >> none >> Pointer: 00000000028542E0 >> Container manages memory: true >> Size: 2299 >> Capacity: 2299 >> >> If I do the same for the resampled image I get: >> >> Image (000000000282B100) >> RTTI typeinfo: class itk::Image >> Reference Count: 2 >> Modified Time: 11626 >> Debug: Off >> Object Name: >> Observers: >> none >> Source: (000000000282BB80) >> Source output name: Primary >> Release Data: Off >> Data Released: False >> Global Release Data: Off >> PipelineMTime: 11614 >> UpdateMTime: 11627 >> RealTimeStamp: 0 seconds >> LargestPossibleRegion: >> Dimension: 3 >> Index: [0, 0, 0] >> Size: [17, 17, 19] >> BufferedRegion: >> Dimension: 3 >> Index: [0, 0, 0] >> Size: [17, 17, 19] >> RequestedRegion: >> Dimension: 3 >> Index: [0, 0, 0] >> Size: [17, 17, 19] >> Spacing: [2, 2, 2] >> Origin: [67.6671, -152.888, 20.5] >> Direction: >> 1 0 0 >> 0 1 0 >> 0 0 1 >> >> IndexToPointMatrix: >> 2 0 0 >> 0 2 0 >> 0 0 2 >> >> PointToIndexMatrix: >> 0.5 0 0 >> 0 0.5 0 >> 0 0 0.5 >> >> Inverse Direction: >> 1 0 0 >> 0 1 0 >> 0 0 1 >> >> PixelContainer: >> ImportImageContainer (00000000027B5EC0) >> RTTI typeinfo: class itk::ImportImageContainer >> Reference Count: 1 >> Modified Time: 11625 >> Debug: Off >> Object Name: >> Observers: >> none >> Pointer: 0000000002A8D520 >> Container manages memory: true >> Size: 5491 >> Capacity: 5491 >> >> Does that maybe help to find out whats going wrong? >> >> Thanks in advance >> >> >> >> ________________________________________ >> Van: Matt McCormick [matt.mccormick at kitware.com] >> Verzonden: vrijdag 8 september 2017 15:32 >> Aan: Pfaehler, EAG (ngmb) >> CC: Samuel Gerber; insight-developers at itk.org >> Onderwerp: Re: [ITK-dev] [ITK] problems itk resample filter >> >> Hi Elli, >> >> The OutputOrigin and OutputDirection may need to be set so the >> sampling grids overlap. >> >> HTH, >> Matt >> >> On Fri, Sep 8, 2017 at 9:13 AM, Pfaehler, EAG (ngmb) >> wrote: >>> Thanks, I did this. Now I get an image, with the desired size, but there all >>> image values are 0. I get the same when I use linear interpolation? >>> >>> Does someone know, what could be the reason? >>> >>> >>> >>> Thanks in advance, >>> >>> >>> >>> Regards >>> >>> >>> >>> Elli >>> >>> >>> >>> Van: Samuel Gerber [mailto:samuel.gerber at kitware.com] >>> Verzonden: vrijdag 8 september 2017 14:51 >>> Aan: Pfaehler, EAG (ngmb) >>> CC: insight-developers at itk.org >>> Onderwerp: Re: [ITK] [ITK-dev] problems itk resample filter >>> >>> >>> >>> I believe you might need to call resizeFilter2->Update() >>> >>> >>> >>> >>> >>> >>> >>> On Fri, Sep 8, 2017 at 8:32 AM, Pfaehler, EAG (ngmb) >>> wrote: >>> >>> Dear all, >>> >>> >>> >>> I would need some help to resample so that it has isotropic voxels in the >>> end. >>> >>> For this, I wanted to use the Nearest Neighbor Interpolator and the >>> ResampleFilterType. >>> >>> My code is running, but the output of the filter has always the dimensions >>> [0 0 0], so is not existent. >>> >>> What am I doing wrong? (see code below) >>> >>> >>> >>> Thanks in advance! >>> >>> Elli >>> >>> >>> >>> typedef itk::NearestNeighborInterpolateImageFunction >>> NearestNeighborInterpolatorType; >>> >>> typedef itk::ResampleImageFilter >>> ResampleFilterType; >>> >>> typedef itk::AffineTransform TransformType; >>> >>> //use nearest neighbor interpolation >>> >>> typename NearestNeighborInterpolatorType::Pointer >>> nearestNeighborInterpolator = NearestNeighborInterpolatorType::New(); >>> >>> typename ImageType::DirectionType direction; >>> >>> typename TransformType::Pointer transform = TransformType::New(); >>> >>> //transform->SetIdentity(); >>> >>> typedef itk::NearestNeighborInterpolateImageFunction >>> InterpolatorType; >>> >>> //typedef itk::LinearInterpolateImageFunction >>> InterpolatorType; >>> >>> typename InterpolatorType::Pointer interpolator = InterpolatorType::New(); >>> >>> >>> >>> typename ResampleFilterType::Pointer resizeFilter2 = >>> ResampleFilterType::New(); >>> >>> resizeFilter2->SetTransform(transform); >>> >>> >>> >>> resizeFilter2->SetInterpolator( interpolator ); >>> >>> resizeFilter2->SetDefaultPixelValue(0); >>> >>> //resizeFilter2->SetInterpolator(); >>> >>> >>> >>> const typename ImageType::SpacingType& inputSpacing = image->GetSpacing(); >>> >>> //sampling >>> >>> double outputSpacing[3]; >>> >>> // Fetch original image size >>> >>> const typename ImageType::RegionType& inputRegion = >>> image->GetLargestPossibleRegion(); >>> >>> const typename ImageType::SizeType& inputSize = inputRegion.GetSize(); >>> >>> unsigned int oldWidth = inputSize[0]; >>> >>> unsigned int oldHeight = inputSize[1]; >>> >>> unsigned int oldDepth = inputSize[2]; >>> >>> unsigned int newWidth; >>> >>> unsigned int newHeight; >>> >>> unsigned int newDepth; >>> >>> //get the new height etc of image >>> >>> double minimum = inputSpacing[0]; >>> >>> if (inputSpacing[1]>> >>> minimum = inputSpacing[1]; >>> >>> } >>> >>> if (inputSpacing[2] < minimum){ >>> >>> minimum = inputSpacing[2]; >>> >>> } >>> >>> outputSpacing[0] = minimum; >>> >>> outputSpacing[1] = minimum; >>> >>> outputSpacing[2] = minimum; >>> >>> newWidth = (double) oldWidth * inputSpacing[0]/minimum; >>> >>> ewHeight = (double) oldHeight * inputSpacing[1]/minimum; >>> >>> newDepth = (double) oldDepth * inputSpacing[2]/minimum; >>> >>> // Set the output spacing as specified on the command line >>> >>> resizeFilter2->SetOutputSpacing(outputSpacing); >>> >>> // Set the computed size >>> >>> itk::Size<3> outputSize = { {newWidth, newHeight, newDepth} }; >>> >>> resizeFilter2->SetSize(outputSize); >>> >>> // Specify the input for the resamplers >>> >>> resizeFilter2->SetInput(image); >>> >>> ImageType::Pointer imageNew = resizeFilter2->GetOutput(); >>> >>> const typename ImageType::RegionType& outputRegion = >>> imageNew->GetLargestPossibleRegion(); >>> >>> const typename ImageType::SizeType& outputSize2 = >>> outputRegion.GetSize(); >>> >>> >>> >>> ________________________________ >>> >>> De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de >>> geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken >>> van dit bericht, het niet openbaar maken of op enige wijze verspreiden of >>> vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een >>> incomplete aankomst of vertraging van dit verzonden bericht. >>> >>> The contents of this message are confidential and only intended for the eyes >>> of the addressee(s). Others than the addressee(s) are not allowed to use >>> this message, to make it public or to distribute or multiply this message in >>> any way. The UMCG cannot be held responsible for incomplete reception or >>> delay of this transferred message. >>> >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the ITK FAQ at: >>> http://www.itk.org/Wiki/ITK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/insight-developers >>> >>> _______________________________________________ >>> Community mailing list >>> Community at itk.org >>> http://public.kitware.com/mailman/listinfo/community >>> >>> >>> >>> >>> >>> -- >>> >>> Samuel Gerber >>> R&D Engineer >>> Kitware, Inc. >>> >>> ________________________________ >>> De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de >>> geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken >>> van dit bericht, het niet openbaar maken of op enige wijze verspreiden of >>> vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een >>> incomplete aankomst of vertraging van dit verzonden bericht. >>> >>> The contents of this message are confidential and only intended for the eyes >>> of the addressee(s). Others than the addressee(s) are not allowed to use >>> this message, to make it public or to distribute or multiply this message in >>> any way. The UMCG cannot be held responsible for incomplete reception or >>> delay of this transferred message. >>> >>> _______________________________________________ >>> Powered by www.kitware.com >>> >>> Visit other Kitware open-source projects at >>> http://www.kitware.com/opensource/opensource.html >>> >>> Kitware offers ITK Training Courses, for more information visit: >>> http://kitware.com/products/protraining.php >>> >>> Please keep messages on-topic and check the ITK FAQ at: >>> http://www.itk.org/Wiki/ITK_FAQ >>> >>> Follow this link to subscribe/unsubscribe: >>> http://public.kitware.com/mailman/listinfo/insight-developers >>> >> ________________________________ >> De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken van dit bericht, het niet openbaar maken of op enige wijze verspreiden of vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een incomplete aankomst of vertraging van dit verzonden bericht. >> >> The contents of this message are confidential and only intended for the eyes of the addressee(s). Others than the addressee(s) are not allowed to use this message, to make it public or to distribute or multiply this message in any way. The UMCG cannot be held responsible for incomplete reception or delay of this transferred message. > ________________________________ > De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken van dit bericht, het niet openbaar maken of op enige wijze verspreiden of vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een incomplete aankomst of vertraging van dit verzonden bericht. > > The contents of this message are confidential and only intended for the eyes of the addressee(s). Others than the addressee(s) are not allowed to use this message, to make it public or to distribute or multiply this message in any way. The UMCG cannot be held responsible for incomplete reception or delay of this transferred message. ________________________________ De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken van dit bericht, het niet openbaar maken of op enige wijze verspreiden of vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een incomplete aankomst of vertraging van dit verzonden bericht. The contents of this message are confidential and only intended for the eyes of the addressee(s). Others than the addressee(s) are not allowed to use this message, to make it public or to distribute or multiply this message in any way. The UMCG cannot be held responsible for incomplete reception or delay of this transferred message. _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers From antoine.letouzey at gmail.com Fri Sep 15 07:14:43 2017 From: antoine.letouzey at gmail.com (Antoine) Date: Fri, 15 Sep 2017 13:14:43 +0200 Subject: [ITK] [ITK-users] Rotation of anisotropic 3D image In-Reply-To: <1505301404377-0.post@n7.nabble.com> References: <1505209284609-0.post@n2.nabble.com> <1505301404377-0.post@n7.nabble.com> Message-ID: OK I got it to work by changing my approach. As I wasn't able to get the rotation and translation working in a single pass, I divided my algorithm in two steps : - a translation so that my initial point is in the center of the image. - a rotation around the center of the image with the given rotation matrix As a pre-processing I also reset the origin of my input image to be (0,0,0), this values is then restored afterward, but it simplified a lot of things for me. This solved also the issue of guessing the size of my output image when the feature I'm interested in is far from the center. By applying a translation first I know that it's going to stay centred after the rotation and I do not need to worry about my area of interest ending up out of bounds. After these two steps I can crop from the center of the image and along the X axis (see drawing from two posts above). Obviously two re-sampling filters instead of one is bad practice. But in my case it's done only once so it's not an issue. here is a final bit of code doing exactly that : // input data : typedef itk::Image Image3d; Image3d::PointType P1 = somePoint(); Image3d::Pointer itkImage = someImage(); double R[3][3] = someRotationMatrix(); auto inSize = itkImage->GetLargestPossibleRegion().GetSize(); Image3d::PointType origin = itkImage->GetOrigin(); origin.Fill(0); itkImage->SetOrigin(origin); //--- translate image typedef itk::TranslationTransform TranslationTransformType; TranslationTransformType::Pointer transform_t = TranslationTransformType::New(); TranslationTransformType::OutputVectorType translation; Image3d::PointType offset; offset.Fill(0); Image3d::IndexType centerPix; for (int i = 0; i < 3; i++) centerPix[i] = inSize[i] / 2; Image3d::PointType centerPhysical; itkImage->TransformIndexToPhysicalPoint(centerPix, centerPhysical); offset = P1 - centerPhysical; translation[0] = offset[0]; translation[1] = offset[1]; translation[2] = offset[2]; transform_t->Translate(translation); typedef itk::ResampleImageFilter ResampleImageFilterType; ResampleImageFilterType::Pointer resampleFilter_t = ResampleImageFilterType::New(); resampleFilter_t->SetTransform(transform_t.GetPointer()); resampleFilter_t->SetInput(itkImage); double outSpacing[3] = { 0.3, 0.3, 0.3 }; resampleFilter_t->SetOutputSpacing(outSpacing); for (int i = 0; i < 3; i++) inSize[i] *= itkImage->GetSpacing()[i] / outSpacing[i]; resampleFilter_t->SetSize(inSize); resampleFilter_t->SetDefaultPixelValue(255); resampleFilter_t->Update(); Image3d::Pointer translatedImg = resampleFilter_t->GetOutput(); //--- rotate translated image typedef itk::FixedCenterOfRotationAffineTransform TransformType; TransformType::Pointer Rt = TransformType::New(); TransformType::ParametersType params(12); params.Fill(0); for (int i = 0; i < 9; i++) params[i] = R[i/3][i%3]; // R[i%3][i/3] == R.tranpsose , switch % and / to alternate between R and R.t Rt->SetParameters(params); Image3d::PointType rotcenter; for (int i = 0; i < 3; i++) centerPix[i] = inSize[i] / 2.; translatedImg->TransformIndexToPhysicalPoint(centerPix, rotcenter); Rt->SetCenter(rotcenter); typedef itk::ResampleImageFilter FilterType; FilterType::Pointer filter = FilterType::New(); typedef itk::NearestNeighborInterpolateImageFunction InterpolatorType; InterpolatorType::Pointer interpolator = InterpolatorType::New(); filter->SetInterpolator(interpolator); filter->SetDefaultPixelValue(255); filter->SetOutputOrigin(origin); filter->SetOutputSpacing(outSpacing); filter->SetSize(inSize); filter->SetInput(translatedImg); filter->SetTransform(Rt); filter->Update(); Image3d::Pointer rotatedImg = filter->GetOutput(); //--- crop Image3d::IndexType start; Image3d::SizeType size; start.Fill(0); size.Fill(10); start = centerPix; start[1] -= 10 / rotatedImg->GetSpacing()[1]; // 1cm bellow in Y start[2] -= 10 / rotatedImg->GetSpacing()[2]; // 1cm bellow in Z size[0] = axis.length() / rotatedImg->GetSpacing()[0]; // axis lenght in X size[1] = 20 / rotatedImg->GetSpacing()[1]; // 2cm in Y size[2] = 20 / rotatedImg->GetSpacing()[2]; // 2cm in Z Image3d::RegionType desiredRegion(start, size); typedef itk::ExtractImageFilter< Image3d, Image3d > CropFilterType; CropFilterType::Pointer cropFilter = CropFilterType::New(); cropFilter->SetExtractionRegion(desiredRegion); cropFilter->SetInput(rotatedImg); cropFilter->SetDirectionCollapseToIdentity(); cropFilter->Update(); Image3d::Pointer cropOut = cropFilter->GetOutput(); cropOut->SetRegions(cropOut->GetLargestPossibleRegion().GetSize()); Thanks again for the help, A. 2017-09-13 13:16 GMT+02:00 g2 : > Hello Francois, D?enan, > > > Francois Budin-3 wrote > > I think you are missing a step in your computation: > > 1) You need to trnasform your point before rotation to find its position > > after transformation. You can directly use the affine transform for that: > > affineTransform->TransformPoint(my_point) > > 2) Compute the index of the transformed point: > > filter->GetOutput()->TransformPhysicalPointToIndex(Pp, Pp_pix); > > > > I think you forgot to compute 1) > > I did not use the TransformPoint function but I did transform the points > using my own matrix multiplication method before using > transformPhysicalPointToIndex. And it gives the same results. > > > > While cleaning up the code I discovered that the input 3D point I was > getting were actually not in proper physical space, they did not take image > origin into account, only pixel position * spacing. I'll try to see the > implication of that in my code and I'll come back to you. > > Cheers, > A. > > > > > -- > Sent from: http://itk-users.7.n7.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: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 francois.budin at kitware.com Fri Sep 15 09:06:01 2017 From: francois.budin at kitware.com (Francois Budin) Date: Fri, 15 Sep 2017 09:06:01 -0400 Subject: [ITK] [ITK-users] Rotation of anisotropic 3D image In-Reply-To: References: <1505209284609-0.post@n2.nabble.com> <1505301404377-0.post@n7.nabble.com> Message-ID: Thanks for sharing your final code! On Fri, Sep 15, 2017 at 7:14 AM, Antoine wrote: > OK I got it to work by changing my approach. > As I wasn't able to get the rotation and translation working in a single > pass, I divided my algorithm in two steps : > - a translation so that my initial point is in the center of the image. > - a rotation around the center of the image with the given rotation matrix > > As a pre-processing I also reset the origin of my input image to be > (0,0,0), this values is then restored afterward, but it simplified a lot of > things for me. > This solved also the issue of guessing the size of my output image when > the feature I'm interested in is far from the center. By applying a > translation first I know that it's going to stay centred after the rotation > and I do not need to worry about my area of interest ending up out of > bounds. After these two steps I can crop from the center of the image and > along the X axis (see drawing from two posts above). > Obviously two re-sampling filters instead of one is bad practice. But in > my case it's done only once so it's not an issue. > > here is a final bit of code doing exactly that : > > > // input data : > typedef itk::Image Image3d; > Image3d::PointType P1 = somePoint(); > Image3d::Pointer itkImage = someImage(); > double R[3][3] = someRotationMatrix(); > auto inSize = itkImage->GetLargestPossibleRegion().GetSize(); > Image3d::PointType origin = itkImage->GetOrigin(); > origin.Fill(0); > itkImage->SetOrigin(origin); > > //--- translate image > typedef itk::TranslationTransform TranslationTransformType; > TranslationTransformType::Pointer transform_t = > TranslationTransformType::New(); > TranslationTransformType::OutputVectorType translation; > > Image3d::PointType offset; > offset.Fill(0); > Image3d::IndexType centerPix; > for (int i = 0; i < 3; i++) centerPix[i] = inSize[i] / 2; > Image3d::PointType centerPhysical; > itkImage->TransformIndexToPhysicalPoint(centerPix, centerPhysical); > offset = P1 - centerPhysical; > translation[0] = offset[0]; > translation[1] = offset[1]; > translation[2] = offset[2]; > transform_t->Translate(translation); > > typedef itk::ResampleImageFilter > ResampleImageFilterType; > ResampleImageFilterType::Pointer resampleFilter_t = > ResampleImageFilterType::New(); > resampleFilter_t->SetTransform(transform_t.GetPointer()); > resampleFilter_t->SetInput(itkImage); > double outSpacing[3] = { 0.3, 0.3, 0.3 }; > resampleFilter_t->SetOutputSpacing(outSpacing); > for (int i = 0; i < 3; i++) inSize[i] *= itkImage->GetSpacing()[i] / > outSpacing[i]; > resampleFilter_t->SetSize(inSize); > resampleFilter_t->SetDefaultPixelValue(255); > resampleFilter_t->Update(); > Image3d::Pointer translatedImg = resampleFilter_t->GetOutput(); > > > > //--- rotate translated image > typedef itk::FixedCenterOfRotationAffineTransform > TransformType; > TransformType::Pointer Rt = TransformType::New(); > TransformType::ParametersType params(12); > params.Fill(0); > for (int i = 0; i < 9; i++) params[i] = R[i/3][i%3]; // R[i%3][i/3] == > R.tranpsose , switch % and / to alternate between R and R.t > > Rt->SetParameters(params); > Image3d::PointType rotcenter; > for (int i = 0; i < 3; i++) centerPix[i] = inSize[i] / 2.; > translatedImg->TransformIndexToPhysicalPoint(centerPix, rotcenter); > Rt->SetCenter(rotcenter); > > typedef itk::ResampleImageFilter FilterType; > FilterType::Pointer filter = FilterType::New(); > typedef itk::NearestNeighborInterpolateImageFunction > InterpolatorType; > InterpolatorType::Pointer interpolator = InterpolatorType::New(); > filter->SetInterpolator(interpolator); > filter->SetDefaultPixelValue(255); > filter->SetOutputOrigin(origin); > filter->SetOutputSpacing(outSpacing); > filter->SetSize(inSize); > filter->SetInput(translatedImg); > filter->SetTransform(Rt); > filter->Update(); > > Image3d::Pointer rotatedImg = filter->GetOutput(); > > //--- crop > Image3d::IndexType start; > Image3d::SizeType size; > > start.Fill(0); > size.Fill(10); > > start = centerPix; > start[1] -= 10 / rotatedImg->GetSpacing()[1]; // 1cm bellow in Y > start[2] -= 10 / rotatedImg->GetSpacing()[2]; // 1cm bellow in Z > size[0] = axis.length() / rotatedImg->GetSpacing()[0]; // axis lenght in X > size[1] = 20 / rotatedImg->GetSpacing()[1]; // 2cm in Y > size[2] = 20 / rotatedImg->GetSpacing()[2]; // 2cm in Z > > Image3d::RegionType desiredRegion(start, size); > typedef itk::ExtractImageFilter< Image3d, Image3d > CropFilterType; > CropFilterType::Pointer cropFilter = CropFilterType::New(); > cropFilter->SetExtractionRegion(desiredRegion); > cropFilter->SetInput(rotatedImg); > cropFilter->SetDirectionCollapseToIdentity(); > cropFilter->Update(); > Image3d::Pointer cropOut = cropFilter->GetOutput(); > cropOut->SetRegions(cropOut->GetLargestPossibleRegion().GetSize()); > > > Thanks again for the help, > A. > > > 2017-09-13 13:16 GMT+02:00 g2 : > >> Hello Francois, D?enan, >> >> >> Francois Budin-3 wrote >> > I think you are missing a step in your computation: >> > 1) You need to trnasform your point before rotation to find its position >> > after transformation. You can directly use the affine transform for >> that: >> > affineTransform->TransformPoint(my_point) >> > 2) Compute the index of the transformed point: >> > filter->GetOutput()->TransformPhysicalPointToIndex(Pp, Pp_pix); >> > >> > I think you forgot to compute 1) >> >> I did not use the TransformPoint function but I did transform the points >> using my own matrix multiplication method before using >> transformPhysicalPointToIndex. And it gives the same results. >> >> >> >> While cleaning up the code I discovered that the input 3D point I was >> getting were actually not in proper physical space, they did not take >> image >> origin into account, only pixel position * spacing. I'll try to see the >> implication of that in my code and I'll come back to you. >> >> Cheers, >> A. >> >> >> >> >> -- >> Sent from: http://itk-users.7.n7.nabble.com/ >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the ITK FAQ at: >> http://www.itk.org/Wiki/ITK_FAQ >> >> Follow this link to subscribe/unsubscribe: >> http://public.kitware.com/mailman/listinfo/insight-users >> > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 francois.budin at kitware.com Fri Sep 15 09:10:47 2017 From: francois.budin at kitware.com (Francois Budin) Date: Fri, 15 Sep 2017 09:10:47 -0400 Subject: [ITK] [ITK-users] Suggestion for itk::BoundingBox In-Reply-To: <1505436450589.98090@sphic.org.cn> References: <1505436450589.98090@sphic.org.cn> Message-ID: Hello Zhuangming Shen, Thanks for suggesting new functionalities. Could you add that suggestion on JIRA [1], the bug tracking system ITK uses. Thanks, Francois [1] https://issues.itk.org/jira/secure/Dashboard.jspa On Thu, Sep 14, 2017 at 8:46 PM, ??? wrote: > Hi all, > > > Bounding box is a very useful functionality for me. I suggest whether > itk::BoundingBox can provide an API which will directly output a binary > image. For the binary image, pixels/voxels inside the bounding box are > represented as 1, other pixels/voxels outside the bounding box are > represented as 0. > > > > 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 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 Sep 15 09:50:43 2017 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Fri, 15 Sep 2017 09:50:43 -0400 Subject: [ITK] [ITK-users] Suggestion for itk::BoundingBox In-Reply-To: References: <1505436450589.98090@sphic.org.cn> Message-ID: Hi Zhuangming Shen, itk::Region already has IsInside method. A method which returns an image with all 1s inside the region, and 0s outside is a big functionality overlap with IsInside method, and probably too specific to be worth maintaining it in the long term. You can add it as a feature request, but I doubt anyone will implement that: those competent enough to implement it will not see a big need for it, and those who see the need for it are probably not competent enough to implement it :) It would be a good exercise if you tried to implement it yourself. Regards, D?enan Zuki?, PhD, Senior R&D Engineer, Kitware (Carrboro, N.C.) On Fri, Sep 15, 2017 at 9:10 AM, Francois Budin wrote: > Hello Zhuangming Shen, > > Thanks for suggesting new functionalities. Could you add that suggestion > on JIRA [1], the bug tracking system ITK uses. > > Thanks, > Francois > [1] https://issues.itk.org/jira/secure/Dashboard.jspa > > On Thu, Sep 14, 2017 at 8:46 PM, ??? wrote: > >> Hi all, >> >> >> Bounding box is a very useful functionality for me. I suggest whether >> itk::BoundingBox can provide an API which will directly output a binary >> image. For the binary image, pixels/voxels inside the bounding box are >> represented as 1, other pixels/voxels outside the bounding box are >> represented as 0. >> >> >> >> 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 > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 zhuangming.shen at sphic.org.cn Fri Sep 15 09:56:24 2017 From: zhuangming.shen at sphic.org.cn (=?utf-8?B?5rKI5bqE5piO?=) Date: Fri, 15 Sep 2017 13:56:24 +0000 Subject: [ITK] [ITK-users] Suggestion for itk::BoundingBox In-Reply-To: References: <1505436450589.98090@sphic.org.cn> , Message-ID: <1505483808150.21368@sphic.org.cn> Hi Francois and D?enan, Thanks for your advises. I have created a feature request. https://issues.itk.org/jira/browse/ITK-3567? Regards, Zhuangming Shen ________________________________ From: D?enan Zuki? Sent: Friday, September 15, 2017 9:50 PM To: Francois Budin Cc: ???; insight-users at itk.org Subject: Re: [ITK-users] Suggestion for itk::BoundingBox Hi Zhuangming Shen, itk::Region already has IsInside method. A method which returns an image with all 1s inside the region, and 0s outside is a big functionality overlap with IsInside method, and probably too specific to be worth maintaining it in the long term. You can add it as a feature request, but I doubt anyone will implement that: those competent enough to implement it will not see a big need for it, and those who see the need for it are probably not competent enough to implement it :) It would be a good exercise if you tried to implement it yourself. Regards, D?enan Zuki?, PhD, Senior R&D Engineer, Kitware (Carrboro, N.C.) On Fri, Sep 15, 2017 at 9:10 AM, Francois Budin > wrote: Hello Zhuangming Shen, Thanks for suggesting new functionalities. Could you add that suggestion on JIRA [1], the bug tracking system ITK uses. Thanks, Francois [1] https://issues.itk.org/jira/secure/Dashboard.jspa On Thu, Sep 14, 2017 at 8:46 PM, ??? > wrote: Hi all, Bounding box is a very useful functionality for me. I suggest whether itk::BoundingBox can provide an API which will directly output a binary image. For the binary image, pixels/voxels inside the bounding box are represented as 1, other pixels/voxels outside the bounding box are represented as 0. 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 niels-xtk at xs4all.nl Fri Sep 15 10:54:13 2017 From: niels-xtk at xs4all.nl (Niels Dekker) Date: Fri, 15 Sep 2017 16:54:13 +0200 Subject: [ITK] [ANN] ITK 4.12.2 has been released! In-Reply-To: References: Message-ID: <1a4b0fa6dd288fc7f2b6188d6aabc7b2@xs4all.nl> Thank you very much, Matt! Two very small nitpicks: https://itk.org/ITK/resources/software.html still says "The current release is version 4.12.1". And the last commit at https://github.com/Kitware/ITK/tree/v4.12.2 mistakenly says: "ENH: Bump CMakeLists.txt version to 4.12.1" But it doesn't matter, as the tag itself is correctly tagging v4.12.2. And I'm very happy to see that the NIFTI fixes that I asked for are in there :-) Kind regards, Niels On 2017-09-14 21:15, Matt McCormick wrote: > On behalf of the Insight Segmentation and Registration Toolkit (ITK) > Community, we are happy to announce the release of ITK 4.12.2! > > ITK is an open-source, cross-platform library for multidimensional > image analysis. > > Release files can be downloaded from > > http://itk.org/ITK/resources/software.html. > > This is a patch release that fixes critical issues, regressions, > documentation, and compiler support. This release includes better > compatibility when building an application that includes additional > NIFTI libraries and also fixes for GPGPU build support. Contributions > from the 3D Slicer community improve packaging on macOS. > > The release also includes an update to the ITK Software Guide that > adds the coding style guide among other updates and additions. > > The next feature release, 4.13.0, is scheduled for mid-December. > > Enjoy ITK! > > > ITK changes from v4.12.1 to v4.12.2: > > Edwin Bennink (1): > BUG: Fixed cylinder bbox, fixed and enhanced IsInside func > > Floris Berendsen (1): > COMP: add symbol name mangling for niftilib in ITK > > Jean-Christophe Fillion-Robin (2): > COMP: Update MINC to set MACOSX_RPATH property based on > CMAKE_MACOSX_RPATH > COMP: Update KWsys to set MACOSX_RPATH property based on > CMAKE_MACOSX_RPATH > > Matthew McCormick (6): > BUG: Correct GPUMeanImageFilter Superclass > BUG: Remove debug code from GPUMeanImageFilter > BUG: Do not use static_cast, SmartPointer in > GPUImage::GetGPUDataManager > BUG: Remove debug code in itkGPUImage.hxx > COMP: Fix AnisotropicDiffusionLBR example build > ENH: Bump CMakeLists.txt version to 4.12.2 > > Niels Dekker (1): > COMP: Fixed leak into user code > > > ITK Software Guide changes: > > Jon Haitz Legarreta Gorro?o (8): > DOC: Add and reference Coding Style appendix. > DOC: Fix typo in Registration chapter files headers. > STYLE: Replace tabs with white spaces. > DOC: Fix typos in the SW guide LaTeX files. > ENH: Add the link to the SW Guide PDF compilation version. > DOC: Add missing wrap types to Wrapping section. > STYLE: Rework the folder structure and rename files. > ENH: Remove \ifitkFullVersion artifact switch. > > Matt McCormick (2): > DOC: Add instructions on how to install the stable Python > packages > ENH: Bump ITK ExternalProject version to 4.12.2 -- Niels Dekker Scientific programmer LKEB, Leiden University Medical Center, Netherlands From matt.mccormick at kitware.com Fri Sep 15 11:00:20 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Fri, 15 Sep 2017 11:00:20 -0400 Subject: [ITK] [ITK-dev] [ANN] ITK 4.12.2 has been released! In-Reply-To: <1a4b0fa6dd288fc7f2b6188d6aabc7b2@xs4all.nl> References: <1a4b0fa6dd288fc7f2b6188d6aabc7b2@xs4all.nl> Message-ID: On Fri, Sep 15, 2017 at 10:54 AM, Niels Dekker wrote: > Thank you very much, Matt! > > Two very small nitpicks: > > https://itk.org/ITK/resources/software.html still says "The current release > is version 4.12.1". Thanks for the note. We'll correct that. > And the last commit at https://github.com/Kitware/ITK/tree/v4.12.2 > mistakenly says: "ENH: Bump CMakeLists.txt version to 4.12.1" But it doesn't > matter, as the tag itself is correctly tagging v4.12.2. Yes, the commit message is wrong, but the tag is correct. I also moved the previous v4.12.1 tag so it points to the correct commit. > And I'm very happy to see that the NIFTI fixes that I asked for are in there > :-) Thanks again for the contribution, and sorry we did not get it in the first time around. From niels-xtk at xs4all.nl Fri Sep 15 11:35:43 2017 From: niels-xtk at xs4all.nl (Niels Dekker) Date: Fri, 15 Sep 2017 17:35:43 +0200 Subject: [ITK] How to avoid NIFTI header files from being installed? Message-ID: <348ae5559ef7e6c035f3b5f01a7b1c16@xs4all.nl> With ITK 4.12.2, ITKNIFTI has moved from the DEPENDS section to the PRIVATE_DEPENDS section of NIFTI IO module, and I think that's a good thing: https://github.com/Kitware/ITK/blob/v4.12.2/Modules/IO/NIFTI/itk-module.cmake https://github.com/Kitware/ITK/commit/940f68ec18b15e500cc22d8ddb1dbae34b66cb2f#diff-72c0401735029f07ee8f10df8269b871 The internal interface between ITK and NIFTI should not be leaked to ITK user applications, so that's just fine. However, when doing an INSTALL, nifti1.h and nifti1_io.h (as well as itk_nifti_mangle.h) are still copied to the user's install directory: -- Installing: /include/ITK-4.12/itk_nifti_mangle.h -- Installing: /include/ITK-4.12/nifti1.h -- Installing: /include/ITK-4.12/nifti1_io.h Is this really necessary? If not, how could this possibly be fixed? Kind regards, Niels -- Niels Dekker Scientific programmer LKEB, Leiden University Medical Center, Netherlands From axb724 at case.edu Fri Sep 15 14:39:38 2017 From: axb724 at case.edu (Atallah Baydoun) Date: Fri, 15 Sep 2017 14:39:38 -0400 Subject: [ITK] CBCT projection data Message-ID: Sorry for the question but I am starting to process CBCT data from Elekta XVI. I was able to read the .his file. I have applied the formula: I/I0= 1- Projection/65535 One problem is that even when *no attenuation is expected* the matrix is returning *positive values instead of 0 ?* Does anyone have any thought about it ? Thank you, Atallah -------------- next part -------------- An HTML attachment was scrubbed... URL: From s0548921 at HTW-Berlin.de Fri Sep 15 15:52:27 2017 From: s0548921 at HTW-Berlin.de (Chris Rebbelin) Date: Fri, 15 Sep 2017 21:52:27 +0200 Subject: [ITK] The Meaning of MHD/MHA Message-ID: <71ea87d9ddee65bd304f86a22d885b83@HTW-Berlin.de> Hi, I'm working with the MetaImage Format and was wondering what MHA actually stands for? Given MHD seems to be "MetaHeaDer", what is the "A" in "MHA" standing for? Thanks a lot. Chris From dzenanz at gmail.com Fri Sep 15 17:21:13 2017 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Fri, 15 Sep 2017 17:21:13 -0400 Subject: [ITK] The Meaning of MHD/MHA In-Reply-To: <71ea87d9ddee65bd304f86a22d885b83@HTW-Berlin.de> References: <71ea87d9ddee65bd304f86a22d885b83@HTW-Berlin.de> Message-ID: Hi Chris, my guess would be *M*eta*H*eader*A*ll-in-one. But somebody might pitch in with more insider information :) Regards, D?enan Zuki?, PhD, Senior R&D Engineer, Kitware (Carrboro, N.C.) On Fri, Sep 15, 2017 at 3:52 PM, Chris Rebbelin wrote: > Hi, > I'm working with the MetaImage Format and was wondering what MHA actually > stands for? > Given MHD seems to be "MetaHeaDer", what is the "A" in "MHA" standing for? > > > Thanks a lot. > Chris > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lasso at queensu.ca Fri Sep 15 17:29:56 2017 From: lasso at queensu.ca (Andras Lasso) Date: Fri, 15 Sep 2017 21:29:56 +0000 Subject: [ITK] The Meaning of MHD/MHA In-Reply-To: References: <71ea87d9ddee65bd304f86a22d885b83@HTW-Berlin.de>, Message-ID: As far as I know, 'a' stands for 'archive'. Andras ________________________________ From: Community on behalf of D?enan Zuki? Sent: Friday, September 15, 2017 5:21:13 PM To: Chris Rebbelin Cc: community at itk.org Subject: Re: [ITK] The Meaning of MHD/MHA Hi Chris, my guess would be MetaHeaderAll-in-one. But somebody might pitch in with more insider information :) Regards, D?enan Zuki?, PhD, Senior R&D Engineer, Kitware (Carrboro, N.C.) On Fri, Sep 15, 2017 at 3:52 PM, Chris Rebbelin > wrote: Hi, I'm working with the MetaImage Format and was wondering what MHA actually stands for? Given MHD seems to be "MetaHeaDer", what is the "A" in "MHA" standing for? Thanks a lot. Chris _______________________________________________ Community mailing list Community at itk.org http://public.kitware.com/mailman/listinfo/community -------------- next part -------------- An HTML attachment was scrubbed... URL: From jhlegarreta at vicomtech.org Sat Sep 16 04:14:49 2017 From: jhlegarreta at vicomtech.org (Jon Haitz Legarreta) Date: Sat, 16 Sep 2017 10:14:49 +0200 Subject: [ITK] [ITK-dev] Coding Style guide added to the ITKSoftwareGuide In-Reply-To: References: Message-ID: Thanks for the release ! The addition was based on previous work by the community, and it's been the result of the review process where many developers have taken part. Hope developers find it useful, and find answers to the style questions they may have when contributing to ITK. Best, JON HAITZ -- On 14 September 2017 at 20:54, Matt McCormick wrote: > Hats off to Jon! > > There may be omissions or corrections to make as we migrate the > content from the wiki and source tree PDF. If you find any areas for > improvement, please consider submitting a patch: > > https://github.com/InsightSoftwareConsortium/ITKSoftwareGuide/blob/ > b202452cb7f9ad85f471d5acd036bb3bd79a8b18/README.md#how-to- > contribute-to-the-itk-software-guide > > > On Thu, Sep 14, 2017 at 2:48 PM, Francois Budin > wrote: > > Dear ITK developers, > > > > > > I am happy to announce that the ITK Coding Style Guide has been added to > the > > book 1 of the ITKSoftwareGuide as a new appendix (B). You can access the > > guide in the HTML version of the ITKSoftwareGuide here [1] or download > the > > new ITKSoftwareGuide PDF here [2]. This is the result of the hard work > frome > > by Jon Haitz Legarreta Gorro?o. > > This addition will be extremely useful not only to new developers but > also > > to experimented developers. The coding style documents all the aspects of > > the code style: philosophy, naming conventions, error message > conventions, > > tests, and documentation. > > > > Enjoy the read and thanks for the wonderful contribution! > > Francois > > > > [1] > > https://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch12. > html#x51-188000B > > [2] http://www.itk.org/ItkSoftwareGuide.pdf > > > > _______________________________________________ > > Powered by www.kitware.com > > > > Visit other Kitware open-source projects at > > http://www.kitware.com/opensource/opensource.html > > > > Kitware offers ITK Training Courses, for more information visit: > > http://kitware.com/products/protraining.php > > > > Please keep messages on-topic and check the ITK FAQ at: > > http://www.itk.org/Wiki/ITK_FAQ > > > > Follow this link to subscribe/unsubscribe: > > http://public.kitware.com/mailman/listinfo/insight-developers > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-developers > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers From yannick.suter at istb.unibe.ch Sat Sep 16 12:45:57 2017 From: yannick.suter at istb.unibe.ch (yannick.suter at istb.unibe.ch) Date: Sat, 16 Sep 2017 16:45:57 +0000 Subject: [ITK] Python wrapper for first order ITKTextureFeatures Message-ID: <9B84F4F1401CC544B71937C2CC607EE21A404CC2@AAI-EXCH-MBX1.campus.unibe.ch> Dear all, I would like to use the the first order texture features of ITKTextureFeatures (https://github.com/InsightSoftwareConsortium/ITKTextureFeatures) in Python. Thanks to J.Vimort et al. for the great work! Since the coocurrence and run length features are already wrapped, I tried to take these as an example and wrap it myself (I'm very new to this). I would appreciate any help to point me into the right direction. That's what I've tried: - Created a .wrap file "itkFirstOrderTextureFeaturesImageFilter.wrap" and put it in the "/Modules/External/ITKTextureFeatures/wrapping" directory (see below) - Added "itkFirstOrderTextureFeaturesImageFilter" to the CMakeLists.txt in the "/Modules/External/ITKTextureFeatures/wrapping" directory, now looking like this: itk_wrap_module(TextureFeatures) set(WRAPPER_SUBMODULE_ORDER itkCoocurrenceTextureFeaturesImageFilter itkRunLengthTextureFeaturesImageFilter itkFirstOrderTextureFeaturesImageFilter) itk_auto_load_submodules() itk_end_wrap_module() This gives me the folowwing error for every datatype I set to wrap: >> /home/yannick/Projects/PhD/ITK/ITK/bin/Wrapping/itkFirstOrderTextureFeaturesImageFilter.cxx:79:18: error: too few template arguments for class template 'FirstOrderTextureFeaturesImageFilter' >> typedef itk::FirstOrderTextureFeaturesImageFilter< itk::Image< signed short,2 >, itk::Image,2> > itkFirstOrderTextureFeaturesImageFilterISS2IVF82; ^ >>/home/yannick/Projects/PhD/ITK/ITK/Modules/External/ITKTextureFeatures/include/itkFirstOrderTextureFeaturesImageFilter.h:52:27: note: template is declared here >>class ITK_TEMPLATE_EXPORT FirstOrderTextureFeaturesImageFilter: Since the it's working if I use it in C++, I don't see where template arguments are missing. Best and thank you, Yannick That's my .wrap-file: ------------ set(OutputVectorDim 8) itk_wrap_class("itk::FixedArray") itk_wrap_template("${ITKM_F}${OutputVectorDim}" "${ITKT_F},${OutputVectorDim}") itk_end_wrap_class() itk_wrap_class("itk::Vector") itk_wrap_template("${ITKM_F}${OutputVectorDim}" "${ITKT_F},${OutputVectorDim}") itk_end_wrap_class() WRAP_TYPE("itk::Image" "I" "itkImage.h") foreach(d ${ITK_WRAP_IMAGE_DIMS}) ADD_TEMPLATE("V${ITKM_F}${OutputVectorDim}${d}" "itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}") endforeach() END_WRAP_TYPE() itk_wrap_class("itk::Image" POINTER) foreach(d ${ITK_WRAP_IMAGE_DIMS}) itk_wrap_template("V${ITKM_F}${OutputVectorDim}${d}" "itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}") endforeach() itk_end_wrap_class() itk_wrap_class("itk::ImageSource" POINTER) foreach(d ${ITK_WRAP_IMAGE_DIMS}) itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" "itk::Image,${d}>") endforeach() itk_end_wrap_class() itk_wrap_class("itk::ImageToImageFilter" POINTER) foreach(d ${ITK_WRAP_IMAGE_DIMS}) foreach(t ${WRAP_ITK_INT}) itk_wrap_template("${ITKM_I${t}${d}}IV${ITKM_F}${OutputVectorDim}${d}" "${ITKT_I${t}${d}}, itk::Image,${d}>") endforeach() endforeach() itk_end_wrap_class() itk_wrap_simple_class("itk::ImageIOBase" ) itk_wrap_class("itk::ImageFileReader" POINTER) foreach(d ${ITK_WRAP_IMAGE_DIMS}) itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" "itk::Image,${d}>") endforeach() itk_end_wrap_class() itk_wrap_class("itk::ImageFileWriter" POINTER) foreach(d ${ITK_WRAP_IMAGE_DIMS}) itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" "itk::Image,${d}>") endforeach() itk_end_wrap_class() itk_wrap_class("itk::ImageFileWriter" POINTER) foreach(d ${ITK_WRAP_IMAGE_DIMS}) itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" "itk::Image,${d}>") endforeach() itk_end_wrap_class() itk_wrap_class("itk::FirstOrderTextureFeaturesImageFilter" POINTER) foreach(d ${ITK_WRAP_IMAGE_DIMS}) foreach(t ${WRAP_ITK_INT}) itk_wrap_template("${ITKM_I${t}${d}}IV${ITKM_F}${OutputVectorDim}${d}" "${ITKT_I${t}${d}}, itk::Image,${d}>") itk_wrap_template("${ITKM_I${t}${d}}${ITKM_VI${ITKM_F}${d}}" "${ITKT_I${t}${d}}, ${ITKT_VI${ITKM_F}${d}}") endforeach() endforeach() itk_end_wrap_class() -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Sun Sep 17 14:33:46 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Sun, 17 Sep 2017 14:33:46 -0400 Subject: [ITK] How to avoid NIFTI header files from being installed? In-Reply-To: <348ae5559ef7e6c035f3b5f01a7b1c16@xs4all.nl> References: <348ae5559ef7e6c035f3b5f01a7b1c16@xs4all.nl> Message-ID: Hi Niels, On Fri, Sep 15, 2017 at 11:35 AM, Niels Dekker wrote: > With ITK 4.12.2, ITKNIFTI has moved from the DEPENDS section to the > PRIVATE_DEPENDS section of NIFTI IO module, and I think that's a good thing: > > > https://github.com/Kitware/ITK/blob/v4.12.2/Modules/IO/NIFTI/itk-module.cmake > > https://github.com/Kitware/ITK/commit/940f68ec18b15e500cc22d8ddb1dbae34b66cb2f#diff-72c0401735029f07ee8f10df8269b871 > > The internal interface between ITK and NIFTI should not be leaked to ITK > user applications, so that's just fine. Yes, this is excellent. > However, when doing an INSTALL, nifti1.h and nifti1_io.h (as well as > itk_nifti_mangle.h) are still copied to the user's install directory: > > -- Installing: /include/ITK-4.12/itk_nifti_mangle.h > -- Installing: /include/ITK-4.12/nifti1.h > -- Installing: /include/ITK-4.12/nifti1_io.h > > Is this really necessary? If not, how could this possibly be fixed? To avoid this, a CMake option, ITK_USE_SYSTEM_NIFTI could be set up similar to other third party modules. The CMake configuration code needs to be added to the module so it can find the system NIFTI and export the required build information to other modules. Thanks, Matt From matt.mccormick at kitware.com Sun Sep 17 14:48:52 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Sun, 17 Sep 2017 14:48:52 -0400 Subject: [ITK] Python wrapper for first order ITKTextureFeatures In-Reply-To: <9B84F4F1401CC544B71937C2CC607EE21A404CC2@AAI-EXCH-MBX1.campus.unibe.ch> References: <9B84F4F1401CC544B71937C2CC607EE21A404CC2@AAI-EXCH-MBX1.campus.unibe.ch> Message-ID: Dear Yannick, It looks like you are close. To find out what template parameters to pass, the class declaration has this information: https://github.com/InsightSoftwareConsortium/ITKTextureFeatures/blob/master/include/itkFirstOrderTextureFeaturesImageFilter.h#L51 template< class TInputImage, class TOutputImage, class TKernel > There are three template parameters, the input image, the output image, and the kernel. To see what kind of types are used for these parameters, the test gives a hint: https://github.com/InsightSoftwareConsortium/ITKTextureFeatures/blob/master/test/itkFirstOrderTextureFeaturesImageFilterTest.cxx#L28-L30 The KernelType is usually itk::FlatStructuringElement< ImageDimension >. A grep through ITK's sources finds an example of how this is used as a template parameter when wrapping: https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/BinaryMathematicalMorphology/wrapping/itkBinaryDilateImageFilter.wrap There is also a good wrapping reference in the ITK Software Guide to reach for: https://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch9.html#x48-1540009.5 Please let use know if more help is needed. Contribution pull requests are welcome and appreciated :-) Thanks, Matt On Sat, Sep 16, 2017 at 12:45 PM, wrote: > Dear all, > > I would like to use the the first order texture features of > ITKTextureFeatures > (https://github.com/InsightSoftwareConsortium/ITKTextureFeatures) in Python. > Thanks to J.Vimort et al. for the great work! > Since the coocurrence and run length features are already wrapped, I tried > to take these as an example and wrap it myself (I'm very new to this). > > I would appreciate any help to point me into the right direction. > > That's what I've tried: > - Created a .wrap file "itkFirstOrderTextureFeaturesImageFilter.wrap" and > put it in the "/Modules/External/ITKTextureFeatures/wrapping" directory (see > below) > - Added "itkFirstOrderTextureFeaturesImageFilter" to the CMakeLists.txt in > the "/Modules/External/ITKTextureFeatures/wrapping" directory, now looking > like this: > > itk_wrap_module(TextureFeatures) > > set(WRAPPER_SUBMODULE_ORDER > itkCoocurrenceTextureFeaturesImageFilter > itkRunLengthTextureFeaturesImageFilter > itkFirstOrderTextureFeaturesImageFilter) > > itk_auto_load_submodules() > itk_end_wrap_module() > > This gives me the folowwing error for every datatype I set to wrap: >>> >>> /home/yannick/Projects/PhD/ITK/ITK/bin/Wrapping/itkFirstOrderTextureFeaturesImageFilter.cxx:79:18: >>> error: too few template arguments for class template >>> 'FirstOrderTextureFeaturesImageFilter' >>> typedef itk::FirstOrderTextureFeaturesImageFilter< itk::Image< signed >>> short,2 >, itk::Image,2> > >>> itkFirstOrderTextureFeaturesImageFilterISS2IVF82; > ^ >>>/home/yannick/Projects/PhD/ITK/ITK/Modules/External/ITKTextureFeatures/include/itkFirstOrderTextureFeaturesImageFilter.h:52:27: >>> note: template is declared here >>>class ITK_TEMPLATE_EXPORT FirstOrderTextureFeaturesImageFilter: > > Since the it's working if I use it in C++, I don't see where template > arguments are missing. > > Best and thank you, > > Yannick > > That's my .wrap-file: > ------------ > set(OutputVectorDim 8) > itk_wrap_class("itk::FixedArray") > itk_wrap_template("${ITKM_F}${OutputVectorDim}" > "${ITKT_F},${OutputVectorDim}") > itk_end_wrap_class() > > itk_wrap_class("itk::Vector") > itk_wrap_template("${ITKM_F}${OutputVectorDim}" > "${ITKT_F},${OutputVectorDim}") > itk_end_wrap_class() > > WRAP_TYPE("itk::Image" "I" "itkImage.h") > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > ADD_TEMPLATE("V${ITKM_F}${OutputVectorDim}${d}" > "itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}") > endforeach() > END_WRAP_TYPE() > > itk_wrap_class("itk::Image" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > itk_wrap_template("V${ITKM_F}${OutputVectorDim}${d}" > "itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}") > endforeach() > itk_end_wrap_class() > > itk_wrap_class("itk::ImageSource" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" > "itk::Image,${d}>") > endforeach() > itk_end_wrap_class() > > itk_wrap_class("itk::ImageToImageFilter" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > foreach(t ${WRAP_ITK_INT}) > itk_wrap_template("${ITKM_I${t}${d}}IV${ITKM_F}${OutputVectorDim}${d}" > "${ITKT_I${t}${d}}, > itk::Image,${d}>") > endforeach() > endforeach() > itk_end_wrap_class() > > itk_wrap_simple_class("itk::ImageIOBase" ) > > itk_wrap_class("itk::ImageFileReader" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" > > "itk::Image,${d}>") > endforeach() > itk_end_wrap_class() > > itk_wrap_class("itk::ImageFileWriter" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" > > "itk::Image,${d}>") > endforeach() > itk_end_wrap_class() > > itk_wrap_class("itk::ImageFileWriter" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" > > "itk::Image,${d}>") > endforeach() > itk_end_wrap_class() > > itk_wrap_class("itk::FirstOrderTextureFeaturesImageFilter" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > foreach(t ${WRAP_ITK_INT}) > itk_wrap_template("${ITKM_I${t}${d}}IV${ITKM_F}${OutputVectorDim}${d}" > "${ITKT_I${t}${d}}, > itk::Image,${d}>") > itk_wrap_template("${ITKM_I${t}${d}}${ITKM_VI${ITKM_F}${d}}" > "${ITKT_I${t}${d}}, ${ITKT_VI${ITKM_F}${d}}") > endforeach() > endforeach() > itk_end_wrap_class() > > > > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > From niels-xtk at xs4all.nl Mon Sep 18 09:32:51 2017 From: niels-xtk at xs4all.nl (Niels Dekker) Date: Mon, 18 Sep 2017 15:32:51 +0200 Subject: [ITK] How to avoid NIFTI header files from being installed? In-Reply-To: References: <348ae5559ef7e6c035f3b5f01a7b1c16@xs4all.nl> Message-ID: <83d513b3f543e03025dd944b1664723f@xs4all.nl> >> However, when doing an INSTALL, nifti1.h and nifti1_io.h (as well as >> itk_nifti_mangle.h) are still copied to the user's install directory Matt McCormick replied: > To avoid this, a CMake option, ITK_USE_SYSTEM_NIFTI could be set up > similar to other third party modules. The CMake configuration code > needs to be added to the module so it can find the system NIFTI and > export the required build information to other modules. Thanks for your reply, Matt! ITK_USE_SYSTEM_NIFTI might be interesting option. However, I was thinking of a different problem: Suppose my application MyApp depends on both ITK (installed at the ITK_INSTALL_PREFIX directory), and "my own version" of niftilib. In this case, I want ITK to internally still use the ITK version of niftilib. MyApp has ITK_INSTALL_PREFIX/include/ITK-4.12 as one of its include directories. However, when a CXX file of MyApp does #include , it should #include the niftilib file from "my own version" of niftilib, not the one internally used by ITK! Now I see there already exists a CMake option to stop ITK niftilib header files from being installed: NIFTI_INSTALL_NO_DEVELOPMENT It's being used in the CMakeLists.txt files at ThirdParty\NIFTI\src\nifti\znzlib and ThirdParty\NIFTI\src\nifti\niftilib: https://github.com/Kitware/ITK/blob/v4.12.2/Modules/ThirdParty/NIFTI/src/nifti/niftilib/CMakeLists.txt#L29 I was about to suggest to set NIFTI_INSTALL_NO_DEVELOPMENT ON by default. But now I see, "gifti_io.h" does #include : https://github.com/Kitware/ITK/blob/v4.12.2/Modules/ThirdParty/GIFTI/src/gifticlib/gifti_io.h#L6 "gifti_io.h" is also copied to ITK_INSTALL_PREFIX, during an ITK install. So ITK users can only set NIFTI_INSTALL_NO_DEVELOPMENT ON when they do not need to #include this header file. And actually, "itkGiftiMeshIO.h" does #include "gifti_io.h": https://github.com/Kitware/ITK/blob/v4.12.2/Modules/IO/Mesh/include/itkGiftiMeshIO.h#L27 This #include "gifti_io.h" could be hidden by moving the include statement from "itkGiftiMeshIO.h" to "itkGiftiMeshIO.cxx". That could be done by adding a "proxy mechanism" to itk::GiftiMeshIO, similar to what we added to itk::NiftiIO. Do you think that would be a good idea? Kind regards, also on behalf of my colleague Floris Berendsen, Niels -- Niels Dekker Scientific programmer LKEB, Leiden University Medical Center, Netherlands From yannick.suter at istb.unibe.ch Mon Sep 18 10:09:00 2017 From: yannick.suter at istb.unibe.ch (yannick.suter at istb.unibe.ch) Date: Mon, 18 Sep 2017 14:09:00 +0000 Subject: [ITK] Python wrapper for first order ITKTextureFeatures In-Reply-To: References: <9B84F4F1401CC544B71937C2CC607EE21A404CC2@AAI-EXCH-MBX1.campus.unibe.ch>, Message-ID: <9B84F4F1401CC544B71937C2CC607EE21A4051BF@AAI-EXCH-MBX1.campus.unibe.ch> Dear Matt, Thank you for helping! The link to the structuring element example was very useful. I ran into a new issue where I would appreciate some help: The FirstOrderTextureFeaturesImageFilter uses the "MovingHistogramImageFilter", and I have some issues wrapping it correctly. I get the following error for each type I want to wrap: Warning 401: Nothing known about base class 'itk::MovingHistogramImageFilter< itk::Image< short,2 >,itk::VectorImage< float,2 >,itk::FlatStructuringElement< 2 >,itk::Function::FirstOrderTextureHistogram< short,itk::VariableLengthVector< float > > >'. Ignored. /home/yannick/Projects/PhD/ITK/ITK/bin/Wrapping/Typedefs/itkFirstOrderTextureFeaturesImageFilter.i:99: Warning 401: Maybe you forgot to instantiate 'itk::MovingHistogramImageFilter< itk::Image< short,2 >,itk::VectorImage< float,2 >,itk::FlatStructuringElement< 2 >,itk::Function::FirstOrderTextureHistogram< short,itk::VariableLengthVector< float > > >' using %template. Even though I put the MovingHistogramImageFilter in the .wrap file and tried including the base class itkMovingHistogramImageFilterBase as well. Could you take a look? Here's my itkFirstOrderTextureFeaturesImageFilter.wrap file: ---------------------------------------------------- set(OutputVectorDim 8) itk_wrap_class("itk::FixedArray") itk_wrap_template("${ITKM_F}${OutputVectorDim}" "${ITKT_F},${OutputVectorDim}") itk_end_wrap_class() itk_wrap_class("itk::Vector") itk_wrap_template("${ITKM_F}${OutputVectorDim}" "${ITKT_F},${OutputVectorDim}") itk_end_wrap_class() WRAP_TYPE("itk::Image" "I" "itkImage.h") foreach(d ${ITK_WRAP_IMAGE_DIMS}) ADD_TEMPLATE("V${ITKM_F}${OutputVectorDim}${d}" "itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}") endforeach() END_WRAP_TYPE() itk_wrap_class("itk::Image" POINTER) foreach(d ${ITK_WRAP_IMAGE_DIMS}) itk_wrap_template("V${ITKM_F}${OutputVectorDim}${d}" "itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}") endforeach() itk_end_wrap_class() itk_wrap_class("itk::ImageSource" POINTER) foreach(d ${ITK_WRAP_IMAGE_DIMS}) itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" "itk::Image,${d}>") endforeach() itk_end_wrap_class() itk_wrap_class("itk::ImageToImageFilter" POINTER) foreach(d ${ITK_WRAP_IMAGE_DIMS}) foreach(t ${WRAP_ITK_INT}) itk_wrap_template("${ITKM_I${t}${d}}IV${ITKM_F}${OutputVectorDim}${d}" "${ITKT_I${t}${d}}, itk::Image,${d}>") endforeach() endforeach() itk_end_wrap_class() itk_wrap_include("itkFlatStructuringElement.h") WRAP_TYPE("itk::FlatStructuringElement" "SE") foreach(d ${ITK_WRAP_IMAGE_DIMS}) ADD_TEMPLATE("${d}" "${d}") endforeach() END_WRAP_TYPE() set(itk_Wrap_StructuringElement ${WRAPPER_TEMPLATES}) itk_wrap_simple_class("itk::ImageIOBase" ) itk_wrap_class("itk::KernelImageFilter" POINTER) foreach(t ${WRAP_ITK_INT}) foreach(d ${ITK_WRAP_IMAGE_DIMS}) itk_wrap_template("${ITKM_I${t}${d}}${ITKM_I${t}${d}}${ITKM_SE${d}}" "${ITKT_I${t}${d}}, ${ITKT_I${t}${d}}, ${ITKT_SE${d}}") endforeach() endforeach() itk_end_wrap_class() itk_wrap_include("itkMovingHistogramImageFilterBase.h") itk_wrap_class("itk::MovingHistogramImageFilterBase" POINTER) foreach(d ${ITK_WRAP_IMAGE_DIMS}) foreach(t ${WRAP_ITK_INT}) itk_wrap_template("${ITKM_I${t}${d}}${ITKM_I${t}${d}}${ITKM_SE${d}}" "${ITKT_I${t}${d}},${ITKT_I${t}${d}},${ITKT_SE${d}}") endforeach() endforeach() itk_end_wrap_class() itk_wrap_class("itk::ImageFileReader" POINTER) foreach(d ${ITK_WRAP_IMAGE_DIMS}) itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" "itk::Image,${d}>") endforeach() itk_end_wrap_class() itk_wrap_class("itk::ImageFileWriter" POINTER) foreach(d ${ITK_WRAP_IMAGE_DIMS}) itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" "itk::Image,${d}>") endforeach() itk_end_wrap_class() itk_wrap_include("itkFirstOrderTextureHistogram.h") itk_wrap_class("itk::Function::FirstOrderTextureHistogram") foreach(t ${WRAP_ITK_INT}) itk_wrap_template("${ITKM_${t}}${ITKM_${t}}" "${ITKT_${t}}, ${ITKT_${t}}") endforeach() itk_end_wrap_class() itk_wrap_include("itkMovingHistogramImageFilter.h") itk_wrap_class("itk::MovingHistogramImageFilter" POINTER) foreach(t ${WRAP_ITK_INT}) foreach(d ${ITK_WRAP_IMAGE_DIMS}) itk_wrap_template("${ITKM_I${t}${d}}${ITKM_I${t}${d}}${ITKM_SE${d}}" "${ITKT_I${t}${d}}, ${ITKT_I${t}${d}}, ${ITKT_SE${d}}, itk::Function::FirstOrderTextureHistogram< ${ITKT_${t}}, ${ITKT_${t}} >") endforeach() endforeach() itk_end_wrap_class() itk_wrap_class("itk::FirstOrderTextureFeaturesImageFilter" POINTER) foreach(d ${ITK_WRAP_IMAGE_DIMS}) foreach(t ${WRAP_ITK_INT}) itk_wrap_template("${ITKM_I${t}${d}}${ITKM_VI${ITKM_F}${d}}${ITKM_SE${d}}" "${ITKT_I${t}${d}}, ${ITKT_VI${ITKM_F}${d}}, ${ITKT_SE${d}}") endforeach() endforeach() itk_end_wrap_class() ---------------------------------------------------- Best and thank you, Best, Yannick ________________________________________ Von: Matt McCormick [matt.mccormick at kitware.com] Gesendet: Sonntag, 17. September 2017 20:48 An: Suter, Yannick Raphael (ISTB) Cc: community at itk.org; Jean-Baptiste Vimort Betreff: Re: [ITK] Python wrapper for first order ITKTextureFeatures Dear Yannick, It looks like you are close. To find out what template parameters to pass, the class declaration has this information: https://github.com/InsightSoftwareConsortium/ITKTextureFeatures/blob/master/include/itkFirstOrderTextureFeaturesImageFilter.h#L51 template< class TInputImage, class TOutputImage, class TKernel > There are three template parameters, the input image, the output image, and the kernel. To see what kind of types are used for these parameters, the test gives a hint: https://github.com/InsightSoftwareConsortium/ITKTextureFeatures/blob/master/test/itkFirstOrderTextureFeaturesImageFilterTest.cxx#L28-L30 The KernelType is usually itk::FlatStructuringElement< ImageDimension >. A grep through ITK's sources finds an example of how this is used as a template parameter when wrapping: https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/BinaryMathematicalMorphology/wrapping/itkBinaryDilateImageFilter.wrap There is also a good wrapping reference in the ITK Software Guide to reach for: https://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch9.html#x48-1540009.5 Please let use know if more help is needed. Contribution pull requests are welcome and appreciated :-) Thanks, Matt On Sat, Sep 16, 2017 at 12:45 PM, wrote: > Dear all, > > I would like to use the the first order texture features of > ITKTextureFeatures > (https://github.com/InsightSoftwareConsortium/ITKTextureFeatures) in Python. > Thanks to J.Vimort et al. for the great work! > Since the coocurrence and run length features are already wrapped, I tried > to take these as an example and wrap it myself (I'm very new to this). > > I would appreciate any help to point me into the right direction. > > That's what I've tried: > - Created a .wrap file "itkFirstOrderTextureFeaturesImageFilter.wrap" and > put it in the "/Modules/External/ITKTextureFeatures/wrapping" directory (see > below) > - Added "itkFirstOrderTextureFeaturesImageFilter" to the CMakeLists.txt in > the "/Modules/External/ITKTextureFeatures/wrapping" directory, now looking > like this: > > itk_wrap_module(TextureFeatures) > > set(WRAPPER_SUBMODULE_ORDER > itkCoocurrenceTextureFeaturesImageFilter > itkRunLengthTextureFeaturesImageFilter > itkFirstOrderTextureFeaturesImageFilter) > > itk_auto_load_submodules() > itk_end_wrap_module() > > This gives me the folowwing error for every datatype I set to wrap: >>> >>> /home/yannick/Projects/PhD/ITK/ITK/bin/Wrapping/itkFirstOrderTextureFeaturesImageFilter.cxx:79:18: >>> error: too few template arguments for class template >>> 'FirstOrderTextureFeaturesImageFilter' >>> typedef itk::FirstOrderTextureFeaturesImageFilter< itk::Image< signed >>> short,2 >, itk::Image,2> > >>> itkFirstOrderTextureFeaturesImageFilterISS2IVF82; > ^ >>>/home/yannick/Projects/PhD/ITK/ITK/Modules/External/ITKTextureFeatures/include/itkFirstOrderTextureFeaturesImageFilter.h:52:27: >>> note: template is declared here >>>class ITK_TEMPLATE_EXPORT FirstOrderTextureFeaturesImageFilter: > > Since the it's working if I use it in C++, I don't see where template > arguments are missing. > > Best and thank you, > > Yannick > > That's my .wrap-file: > ------------ > set(OutputVectorDim 8) > itk_wrap_class("itk::FixedArray") > itk_wrap_template("${ITKM_F}${OutputVectorDim}" > "${ITKT_F},${OutputVectorDim}") > itk_end_wrap_class() > > itk_wrap_class("itk::Vector") > itk_wrap_template("${ITKM_F}${OutputVectorDim}" > "${ITKT_F},${OutputVectorDim}") > itk_end_wrap_class() > > WRAP_TYPE("itk::Image" "I" "itkImage.h") > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > ADD_TEMPLATE("V${ITKM_F}${OutputVectorDim}${d}" > "itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}") > endforeach() > END_WRAP_TYPE() > > itk_wrap_class("itk::Image" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > itk_wrap_template("V${ITKM_F}${OutputVectorDim}${d}" > "itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}") > endforeach() > itk_end_wrap_class() > > itk_wrap_class("itk::ImageSource" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" > "itk::Image,${d}>") > endforeach() > itk_end_wrap_class() > > itk_wrap_class("itk::ImageToImageFilter" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > foreach(t ${WRAP_ITK_INT}) > itk_wrap_template("${ITKM_I${t}${d}}IV${ITKM_F}${OutputVectorDim}${d}" > "${ITKT_I${t}${d}}, > itk::Image,${d}>") > endforeach() > endforeach() > itk_end_wrap_class() > > itk_wrap_simple_class("itk::ImageIOBase" ) > > itk_wrap_class("itk::ImageFileReader" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" > > "itk::Image,${d}>") > endforeach() > itk_end_wrap_class() > > itk_wrap_class("itk::ImageFileWriter" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" > > "itk::Image,${d}>") > endforeach() > itk_end_wrap_class() > > itk_wrap_class("itk::ImageFileWriter" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" > > "itk::Image,${d}>") > endforeach() > itk_end_wrap_class() > > itk_wrap_class("itk::FirstOrderTextureFeaturesImageFilter" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > foreach(t ${WRAP_ITK_INT}) > itk_wrap_template("${ITKM_I${t}${d}}IV${ITKM_F}${OutputVectorDim}${d}" > "${ITKT_I${t}${d}}, > itk::Image,${d}>") > itk_wrap_template("${ITKM_I${t}${d}}${ITKM_VI${ITKM_F}${d}}" > "${ITKT_I${t}${d}}, ${ITKT_VI${ITKM_F}${d}}") > endforeach() > endforeach() > itk_end_wrap_class() > > > > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > From matt.mccormick at kitware.com Mon Sep 18 11:06:00 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 18 Sep 2017 11:06:00 -0400 Subject: [ITK] Python wrapper for first order ITKTextureFeatures In-Reply-To: <9B84F4F1401CC544B71937C2CC607EE21A4051BF@AAI-EXCH-MBX1.campus.unibe.ch> References: <9B84F4F1401CC544B71937C2CC607EE21A404CC2@AAI-EXCH-MBX1.campus.unibe.ch> <9B84F4F1401CC544B71937C2CC607EE21A4051BF@AAI-EXCH-MBX1.campus.unibe.ch> Message-ID: Hi Yannick, Great progress. This error: Warning 401: Nothing known about base class 'itk::MovingHistogramImageFilter< itk::Image< short,2 >,itk::VectorImage< float,2 >,itk::FlatStructuringElement< 2 >,itk::Function::FirstOrderTextureHistogram< short,itk::VariableLengthVector< float > > >'. Ignored. occurs because FirstOrderTextureFeaturesImageFilter depends on MovingHistogramImageFilter (it is its parent class): https://github.com/InsightSoftwareConsortium/ITKTextureFeatures/blob/c1039d5ab834d8dba77ae4b9a3cc96a60788686b/include/itkFirstOrderTextureFeaturesImageFilter.h#L53-L57 The lines above show the relationship between the types. The second template argument, TOutputImage, for FirstOrderTextureFeaturesImageFilter, is the second template argument for MovingHistogramImageFilter. So, in the wrapping for MovingHistogramImageFilter, change ${ITKM_I${t}${d}}${ITKM_I${t}${d}} ${ITKT_I${t}${d}}, ${ITKT_I${t}${d}} to ${ITKM_I${t}${d}}${ITKM_VI${ITKM_F}${d}} ${ITKT_I${t}${d}}, ${ITKT_VI${ITKM_F}${d}} to match the arguments that were used for FirstOrderTextureFeaturesImageFilter. Hope this helps, Mat On Mon, Sep 18, 2017 at 10:09 AM, wrote: > Dear Matt, > > Thank you for helping! > The link to the structuring element example was very useful. > > I ran into a new issue where I would appreciate some help: > The FirstOrderTextureFeaturesImageFilter uses the "MovingHistogramImageFilter", and I have some issues wrapping it correctly. I get the following error for each type I want to wrap: > > Warning 401: Nothing known about base class 'itk::MovingHistogramImageFilter< itk::Image< short,2 >,itk::VectorImage< float,2 >,itk::FlatStructuringElement< 2 >,itk::Function::FirstOrderTextureHistogram< short,itk::VariableLengthVector< float > > >'. Ignored. > /home/yannick/Projects/PhD/ITK/ITK/bin/Wrapping/Typedefs/itkFirstOrderTextureFeaturesImageFilter.i:99: Warning 401: Maybe you forgot to instantiate 'itk::MovingHistogramImageFilter< itk::Image< short,2 >,itk::VectorImage< float,2 >,itk::FlatStructuringElement< 2 >,itk::Function::FirstOrderTextureHistogram< short,itk::VariableLengthVector< float > > >' using %template. > > Even though I put the MovingHistogramImageFilter in the .wrap file and tried including the base class itkMovingHistogramImageFilterBase as well. > > Could you take a look? > Here's my itkFirstOrderTextureFeaturesImageFilter.wrap file: > ---------------------------------------------------- > set(OutputVectorDim 8) > itk_wrap_class("itk::FixedArray") > itk_wrap_template("${ITKM_F}${OutputVectorDim}" "${ITKT_F},${OutputVectorDim}") > itk_end_wrap_class() > > itk_wrap_class("itk::Vector") > itk_wrap_template("${ITKM_F}${OutputVectorDim}" "${ITKT_F},${OutputVectorDim}") > itk_end_wrap_class() > > WRAP_TYPE("itk::Image" "I" "itkImage.h") > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > ADD_TEMPLATE("V${ITKM_F}${OutputVectorDim}${d}" "itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}") > endforeach() > END_WRAP_TYPE() > > itk_wrap_class("itk::Image" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > itk_wrap_template("V${ITKM_F}${OutputVectorDim}${d}" "itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}") > endforeach() > itk_end_wrap_class() > > itk_wrap_class("itk::ImageSource" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" "itk::Image,${d}>") > endforeach() > itk_end_wrap_class() > > itk_wrap_class("itk::ImageToImageFilter" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > foreach(t ${WRAP_ITK_INT}) > itk_wrap_template("${ITKM_I${t}${d}}IV${ITKM_F}${OutputVectorDim}${d}" > "${ITKT_I${t}${d}}, itk::Image,${d}>") > endforeach() > endforeach() > itk_end_wrap_class() > > itk_wrap_include("itkFlatStructuringElement.h") > > WRAP_TYPE("itk::FlatStructuringElement" "SE") > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > ADD_TEMPLATE("${d}" "${d}") > endforeach() > END_WRAP_TYPE() > set(itk_Wrap_StructuringElement ${WRAPPER_TEMPLATES}) > > itk_wrap_simple_class("itk::ImageIOBase" ) > > itk_wrap_class("itk::KernelImageFilter" POINTER) > foreach(t ${WRAP_ITK_INT}) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > itk_wrap_template("${ITKM_I${t}${d}}${ITKM_I${t}${d}}${ITKM_SE${d}}" "${ITKT_I${t}${d}}, ${ITKT_I${t}${d}}, ${ITKT_SE${d}}") > endforeach() > endforeach() > itk_end_wrap_class() > > itk_wrap_include("itkMovingHistogramImageFilterBase.h") > itk_wrap_class("itk::MovingHistogramImageFilterBase" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > foreach(t ${WRAP_ITK_INT}) > itk_wrap_template("${ITKM_I${t}${d}}${ITKM_I${t}${d}}${ITKM_SE${d}}" > "${ITKT_I${t}${d}},${ITKT_I${t}${d}},${ITKT_SE${d}}") > endforeach() > endforeach() > itk_end_wrap_class() > > itk_wrap_class("itk::ImageFileReader" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" > "itk::Image,${d}>") > endforeach() > itk_end_wrap_class() > > itk_wrap_class("itk::ImageFileWriter" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" > "itk::Image,${d}>") > endforeach() > itk_end_wrap_class() > > itk_wrap_include("itkFirstOrderTextureHistogram.h") > itk_wrap_class("itk::Function::FirstOrderTextureHistogram") > foreach(t ${WRAP_ITK_INT}) > itk_wrap_template("${ITKM_${t}}${ITKM_${t}}" "${ITKT_${t}}, ${ITKT_${t}}") > endforeach() > itk_end_wrap_class() > > itk_wrap_include("itkMovingHistogramImageFilter.h") > itk_wrap_class("itk::MovingHistogramImageFilter" POINTER) > foreach(t ${WRAP_ITK_INT}) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > itk_wrap_template("${ITKM_I${t}${d}}${ITKM_I${t}${d}}${ITKM_SE${d}}" > "${ITKT_I${t}${d}}, ${ITKT_I${t}${d}}, ${ITKT_SE${d}}, itk::Function::FirstOrderTextureHistogram< ${ITKT_${t}}, ${ITKT_${t}} >") > endforeach() > endforeach() > itk_end_wrap_class() > > itk_wrap_class("itk::FirstOrderTextureFeaturesImageFilter" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > foreach(t ${WRAP_ITK_INT}) > itk_wrap_template("${ITKM_I${t}${d}}${ITKM_VI${ITKM_F}${d}}${ITKM_SE${d}}" > "${ITKT_I${t}${d}}, ${ITKT_VI${ITKM_F}${d}}, ${ITKT_SE${d}}") > endforeach() > endforeach() > itk_end_wrap_class() > ---------------------------------------------------- > > Best and thank you, > > Best, > > Yannick > > ________________________________________ > Von: Matt McCormick [matt.mccormick at kitware.com] > Gesendet: Sonntag, 17. September 2017 20:48 > An: Suter, Yannick Raphael (ISTB) > Cc: community at itk.org; Jean-Baptiste Vimort > Betreff: Re: [ITK] Python wrapper for first order ITKTextureFeatures > > Dear Yannick, > > It looks like you are close. > > To find out what template parameters to pass, the class declaration > has this information: > > https://github.com/InsightSoftwareConsortium/ITKTextureFeatures/blob/master/include/itkFirstOrderTextureFeaturesImageFilter.h#L51 > > template< class TInputImage, class TOutputImage, class TKernel > > > There are three template parameters, the input image, the output > image, and the kernel. To see what kind of types are used for these > parameters, the test gives a hint: > > https://github.com/InsightSoftwareConsortium/ITKTextureFeatures/blob/master/test/itkFirstOrderTextureFeaturesImageFilterTest.cxx#L28-L30 > > The KernelType is usually itk::FlatStructuringElement< ImageDimension >>. A grep through ITK's sources finds an example of how this is used > as a template parameter when wrapping: > > https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/BinaryMathematicalMorphology/wrapping/itkBinaryDilateImageFilter.wrap > > > There is also a good wrapping reference in the ITK Software Guide to reach for: > > https://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch9.html#x48-1540009.5 > > > Please let use know if more help is needed. Contribution pull requests > are welcome and appreciated :-) > > > Thanks, > Matt > > On Sat, Sep 16, 2017 at 12:45 PM, wrote: >> Dear all, >> >> I would like to use the the first order texture features of >> ITKTextureFeatures >> (https://github.com/InsightSoftwareConsortium/ITKTextureFeatures) in Python. >> Thanks to J.Vimort et al. for the great work! >> Since the coocurrence and run length features are already wrapped, I tried >> to take these as an example and wrap it myself (I'm very new to this). >> >> I would appreciate any help to point me into the right direction. >> >> That's what I've tried: >> - Created a .wrap file "itkFirstOrderTextureFeaturesImageFilter.wrap" and >> put it in the "/Modules/External/ITKTextureFeatures/wrapping" directory (see >> below) >> - Added "itkFirstOrderTextureFeaturesImageFilter" to the CMakeLists.txt in >> the "/Modules/External/ITKTextureFeatures/wrapping" directory, now looking >> like this: >> >> itk_wrap_module(TextureFeatures) >> >> set(WRAPPER_SUBMODULE_ORDER >> itkCoocurrenceTextureFeaturesImageFilter >> itkRunLengthTextureFeaturesImageFilter >> itkFirstOrderTextureFeaturesImageFilter) >> >> itk_auto_load_submodules() >> itk_end_wrap_module() >> >> This gives me the folowwing error for every datatype I set to wrap: >>>> >>>> /home/yannick/Projects/PhD/ITK/ITK/bin/Wrapping/itkFirstOrderTextureFeaturesImageFilter.cxx:79:18: >>>> error: too few template arguments for class template >>>> 'FirstOrderTextureFeaturesImageFilter' >>>> typedef itk::FirstOrderTextureFeaturesImageFilter< itk::Image< signed >>>> short,2 >, itk::Image,2> > >>>> itkFirstOrderTextureFeaturesImageFilterISS2IVF82; >> ^ >>>>/home/yannick/Projects/PhD/ITK/ITK/Modules/External/ITKTextureFeatures/include/itkFirstOrderTextureFeaturesImageFilter.h:52:27: >>>> note: template is declared here >>>>class ITK_TEMPLATE_EXPORT FirstOrderTextureFeaturesImageFilter: >> >> Since the it's working if I use it in C++, I don't see where template >> arguments are missing. >> >> Best and thank you, >> >> Yannick >> >> That's my .wrap-file: >> ------------ >> set(OutputVectorDim 8) >> itk_wrap_class("itk::FixedArray") >> itk_wrap_template("${ITKM_F}${OutputVectorDim}" >> "${ITKT_F},${OutputVectorDim}") >> itk_end_wrap_class() >> >> itk_wrap_class("itk::Vector") >> itk_wrap_template("${ITKM_F}${OutputVectorDim}" >> "${ITKT_F},${OutputVectorDim}") >> itk_end_wrap_class() >> >> WRAP_TYPE("itk::Image" "I" "itkImage.h") >> foreach(d ${ITK_WRAP_IMAGE_DIMS}) >> ADD_TEMPLATE("V${ITKM_F}${OutputVectorDim}${d}" >> "itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}") >> endforeach() >> END_WRAP_TYPE() >> >> itk_wrap_class("itk::Image" POINTER) >> foreach(d ${ITK_WRAP_IMAGE_DIMS}) >> itk_wrap_template("V${ITKM_F}${OutputVectorDim}${d}" >> "itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}") >> endforeach() >> itk_end_wrap_class() >> >> itk_wrap_class("itk::ImageSource" POINTER) >> foreach(d ${ITK_WRAP_IMAGE_DIMS}) >> itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" >> "itk::Image,${d}>") >> endforeach() >> itk_end_wrap_class() >> >> itk_wrap_class("itk::ImageToImageFilter" POINTER) >> foreach(d ${ITK_WRAP_IMAGE_DIMS}) >> foreach(t ${WRAP_ITK_INT}) >> itk_wrap_template("${ITKM_I${t}${d}}IV${ITKM_F}${OutputVectorDim}${d}" >> "${ITKT_I${t}${d}}, >> itk::Image,${d}>") >> endforeach() >> endforeach() >> itk_end_wrap_class() >> >> itk_wrap_simple_class("itk::ImageIOBase" ) >> >> itk_wrap_class("itk::ImageFileReader" POINTER) >> foreach(d ${ITK_WRAP_IMAGE_DIMS}) >> itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" >> >> "itk::Image,${d}>") >> endforeach() >> itk_end_wrap_class() >> >> itk_wrap_class("itk::ImageFileWriter" POINTER) >> foreach(d ${ITK_WRAP_IMAGE_DIMS}) >> itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" >> >> "itk::Image,${d}>") >> endforeach() >> itk_end_wrap_class() >> >> itk_wrap_class("itk::ImageFileWriter" POINTER) >> foreach(d ${ITK_WRAP_IMAGE_DIMS}) >> itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" >> >> "itk::Image,${d}>") >> endforeach() >> itk_end_wrap_class() >> >> itk_wrap_class("itk::FirstOrderTextureFeaturesImageFilter" POINTER) >> foreach(d ${ITK_WRAP_IMAGE_DIMS}) >> foreach(t ${WRAP_ITK_INT}) >> itk_wrap_template("${ITKM_I${t}${d}}IV${ITKM_F}${OutputVectorDim}${d}" >> "${ITKT_I${t}${d}}, >> itk::Image,${d}>") >> itk_wrap_template("${ITKM_I${t}${d}}${ITKM_VI${ITKM_F}${d}}" >> "${ITKT_I${t}${d}}, ${ITKT_VI${ITKM_F}${d}}") >> endforeach() >> endforeach() >> itk_end_wrap_class() >> >> >> >> _______________________________________________ >> Community mailing list >> Community at itk.org >> http://public.kitware.com/mailman/listinfo/community >> From matt.mccormick at kitware.com Mon Sep 18 11:09:09 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 18 Sep 2017 11:09:09 -0400 Subject: [ITK] How to avoid NIFTI header files from being installed? In-Reply-To: <83d513b3f543e03025dd944b1664723f@xs4all.nl> References: <348ae5559ef7e6c035f3b5f01a7b1c16@xs4all.nl> <83d513b3f543e03025dd944b1664723f@xs4all.nl> Message-ID: On Mon, Sep 18, 2017 at 9:32 AM, Niels Dekker wrote: >>> However, when doing an INSTALL, nifti1.h and nifti1_io.h (as well as >>> itk_nifti_mangle.h) are still copied to the user's install directory > > > Matt McCormick replied: >> >> To avoid this, a CMake option, ITK_USE_SYSTEM_NIFTI could be set up >> similar to other third party modules. The CMake configuration code >> needs to be added to the module so it can find the system NIFTI and >> export the required build information to other modules. > > > Thanks for your reply, Matt! ITK_USE_SYSTEM_NIFTI might be interesting > option. > > However, I was thinking of a different problem: Suppose my application MyApp > depends on both ITK (installed at the ITK_INSTALL_PREFIX directory), and "my > own version" of niftilib. In this case, I want ITK to internally still use > the ITK version of niftilib. MyApp has ITK_INSTALL_PREFIX/include/ITK-4.12 > as one of its include directories. However, when a CXX file of MyApp does > #include , it should #include the niftilib file from "my own > version" of niftilib, not the one internally used by ITK! > > Now I see there already exists a CMake option to stop ITK niftilib header > files from being installed: NIFTI_INSTALL_NO_DEVELOPMENT It's being used in > the CMakeLists.txt files at ThirdParty\NIFTI\src\nifti\znzlib and > ThirdParty\NIFTI\src\nifti\niftilib: > https://github.com/Kitware/ITK/blob/v4.12.2/Modules/ThirdParty/NIFTI/src/nifti/niftilib/CMakeLists.txt#L29 > > I was about to suggest to set NIFTI_INSTALL_NO_DEVELOPMENT ON by default. > But now I see, "gifti_io.h" does #include : > https://github.com/Kitware/ITK/blob/v4.12.2/Modules/ThirdParty/GIFTI/src/gifticlib/gifti_io.h#L6 > > "gifti_io.h" is also copied to ITK_INSTALL_PREFIX, during an ITK install. So > ITK users can only set NIFTI_INSTALL_NO_DEVELOPMENT ON when they do not need > to #include this header file. And actually, "itkGiftiMeshIO.h" does #include > "gifti_io.h": > https://github.com/Kitware/ITK/blob/v4.12.2/Modules/IO/Mesh/include/itkGiftiMeshIO.h#L27 > > This #include "gifti_io.h" could be hidden by moving the include statement > from "itkGiftiMeshIO.h" to "itkGiftiMeshIO.cxx". That could be done by > adding a "proxy mechanism" to itk::GiftiMeshIO, similar to what we added to > itk::NiftiIO. Do you think that would be a good idea? Yes, great idea :-) From francois.budin at kitware.com Mon Sep 18 12:04:23 2017 From: francois.budin at kitware.com (Francois Budin) Date: Mon, 18 Sep 2017 12:04:23 -0400 Subject: [ITK] ITK bug or feature In-Reply-To: References: Message-ID: Hello Ziv, Thanks for the report. There was indeed a bug in itkSimilarity2DTransform and itkCenteredSimilarity2DTransform. I submitted a patch [1] to correct the problem. It would be great if you could test it and review it. Thanks! Francois [1] http://review.source.kitware.com/#/c/22633/ On Thu, Sep 14, 2017 at 12:34 PM, Yaniv, Ziv Rafael (NIH/NLM/LHC) [C] < zivrafael.yaniv at nih.gov> wrote: > Hello ITK developers, > > > > I encountered unexpected behavior with ITK parameter settings in > degenerate cases for the CenteredSimilarity2DTransform and > Similarity3DTransform classes. > > > > The degenerate parameter values I am referring to is setting the scale to > zero. I encountered this issue when I blindly set all parameters to zero to > get an identity transform (obviously scale should be one). It appears that > setting the scale factor to zero is acceptable, no exception (arbitrary > choice which makes sense for the general SetParameters method ? up to the > user to make sure the parameter values make sense). > > > > The feature/bug I am referring to has to do with the GetInverse method > (ill-defined for this degenerate case): > > > > 2D case - when I print the original transformation, it is identified as > singular. When I invoke the GetInverse method vnl generates a warning with > the resulting ?inverse? transform including Nan and Inf , not identified as > singular. > > > > 3D case - when I print the original transformation, it is identified as > singular. When I invoke the GetInverse method there is no warning and the > ?inverse? transform has numbers and is identified as singular. > > > > Is this behavior fine and up to the user to deal with? Should the > GetInverse generate an exception? > > thanks > > Ziv > > > > Code for the two cases below: > > > > { > > typedef itk::Similarity3DTransform TransformType3D; > > // Test degenerate parameter settings > > TransformType3D::Pointer t1 = TransformType3D::New(); > > TransformType3D::Pointer t1Inverse = TransformType3D::New(); > > > > // Set parameters > > TransformType3D::ParametersType parameters( > t1->GetNumberOfParameters() ); > > // Degenerate configuration with zero scale > > parameters[0] = 1.0; > > parameters[1] = 0.0; > > parameters[2] = 0.0; > > parameters[3] = 1.0; > > parameters[4] = 2.0; > > parameters[5] = 3.0; > > parameters[6] = 0.0; //scale > > > > t1->SetParameters( parameters ); > > t1Inverse->SetParameters(parameters); > > > > t1->GetInverse( t1Inverse ); > > std::cout<< "**original**\n"< > std::cout<< "**inverse**\n"< > } > > > > { > > // Test degenerate parameter settings > > typedef itk::CenteredSimilarity2DTransform TransformType2D; > > TransformType2D::Pointer t1 = TransformType2D::New(); > > TransformType2D::Pointer t1Inverse = TransformType2D::New(); > > > > // Set parameters > > TransformType2D::ParametersType parameters( > t1->GetNumberOfParameters() ); > > // Degenerate configuration with zero scale > > parameters[0] = 0.0; //scale > > parameters[1] = -21.0 / 180.0 * itk::Math::pi; > > parameters[2] = 12.0; > > parameters[3] = -8.9; > > parameters[4] = 67.8; > > parameters[5] = -0.2; > > > > t1->SetParameters( parameters ); > > t1->GetInverse( t1Inverse ); > > std::cout<< "**original**\n"< > std::cout<< "**inverse**\n"< > } > > > > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yannick.suter at istb.unibe.ch Mon Sep 18 18:03:33 2017 From: yannick.suter at istb.unibe.ch (yannick.suter at istb.unibe.ch) Date: Mon, 18 Sep 2017 22:03:33 +0000 Subject: [ITK] Python wrapper for first order ITKTextureFeatures In-Reply-To: References: <9B84F4F1401CC544B71937C2CC607EE21A404CC2@AAI-EXCH-MBX1.campus.unibe.ch> <9B84F4F1401CC544B71937C2CC607EE21A4051BF@AAI-EXCH-MBX1.campus.unibe.ch>, Message-ID: <9B84F4F1401CC544B71937C2CC607EE21A40547C@AAI-EXCH-MBX1.campus.unibe.ch> Hi Matt, Thanks! I made the changes and am now using the VectorImag type in the MovingHistogramImageFilter part in the .wrap file, but still get the exact same error: Nothing known about base class 'itk::MovingHistogramImageFilter< itk::Image< short,2 >,itk::VectorImage< float,2 >,itk::FlatStructuringElement< 2 >,itk::Function::FirstOrderTextureHistogram< short,itk::VariableLengthVector< float > > >'. Ignored. /ITK/ITK/bin/Wrapping/Typedefs/itkFirstOrderTextureFeaturesImageFilter.i:99: Warning 401: Maybe you forgot to instantiate 'itk::MovingHistogramImageFilter< itk::Image< short,2 >,itk::VectorImage< float,2 >,itk::FlatStructuringElement< 2 >,itk::Function::FirstOrderTextureHistogram< short,itk::VariableLengthVector< float > > >' using %template What I find odd is that the error message states using a "VariableLengthVector (itk::Function::FirstOrderTextureHistogram< short,itk::VariableLengthVector< float > > >' ), but my line is itk::Function::FirstOrderTextureHistogram< ${ITKT_${t}}, ${ITKT_VI${ITKM_F}${d}}>" with a VectorImage and not a VariableLengthVector. I tried changing to a VariableLengthVector in the .wrap file, but to no avail. I'm wrapping the base class "itkMovingHistogramImageFilterBase" as well, is this necessary? The whole .wrap file is at the end of the message if needed... Sorry for the endless questions and thank you very much for the help! Best, Yannick set(OutputVectorDim 8) itk_wrap_class("itk::FixedArray") itk_wrap_template("${ITKM_F}${OutputVectorDim}" "${ITKT_F},${OutputVectorDim}") itk_end_wrap_class() itk_wrap_class("itk::Vector") itk_wrap_template("${ITKM_F}${OutputVectorDim}" "${ITKT_F},${OutputVectorDim}") itk_end_wrap_class() WRAP_TYPE("itk::Image" "I" "itkImage.h") foreach(d ${ITK_WRAP_IMAGE_DIMS}) ADD_TEMPLATE("V${ITKM_F}${OutputVectorDim}${d}" "itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}") endforeach() END_WRAP_TYPE() itk_wrap_class("itk::Image" POINTER) foreach(d ${ITK_WRAP_IMAGE_DIMS}) itk_wrap_template("V${ITKM_F}${OutputVectorDim}${d}" "itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}") endforeach() itk_end_wrap_class() itk_wrap_class("itk::ImageSource" POINTER) foreach(d ${ITK_WRAP_IMAGE_DIMS}) itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" "itk::Image,${d}>") endforeach() itk_end_wrap_class() itk_wrap_class("itk::ImageToImageFilter" POINTER) foreach(d ${ITK_WRAP_IMAGE_DIMS}) foreach(t ${WRAP_ITK_INT}) itk_wrap_template("${ITKM_I${t}${d}}IV${ITKM_F}${OutputVectorDim}${d}" "${ITKT_I${t}${d}}, itk::Image,${d}>") endforeach() endforeach() itk_end_wrap_class() itk_wrap_include("itkFlatStructuringElement.h") WRAP_TYPE("itk::FlatStructuringElement" "SE") foreach(d ${ITK_WRAP_IMAGE_DIMS}) ADD_TEMPLATE("${d}" "${d}") endforeach() END_WRAP_TYPE() set(itk_Wrap_StructuringElement ${WRAPPER_TEMPLATES}) itk_wrap_simple_class("itk::ImageIOBase" ) itk_wrap_class("itk::KernelImageFilter" POINTER) foreach(t ${WRAP_ITK_INT}) foreach(d ${ITK_WRAP_IMAGE_DIMS}) itk_wrap_template("${ITKM_I${t}${d}}${ITKM_VI${ITKM_F}${d}}${ITKM_SE${d}}" "${ITKT_I${t}${d}}, ${ITKT_I${t}${d}}, ${ITKT_SE${d}}") endforeach() endforeach() itk_end_wrap_class() itk_wrap_class("itk::ImageFileReader" POINTER) foreach(d ${ITK_WRAP_IMAGE_DIMS}) itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" "itk::Image,${d}>") endforeach() itk_end_wrap_class() itk_wrap_class("itk::ImageFileWriter" POINTER) foreach(d ${ITK_WRAP_IMAGE_DIMS}) itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" "itk::Image,${d}>") endforeach() itk_end_wrap_class() itk_wrap_include("itkMovingHistogramImageFilterBase.h") itk_wrap_class("itk::MovingHistogramImageFilterBase" POINTER) foreach(d ${ITK_WRAP_IMAGE_DIMS}) foreach(t ${WRAP_ITK_INT}) itk_wrap_template("${ITKM_I${t}${d}}${ITKM_VI${ITKM_F}${d}}${ITKM_SE${d}}" "${ITKM_I${t}${d}}${ITKM_VI${ITKM_F}${d}},${ITKT_SE${d}}, itk::Function::FirstOrderTextureHistogram< ${ITKT_${t}}, ${ITKT_VI${ITKM_F}${d}} >") endforeach() endforeach() itk_end_wrap_class() itk_wrap_include("itkFirstOrderTextureHistogram.h") itk_wrap_class("itk::Function::FirstOrderTextureHistogram") foreach(t ${WRAP_ITK_INT}) itk_wrap_template("${ITKM_${t}}${ITKM_VI${ITKM_F}${d}} " "${ITKT_${t}}, ${ITKT_VI${ITKM_F}${d}}") endforeach() itk_end_wrap_class() itk_wrap_include("itkMovingHistogramImageFilter.h") itk_wrap_class("itk::MovingHistogramImageFilter" POINTER) foreach(t ${WRAP_ITK_INT}) foreach(d ${ITK_WRAP_IMAGE_DIMS}) itk_wrap_template("${ITKM_I${t}${d}}${ITKM_VI${ITKM_F}${d}}${ITKM_SE${d}}" "${ITKT_I${t}${d}}${ITKM_VI${ITKM_F}${d}}, ${ITKT_SE${d}}, itk::Function::FirstOrderTextureHistogram< ${ITKT_${t}}, ${ITKT_VI${ITKM_F}${d}}>") endforeach() endforeach() itk_end_wrap_class() itk_wrap_class("itk::FirstOrderTextureFeaturesImageFilter" POINTER) foreach(d ${ITK_WRAP_IMAGE_DIMS}) foreach(t ${WRAP_ITK_INT}) itk_wrap_template("${ITKM_I${t}${d}}${ITKM_VI${ITKM_F}${d}}${ITKM_SE${d}}" "${ITKT_I${t}${d}}, ${ITKT_VI${ITKM_F}${d}}, ${ITKT_SE${d}}, itk::Function::FirstOrderTextureHistogram< ${ITKT_${t}}, ${ITKT_VI${ITKM_F}${d}}>") endforeach() endforeach() itk_end_wrap_class() From niels-xtk at xs4all.nl Tue Sep 19 06:16:07 2017 From: niels-xtk at xs4all.nl (Niels Dekker) Date: Tue, 19 Sep 2017 12:16:07 +0200 Subject: [ITK] How to avoid NIFTI header files from being installed? In-Reply-To: References: <348ae5559ef7e6c035f3b5f01a7b1c16@xs4all.nl> <83d513b3f543e03025dd944b1664723f@xs4all.nl> Message-ID: <42e642e97ff67557d815e7b174c3fc48@xs4all.nl> >> This #include "gifti_io.h" could be hidden by moving the include >> statement >> from "itkGiftiMeshIO.h" to "itkGiftiMeshIO.cxx". That could be done by >> adding a "proxy mechanism" to itk::GiftiMeshIO, similar to what we >> added to >> itk::NiftiIO. Do you think that would be a good idea? On 2017-09-18 17:09, Matt McCormick wrote: > Yes, great idea :-) Thanks for your encouragement, Matt :-) The approach for itk::GiftiMeshIO could be very, very similar as for itk::NiftiIO, as I committed at Modules/IO/NIFTI/include/itkNiftiImageIO.h and Modules/IO/NIFTI/src/itkNiftiImageIO.cxx: https://github.com/Kitware/ITK/commit/940f68ec18b15e500cc22d8ddb1dbae34b66cb2f However, I wouldn't like to have so much duplicate code. The amount of code duplication could be reduced by replacing my 'NiftiImageHolder' class by std::unique_ptr. Is it OK to use std::unique_ptr in the ITK code base? It's basically the most lightweight smart pointer of the Standard C++ Library but I don't see it being used by ITK. Kind regards, Niels -- Niels Dekker Scientific programmer LKEB, Leiden University Medical Center, Netherlands From zivrafael.yaniv at nih.gov Tue Sep 19 10:03:11 2017 From: zivrafael.yaniv at nih.gov (Yaniv, Ziv Rafael (NIH/NLM/LHC) [C]) Date: Tue, 19 Sep 2017 14:03:11 +0000 Subject: [ITK] ITK bug or feature In-Reply-To: References: Message-ID: Hello Francois, Tested the patch on gerrit and it fixed the issue (gave +2 on gerrit). Thanks for the prompt response. Ziv From: Francois Budin Date: Monday, September 18, 2017 at 12:06 PM To: "Yaniv, Ziv Rafael (NIH/NLM/LHC) [C]" Cc: "community at itk.org" Subject: Re: [ITK] ITK bug or feature Hello Ziv, Thanks for the report. There was indeed a bug in itkSimilarity2DTransform and itkCenteredSimilarity2DTransform. I submitted a patch [1] to correct the problem. It would be great if you could test it and review it. Thanks! Francois [1] http://review.source.kitware.com/#/c/22633/ On Thu, Sep 14, 2017 at 12:34 PM, Yaniv, Ziv Rafael (NIH/NLM/LHC) [C] > wrote: Hello ITK developers, I encountered unexpected behavior with ITK parameter settings in degenerate cases for the CenteredSimilarity2DTransform and Similarity3DTransform classes. The degenerate parameter values I am referring to is setting the scale to zero. I encountered this issue when I blindly set all parameters to zero to get an identity transform (obviously scale should be one). It appears that setting the scale factor to zero is acceptable, no exception (arbitrary choice which makes sense for the general SetParameters method ? up to the user to make sure the parameter values make sense). The feature/bug I am referring to has to do with the GetInverse method (ill-defined for this degenerate case): 2D case - when I print the original transformation, it is identified as singular. When I invoke the GetInverse method vnl generates a warning with the resulting ?inverse? transform including Nan and Inf , not identified as singular. 3D case - when I print the original transformation, it is identified as singular. When I invoke the GetInverse method there is no warning and the ?inverse? transform has numbers and is identified as singular. Is this behavior fine and up to the user to deal with? Should the GetInverse generate an exception? thanks Ziv Code for the two cases below: { typedef itk::Similarity3DTransform TransformType3D; // Test degenerate parameter settings TransformType3D::Pointer t1 = TransformType3D::New(); TransformType3D::Pointer t1Inverse = TransformType3D::New(); // Set parameters TransformType3D::ParametersType parameters( t1->GetNumberOfParameters() ); // Degenerate configuration with zero scale parameters[0] = 1.0; parameters[1] = 0.0; parameters[2] = 0.0; parameters[3] = 1.0; parameters[4] = 2.0; parameters[5] = 3.0; parameters[6] = 0.0; //scale t1->SetParameters( parameters ); t1Inverse->SetParameters(parameters); t1->GetInverse( t1Inverse ); std::cout<< "**original**\n"< TransformType2D; TransformType2D::Pointer t1 = TransformType2D::New(); TransformType2D::Pointer t1Inverse = TransformType2D::New(); // Set parameters TransformType2D::ParametersType parameters( t1->GetNumberOfParameters() ); // Degenerate configuration with zero scale parameters[0] = 0.0; //scale parameters[1] = -21.0 / 180.0 * itk::Math::pi; parameters[2] = 12.0; parameters[3] = -8.9; parameters[4] = 67.8; parameters[5] = -0.2; t1->SetParameters( parameters ); t1->GetInverse( t1Inverse ); std::cout<< "**original**\n"< http://public.kitware.com/mailman/listinfo/community -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt.mccormick at kitware.com Tue Sep 19 10:18:04 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 19 Sep 2017 10:18:04 -0400 Subject: [ITK] Python wrapper for first order ITKTextureFeatures In-Reply-To: <9B84F4F1401CC544B71937C2CC607EE21A40547C@AAI-EXCH-MBX1.campus.unibe.ch> References: <9B84F4F1401CC544B71937C2CC607EE21A404CC2@AAI-EXCH-MBX1.campus.unibe.ch> <9B84F4F1401CC544B71937C2CC607EE21A4051BF@AAI-EXCH-MBX1.campus.unibe.ch> <9B84F4F1401CC544B71937C2CC607EE21A40547C@AAI-EXCH-MBX1.campus.unibe.ch> Message-ID: Hi Yannick, The FirstOrderTextureFeaturesImageFilter only has three template parameters: https://github.com/InsightSoftwareConsortium/ITKTextureFeatures/blob/c1039d5ab834d8dba77ae4b9a3cc96a60788686b/include/itkFirstOrderTextureFeaturesImageFilter.h#L51 So the wrapping should be: itk_wrap_class("itk::FirstOrderTextureFeaturesImageFilter" POINTER) foreach(d ${ITK_WRAP_IMAGE_DIMS}) foreach(t ${WRAP_ITK_INT}) itk_wrap_template("${ITKM_I${t}${d}}${ITKM_VI${ITKM_F}${d}}${ITKM_SE${d}}" "${ITKT_I${t}${d}}, ${ITKT_VI${ITKM_F}${d}}, ${ITKT_SE${d}}") endforeach() endforeach() itk_end_wrap_class() And the relationship with the MovingImageHistogramImageFilter is here: https://github.com/InsightSoftwareConsortium/ITKTextureFeatures/blob/c1039d5ab834d8dba77ae4b9a3cc96a60788686b/include/itkFirstOrderTextureFeaturesImageFilter.h#L53-L57 The fourth template parameter for MovingImageHistogramImageFilter is: typename Function::FirstOrderTextureHistogram< typename TInputImage::PixelType, typename TOutputImage::PixelType > > TInputImage::PixelType for a scalar Image is just the scalar (which you have). TOutputImage::PixelType for a VectorImage is a VariableLengthVector, which has a CMake variable defined to be Mangling ITKM_VLV${ITKM_${type}}${dim} C++ Type ITKT_VLV${ITKM_${type}}${dim} as listed here: https://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch9.html#x48-1540009.5 I hope this explanation is helpful. Matt On Mon, Sep 18, 2017 at 6:03 PM, wrote: > Hi Matt, > > Thanks! > I made the changes and am now using the VectorImag type in the MovingHistogramImageFilter part in the .wrap file, but still get the exact same error: > > Nothing known about base class 'itk::MovingHistogramImageFilter< itk::Image< short,2 >,itk::VectorImage< float,2 >,itk::FlatStructuringElement< 2 >,itk::Function::FirstOrderTextureHistogram< short,itk::VariableLengthVector< float > > >'. Ignored. > /ITK/ITK/bin/Wrapping/Typedefs/itkFirstOrderTextureFeaturesImageFilter.i:99: Warning 401: Maybe you forgot to instantiate 'itk::MovingHistogramImageFilter< itk::Image< short,2 >,itk::VectorImage< float,2 >,itk::FlatStructuringElement< 2 >,itk::Function::FirstOrderTextureHistogram< short,itk::VariableLengthVector< float > > >' using %template > > What I find odd is that the error message states using a "VariableLengthVector (itk::Function::FirstOrderTextureHistogram< short,itk::VariableLengthVector< float > > >' ), but my line is itk::Function::FirstOrderTextureHistogram< ${ITKT_${t}}, ${ITKT_VI${ITKM_F}${d}}>" with a VectorImage and not a VariableLengthVector. I tried changing to a VariableLengthVector in the .wrap file, but to no avail. > I'm wrapping the base class "itkMovingHistogramImageFilterBase" as well, is this necessary? > The whole .wrap file is at the end of the message if needed... > > Sorry for the endless questions and thank you very much for the help! > > Best, > > Yannick > > > set(OutputVectorDim 8) > itk_wrap_class("itk::FixedArray") > itk_wrap_template("${ITKM_F}${OutputVectorDim}" "${ITKT_F},${OutputVectorDim}") > itk_end_wrap_class() > > itk_wrap_class("itk::Vector") > itk_wrap_template("${ITKM_F}${OutputVectorDim}" "${ITKT_F},${OutputVectorDim}") > itk_end_wrap_class() > > WRAP_TYPE("itk::Image" "I" "itkImage.h") > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > ADD_TEMPLATE("V${ITKM_F}${OutputVectorDim}${d}" "itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}") > endforeach() > END_WRAP_TYPE() > > itk_wrap_class("itk::Image" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > itk_wrap_template("V${ITKM_F}${OutputVectorDim}${d}" "itk::Vector<${ITKT_F},${OutputVectorDim}>,${d}") > endforeach() > itk_end_wrap_class() > > itk_wrap_class("itk::ImageSource" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" "itk::Image,${d}>") > endforeach() > itk_end_wrap_class() > > itk_wrap_class("itk::ImageToImageFilter" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > foreach(t ${WRAP_ITK_INT}) > itk_wrap_template("${ITKM_I${t}${d}}IV${ITKM_F}${OutputVectorDim}${d}" > "${ITKT_I${t}${d}}, itk::Image,${d}>") > endforeach() > endforeach() > itk_end_wrap_class() > > itk_wrap_include("itkFlatStructuringElement.h") > > WRAP_TYPE("itk::FlatStructuringElement" "SE") > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > ADD_TEMPLATE("${d}" "${d}") > endforeach() > END_WRAP_TYPE() > set(itk_Wrap_StructuringElement ${WRAPPER_TEMPLATES}) > > itk_wrap_simple_class("itk::ImageIOBase" ) > > itk_wrap_class("itk::KernelImageFilter" POINTER) > foreach(t ${WRAP_ITK_INT}) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > itk_wrap_template("${ITKM_I${t}${d}}${ITKM_VI${ITKM_F}${d}}${ITKM_SE${d}}" "${ITKT_I${t}${d}}, ${ITKT_I${t}${d}}, ${ITKT_SE${d}}") > endforeach() > endforeach() > itk_end_wrap_class() > > itk_wrap_class("itk::ImageFileReader" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" > "itk::Image,${d}>") > endforeach() > itk_end_wrap_class() > > itk_wrap_class("itk::ImageFileWriter" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > itk_wrap_template("IV${ITKM_F}${OutputVectorDim}${d}" > "itk::Image,${d}>") > endforeach() > itk_end_wrap_class() > > itk_wrap_include("itkMovingHistogramImageFilterBase.h") > itk_wrap_class("itk::MovingHistogramImageFilterBase" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > foreach(t ${WRAP_ITK_INT}) > itk_wrap_template("${ITKM_I${t}${d}}${ITKM_VI${ITKM_F}${d}}${ITKM_SE${d}}" > "${ITKM_I${t}${d}}${ITKM_VI${ITKM_F}${d}},${ITKT_SE${d}}, itk::Function::FirstOrderTextureHistogram< ${ITKT_${t}}, ${ITKT_VI${ITKM_F}${d}} >") > endforeach() > endforeach() > itk_end_wrap_class() > > itk_wrap_include("itkFirstOrderTextureHistogram.h") > itk_wrap_class("itk::Function::FirstOrderTextureHistogram") > foreach(t ${WRAP_ITK_INT}) > itk_wrap_template("${ITKM_${t}}${ITKM_VI${ITKM_F}${d}} " "${ITKT_${t}}, ${ITKT_VI${ITKM_F}${d}}") > endforeach() > itk_end_wrap_class() > > itk_wrap_include("itkMovingHistogramImageFilter.h") > itk_wrap_class("itk::MovingHistogramImageFilter" POINTER) > foreach(t ${WRAP_ITK_INT}) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > itk_wrap_template("${ITKM_I${t}${d}}${ITKM_VI${ITKM_F}${d}}${ITKM_SE${d}}" > "${ITKT_I${t}${d}}${ITKM_VI${ITKM_F}${d}}, ${ITKT_SE${d}}, itk::Function::FirstOrderTextureHistogram< ${ITKT_${t}}, ${ITKT_VI${ITKM_F}${d}}>") > endforeach() > endforeach() > itk_end_wrap_class() > > itk_wrap_class("itk::FirstOrderTextureFeaturesImageFilter" POINTER) > foreach(d ${ITK_WRAP_IMAGE_DIMS}) > foreach(t ${WRAP_ITK_INT}) > itk_wrap_template("${ITKM_I${t}${d}}${ITKM_VI${ITKM_F}${d}}${ITKM_SE${d}}" > "${ITKT_I${t}${d}}, ${ITKT_VI${ITKM_F}${d}}, ${ITKT_SE${d}}, itk::Function::FirstOrderTextureHistogram< ${ITKT_${t}}, ${ITKT_VI${ITKM_F}${d}}>") > endforeach() > endforeach() > itk_end_wrap_class() > > From matt.mccormick at kitware.com Tue Sep 19 10:21:20 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 19 Sep 2017 10:21:20 -0400 Subject: [ITK] [ITK-users] multiresolution v4 and label images In-Reply-To: <0a6b928f-40e4-1a99-db4f-2bfdbae5caa4@yahoo.fr> References: <0a6b928f-40e4-1a99-db4f-2bfdbae5caa4@yahoo.fr> Message-ID: Hi Yann, A MeanSquaresImageToImageMetricv4 could be applied. The images could be passed through a distance map filter to get better results. Hope this helps, Matt On Mon, Sep 18, 2017 at 7:41 PM, asertyuio via Insight-users wrote: > Hi everyone, > > I have some BW images to register. I was using the Amoeba optimizer, > and the match cardinality metric, but I would like to add > multiresolution, and I would prefer using the v4 registration. I'm not > fully sure, but my impression is that I cannot do it through the v4 > registration, because the metric/optimizer are not implemented in the v4 > registration. Is there any metric/optimizer combination in the v4 > framework recommended for BW images ? > > Thanks in advance, > > Yann > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-users _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From matt.mccormick at kitware.com Tue Sep 19 10:24:07 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 19 Sep 2017 10:24:07 -0400 Subject: [ITK] How to avoid NIFTI header files from being installed? In-Reply-To: <42e642e97ff67557d815e7b174c3fc48@xs4all.nl> References: <348ae5559ef7e6c035f3b5f01a7b1c16@xs4all.nl> <83d513b3f543e03025dd944b1664723f@xs4all.nl> <42e642e97ff67557d815e7b174c3fc48@xs4all.nl> Message-ID: On Tue, Sep 19, 2017 at 6:16 AM, Niels Dekker wrote: >>> This #include "gifti_io.h" could be hidden by moving the include >>> statement >>> from "itkGiftiMeshIO.h" to "itkGiftiMeshIO.cxx". That could be done by >>> adding a "proxy mechanism" to itk::GiftiMeshIO, similar to what we added >>> to >>> itk::NiftiIO. Do you think that would be a good idea? > > > On 2017-09-18 17:09, Matt McCormick wrote: >> >> Yes, great idea :-) > > > Thanks for your encouragement, Matt :-) The approach for itk::GiftiMeshIO > could be very, very similar as for itk::NiftiIO, as I committed at > Modules/IO/NIFTI/include/itkNiftiImageIO.h and > Modules/IO/NIFTI/src/itkNiftiImageIO.cxx: > https://github.com/Kitware/ITK/commit/940f68ec18b15e500cc22d8ddb1dbae34b66cb2f > > However, I wouldn't like to have so much duplicate code. The amount of code > duplication could be reduced by replacing my 'NiftiImageHolder' class by > std::unique_ptr. Is it OK to use std::unique_ptr in the ITK > code base? It's basically the most lightweight smart pointer of the Standard > C++ Library but I don't see it being used by ITK. ITK currently supports compilers without C++11 availability, which is why std::unique_ptr is not used. itk::AutoPointer could be used an alternative: https://itk.org/Doxygen/html/classitk_1_1AutoPointer.html Thanks, Matt From matt.mccormick at kitware.com Tue Sep 19 10:57:18 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Tue, 19 Sep 2017 10:57:18 -0400 Subject: [ITK] [ITK-dev] Module cookiecutter template Message-ID: Hi folks, To make ITK module creation easier, we now have a cookiecutter template. To create a new external module in your current directory, run: python -m pip install cookiecutter python -m cookiecutter gh:InsightSoftwareConsortium/ITKModuleTemplate # Fill in the information requested at the prompts For more information, see: https://github.com/InsightSoftwareConsortium/ITKModuleTemplate Matt _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers From niels-xtk at xs4all.nl Tue Sep 19 15:08:23 2017 From: niels-xtk at xs4all.nl (Niels Dekker) Date: Tue, 19 Sep 2017 21:08:23 +0200 Subject: [ITK] How to avoid NIFTI header files from being installed? In-Reply-To: References: <348ae5559ef7e6c035f3b5f01a7b1c16@xs4all.nl> <83d513b3f543e03025dd944b1664723f@xs4all.nl> <42e642e97ff67557d815e7b174c3fc48@xs4all.nl> Message-ID: <6cea7aee7930bb4fdd2feffe54d3061a@xs4all.nl> >> However, I wouldn't like to have so much duplicate code. The amount of >> code >> duplication could be reduced by replacing my 'NiftiImageHolder' class >> by >> std::unique_ptr. Is it OK to use std::unique_ptr in >> the ITK >> code base? It's basically the most lightweight smart pointer of the >> Standard >> C++ Library but I don't see it being used by ITK. On 2017-09-19 16:24, Matt McCormick wrote: > ITK currently supports compilers without C++11 availability, which is > why std::unique_ptr is not used. itk::AutoPointer could be used an > alternative Thanks for the suggestion, Matt! Please have a look: STYLE: Replaced NiftiImageHolder by AutoPointer http://review.source.kitware.com/#/c/22644/1 And more importantly: COMP: Fixed "gifti_io.h" leak into user code COMP: No longer installing nifti header files by default See http://review.source.kitware.com/#/c/22644 Kind regards, Niels -- Niels Dekker Scientific programmer LKEB, Leiden University Medical Center, Netherlands From tobias.wood at kcl.ac.uk Wed Sep 20 08:43:00 2017 From: tobias.wood at kcl.ac.uk (Wood, Tobias) Date: Wed, 20 Sep 2017 12:43:00 +0000 Subject: [ITK] New Bruker module not exposed correctly Message-ID: <2F3BBBB7-0154-4CC1-9CB7-24D78F0610EA@kcl.ac.uk> Hello, I updated my local copy of ITK to master to test my Bruker patch that was merged a couple of weeks ago. Unfortunately my patch did not change the UseITK.cmake to follow the new name of the module (it was suggested to me that the module name be shortened in case of anymore Bruker formats), so the Bruker reader is not correctly registered. I think I have worked out the required changes to UseITK.cmake, so can submit a patch. However, this raises the question of whether the naming scheme could be rationalized further. Before, both module and class were called ?Bruker2DSEQ?. The module is now ?Bruker?, and the class is ?Bruker2dseq?, which is the correct capitalisation for the format. Should the class/format be shortened to just ?2dseq?? I?m sorry not to catch this before my original patch was merged. Changing the name was one of the last things I did, and because the tests explicitly register the ImageIOFactory, they would not pick this up. Best wishes, Toby From matt.mccormick at kitware.com Wed Sep 20 09:16:59 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Wed, 20 Sep 2017 09:16:59 -0400 Subject: [ITK] New Bruker module not exposed correctly In-Reply-To: <2F3BBBB7-0154-4CC1-9CB7-24D78F0610EA@kcl.ac.uk> References: <2F3BBBB7-0154-4CC1-9CB7-24D78F0610EA@kcl.ac.uk> Message-ID: Hi Toby, Thanks again for the contribution. Yes, a small follow-up patch in UseITK.cmake will do the trick. For a large addition like this, some follow-up effort is expected. In my opinion, "2dseq" is obscure enough that the addition of "Bruker" helps identify the class. Thanks, Matt On Wed, Sep 20, 2017 at 8:43 AM, Wood, Tobias wrote: > Hello, > > I updated my local copy of ITK to master to test my Bruker patch that was merged a couple of weeks ago. Unfortunately my patch did not change the UseITK.cmake to follow the new name of the module (it was suggested to me that the module name be shortened in case of anymore Bruker formats), so the Bruker reader is not correctly registered. > > I think I have worked out the required changes to UseITK.cmake, so can submit a patch. However, this raises the question of whether the naming scheme could be rationalized further. Before, both module and class were called ?Bruker2DSEQ?. The module is now ?Bruker?, and the class is ?Bruker2dseq?, which is the correct capitalisation for the format. Should the class/format be shortened to just ?2dseq?? > > I?m sorry not to catch this before my original patch was merged. Changing the name was one of the last things I did, and because the tests explicitly register the ImageIOFactory, they would not pick this up. > > Best wishes, > Toby > > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community From jhlegarreta at vicomtech.org Wed Sep 20 09:25:35 2017 From: jhlegarreta at vicomtech.org (Jon Haitz Legarreta) Date: Wed, 20 Sep 2017 15:25:35 +0200 Subject: [ITK] New Bruker module not exposed correctly In-Reply-To: References: <2F3BBBB7-0154-4CC1-9CB7-24D78F0610EA@kcl.ac.uk> Message-ID: +1 for Matt's proposal. JON HAITZ -- On 20 September 2017 at 15:16, Matt McCormick wrote: > Hi Toby, > > Thanks again for the contribution. > > Yes, a small follow-up patch in UseITK.cmake will do the trick. For a > large addition like this, some follow-up effort is expected. > > In my opinion, "2dseq" is obscure enough that the addition of "Bruker" > helps identify the class. > > Thanks, > Matt > > On Wed, Sep 20, 2017 at 8:43 AM, Wood, Tobias > wrote: > > Hello, > > > > I updated my local copy of ITK to master to test my Bruker patch that > was merged a couple of weeks ago. Unfortunately my patch did not change the > UseITK.cmake to follow the new name of the module (it was suggested to me > that the module name be shortened in case of anymore Bruker formats), so > the Bruker reader is not correctly registered. > > > > I think I have worked out the required changes to UseITK.cmake, so can > submit a patch. However, this raises the question of whether the naming > scheme could be rationalized further. Before, both module and class were > called ?Bruker2DSEQ?. The module is now ?Bruker?, and the class is > ?Bruker2dseq?, which is the correct capitalisation for the format. Should > the class/format be shortened to just ?2dseq?? > > > > I?m sorry not to catch this before my original patch was merged. > Changing the name was one of the last things I did, and because the tests > explicitly register the ImageIOFactory, they would not pick this up. > > > > Best wishes, > > Toby > > > > _______________________________________________ > > Community mailing list > > Community at itk.org > > http://public.kitware.com/mailman/listinfo/community > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thanosxania at gmail.com Wed Sep 20 10:20:57 2017 From: thanosxania at gmail.com (thanos) Date: Wed, 20 Sep 2017 07:20:57 -0700 (MST) Subject: [ITK] [ITK-users] New Submission: ND morphological contour interpolation In-Reply-To: <20160822071136.020FE3D620D3@insight-journal.org> References: <20160822071136.020FE3D620D3@insight-journal.org> Message-ID: <1505917257724-0.post@n2.nabble.com> Hello, Is there maybe an example for the morphological contour interpolation? I am working on Matlab for the segmentation of some 3D data and since I am currently segmenting semi-automatically slice by slice, it would be great if I could use this class.. I also have a quite silly question.. I am aware about the "test" folder and data but I don't really understand what is used for... I had a look on the Software Guide on the chapter "How to create a module" but I still don't get it.. Thank you very much. Best regards, Thanos -- Sent from: http://itk-insight-users.2283740.n2.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 lasso at queensu.ca Wed Sep 20 12:25:05 2017 From: lasso at queensu.ca (Andras Lasso) Date: Wed, 20 Sep 2017 16:25:05 +0000 Subject: [ITK] [ITK-users] New Submission: ND morphological contour interpolation In-Reply-To: <1505917257724-0.post@n2.nabble.com> References: <20160822071136.020FE3D620D3@insight-journal.org> <1505917257724-0.post@n2.nabble.com> Message-ID: If you want to see what the morphological contour interpolation filter can do, then download nightly version of 3D Slicer (www.slicer.org) and try "Fill between slices" effect. Some information about the tool is available at http://slicer.readthedocs.io/en/latest/user_guide/module_segmenteditor.html, but if you are stuck at any point then you can ask help at https://discourse.slicer.org - all questions are answered, typically within a few hours. Andras -----Original Message----- From: Community [mailto:community-bounces at itk.org] On Behalf Of thanos Sent: Wednesday, September 20, 2017 10:21 AM To: insight-users at itk.org Subject: Re: [ITK] [ITK-users] New Submission: ND morphological contour interpolation Hello, Is there maybe an example for the morphological contour interpolation? I am working on Matlab for the segmentation of some 3D data and since I am currently segmenting semi-automatically slice by slice, it would be great if I could use this class.. I also have a quite silly question.. I am aware about the "test" folder and data but I don't really understand what is used for... I had a look on the Software Guide on the chapter "How to create a module" but I still don't get it.. Thank you very much. Best regards, Thanos -- Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fitk-insight-users.2283740.n2.nabble.com%2F&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=w8KKHVVNr%2BQU7gU2kx9hlrlI4oQKpSRemCZunUiPHiY%3D&reserved=0 _____________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=3GRadntJJVw%2BXFixpMl00ZrbMdG89XZ5Ud8E5itiYNs%3D&reserved=0 Visit other Kitware open-source projects at https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=VYlnDSe2Fw31wAWDnhgvnVutXCQrlmSTFy81h5JlYqo%3D&reserved=0 Kitware offers ITK Training Courses, for more information visit: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fproducts%2Fprotraining.php&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=9MblUPjPUyQGNWN%2BVHwqIcF%2Fn2%2BGoYPzJogE8VV%2FCEc%3D&reserved=0 Please keep messages on-topic and check the ITK FAQ at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.itk.org%2FWiki%2FITK_FAQ&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=%2BGQeoDNmK1PyueIexmz%2F1%2F4%2BWHDgiWYUGGGaePJMMzo%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Finsight-users&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=jBHTnHY%2BFgrahTGkQ0SBY363B%2FXsCBpxdS4S9ocZhBI%3D&reserved=0 _______________________________________________ Community mailing list Community at itk.org https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fcommunity&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=knp5fEl0ec9s8nSlN2pYITU41RJp3T9JKATsOVjjbos%3D&reserved=0 _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 tobias.wood at kcl.ac.uk Thu Sep 21 05:22:16 2017 From: tobias.wood at kcl.ac.uk (Wood, Tobias) Date: Thu, 21 Sep 2017 09:22:16 +0000 Subject: [ITK] New Bruker module not exposed correctly In-Reply-To: References: <2F3BBBB7-0154-4CC1-9CB7-24D78F0610EA@kcl.ac.uk> Message-ID: <92A1A72F-85D4-41CC-A73F-CAD45B391D39@kcl.ac.uk> Thanks guys - I?ve pushed a patch to Gerrit and added you as reviewers. Toby On 20/09/2017, 14:25, "Jon Haitz Legarreta" > wrote: +1 for Matt's proposal. JON HAITZ -- On 20 September 2017 at 15:16, Matt McCormick > wrote: Hi Toby, Thanks again for the contribution. Yes, a small follow-up patch in UseITK.cmake will do the trick. For a large addition like this, some follow-up effort is expected. In my opinion, "2dseq" is obscure enough that the addition of "Bruker" helps identify the class. Thanks, Matt On Wed, Sep 20, 2017 at 8:43 AM, Wood, Tobias > wrote: > Hello, > > I updated my local copy of ITK to master to test my Bruker patch that was merged a couple of weeks ago. Unfortunately my patch did not change the UseITK.cmake to follow the new name of the module (it was suggested to me that the module name be shortened in case of anymore Bruker formats), so the Bruker reader is not correctly registered. > > I think I have worked out the required changes to UseITK.cmake, so can submit a patch. However, this raises the question of whether the naming scheme could be rationalized further. Before, both module and class were called ?Bruker2DSEQ?. The module is now ?Bruker?, and the class is ?Bruker2dseq?, which is the correct capitalisation for the format. Should the class/format be shortened to just ?2dseq?? > > I?m sorry not to catch this before my original patch was merged. Changing the name was one of the last things I did, and because the tests explicitly register the ImageIOFactory, they would not pick this up. > > Best wishes, > Toby > > _______________________________________________ > Community mailing list > Community at itk.org > http://public.kitware.com/mailman/listinfo/community _______________________________________________ Community mailing list Community at itk.org http://public.kitware.com/mailman/listinfo/community -------------- next part -------------- An HTML attachment was scrubbed... URL: From thanosxania at gmail.com Thu Sep 21 08:21:39 2017 From: thanosxania at gmail.com (thanos thanos) Date: Thu, 21 Sep 2017 14:21:39 +0200 Subject: [ITK] [ITK-users] New Submission: ND morphological contour interpolation In-Reply-To: References: <20160822071136.020FE3D620D3@insight-journal.org> <1505917257724-0.post@n2.nabble.com> Message-ID: Hello Andras, Thank you very much for your answer. I already tried Slicer and the Segment Editor and it works fine. I was wondering if I can make an executable that I could use for my data (for example an .nrrd segmented volume with some slices missing). Best regards, Thanos On Wed, Sep 20, 2017 at 6:25 PM, Andras Lasso wrote: > If you want to see what the morphological contour interpolation filter can > do, then download nightly version of 3D Slicer (www.slicer.org) and try > "Fill between slices" effect. Some information about the tool is available > at http://slicer.readthedocs.io/en/latest/user_guide/module_ > segmenteditor.html, but if you are stuck at any point then you can ask > help at https://discourse.slicer.org - all questions are answered, > typically within a few hours. > > Andras > > -----Original Message----- > From: Community [mailto:community-bounces at itk.org] On Behalf Of thanos > Sent: Wednesday, September 20, 2017 10:21 AM > To: insight-users at itk.org > Subject: Re: [ITK] [ITK-users] New Submission: ND morphological contour > interpolation > > Hello, > > Is there maybe an example for the morphological contour interpolation? > I am working on Matlab for the segmentation of some 3D data and since I am > currently segmenting semi-automatically slice by slice, it would be great > if I could use this class.. > I also have a quite silly question.. I am aware about the "test" folder > and data but I don't really understand what is used for... I had a look on > the Software Guide on the chapter "How to create a module" but I still > don't get it.. > > Thank you very much. > > Best regards, > Thanos > > > > -- > Sent from: https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fitk-insight-users.2283740.n2.nabble.com% > 2F&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e% > 7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata= > w8KKHVVNr%2BQU7gU2kx9hlrlI4oQKpSRemCZunUiPHiY%3D&reserved=0 > _____________________________________ > Powered by https://na01.safelinks.protection.outlook.com/?url= > www.kitware.com&data=02%7C01%7Classo%40queensu.ca% > 7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636415140716713211&sdata=3GRadntJJVw% > 2BXFixpMl00ZrbMdG89XZ5Ud8E5itiYNs%3D&reserved=0 > > Visit other Kitware open-source projects at > https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource. > html&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e% > 7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata= > VYlnDSe2Fw31wAWDnhgvnVutXCQrlmSTFy81h5JlYqo%3D&reserved=0 > > Kitware offers ITK Training Courses, for more information visit: > https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fwww.kitware.com%2Fproducts%2Fprotraining.php& > data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e% > 7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata= > 9MblUPjPUyQGNWN%2BVHwqIcF%2Fn2%2BGoYPzJogE8VV%2FCEc%3D&reserved=0 > > Please keep messages on-topic and check the ITK FAQ at: > https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fwww.itk.org%2FWiki%2FITK_FAQ&data=02%7C01% > 7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e% > 7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=% > 2BGQeoDNmK1PyueIexmz%2F1%2F4%2BWHDgiWYUGGGaePJMMzo%3D&reserved=0 > > Follow this link to subscribe/unsubscribe: > https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo% > 2Finsight-users&data=02%7C01%7Classo%40queensu.ca% > 7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636415140716713211&sdata=jBHTnHY%2BFgrahTGkQ0SBY363B% > 2FXsCBpxdS4S9ocZhBI%3D&reserved=0 > _______________________________________________ > Community mailing list > Community at itk.org > https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo% > 2Fcommunity&data=02%7C01%7Classo%40queensu.ca% > 7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636415140716713211&sdata=knp5fEl0ec9s8nSlN2pYITU41RJp3T > 9JKATsOVjjbos%3D&reserved=0 > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From lasso at queensu.ca Thu Sep 21 09:27:02 2017 From: lasso at queensu.ca (Andras Lasso) Date: Thu, 21 Sep 2017 13:27:02 +0000 Subject: [ITK] [ITK-users] New Submission: ND morphological contour interpolation In-Reply-To: References: <20160822071136.020FE3D620D3@insight-journal.org> <1505917257724-0.post@n2.nabble.com> Message-ID: It should be easy to write an executable like that. It can be either a standalone executable, or ? if you want to use other effects or you don?t want to set up a build environment on multiple platforms and create distribution mechanism (software download page and/or app store) ? then you can do it using 3D Slicer and a small Python script. See for example how to apply a Segment Editor effect in a script here: https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#How_to_run_segment_editor_effects_from_a_script How the rest of your pipeline is implemented (image loading, visualization, contouring, etc)? Andras From: thanos thanos [mailto:thanosxania at gmail.com] Sent: Thursday, September 21, 2017 8:22 AM To: Andras Lasso Cc: insight-users at itk.org Subject: Re: [ITK] [ITK-users] New Submission: ND morphological contour interpolation Hello Andras, Thank you very much for your answer. I already tried Slicer and the Segment Editor and it works fine. I was wondering if I can make an executable that I could use for my data (for example an .nrrd segmented volume with some slices missing). Best regards, Thanos On Wed, Sep 20, 2017 at 6:25 PM, Andras Lasso > wrote: If you want to see what the morphological contour interpolation filter can do, then download nightly version of 3D Slicer (www.slicer.org) and try "Fill between slices" effect. Some information about the tool is available at http://slicer.readthedocs.io/en/latest/user_guide/module_segmenteditor.html, but if you are stuck at any point then you can ask help at https://discourse.slicer.org - all questions are answered, typically within a few hours. Andras -----Original Message----- From: Community [mailto:community-bounces at itk.org] On Behalf Of thanos Sent: Wednesday, September 20, 2017 10:21 AM To: insight-users at itk.org Subject: Re: [ITK] [ITK-users] New Submission: ND morphological contour interpolation Hello, Is there maybe an example for the morphological contour interpolation? I am working on Matlab for the segmentation of some 3D data and since I am currently segmenting semi-automatically slice by slice, it would be great if I could use this class.. I also have a quite silly question.. I am aware about the "test" folder and data but I don't really understand what is used for... I had a look on the Software Guide on the chapter "How to create a module" but I still don't get it.. Thank you very much. Best regards, Thanos -- Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fitk-insight-users.2283740.n2.nabble.com%2F&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=w8KKHVVNr%2BQU7gU2kx9hlrlI4oQKpSRemCZunUiPHiY%3D&reserved=0 _____________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=3GRadntJJVw%2BXFixpMl00ZrbMdG89XZ5Ud8E5itiYNs%3D&reserved=0 Visit other Kitware open-source projects at https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=VYlnDSe2Fw31wAWDnhgvnVutXCQrlmSTFy81h5JlYqo%3D&reserved=0 Kitware offers ITK Training Courses, for more information visit: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fproducts%2Fprotraining.php&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=9MblUPjPUyQGNWN%2BVHwqIcF%2Fn2%2BGoYPzJogE8VV%2FCEc%3D&reserved=0 Please keep messages on-topic and check the ITK FAQ at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.itk.org%2FWiki%2FITK_FAQ&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=%2BGQeoDNmK1PyueIexmz%2F1%2F4%2BWHDgiWYUGGGaePJMMzo%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Finsight-users&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=jBHTnHY%2BFgrahTGkQ0SBY363B%2FXsCBpxdS4S9ocZhBI%3D&reserved=0 _______________________________________________ Community mailing list Community at itk.org https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fcommunity&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=knp5fEl0ec9s8nSlN2pYITU41RJp3T9JKATsOVjjbos%3D&reserved=0 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 thanosxania at gmail.com Thu Sep 21 09:58:21 2017 From: thanosxania at gmail.com (thanos thanos) Date: Thu, 21 Sep 2017 15:58:21 +0200 Subject: [ITK] [ITK-users] New Submission: ND morphological contour interpolation In-Reply-To: References: <20160822071136.020FE3D620D3@insight-journal.org> <1505917257724-0.post@n2.nabble.com> Message-ID: Thank you for your reply! I have some binary data which I load in Matlab and I reshape them to obtain my 3D image. I perform 2D semi-automatic segmentation (based on active contours and b-splines) where I obtain both the curve as a set of points as well as binary images which I then multiple with my original image. I then use isosurfaces to get the 3D model. What I want is to avoid performing the semi-automatic segmentation on each slice so I thought of creating a binary 3D model with missing slices and then do the interpolation. I will study now the "grow from seeds effect" and working with scripts on Slicer since I haven't done this before.. Best, Thanos On Thu, Sep 21, 2017 at 3:27 PM, Andras Lasso wrote: > It should be easy to write an executable like that. It can be either a > standalone executable, or ? if you want to use other effects or you don?t > want to set up a build environment on multiple platforms and create > distribution mechanism (software download page and/or app store) ? then you > can do it using 3D Slicer and a small Python script. See for example how to > apply a Segment Editor effect in a script here: > https://www.slicer.org/wiki/Documentation/Nightly/ > ScriptRepository#How_to_run_segment_editor_effects_from_a_script > > > > How the rest of your pipeline is implemented (image loading, > visualization, contouring, etc)? > > > > Andras > > > > *From:* thanos thanos [mailto:thanosxania at gmail.com] > *Sent:* Thursday, September 21, 2017 8:22 AM > *To:* Andras Lasso > *Cc:* insight-users at itk.org > > *Subject:* Re: [ITK] [ITK-users] New Submission: ND morphological contour > interpolation > > > > Hello Andras, > > > > Thank you very much for your answer. I already tried Slicer and the > Segment Editor and it works fine. I was wondering if I can make an > executable that I could use for my data (for example an .nrrd segmented > volume with some slices missing). > > > > Best regards, > > Thanos > > > > On Wed, Sep 20, 2017 at 6:25 PM, Andras Lasso wrote: > > If you want to see what the morphological contour interpolation filter can > do, then download nightly version of 3D Slicer (www.slicer.org > ) > and try "Fill between slices" effect. Some information about the tool is > available at http://slicer.readthedocs.io/en/latest/user_guide/module_ > segmenteditor.html > , > but if you are stuck at any point then you can ask help at > https://discourse.slicer.org > > - all questions are answered, typically within a few hours. > > Andras > > -----Original Message----- > From: Community [mailto:community-bounces at itk.org] On Behalf Of thanos > Sent: Wednesday, September 20, 2017 10:21 AM > To: insight-users at itk.org > Subject: Re: [ITK] [ITK-users] New Submission: ND morphological contour > interpolation > > Hello, > > Is there maybe an example for the morphological contour interpolation? > I am working on Matlab for the segmentation of some 3D data and since I am > currently segmenting semi-automatically slice by slice, it would be great > if I could use this class.. > I also have a quite silly question.. I am aware about the "test" folder > and data but I don't really understand what is used for... I had a look on > the Software Guide on the chapter "How to create a module" but I still > don't get it.. > > Thank you very much. > > Best regards, > Thanos > > > > -- > Sent from: https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fitk-insight-users.2283740.n2.nabble.com% > 2F&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e% > 7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata= > w8KKHVVNr%2BQU7gU2kx9hlrlI4oQKpSRemCZunUiPHiY%3D&reserved=0 > _____________________________________ > Powered by https://na01.safelinks.protection.outlook.com/?url= > www.kitware.com&data=02%7C01%7Classo%40queensu.ca% > 7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636415140716713211&sdata=3GRadntJJVw% > 2BXFixpMl00ZrbMdG89XZ5Ud8E5itiYNs%3D&reserved=0 > > Visit other Kitware open-source projects at > https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource. > html&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e% > 7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata= > VYlnDSe2Fw31wAWDnhgvnVutXCQrlmSTFy81h5JlYqo%3D&reserved=0 > > Kitware offers ITK Training Courses, for more information visit: > https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fwww.kitware.com%2Fproducts%2Fprotraining.php& > data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e% > 7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata= > 9MblUPjPUyQGNWN%2BVHwqIcF%2Fn2%2BGoYPzJogE8VV%2FCEc%3D&reserved=0 > > Please keep messages on-topic and check the ITK FAQ at: > https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fwww.itk.org%2FWiki%2FITK_FAQ&data=02%7C01% > 7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e% > 7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=% > 2BGQeoDNmK1PyueIexmz%2F1%2F4%2BWHDgiWYUGGGaePJMMzo%3D&reserved=0 > > Follow this link to subscribe/unsubscribe: > https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo% > 2Finsight-users&data=02%7C01%7Classo%40queensu.ca% > 7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636415140716713211&sdata=jBHTnHY%2BFgrahTGkQ0SBY363B% > 2FXsCBpxdS4S9ocZhBI%3D&reserved=0 > _______________________________________________ > Community mailing list > Community at itk.org > https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo% > 2Fcommunity&data=02%7C01%7Classo%40queensu.ca% > 7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636415140716713211&sdata=knp5fEl0ec9s8nSlN2pYITU41RJp3T > 9JKATsOVjjbos%3D&reserved=0 > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From lasso at queensu.ca Thu Sep 21 10:15:53 2017 From: lasso at queensu.ca (Andras Lasso) Date: Thu, 21 Sep 2017 14:15:53 +0000 Subject: [ITK] [ITK-users] New Submission: ND morphological contour interpolation In-Reply-To: References: <20160822071136.020FE3D620D3@insight-journal.org> <1505917257724-0.post@n2.nabble.com> Message-ID: Matlab is (was) a nice platform from algorithm prototyping, but implementing user interface in Matlab even for basic tasks, such as DICOM image import, reslicing, surface, volume visualization, etc. is a lot of work. I would recommend using 3D Slicer as user interface and running algorithms that you have implemented in Matlab using Slicer?s MatlabBridge (https://www.slicer.org/wiki/Documentation/Nightly/Extensions/MatlabBridge). With growing popularity of Python and increasing number and quality of Python packages, Matlab is getting more and more irrelevant. I would recommend switching to Python as soon as you can. For example, you could easily put together algorithm prototypes that use ITK, as most (all?) ITK is already available in Python. Andras From: thanos thanos [mailto:thanosxania at gmail.com] Sent: Thursday, September 21, 2017 9:58 AM To: Andras Lasso Cc: insight-users at itk.org Subject: Re: [ITK] [ITK-users] New Submission: ND morphological contour interpolation Thank you for your reply! I have some binary data which I load in Matlab and I reshape them to obtain my 3D image. I perform 2D semi-automatic segmentation (based on active contours and b-splines) where I obtain both the curve as a set of points as well as binary images which I then multiple with my original image. I then use isosurfaces to get the 3D model. What I want is to avoid performing the semi-automatic segmentation on each slice so I thought of creating a binary 3D model with missing slices and then do the interpolation. I will study now the "grow from seeds effect" and working with scripts on Slicer since I haven't done this before.. Best, Thanos On Thu, Sep 21, 2017 at 3:27 PM, Andras Lasso > wrote: It should be easy to write an executable like that. It can be either a standalone executable, or ? if you want to use other effects or you don?t want to set up a build environment on multiple platforms and create distribution mechanism (software download page and/or app store) ? then you can do it using 3D Slicer and a small Python script. See for example how to apply a Segment Editor effect in a script here: https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#How_to_run_segment_editor_effects_from_a_script How the rest of your pipeline is implemented (image loading, visualization, contouring, etc)? Andras From: thanos thanos [mailto:thanosxania at gmail.com] Sent: Thursday, September 21, 2017 8:22 AM To: Andras Lasso > Cc: insight-users at itk.org Subject: Re: [ITK] [ITK-users] New Submission: ND morphological contour interpolation Hello Andras, Thank you very much for your answer. I already tried Slicer and the Segment Editor and it works fine. I was wondering if I can make an executable that I could use for my data (for example an .nrrd segmented volume with some slices missing). Best regards, Thanos On Wed, Sep 20, 2017 at 6:25 PM, Andras Lasso > wrote: If you want to see what the morphological contour interpolation filter can do, then download nightly version of 3D Slicer (www.slicer.org) and try "Fill between slices" effect. Some information about the tool is available at http://slicer.readthedocs.io/en/latest/user_guide/module_segmenteditor.html, but if you are stuck at any point then you can ask help at https://discourse.slicer.org - all questions are answered, typically within a few hours. Andras -----Original Message----- From: Community [mailto:community-bounces at itk.org] On Behalf Of thanos Sent: Wednesday, September 20, 2017 10:21 AM To: insight-users at itk.org Subject: Re: [ITK] [ITK-users] New Submission: ND morphological contour interpolation Hello, Is there maybe an example for the morphological contour interpolation? I am working on Matlab for the segmentation of some 3D data and since I am currently segmenting semi-automatically slice by slice, it would be great if I could use this class.. I also have a quite silly question.. I am aware about the "test" folder and data but I don't really understand what is used for... I had a look on the Software Guide on the chapter "How to create a module" but I still don't get it.. Thank you very much. Best regards, Thanos -- Sent from: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fitk-insight-users.2283740.n2.nabble.com%2F&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=w8KKHVVNr%2BQU7gU2kx9hlrlI4oQKpSRemCZunUiPHiY%3D&reserved=0 _____________________________________ Powered by https://na01.safelinks.protection.outlook.com/?url=www.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=3GRadntJJVw%2BXFixpMl00ZrbMdG89XZ5Ud8E5itiYNs%3D&reserved=0 Visit other Kitware open-source projects at https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource.html&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=VYlnDSe2Fw31wAWDnhgvnVutXCQrlmSTFy81h5JlYqo%3D&reserved=0 Kitware offers ITK Training Courses, for more information visit: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com%2Fproducts%2Fprotraining.php&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=9MblUPjPUyQGNWN%2BVHwqIcF%2Fn2%2BGoYPzJogE8VV%2FCEc%3D&reserved=0 Please keep messages on-topic and check the ITK FAQ at: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.itk.org%2FWiki%2FITK_FAQ&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=%2BGQeoDNmK1PyueIexmz%2F1%2F4%2BWHDgiWYUGGGaePJMMzo%3D&reserved=0 Follow this link to subscribe/unsubscribe: https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Finsight-users&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=jBHTnHY%2BFgrahTGkQ0SBY363B%2FXsCBpxdS4S9ocZhBI%3D&reserved=0 _______________________________________________ Community mailing list Community at itk.org https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo%2Fcommunity&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=knp5fEl0ec9s8nSlN2pYITU41RJp3T9JKATsOVjjbos%3D&reserved=0 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 Thu Sep 21 15:25:50 2017 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Thu, 21 Sep 2017 15:25:50 -0400 Subject: [ITK] [ITK-users] New Submission: ND morphological contour interpolation In-Reply-To: References: <20160822071136.020FE3D620D3@insight-journal.org> <1505917257724-0.post@n2.nabble.com> Message-ID: Hi Thanos, here is a short and easy-to-understand example. The input is an image with some slices segmented, the output is an image with the missing slices interpolated. If smoothing radius is provided, it is used. I will test this a bit more and integrate into the repository, per Matt's suggestion. Regards, D?enan On Thu, Sep 21, 2017 at 10:15 AM, Andras Lasso wrote: > Matlab is (was) a nice platform from algorithm prototyping, but > implementing user interface in Matlab even for basic tasks, such as DICOM > image import, reslicing, surface, volume visualization, etc. is a lot of > work. I would recommend using 3D Slicer as user interface and running > algorithms that you have implemented in Matlab using Slicer?s MatlabBridge ( > https://www.slicer.org/wiki/Documentation/Nightly/Extensions/MatlabBridge > ). > > > > With growing popularity of Python and increasing number and quality of > Python packages, Matlab is getting more and more irrelevant. I would > recommend switching to Python as soon as you can. For example, you could > easily put together algorithm prototypes that use ITK, as most (all?) ITK > is already available in Python. > > > > Andras > > > > *From:* thanos thanos [mailto:thanosxania at gmail.com] > *Sent:* Thursday, September 21, 2017 9:58 AM > > *To:* Andras Lasso > *Cc:* insight-users at itk.org > *Subject:* Re: [ITK] [ITK-users] New Submission: ND morphological contour > interpolation > > > > Thank you for your reply! > I have some binary data which I load in Matlab and I reshape them to > obtain my 3D image. I perform 2D semi-automatic segmentation (based on > active contours and b-splines) where I obtain both the curve as a set of > points as well as binary images which I then multiple with my original > image. I then use isosurfaces to get the 3D model. > > What I want is to avoid performing the semi-automatic segmentation on each > slice so I thought of creating a binary 3D model with missing slices and > then do the interpolation. I will study now the "grow from seeds effect" > and working with scripts on Slicer since I haven't done this before.. > > > > Best, > > Thanos > > > > On Thu, Sep 21, 2017 at 3:27 PM, Andras Lasso wrote: > > It should be easy to write an executable like that. It can be either a > standalone executable, or ? if you want to use other effects or you don?t > want to set up a build environment on multiple platforms and create > distribution mechanism (software download page and/or app store) ? then you > can do it using 3D Slicer and a small Python script. See for example how to > apply a Segment Editor effect in a script here: > https://www.slicer.org/wiki/Documentation/Nightly/ > ScriptRepository#How_to_run_segment_editor_effects_from_a_script > > > > > How the rest of your pipeline is implemented (image loading, > visualization, contouring, etc)? > > > > Andras > > > > *From:* thanos thanos [mailto:thanosxania at gmail.com] > *Sent:* Thursday, September 21, 2017 8:22 AM > *To:* Andras Lasso > *Cc:* insight-users at itk.org > > > *Subject:* Re: [ITK] [ITK-users] New Submission: ND morphological contour > interpolation > > > > Hello Andras, > > > > Thank you very much for your answer. I already tried Slicer and the > Segment Editor and it works fine. I was wondering if I can make an > executable that I could use for my data (for example an .nrrd segmented > volume with some slices missing). > > > > Best regards, > > Thanos > > > > On Wed, Sep 20, 2017 at 6:25 PM, Andras Lasso wrote: > > If you want to see what the morphological contour interpolation filter can > do, then download nightly version of 3D Slicer (www.slicer.org > ) > and try "Fill between slices" effect. Some information about the tool is > available at http://slicer.readthedocs.io/en/latest/user_guide/module_ > segmenteditor.html > , > but if you are stuck at any point then you can ask help at > https://discourse.slicer.org > > - all questions are answered, typically within a few hours. > > Andras > > -----Original Message----- > From: Community [mailto:community-bounces at itk.org] On Behalf Of thanos > Sent: Wednesday, September 20, 2017 10:21 AM > To: insight-users at itk.org > Subject: Re: [ITK] [ITK-users] New Submission: ND morphological contour > interpolation > > Hello, > > Is there maybe an example for the morphological contour interpolation? > I am working on Matlab for the segmentation of some 3D data and since I am > currently segmenting semi-automatically slice by slice, it would be great > if I could use this class.. > I also have a quite silly question.. I am aware about the "test" folder > and data but I don't really understand what is used for... I had a look on > the Software Guide on the chapter "How to create a module" but I still > don't get it.. > > Thank you very much. > > Best regards, > Thanos > > > > -- > Sent from: https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fitk-insight-users.2283740.n2.nabble.com% > 2F&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e% > 7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata= > w8KKHVVNr%2BQU7gU2kx9hlrlI4oQKpSRemCZunUiPHiY%3D&reserved=0 > _____________________________________ > Powered by https://na01.safelinks.protection.outlook.com/?url= > www.kitware.com&data=02%7C01%7Classo%40queensu.ca% > 7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636415140716713211&sdata=3GRadntJJVw% > 2BXFixpMl00ZrbMdG89XZ5Ud8E5itiYNs%3D&reserved=0 > > Visit other Kitware open-source projects at > https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fwww.kitware.com%2Fopensource%2Fopensource. > html&data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e% > 7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata= > VYlnDSe2Fw31wAWDnhgvnVutXCQrlmSTFy81h5JlYqo%3D&reserved=0 > > Kitware offers ITK Training Courses, for more information visit: > https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fwww.kitware.com%2Fproducts%2Fprotraining.php& > data=02%7C01%7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e% > 7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata= > 9MblUPjPUyQGNWN%2BVHwqIcF%2Fn2%2BGoYPzJogE8VV%2FCEc%3D&reserved=0 > > Please keep messages on-topic and check the ITK FAQ at: > https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fwww.itk.org%2FWiki%2FITK_FAQ&data=02%7C01% > 7Classo%40queensu.ca%7C66ffdacfdc7549999e2e08d50032d77e% > 7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636415140716713211&sdata=% > 2BGQeoDNmK1PyueIexmz%2F1%2F4%2BWHDgiWYUGGGaePJMMzo%3D&reserved=0 > > Follow this link to subscribe/unsubscribe: > https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo% > 2Finsight-users&data=02%7C01%7Classo%40queensu.ca% > 7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636415140716713211&sdata=jBHTnHY%2BFgrahTGkQ0SBY363B% > 2FXsCBpxdS4S9ocZhBI%3D&reserved=0 > _______________________________________________ > Community mailing list > Community at itk.org > https://na01.safelinks.protection.outlook.com/?url= > http%3A%2F%2Fpublic.kitware.com%2Fmailman%2Flistinfo% > 2Fcommunity&data=02%7C01%7Classo%40queensu.ca% > 7C66ffdacfdc7549999e2e08d50032d77e%7Cd61ecb3b38b142d582c4efb2838b > 925c%7C1%7C0%7C636415140716713211&sdata=knp5fEl0ec9s8nSlN2pYITU41RJp3T > 9JKATsOVjjbos%3D&reserved=0 > > > > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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: tester.cpp Type: text/x-c++src Size: 1756 bytes Desc: not available URL: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 Sep 21 17:37:44 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Thu, 21 Sep 2017 17:37:44 -0400 Subject: [ITK] Discourse Message-ID: Hi folks, Following requests from the community, Kitware has graciously hosted a Discourse instance for the community to try as a communication platform. Created by the people behind Stack Overflow, Discourse is a next generation, open source discussion platform that functions as a mailing list, discussion forum, and long-form chat room. Discourse is a simple, modern, and fun platform that facilitates civilized discussions. It has been adopted with great success by open source projects like 3D Slicer and the Julia Language. Please give it a try: https://discourse.itk.org/ There is a Getting Started Guide: https://discourse.itk.org/t/getting-started-with-discourse/22 And a Guide to Using Discourse as Mailing List: https://discourse.itk.org/t/using-discourse-as-a-mailing-list/32 From thanosxania at gmail.com Fri Sep 22 06:00:50 2017 From: thanosxania at gmail.com (thanos thanos) Date: Fri, 22 Sep 2017 12:00:50 +0200 Subject: [ITK] [ITK-users] New Submission: ND morphological contour interpolation In-Reply-To: References: <20160822071136.020FE3D620D3@insight-journal.org> <1505917257724-0.post@n2.nabble.com> Message-ID: Hello D?enan, Thank you very much! I tried it already for a couple of my images and it seems to work as I was hoping! Best regards, Thanos -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 brian at mbfbioscience.com Fri Sep 22 16:44:59 2017 From: brian at mbfbioscience.com (Brian Eastwood) Date: Fri, 22 Sep 2017 20:44:59 +0000 Subject: [ITK] Image Registration Initialization Message-ID: Hi Folks, I really like the changes implemented for ITK v4 registration. The composite transform makes multistage registration much easier to implement. Nice work! Is there a way to explicitly set the fixed and moving images to be used at each level of a multiresolution registration? How about the gradient images used by the image metric? I see you can set gradient filters on the metric, but what if you already have the gradients precomputed? I get the feeling that v4 registration runs slower than similar v3 registration, but I think it's mainly down to the initialization where the fixed and moving images are smoothed and the metric computes the image gradients. It seems like there could be some real advantages to using precomputed smoothed and gradient images. For example, the smoothing could be implemented with a cascade of Gaussians where the standard deviation used at a level k is given by s^2 = s_k^2 - s_{k-1}^2. Or the smoothing could be implemented on the GPU. Or we could be reusing a resolution level in a different registration stage, perhaps optimizing a different set of transform parameters. Have I missed something in the API where it is possible to explicitly set the images and gradients to use at each level of the registration? I could probably create an itk::Command that swaps the fixed and moving images before each registration iteration, but is there a way to disable the smoothing step? Regards, Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: From arw.tyx-ouy_mz at suou.waseda.jp Fri Sep 22 22:22:54 2017 From: arw.tyx-ouy_mz at suou.waseda.jp (arwtyxouymz) Date: Fri, 22 Sep 2017 19:22:54 -0700 (MST) Subject: [ITK] [ITK-users] ITK Build Problem Message-ID: <1506133374230-0.post@n7.nabble.com> Hi, I have a problem building ITK. I try to configure, this error message occur. ``` CMake Warning (dev) at /usr/local/Cellar/qt/5.9.1/lib/cmake/Qt5/Qt5ModuleLocation.cmake:4 (set): Policy CMP0053 is not set: Simplify variable reference and escape sequence evaluation. Run "cmake --help-policy CMP0053" for policy details. Use the cmake_policy command to set the policy and suppress this warning. For input: '${_qt5_install_prefix}/Qt5 at module@/Qt5 at module@Config.cmake' the old evaluation rules produce: '/usr/local/Cellar/qt/5.9.1/lib/cmake/Qt5/Qt5Config.cmake' but the new evaluation rules produce: '/usr/local/Cellar/qt/5.9.1/lib/cmake/Qt5 at module@/Qt5 at module@Config.cmake' Using the old result for compatibility since the policy is not set. Call Stack (most recent call first): /usr/local/Cellar/qt/5.9.1/lib/cmake/Qt5/Qt5Config.cmake:25 (include) /usr/local/lib/cmake/vtk-8.0/Modules/vtkGUISupportQtOpenGL.cmake:14 (find_package) /usr/local/lib/cmake/vtk-8.0/vtkModuleAPI.cmake:45 (include) /usr/local/lib/cmake/vtk-8.0/vtkModuleAPI.cmake:15 (vtk_module_load) /usr/local/lib/cmake/vtk-8.0/vtkModuleAPI.cmake:132 (_vtk_module_config_recurse) /usr/local/lib/cmake/vtk-8.0/VTKConfig.cmake:135 (vtk_module_config) Modules/Bridge/VtkGlue/itk-module-init.cmake:9 (find_package) CMake/ITKModuleEnablement.cmake:316 (include) CMakeLists.txt:337 (include) This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at /usr/local/Cellar/qt/5.9.1/lib/cmake/Qt5/Qt5ModuleLocation.cmake:4 (set): Policy CMP0053 is not set: Simplify variable reference and escape sequence evaluation. Run "cmake --help-policy CMP0053" for policy details. Use the cmake_policy command to set the policy and suppress this warning. For input: '${_qt5_install_prefix}/Qt5 at module@/Qt5 at module@Config.cmake' ``` My OS is Mac OS X 10.12.6 and QT version is 5.9.1 Why does this problem occur and how should i recover this problem? Please help me! -- Sent from: http://itk-users.7.n7.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 francois.budin at kitware.com Mon Sep 25 09:36:31 2017 From: francois.budin at kitware.com (Francois Budin) Date: Mon, 25 Sep 2017 09:36:31 -0400 Subject: [ITK] [ITK-users] ITK Build Problem In-Reply-To: <1506133374230-0.post@n7.nabble.com> References: <1506133374230-0.post@n7.nabble.com> Message-ID: Hello, Thank you for reporting this. It is just a warning message. ITK configuration and compilation should run correctly despite this message. You are seeing this message because you are building Module_ITKVtkGlue, and VTK was built with Qt.It seems that it is actually Qt that is producing this message. If you do not need VTK support in ITK, you can disable Module_ITKVtkGlue . Otherwise it should still work even with the warning message. Hope this helps, Francois On Fri, Sep 22, 2017 at 10:22 PM, arwtyxouymz wrote: > Hi, > > I have a problem building ITK. > I try to configure, this error message occur. > > ``` > CMake Warning (dev) at > /usr/local/Cellar/qt/5.9.1/lib/cmake/Qt5/Qt5ModuleLocation.cmake:4 (set): > Policy CMP0053 is not set: Simplify variable reference and escape > sequence > evaluation. Run "cmake --help-policy CMP0053" for policy details. Use > the > cmake_policy command to set the policy and suppress this warning. > > For input: > > '${_qt5_install_prefix}/Qt5 at module@/Qt5 at module@Config.cmake' > > the old evaluation rules produce: > > '/usr/local/Cellar/qt/5.9.1/lib/cmake/Qt5/Qt5Config.cmake' > > but the new evaluation rules produce: > > > '/usr/local/Cellar/qt/5.9.1/lib/cmake/Qt5 at module@/Qt5 at module@Config.cmake' > > Using the old result for compatibility since the policy is not set. > Call Stack (most recent call first): > /usr/local/Cellar/qt/5.9.1/lib/cmake/Qt5/Qt5Config.cmake:25 (include) > /usr/local/lib/cmake/vtk-8.0/Modules/vtkGUISupportQtOpenGL.cmake:14 > (find_package) > /usr/local/lib/cmake/vtk-8.0/vtkModuleAPI.cmake:45 (include) > /usr/local/lib/cmake/vtk-8.0/vtkModuleAPI.cmake:15 (vtk_module_load) > /usr/local/lib/cmake/vtk-8.0/vtkModuleAPI.cmake:132 > (_vtk_module_config_recurse) > /usr/local/lib/cmake/vtk-8.0/VTKConfig.cmake:135 (vtk_module_config) > Modules/Bridge/VtkGlue/itk-module-init.cmake:9 (find_package) > CMake/ITKModuleEnablement.cmake:316 (include) > CMakeLists.txt:337 (include) > This warning is for project developers. Use -Wno-dev to suppress it. > > > CMake Warning (dev) at > /usr/local/Cellar/qt/5.9.1/lib/cmake/Qt5/Qt5ModuleLocation.cmake:4 (set): > Policy CMP0053 is not set: Simplify variable reference and escape > sequence > evaluation. Run "cmake --help-policy CMP0053" for policy details. Use > the > cmake_policy command to set the policy and suppress this warning. > > For input: > > '${_qt5_install_prefix}/Qt5 at module@/Qt5 at module@Config.cmake' > ``` > > My OS is Mac OS X 10.12.6 and QT version is 5.9.1 > Why does this problem occur and how should i recover this problem? > > Please help me! > > > > > -- > Sent from: http://itk-users.7.n7.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: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From blowekamp at mail.nih.gov Mon Sep 25 10:02:20 2017 From: blowekamp at mail.nih.gov (Lowekamp, Bradley (NIH/NLM/LHC) [C]) Date: Mon, 25 Sep 2017 14:02:20 +0000 Subject: [ITK] Image Registration Initialization Message-ID: <9CB383E0-28BD-4755-AF64-79B18E94501C@mail.nih.gov> Hello, Did you do any specific profiling to determine these bottlenecks? If so could you please share the profiling code along with the timing you got? Also you did not provide any details about the situation where you found these performance issues. What transform you are using? What is the size of the image? What optimizer are you using? With the v4 framework, in some situations the initialization, and iterations are slower, however for many registration setups with a large number of parameters good results can be achieved with fewer iterations. Additionally, when the framework is combined with the parameters estimators the results are more robust. And with the built in multi-resolution and metric sampling efficient results can be achieved by using all these features of the framework. Based on your comments, I looked through the itk::ImageRegistrationMethodv4. I see that it is using the itk::DiscreteGaussianImageFilter. The itk::SmoothingRecursiveGuassianImageFilter is generally known to be more efficient. I would suggest hacking the ImageRegistrationMethodv4 to use the itk::SmoothingRecursiveGaussianImageFilter, and determine if there is a performance improvement. You cannot swap the fixed and moving inputs images at each resolution scale iteration. However, you could take control of scale iterations yourself, by just running the ImageRegistrationMethod at one level, where you choose the appropriate scale for setting the fixed and moving input images. HTH, Brad From: Brian Eastwood Date: Friday, September 22, 2017 at 4:55 PM To: "community at itk.org" Subject: [ITK] Image Registration Initialization Hi Folks, I really like the changes implemented for ITK v4 registration. The composite transform makes multistage registration much easier to implement. Nice work! Is there a way to explicitly set the fixed and moving images to be used at each level of a multiresolution registration? How about the gradient images used by the image metric? I see you can set gradient filters on the metric, but what if you already have the gradients precomputed? I get the feeling that v4 registration runs slower than similar v3 registration, but I think it?s mainly down to the initialization where the fixed and moving images are smoothed and the metric computes the image gradients. It seems like there could be some real advantages to using precomputed smoothed and gradient images. For example, the smoothing could be implemented with a cascade of Gaussians where the standard deviation used at a level k is given by s^2 = s_k^2 - s_{k-1}^2. Or the smoothing could be implemented on the GPU. Or we could be reusing a resolution level in a different registration stage, perhaps optimizing a different set of transform parameters. Have I missed something in the API where it is possible to explicitly set the images and gradients to use at each level of the registration? I could probably create an itk::Command that swaps the fixed and moving images before each registration iteration, but is there a way to disable the smoothing step? Regards, Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean at rogue-research.com Mon Sep 25 13:40:21 2017 From: sean at rogue-research.com (Sean McBride) Date: Mon, 25 Sep 2017 13:40:21 -0400 Subject: [ITK] [ITK-dev] Proper ThirdParty (GDCM specifically) update procedure? Message-ID: <20170925174021.217863588@mail.rogue-research.com> Hi all, I'm going to try to update ITK's GDCM... are there docs for this procedure? I know about the ITK/Modules/ThirdParty/GDCM/UpdateFromUpstream.sh script, but I'm wondering things like: - do I run it on the master branch, or should I first create a branch of my own? - running the script creates a branch called 'upstream-gdcm'. After the script runs, there are conflicts. After I just resolve them manually, which branch do I commit to? Thanks, -- ____________________________________________________________ Sean McBride, B. Eng sean at rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montr?al, Qu?bec, Canada _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers From mathieu.malaterre at gmail.com Mon Sep 25 14:19:03 2017 From: mathieu.malaterre at gmail.com (Mathieu Malaterre) Date: Mon, 25 Sep 2017 20:19:03 +0200 Subject: [ITK] [ITK-dev] Proper ThirdParty (GDCM specifically) update procedure? In-Reply-To: <20170925174021.217863588@mail.rogue-research.com> References: <20170925174021.217863588@mail.rogue-research.com> Message-ID: Hi Sean, On Mon, Sep 25, 2017 at 7:40 PM, Sean McBride wrote: > Hi all, > > I'm going to try to update ITK's GDCM... are there docs for this procedure? > > I know about the ITK/Modules/ThirdParty/GDCM/UpdateFromUpstream.sh script, but I'm wondering things like: > - do I run it on the master branch, or should I first create a branch of my own? > - running the script creates a branch called 'upstream-gdcm'. After the script runs, there are conflicts. After I just resolve them manually, which branch do I commit to? Thanks for being very brave. If I have one comment: please upgrade from the release branch instead of the default master branch. I vaguely remember the script tracks git/master. Thanks, -- Mathieu _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers From sean at rogue-research.com Mon Sep 25 14:25:00 2017 From: sean at rogue-research.com (Sean McBride) Date: Mon, 25 Sep 2017 14:25:00 -0400 Subject: [ITK] [ITK-dev] Proper ThirdParty (GDCM specifically) update procedure? In-Reply-To: References: <20170925174021.217863588@mail.rogue-research.com> Message-ID: <20170925182500.772037963@mail.rogue-research.com> On Mon, 25 Sep 2017 20:19:03 +0200, Mathieu Malaterre said: >Hi Sean, > >On Mon, Sep 25, 2017 at 7:40 PM, Sean McBride wrote: >> Hi all, >> >> I'm going to try to update ITK's GDCM... are there docs for this procedure? >> >> I know about the ITK/Modules/ThirdParty/GDCM/UpdateFromUpstream.sh >script, but I'm wondering things like: >> - do I run it on the master branch, or should I first create a branch >of my own? >> - running the script creates a branch called 'upstream-gdcm'. After >the script runs, there are conflicts. After I just resolve them >manually, which branch do I commit to? > >Thanks for being very brave. :) There are about 30 conflicted files, so indeed it's going to be at least a little painful. :) That's why I want to be sure I do the git stuff right, as I don't want to have to manually unconflict dozens of files twice. >If I have one comment: please upgrade >from the release branch instead of the default master branch. I >vaguely remember the script tracks git/master. It's pointing to this currently: upstream_git_url='http://git.code.sf.net/p/gdcm/gdcm.git' upstream_git_branch='release' That correct? Cheers, -- ____________________________________________________________ Sean McBride, B. Eng sean at rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montr?al, Qu?bec, Canada _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers From matt.mccormick at kitware.com Mon Sep 25 16:32:53 2017 From: matt.mccormick at kitware.com (Matt McCormick) Date: Mon, 25 Sep 2017 16:32:53 -0400 Subject: [ITK] [ITK-dev] Proper ThirdParty (GDCM specifically) update procedure? In-Reply-To: <20170925174021.217863588@mail.rogue-research.com> References: <20170925174021.217863588@mail.rogue-research.com> Message-ID: Hi Sean, Thanks for helping to update these third party libraries. > I'm going to try to update ITK's GDCM... are there docs for this procedure? Essentially, run the UpdateFromUpstream.sh script, but we should add some instructions in comments at the top of that file to address your questions. > I know about the ITK/Modules/ThirdParty/GDCM/UpdateFromUpstream.sh script, but I'm wondering things like: > - do I run it on the master branch, or should I first create a branch of my own? Yes, a local branch can be created first, like GDCMUpdate. > - running the script creates a branch called 'upstream-gdcm'. After the script runs, there are conflicts. After I just resolve them manually, which branch do I commit to? After the merge conflicts are resolved, run git add file/with/conflict git commit git gerrit-push Thanks, Matt _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers From mathieu.malaterre at gmail.com Tue Sep 26 02:09:35 2017 From: mathieu.malaterre at gmail.com (Mathieu Malaterre) Date: Tue, 26 Sep 2017 08:09:35 +0200 Subject: [ITK] [ITK-dev] Proper ThirdParty (GDCM specifically) update procedure? In-Reply-To: <20170925182500.772037963@mail.rogue-research.com> References: <20170925174021.217863588@mail.rogue-research.com> <20170925182500.772037963@mail.rogue-research.com> Message-ID: Sean, On Mon, Sep 25, 2017 at 8:25 PM, Sean McBride wrote: > On Mon, 25 Sep 2017 20:19:03 +0200, Mathieu Malaterre said: > >>Hi Sean, >> >>On Mon, Sep 25, 2017 at 7:40 PM, Sean McBride wrote: >>> Hi all, >>> >>> I'm going to try to update ITK's GDCM... are there docs for this procedure? >>> >>> I know about the ITK/Modules/ThirdParty/GDCM/UpdateFromUpstream.sh >>script, but I'm wondering things like: >>> - do I run it on the master branch, or should I first create a branch >>of my own? >>> - running the script creates a branch called 'upstream-gdcm'. After >>the script runs, there are conflicts. After I just resolve them >>manually, which branch do I commit to? >> >>Thanks for being very brave. > > :) > > There are about 30 conflicted files, so indeed it's going to be at least a little painful. :) That's why I want to be sure I do the git stuff right, as I don't want to have to manually unconflict dozens of files twice. Feel free to fwd any conflict on gdcm-dev. I tried to cherry-pick all upstream'able patches, but some needed some tweaking (were too ITK specific). >>If I have one comment: please upgrade >>from the release branch instead of the default master branch. I >>vaguely remember the script tracks git/master. > > It's pointing to this currently: > > upstream_git_url='http://git.code.sf.net/p/gdcm/gdcm.git' > upstream_git_branch='release' > > That correct? Looks correct ! Someone must have updated the script since. thanks _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers From brian at mbfbioscience.com Wed Sep 27 12:44:06 2017 From: brian at mbfbioscience.com (Brian Eastwood) Date: Wed, 27 Sep 2017 16:44:06 +0000 Subject: [ITK] Image Registration Initialization In-Reply-To: <9CB383E0-28BD-4755-AF64-79B18E94501C@mail.nih.gov> References: <9CB383E0-28BD-4755-AF64-79B18E94501C@mail.nih.gov> Message-ID: Hi Brad, Thank you for your suggestions. The performance profiling I did was rather rudimentary, just inserting chrono timings in ITK code. I created a small example program to illustrate the situation, but I?ve seen this in many cases of multiresolution registration, especially if the coarse levels of the registration require a lot of smoothing. In my example program (below), I?m performing 3D-to-3D registration using itk::CenteredEuler3DTransform, itk::CorrelationImageToImageMetricv4, and itk::RegularStepGradientDescentOptimizerv4. My fixed image is a 3D mouse brain image from the Allen Institute, with size [456, 320, 528] and 25 um isotropic spacing; my moving image is just a synthetically rotated and translated version of the same image. I run registration with a single resolution level, smoothing the image with a standard deviation of 100 um and shrinking by a factor of 8. Sample timings from this program show that the smoothing that occurs in itk::ImageRegistrationMethodv4::InitializeRegistrationAtEachLevel() dominates the level initialization (15 s), the moving image?s gradient image computation dominates the metric initialization (4 s), and the registration itself runs pretty speedily (1.6 s). (The chrono timing part is not in my example code, so I?ve indicated which method the timings have been added to.) Fixed image: size [456, 320, 528] spacing [25, 25, 25] Initial transform: parameters [0, 0, 0, 5695.034988478505, 3726.9738602938187, 7309.779123793645, 279.5341527061055, -247.51563557593, -1.3564556700512185] center [5695.03, 3726.97, 7309.78] ImageRegistrationMethodv4::GenerateData() level: 0 InitializeRegistrationAtEachLevel() smoothing: 15.4068 this->InitializeRegistrationAtEachLevel(): 15.4224 ImageToImageMetricv4::ComputeMovingImageGradientFilterImage(): 3.9064 this->m_Metric->Initialize(): 3.9064 this->m_Optimizer->StartOptimization(): 1.62503 Final: -0.987401 @ [0.0007390244255403159, 0.03171806411143246, 0.25914684071268346, 5693.978269101054, 3725.58761384107, 7309.850962050369, 278.47743332865645, -248.90188202867876, -1.2846174133290214] I fully understand that smoothing takes time and that it?s a critically important part of multiresolution registration. My example program will not converge with lower smoothing values. It?s just that there are situations where the smoothed images could be faster to compute another way or may be readily available from elsewhere, so I was hoping there would be a way to exert more control over the multiresolution component of the framework. In fact, switching to itk::SmoothingRecursiveGaussianImageFilter reduces the initial smoothing time significantly (1.4 s), but it has different features that may have minor knock-on effects to ImageRegistrtaionMethodv4. I may also take your suggestion to separately configure and run each level, but as I understand it there will always be some smoothing applied to the fixed and moving images in itk::ImageRegistrationMethodv4, no matter how those images have been preprocessed upstream of registration. Thank you, Brian Eastwood /** * \file TestRegistrationv4.cpp * \brief ITKv4 registration test. * \author Brian Eastwood * \date 9/26/2017 * * Example using ITK registration framework. This is a place to try out several * different registration procedures on different data sets. */ #include #include "itkCenteredEuler3DTransform.h" #include "itkCenteredTransformInitializer.h" #include "itkCommand.h" #include "itkCorrelationImageToImageMetricv4.h" #include "itkImage.h" #include "itkImageFileReader.h" #include "itkImageRegistrationMethodv4.h" #include "itkLinearInterpolateImageFunction.h" #include "itkObjectToObjectOptimizerBase.h" #include "itkRegularStepGradientDescentOptimizerv4.h" #include "itkVersorRigid3DTransform.h" /** * 3D-to-3D volume registration. */ void testVolumeRegistration(int argc, char* argv[]) { // define image types const unsigned int Dimension = 3; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; typedef itk::ImageFileReader< ImageType > ReaderType; // define registration types typedef itk::CenteredEuler3DTransform TransformType; typedef itk::CenteredTransformInitializer< TransformType, ImageType, ImageType > InitializerType; typedef itk::CorrelationImageToImageMetricv4< ImageType, ImageType > MetricType; typedef itk::RegularStepGradientDescentOptimizerv4< double > OptimizerType; typedef itk::ImageRegistrationMethodv4< ImageType, ImageType > RegistrationType; if (argc < 3) { std::cerr << "Usage " << argv[0] << " fixedImage movingImage" << std::endl; exit(1); } // create image pre-processing pipeline std::string fixedIn(argv[1]); std::string movingIn(argv[2]); ReaderType::Pointer fixedReader = ReaderType::New(); fixedReader->SetFileName(fixedIn); fixedReader->Update(); ReaderType::Pointer movingReader = ReaderType::New(); movingReader->SetFileName(movingIn); movingReader->Update(); std::cout << "Fixed image:" << std::endl; std::cout << " size " << fixedReader->GetOutput()->GetLargestPossibleRegion().GetSize() << std::endl; std::cout << " spacing " << fixedReader->GetOutput()->GetSpacing() << std::endl; // initialize transform parameters TransformType::Pointer transform = TransformType::New(); InitializerType::Pointer initializer = InitializerType::New(); initializer->SetFixedImage(fixedReader->GetOutput()); initializer->SetMovingImage(movingReader->GetOutput()); initializer->SetTransform(transform); initializer->MomentsOn(); initializer->InitializeTransform(); std::cout << "Initial transform:" << std::endl; std::cout << " parameters " << transform->GetParameters() << std::endl; std::cout << " center " << transform->GetCenter() << std::endl; // create registration objects OptimizerType::Pointer optimizer = OptimizerType::New(); MetricType::Pointer metric = MetricType::New(); RegistrationType::Pointer registration = RegistrationType::New(); registration->SetFixedImage(fixedReader->GetOutput()); registration->SetMovingImage(movingReader->GetOutput()); registration->SetOptimizer(optimizer); registration->SetMetric(metric); registration->SetInitialTransform(transform); registration->InPlaceOn(); // configure resolution levels itk::SizeValueType levels = 1; ImageType::SpacingType spacing = fixedReader->GetOutput()->GetSpacing(); RegistrationType::SmoothingSigmasArrayType sigmas(levels); RegistrationType::ShrinkFactorsArrayType shrink(levels); sigmas[0] = spacing[0] * 4; shrink[0] = 8; registration->SetNumberOfLevels(levels); registration->SetSmoothingSigmasPerLevel(sigmas); registration->SetSmoothingSigmasAreSpecifiedInPhysicalUnits(true); registration->SetShrinkFactorsPerLevel(shrink); // configure optimizer OptimizerType::ScalesType scales(transform->GetNumberOfParameters()); scales.fill(1e-4); scales[0] = scales[1] = scales[2] = 1; optimizer->SetScales(scales); optimizer->SetLearningRate(1); optimizer->SetMinimumStepLength(1e-3); optimizer->SetMinimumConvergenceValue(1e-4); optimizer->SetNumberOfIterations(60); // run registration try { registration->Update(); } catch (itk::ExceptionObject& err) { std::cerr << "Exception occurred during registration:\n" << err << std::endl; } // print result of registration std::cout << "Final: " << optimizer->GetCurrentMetricValue() << " @ " << transform->GetParameters() << std::endl; } int main(int argc, char* argv[]) { testVolumeRegistration(argc, argv); return 0; } From: Lowekamp, Bradley (NIH/NLM/LHC) [C] [mailto:blowekamp at mail.nih.gov] Sent: Monday, September 25, 2017 10:02 AM To: Brian Eastwood ; community at itk.org Cc: Nick Tustison Subject: Re: [ITK] Image Registration Initialization Hello, Did you do any specific profiling to determine these bottlenecks? If so could you please share the profiling code along with the timing you got? Also you did not provide any details about the situation where you found these performance issues. What transform you are using? What is the size of the image? What optimizer are you using? With the v4 framework, in some situations the initialization, and iterations are slower, however for many registration setups with a large number of parameters good results can be achieved with fewer iterations. Additionally, when the framework is combined with the parameters estimators the results are more robust. And with the built in multi-resolution and metric sampling efficient results can be achieved by using all these features of the framework. Based on your comments, I looked through the itk::ImageRegistrationMethodv4. I see that it is using the itk::DiscreteGaussianImageFilter. The itk::SmoothingRecursiveGuassianImageFilter is generally known to be more efficient. I would suggest hacking the ImageRegistrationMethodv4 to use the itk::SmoothingRecursiveGaussianImageFilter, and determine if there is a performance improvement. You cannot swap the fixed and moving inputs images at each resolution scale iteration. However, you could take control of scale iterations yourself, by just running the ImageRegistrationMethod at one level, where you choose the appropriate scale for setting the fixed and moving input images. HTH, Brad From: Brian Eastwood > Date: Friday, September 22, 2017 at 4:55 PM To: "community at itk.org" > Subject: [ITK] Image Registration Initialization Hi Folks, I really like the changes implemented for ITK v4 registration. The composite transform makes multistage registration much easier to implement. Nice work! Is there a way to explicitly set the fixed and moving images to be used at each level of a multiresolution registration? How about the gradient images used by the image metric? I see you can set gradient filters on the metric, but what if you already have the gradients precomputed? I get the feeling that v4 registration runs slower than similar v3 registration, but I think it?s mainly down to the initialization where the fixed and moving images are smoothed and the metric computes the image gradients. It seems like there could be some real advantages to using precomputed smoothed and gradient images. For example, the smoothing could be implemented with a cascade of Gaussians where the standard deviation used at a level k is given by s^2 = s_k^2 - s_{k-1}^2. Or the smoothing could be implemented on the GPU. Or we could be reusing a resolution level in a different registration stage, perhaps optimizing a different set of transform parameters. Have I missed something in the API where it is possible to explicitly set the images and gradients to use at each level of the registration? I could probably create an itk::Command that swaps the fixed and moving images before each registration iteration, but is there a way to disable the smoothing step? Regards, Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: From lebreton.a at gmail.com Thu Sep 28 03:18:40 2017 From: lebreton.a at gmail.com (Aurelie Le breton) Date: Thu, 28 Sep 2017 09:18:40 +0200 Subject: [ITK] [ITK-users] problem with RelabelComponentImageFilter Message-ID: Hello, I'm using ITK, and since a few days SimpleITK, and I've got a problem with the RelabelComponentImageFilter. I haven't found the way to change the minimum objects size, here is my code (SimpleITK via Java) : BigInteger islet_size = BigInteger.valueOf(round(height/5)); // = 102 RelabelComponentImageFilter relabelFilter = new RelabelComponentImageFilter(); relabelFilter.setMinimumObjectSize(islet_size); BigInteger taille = relabelFilter.getMinimumObjectSize(); System.out.println(taille); relabelImage[i] = relabelFilter.execute(connectedComponentOutput[i]/*, islet_size*/); The size displayed in the terminal is : class org.itk.simple.SimpleITKJNI and the output image is filled full black. I don't understand the problem. Thanks in advance for your help. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 Thu Sep 28 09:33:25 2017 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Thu, 28 Sep 2017 09:33:25 -0400 Subject: [ITK] [ITK-users] problem with RelabelComponentImageFilter In-Reply-To: References: Message-ID: Hi Aurelie, if you don't call .setMinimumObjectSize(), do you still get an all-black image? If not, does any of the objects consist of more than 102 pixels? Regards, D?enan On Thu, Sep 28, 2017 at 3:18 AM, Aurelie Le breton wrote: > Hello, > > I'm using ITK, and since a few days SimpleITK, and I've got a problem with > the RelabelComponentImageFilter. > I haven't found the way to change the minimum objects size, here is my > code (SimpleITK via Java) : > > BigInteger islet_size = BigInteger.valueOf(round(height/5)); // = 102 > RelabelComponentImageFilter relabelFilter = new RelabelComponentImageFilter(); > relabelFilter.setMinimumObjectSize(islet_size); > BigInteger taille = relabelFilter.getMinimumObjectSize(); > System.out.println(taille); > relabelImage[i] = relabelFilter.execute(connectedComponentOutput[i]/*, islet_size*/); > > The size displayed in the terminal is : class org.itk.simple.SimpleITKJNI > > and the output image is filled full black. > > I don't understand the problem. > > Thanks in advance for your help. > > > _____________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://www.kitware.com/products/protraining.php > > Please keep messages on-topic and check the 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 -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 Thu Sep 28 09:35:52 2017 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Thu, 28 Sep 2017 09:35:52 -0400 Subject: [ITK] [ITK-users] problem with RelabelComponentImageFilter In-Reply-To: References: Message-ID: Also, after you call execute, can you call relabelFilter.GetOriginalNumberOfObjects() and see if this returns non-zero number? On Thu, Sep 28, 2017 at 9:33 AM, D?enan Zuki? wrote: > Hi Aurelie, > > if you don't call .setMinimumObjectSize(), do you still get an all-black > image? If not, does any of the objects consist of more than 102 pixels? > > Regards, > D?enan > > On Thu, Sep 28, 2017 at 3:18 AM, Aurelie Le breton > wrote: > >> Hello, >> >> I'm using ITK, and since a few days SimpleITK, and I've got a problem >> with the RelabelComponentImageFilter. >> I haven't found the way to change the minimum objects size, here is my >> code (SimpleITK via Java) : >> >> BigInteger islet_size = BigInteger.valueOf(round(height/5)); // = 102 >> RelabelComponentImageFilter relabelFilter = new RelabelComponentImageFilter(); >> relabelFilter.setMinimumObjectSize(islet_size); >> BigInteger taille = relabelFilter.getMinimumObjectSize(); >> System.out.println(taille); >> relabelImage[i] = relabelFilter.execute(connectedComponentOutput[i]/*, islet_size*/); >> >> The size displayed in the terminal is : class org.itk.simple.SimpleITKJNI >> >> and the output image is filled full black. >> >> I don't understand the problem. >> >> Thanks in advance for your help. >> >> >> _____________________________________ >> Powered by www.kitware.com >> >> Visit other Kitware open-source projects at >> http://www.kitware.com/opensource/opensource.html >> >> Kitware offers ITK Training Courses, for more information visit: >> http://www.kitware.com/products/protraining.php >> >> Please keep messages on-topic and check the 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 -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the 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 lebreton.a at gmail.com Thu Sep 28 10:39:44 2017 From: lebreton.a at gmail.com (lilipj) Date: Thu, 28 Sep 2017 07:39:44 -0700 (MST) Subject: [ITK] [ITK-users] problem with RelabelComponentImageFilter In-Reply-To: References: Message-ID: <1506609584285-0.post@n7.nabble.com> If i don't call setMinimumObjectSize(), all labels are kept, even labels that contains more than 102 pixels or those that are very small. That's what i don't understand !! I can't call GetOriginalNumberOfObjects with SimpleITK, the function doesn't exists.... -- Sent from: http://itk-users.7.n7.nabble.com/ _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users From blowekamp at mail.nih.gov Thu Sep 28 10:49:47 2017 From: blowekamp at mail.nih.gov (Lowekamp, Bradley (NIH/NLM/LHC) [C]) Date: Thu, 28 Sep 2017 14:49:47 +0000 Subject: [ITK] [ITK-users] problem with RelabelComponentImageFilter In-Reply-To: <1506609584285-0.post@n7.nabble.com> References: <1506609584285-0.post@n7.nabble.com> Message-ID: <0545FEBF-C29C-4204-9897-FC6D5BE272DB@mail.nih.gov> Hello, You initial report said ?the output image is filled with black?. It is unclear how you are viewing the image. Perhaps it is just 0?s and 1?s, and you can not see such faint values on the display. I?d suggest running the LabelStatisticsImageFilter on the results to print the number of labels in the output and their sized. You could also run this on the input too, to get the expected results. You could also set ` relabelFilter.debugOn()`, this will print the ITK filter?s state before it?s executed, so that you can verify the parameters are correctly set. The missing GetOriginalNumberOfObjects in SimpleITK is an oversight. Could you please create a feature request on the Github issue tracker[1]. [1] https://github.com/SimpleITK/SimpleITK/issues On 9/28/17, 10:40 AM, "lilipj" wrote: If i don't call setMinimumObjectSize(), all labels are kept, even labels that contains more than 102 pixels or those that are very small. That's what i don't understand !! I can't call GetOriginalNumberOfObjects with SimpleITK, the function doesn't exists.... -- Sent from: http://itk-users.7.n7.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 lebreton.a at gmail.com Thu Sep 28 11:32:30 2017 From: lebreton.a at gmail.com (lilipj) Date: Thu, 28 Sep 2017 08:32:30 -0700 (MST) Subject: [ITK] [ITK-users] problem with RelabelComponentImageFilter In-Reply-To: <0545FEBF-C29C-4204-9897-FC6D5BE272DB@mail.nih.gov> References: <1506609584285-0.post@n7.nabble.com> <0545FEBF-C29C-4204-9897-FC6D5BE272DB@mail.nih.gov> Message-ID: <1506612750788-0.post@n7.nabble.com> I've added a MinimumMaximumImageFilter, and it confirms that min = 0.0 and max = 0.0 and when i run a LabelStatisticsImageFilter, it seems to return 0 label stat.hasLabel(0) = 1.0 stat.hasLabel(1) = 0.0 if i don't set the minimum size, it returns 207 objects... I will try to set the debug mode, thanks. -- Sent from: http://itk-users.7.n7.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 sean at rogue-research.com Fri Sep 29 11:39:39 2017 From: sean at rogue-research.com (Sean McBride) Date: Fri, 29 Sep 2017 11:39:39 -0400 Subject: [ITK] [ITK-dev] Patches for 4.12.2 release In-Reply-To: References: Message-ID: <20170929153939.2106354230@mail.rogue-research.com> On Fri, 1 Sep 2017 14:51:01 -0400, Matt McCormick said: >Let's release 4.12.2 next week. This will be a patch release that >fixes critical issues, regressions, documentation, and compiler >support. Patches currently on the release branch are: > > *snip* > >Niels Dekker (1): > COMP: Fixed leak into user code Hi all, This change has broken compilation of my app. I use the nifti_quatern_to_mat44() API that ITK used to provide (accidentally apparently?). So now I'm looking for a solution... It's a pure function, so I could of course copy-paste it into my own app, and thus preserve exact behaviour. But that would be a shame. Could we expose it as an API in NiftiImageIO? Cheers, -- ____________________________________________________________ Sean McBride, B. Eng sean at rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montr?al, Qu?bec, Canada _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers From dzenanz at gmail.com Fri Sep 29 13:24:04 2017 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Fri, 29 Sep 2017 13:24:04 -0400 Subject: [ITK] [ITK-dev] Patches for 4.12.2 release In-Reply-To: <20170929153939.2106354230@mail.rogue-research.com> References: <20170929153939.2106354230@mail.rogue-research.com> Message-ID: Hi Sean, I guess your use case is close to one-of-a-kind. And if we expose just one function, that makes little to no sense. Unless others have a different opinion, I think it is best if you copy-pasted it into your app. Regards, D?enan On Fri, Sep 29, 2017 at 11:39 AM, Sean McBride wrote: > On Fri, 1 Sep 2017 14:51:01 -0400, Matt McCormick said: > > >Let's release 4.12.2 next week. This will be a patch release that > >fixes critical issues, regressions, documentation, and compiler > >support. Patches currently on the release branch are: > > > > *snip* > > > >Niels Dekker (1): > > COMP: Fixed leak into user code > > Hi all, > > This change has broken compilation of my app. I use the > nifti_quatern_to_mat44() API that ITK used to provide (accidentally > apparently?). So now I'm looking for a solution... > > It's a pure function, so I could of course copy-paste it into my own app, > and thus preserve exact behaviour. But that would be a shame. > > Could we expose it as an API in NiftiImageIO? > > Cheers, > > -- > ____________________________________________________________ > Sean McBride, B. Eng sean at rogue-research.com > Rogue Research www.rogue-research.com > Mac Software Developer Montr?al, Qu?bec, Canada > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Kitware offers ITK Training Courses, for more information visit: > http://kitware.com/products/protraining.php > > Please keep messages on-topic and check the ITK FAQ at: > http://www.itk.org/Wiki/ITK_FAQ > > Follow this link to subscribe/unsubscribe: > http://public.kitware.com/mailman/listinfo/insight-developers > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers From blowekamp at mail.nih.gov Fri Sep 29 13:28:36 2017 From: blowekamp at mail.nih.gov (Lowekamp, Bradley (NIH/NLM/LHC) [C]) Date: Fri, 29 Sep 2017 17:28:36 +0000 Subject: [ITK] [ITK-dev] Patches for 4.12.2 release In-Reply-To: <20170929153939.2106354230@mail.rogue-research.com> References: <20170929153939.2106354230@mail.rogue-research.com> Message-ID: <1C12646C-C41C-4B67-9692-8FA6295E27AA@mail.nih.gov> Sean, Could you explicitly include nigti1_io.h in you code? Brad On 9/29/17, 11:40 AM, "Sean McBride" wrote: On Fri, 1 Sep 2017 14:51:01 -0400, Matt McCormick said: >Let's release 4.12.2 next week. This will be a patch release that >fixes critical issues, regressions, documentation, and compiler >support. Patches currently on the release branch are: > > *snip* > >Niels Dekker (1): > COMP: Fixed leak into user code Hi all, This change has broken compilation of my app. I use the nifti_quatern_to_mat44() API that ITK used to provide (accidentally apparently?). So now I'm looking for a solution... It's a pure function, so I could of course copy-paste it into my own app, and thus preserve exact behaviour. But that would be a shame. Could we expose it as an API in NiftiImageIO? Cheers, -- ____________________________________________________________ Sean McBride, B. Eng sean at rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montr?al, Qu?bec, Canada _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers _______________________________________________ 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://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-developers From Anchit.Dhar at mathworks.com Fri Sep 29 16:50:18 2017 From: Anchit.Dhar at mathworks.com (Anchit Dhar) Date: Fri, 29 Sep 2017 20:50:18 +0000 Subject: [ITK] [ITK-users] ITK 4.12 build issues with cmake 2.8.12 Message-ID: <20A76CF9-5FE0-482D-AF95-42B8F66182AB@mathworks.com> Hello, I am trying to build ITK 4.12 with cmake 2.8.12 on a linux machine with GCC 6.3. My build fails at the configuration sets with the error snippets added below. I was wondering if there are any known/open build issues with this combination on cmake and ITK? Does anyone have any pointers on resolving these configuration issues? Thanks in advance. Regards, Anchit. Error Snippet Performing C SOURCE FILE Test C_HAS_WARNING-Wno-long-double failed with the following output: Change Dir: /home/adhar/3p-tmw/3p/derived/glnxa64/ITK/CMakeFiles/CMakeTmp Run Build Command:"/internal/2106168/glnxa64/gmake/bin/gmake" "cmTC_91c4b/fast" gmake[2]: Entering directory '/home/adhar/3p-tmw/3p/derived/glnxa64/ITK/CMakeFiles/CMakeTmp' /internal/2106168/glnxa64/gmake/bin/gmake -f CMakeFiles/cmTC_91c4b.dir/build.make CMakeFiles/cmTC_91c4b.dir/build gmake[3]: Entering directory '/home/adhar/3p-tmw/3p/derived/glnxa64/ITK/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_91c4b.dir/src.c.o /internal/2501977/glnxa64/gcc-6.3.0/bin/gcc -O2 -pipe -pthread -fPIC -DC_HAS_WARNING-Wno-long-double -Wno-long-double -o CMakeFiles/cmTC_91c4b.dir/src.c.o -c /home/adhar/3p-tmw/3p/derived/glnxa64/ITK/CMakeFiles/CMakeTmp/src.c :0:14: warning: ISO C99 requires whitespace after the macro name cc1: warning: unrecognized command line option ?-Wno-long-double? Linking C executable cmTC_91c4b /home/adhar/3p-tmw/3p/private/unknown/glnxa64/cmake-bin/glnx86/cmake -E cmake_link_script CMakeFiles/cmTC_91c4b.dir/link.txt --verbose=1 /internal/2501977/glnxa64/gcc-6.3.0/bin/gcc -O2 -pipe -pthread -fPIC -DC_HAS_WARNING-Wno-long-double -pthread -Wl,--hash-style=both -L/home/adhar/3p-tmw/3p/derived/glnxa64/ITK/lib -Wl,-rpath-link,/home/adhar/3p-tmw/3p/derived/glnxa64/ITK/lib CMakeFiles/cmTC_91c4b.dir/src.c.o -o cmTC_91c4b -rdynamic gmake[3]: Leaving directory '/home/adhar/3p-tmw/3p/derived/glnxa64/ITK/CMakeFiles/CMakeTmp' gmake[2]: Leaving directory '/home/adhar/3p-tmw/3p/derived/glnxa64/ITK/CMakeFiles/CMakeTmp' Source file was: int main(void) { return 0; } Performing C++ SOURCE FILE Test CXX_HAS_WARNING-Wno-long-double failed with the following output: Change Dir: /home/adhar/3p-tmw/3p/derived/glnxa64/ITK/CMakeFiles/CMakeTmp Run Build Command:"/internal/2106168/glnxa64/gmake/bin/gmake" "cmTC_82695/fast" gmake[2]: Entering directory '/home/adhar/3p-tmw/3p/derived/glnxa64/ITK/CMakeFiles/CMakeTmp' /internal/2106168/glnxa64/gmake/bin/gmake -f CMakeFiles/cmTC_82695.dir/build.make CMakeFiles/cmTC_82695.dir/build gmake[3]: Entering directory '/home/adhar/3p-tmw/3p/derived/glnxa64/ITK/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_82695.dir/src.cxx.o /internal/2501977/glnxa64/gcc-6.3.0/bin/g++ -O2 -pipe -pthread -fPIC -std=c++11 -DCXX_HAS_WARNING-Wno-long-double -Wno-long-double -o CMakeFiles/cmTC_82695.dir/src.cxx.o -c /home/adhar/3p-tmw/3p/derived/glnxa64/ITK/CMakeFiles/CMakeTmp/src.cxx :0:16: warning: ISO C++11 requires whitespace after the macro name cc1plus: warning: unrecognized command line option ?-Wno-long-double? Linking CXX executable cmTC_82695 /home/adhar/3p-tmw/3p/private/unknown/glnxa64/cmake-bin/glnx86/cmake -E cmake_link_script CMakeFiles/cmTC_82695.dir/link.txt --verbose=1 /internal/2501977/glnxa64/gcc-6.3.0/bin/g++ -O2 -pipe -pthread -fPIC -std=c++11 -DCXX_HAS_WARNING-Wno-long-double -pthread -Wl,--hash-style=both -L/home/adhar/3p-tmw/3p/derived/glnxa64/ITK/lib -Wl,-rpath-link,/home/adhar/3p-tmw/3p/derived/glnxa64/ITK/lib CMakeFiles/cmTC_82695.dir/src.cxx.o -o cmTC_82695 -rdynamic gmake[3]: Leaving directory '/home/adhar/3p-tmw/3p/derived/glnxa64/ITK/CMakeFiles/CMakeTmp' gmake[2]: Leaving directory '/home/adhar/3p-tmw/3p/derived/glnxa64/ITK/CMakeFiles/CMakeTmp' Source file was: int main() { return 0;} Performing C++ SOURCE FILE Test have_gold failed with the following output: Change Dir: /home/adhar/3p-tmw/3p/derived/glnxa64/ITK/CMakeFiles/CMakeTmp Run Build Command:"/internal/2106168/glnxa64/gmake/bin/gmake" "cmTC_93f61/fast" gmake[2]: Entering directory '/home/adhar/3p-tmw/3p/derived/glnxa64/ITK/CMakeFiles/CMakeTmp' /internal/2106168/glnxa64/gmake/bin/gmake -f CMakeFiles/cmTC_93f61.dir/build.make CMakeFiles/cmTC_93f61.dir/build gmake[3]: Entering directory '/home/adhar/3p-tmw/3p/derived/glnxa64/ITK/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_93f61.dir/src.cxx.o /internal/2501977/glnxa64/gcc-6.3.0/bin/g++ -O2 -pipe -pthread -fPIC -std=c++11 -Wall -Wcast-align -Wdisabled-optimization -Wextra -Wformat=2 -Winvalid-pch -Wno-format-nonliteral -Wpointer-arith -Wshadow -Wunused -Wwrite-strings -funit-at-a-time -Wno-strict-overflow -Wno-deprecated -Wno-invalid-offsetof -Woverloaded-virtual -Wstrict-null-sentinel -Dhave_gold -fuse-ld=gold -o CMakeFiles/cmTC_93f61.dir/src.cxx.o -c /home/adhar/3p-tmw/3p/derived/glnxa64/ITK/CMakeFiles/CMakeTmp/src.cxx Linking CXX executable cmTC_93f61 /home/adhar/3p-tmw/3p/private/unknown/glnxa64/cmake-bin/glnx86/cmake -E cmake_link_script CMakeFiles/cmTC_93f61.dir/link.txt --verbose=1 /internal/2501977/glnxa64/gcc-6.3.0/bin/g++ -O2 -pipe -pthread -fPIC -std=c++11 -Wall -Wcast-align -Wdisabled-optimization -Wextra -Wformat=2 -Winvalid-pch -Wno-format-nonliteral -Wpointer-arith -Wshadow -Wunused -Wwrite-strings -funit-at-a-time -Wno-strict-overflow -Wno-deprecated -Wno-invalid-offsetof -Woverloaded-virtual -Wstrict-null-sentinel -Dhave_gold -fuse-ld=gold -pthread -Wl,--hash-style=both -L/home/adhar/3p-tmw/3p/derived/glnxa64/ITK/lib -Wl,-rpath-link,/home/adhar/3p-tmw/3p/derived/glnxa64/ITK/lib CMakeFiles/cmTC_93f61.dir/src.cxx.o -o cmTC_93f61 -rdynamic /internal/2501977/glnxa64/gcc-6.3.0/bin/ld.gold: -plugin: unknown option /internal/2501977/glnxa64/gcc-6.3.0/bin/ld.gold: use the --help option for usage information collect2: error: ld returned 1 exit status gmake[3]: Leaving directory '/home/adhar/3p-tmw/3p/derived/glnxa64/ITK/CMakeFiles/CMakeTmp' gmake[3]: *** [CMakeFiles/cmTC_93f61.dir/build.make:98: cmTC_93f61] Error 1 gmake[2]: *** [Makefile:126: cmTC_93f61/fast] Error 2 gmake[2]: Leaving directory '/home/adhar/3p-tmw/3p/derived/glnxa64/ITK/CMakeFiles/CMakeTmp' . . . . . . . /home/adhar/3p-tmw/3p/sources/ITK/Modules/ThirdParty/KWSys/src/KWSys/kwsysPlatformTestsCXX.cxx:24:1: error: ?__int64? does not name a type __int64 f(__int64 n) ^~~~~~~ /home/adhar/3p-tmw/3p/sources/ITK/Modules/ThirdParty/KWSys/src/KWSys/kwsysPlatformTestsCXX.cxx: In function ?int main()?: /home/adhar/3p-tmw/3p/sources/ITK/Modules/ThirdParty/KWSys/src/KWSys/kwsysPlatformTestsCXX.cxx:30:3: error: ?__int64? was not declared in this scope __int64 n = 0; ^~~~~~~ /home/adhar/3p-tmw/3p/sources/ITK/Modules/ThirdParty/KWSys/src/KWSys/kwsysPlatformTestsCXX.cxx:31:29: error: ?n? was not declared in this scope return static_cast(f(n)); ^ /home/adhar/3p-tmw/3p/sources/ITK/Modules/ThirdParty/KWSys/src/KWSys/kwsysPlatformTestsCXX.cxx:31:30: error: ?f? was not declared in this scope return static_cast(f(n)); ^ gmake[3]: *** [CMakeFiles/cmTC_797a6.dir/build.make:66: CMakeFiles/cmTC_797a6.dir/kwsysPlatformTestsCXX.cxx.o] Error 1 . . . . . . . Checking whether CXX compiler has _atoi64 failed to compile with the following output: Change Dir: /home/adhar/3p-tmw/3p/derived/glnxa64/ITK/Modules/ThirdParty/KWSys/src/KWSys/CMakeFiles/CMakeTmp Run Build Command:"/internal/2106168/glnxa64/gmake/bin/gmake" "cmTC_82d35/fast" gmake[2]: Entering directory '/home/adhar/3p-tmw/3p/derived/glnxa64/ITK/Modules/ThirdParty/KWSys/src/KWSys/CMakeFiles/CMakeTmp' /internal/2106168/glnxa64/gmake/bin/gmake -f CMakeFiles/cmTC_82d35.dir/build.make CMakeFiles/cmTC_82d35.dir/build gmake[3]: Entering directory '/home/adhar/3p-tmw/3p/derived/glnxa64/ITK/Modules/ThirdParty/KWSys/src/KWSys/CMakeFiles/CMakeTmp' Building CXX object CMakeFiles/cmTC_82d35.dir/kwsysPlatformTestsCXX.cxx.o /internal/2501977/glnxa64/gcc-6.3.0/bin/g++ -DTEST_KWSYS_CXX_HAS__ATOI64 -O2 -pipe -pthread -fPIC -std=c++11 -Wall -Wcast-align -Wdisabled-optimization -Wextra -Wformat=2 -Winvalid-pch -Wno-format-nonliteral -Wpointer-arith -Wshadow -Wunused -Wwrite-strings -funit-at-a-time -Wno-strict-overflow -Wno-deprecated -Wno-invalid-offsetof -Woverloaded-virtual -Wstrict-null-sentinel -w -fPIE -o CMakeFiles/cmTC_82d35.dir/kwsysPlatformTestsCXX.cxx.o -c /home/adhar/3p-tmw/3p/sources/ITK/Modules/ThirdParty/KWSys/src/KWSys/kwsysPlatformTestsCXX.cxx /home/adhar/3p-tmw/3p/sources/ITK/Modules/ThirdParty/KWSys/src/KWSys/kwsysPlatformTestsCXX.cxx: In function ?int main()?: /home/adhar/3p-tmw/3p/sources/ITK/Modules/ThirdParty/KWSys/src/KWSys/kwsysPlatformTestsCXX.cxx:252:38: error: ?_atoi64? was not declared in this scope return static_cast(_atoi64(str)); ^ gmake[3]: *** [CMakeFiles/cmTC_82d35.dir/build.make:66: CMakeFiles/cmTC_82d35.dir/kwsysPlatformTestsCXX.cxx.o] Error 1 gmake[3]: Leaving directory '/home/adhar/3p-tmw/3p/derived/glnxa64/ITK/Modules/ThirdParty/KWSys/src/KWSys/CMakeFiles/CMakeTmp' gmake[2]: *** [Makefile:126: cmTC_82d35/fast] Error 2 gmake[2]: Leaving directory '/home/adhar/3p-tmw/3p/derived/glnxa64/ITK/Modules/ThirdParty/KWSys/src/KWSys/CMakeFiles/CMakeTmp' -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- _____________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://www.kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/insight-users