From solomoncztang at gmail.com Mon May 2 16:42:44 2016 From: solomoncztang at gmail.com (Solomon Tang) Date: Mon, 2 May 2016 13:42:44 -0700 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Thanks for the tip Simon, I think I may have figured it out. I initially read as a CUDA Image, and then passed the CUDA image through ChangeInformationImageFilter to change the offset of the image. template typename itk::CudaImage::Pointer ShiftOffset( const typename itk::CudaImage::Pointer image, const typename itk::Image::PointType origin) { typedef itk::ChangeInformationImageFilter< itk::CudaImage > FilterType; FilterType::Pointer filter = FilterType::New(); filter -> SetInput(image); filter -> SetOutputOrigin(origin); filter -> ChangeOriginOn(); filter -> UpdateOutputInformation(); filter -> Update(); return filter->GetOutput(); } If I pass the offset image pointer to ForwardProjection, it outputs a blank image. However, when I write the offset image and then read it again as a CUDA image, then the ForwardProjection works as intended. Perhaps using the CUDA version of ITK would fix this. On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit wrote: > Hi Solomon, > Hard to say without the full code. Maybe the cudaness of your output image > is lost further in the code. Try accessing the CPU buffer at the end, after > the update, to be sure that the GPU image is transferred to CPU, e.g. > std::cout << forwardProjection->GetOutput()->GetPointer() < Simon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Tue May 3 18:59:03 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Wed, 4 May 2016 00:59:03 +0200 Subject: [Rtk-users] forward and back projection - MITK Message-ID: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I've seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I've also seen the test for this class but I don't get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I've got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 4 03:02:05 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 4 May 2016 09:02:05 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Message-ID: Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein wrote: > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 4 03:16:33 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 4 May 2016 09:16:33 +0200 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Dear Solomon, Thanks for the report. It looks like a bug to me. I checked and itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in the itkGPUImage and the itkCudaImage, this function does not check consistency between CPU and GPU data. I'll work on a minimal example to check this but can you test that your problem is solved if you add m_DataManager->UpdateCPUBuffer(); before m_DataManager->SetGPUBufferDirty(); in itkCudaImage.h line 121? Thanks, Simon On Mon, May 2, 2016 at 10:42 PM, Solomon Tang wrote: > Thanks for the tip Simon, > > I think I may have figured it out. I initially read as a CUDA Image, and > then passed the CUDA image through ChangeInformationImageFilter to change > the offset of the image. > > template > typename itk::CudaImage::Pointer ShiftOffset( > const typename itk::CudaImage::Pointer image, > const typename itk::Image::PointType origin) > { > typedef itk::ChangeInformationImageFilter< itk::CudaImage > > FilterType; > FilterType::Pointer filter = FilterType::New(); > filter -> SetInput(image); > filter -> SetOutputOrigin(origin); > filter -> ChangeOriginOn(); > filter -> UpdateOutputInformation(); > filter -> Update(); > return filter->GetOutput(); > } > > If I pass the offset image pointer to ForwardProjection, it outputs a > blank image. > > However, when I write the offset image and then read it again as a CUDA > image, then the ForwardProjection works as intended. Perhaps using the CUDA > version of ITK would fix this. > > > On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < > simon.rit at creatis.insa-lyon.fr> wrote: > >> Hi Solomon, >> Hard to say without the full code. Maybe the cudaness of your output >> image is lost further in the code. Try accessing the CPU buffer at the end, >> after the update, to be sure that the GPU image is transferred to CPU, e.g. >> std::cout << forwardProjection->GetOutput()->GetPointer() <> Simon >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Wed May 4 05:04:28 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Wed, 4 May 2016 14:34:28 +0530 Subject: [Rtk-users] Reconstructed Slice save as tiff Message-ID: Hi all, I have wrote code for saving output volume stack as *.tiff. Currently I am getting output of XY axis. What should I do in order to get the other axes. My code is shown below. typedef itk::StreamingImageFilter StreamerType; StreamerType::Pointer streamerBP = StreamerType::New(); streamerBP->SetInput(feldkampCUDA->GetOutput()); streamerBP->SetNumberOfStreamDivisions(8); typedef itk::Image< float, 2 > Image2DType; typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; WriterType::Pointer writer = WriterType::New(); writer->SetInput(streamerBP->GetOutput()); typedef itk::NumericSeriesFileNames NameGeneratorType; NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); nameGenerator->SetStartIndex(0); nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the Z-axis value of //reconstructed volume nameGenerator->SetIncrementIndex(1); writer->SetFileNames(nameGenerator->GetFileNames()); writer->SetUseCompression(true); writer->Update(); PS: My reconstruction works fine. Thanks and Regards AMJAD N -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyril.mory at uclouvain.be Wed May 4 07:27:24 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Wed, 4 May 2016 13:27:24 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: References: Message-ID: <5729DC9C.10105@uclouvain.be> Hi Amjad, You can use an ITK extract filter to extract a region that corresponds to one of your slices (along the axis you want). The output of the extract filter will be 3D, so you will need to cast it into a 2D images using an ITK cast filter. Cyril On 05/04/2016 11:04 AM, AMJAD N wrote: > Hi all, > > I have wrote code for saving output volume stack as *.tiff. Currently > I am getting output of XY axis. What should I do in order to get the > other axes. > My code is shown below. > > typedef itk::StreamingImageFilter FloatImageType> StreamerType; > StreamerType::Pointer streamerBP = StreamerType::New(); > streamerBP->SetInput(feldkampCUDA->GetOutput()); > streamerBP->SetNumberOfStreamDivisions(8); > > typedef itk::Image< float, 2 > Image2DType; > typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; > WriterType::Pointer writer = WriterType::New(); > writer->SetInput(streamerBP->GetOutput()); > > typedef itk::NumericSeriesFileNames NameGeneratorType; > NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); > nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); > nameGenerator->SetStartIndex(0); > nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the > Z-axis value of //reconstructed volume > nameGenerator->SetIncrementIndex(1); > writer->SetFileNames(nameGenerator->GetFileNames()); > writer->SetUseCompression(true); > writer->Update(); > > PS: My reconstruction works fine. > > Thanks and Regards > > AMJAD N > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From wuchao04 at gmail.com Wed May 4 08:44:37 2016 From: wuchao04 at gmail.com (Chao Wu) Date: Wed, 4 May 2016 14:44:37 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: <5729DC9C.10105@uclouvain.be> References: <5729DC9C.10105@uclouvain.be> Message-ID: A small add-on (copied from ITK document): ExtractImageFilter also collapses dimensions so that the input image may have more dimensions than the output image (i.e. 4-D input image to a 3-D output image). To specify what dimensions to collapse, the ExtractionRegion must be specified. For any dimension dim where ExtractionRegion.Size[dim] = 0, that dimension is collapsed. The index to collapse on is specified by ExtractionRegion.Index[dim]. For example, we have a image 4D = a 4x4x4x4 image, and we want to get a 3D image, 3D = a 4x4x4 image, specified as [x,y,z,2] from 4D (i.e. the 3rd "time" slice from 4D). The ExtractionRegion.Size = [4,4,4,0] and ExtractionRegion.Index = [0,0,0,2]. Regards, Chao 2016-05-04 13:27 GMT+02:00 Cyril Mory : > Hi Amjad, > > You can use an ITK extract filter to extract a region that corresponds to > one of your slices (along the axis you want). The output of the extract > filter will be 3D, so you will need to cast it into a 2D images using an > ITK cast filter. > > Cyril > > > On 05/04/2016 11:04 AM, AMJAD N wrote: > > Hi all, > > I have wrote code for saving output volume stack as *.tiff. Currently I am > getting output of XY axis. What should I do in order to get the other axes. > My code is shown below. > > typedef itk::StreamingImageFilter > StreamerType; > StreamerType::Pointer streamerBP = StreamerType::New(); > streamerBP->SetInput(feldkampCUDA->GetOutput()); > streamerBP->SetNumberOfStreamDivisions(8); > > typedef itk::Image< float, 2 > Image2DType; > typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; > WriterType::Pointer writer = WriterType::New(); > writer->SetInput(streamerBP->GetOutput()); > > typedef itk::NumericSeriesFileNames NameGeneratorType; > NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); > nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); > nameGenerator->SetStartIndex(0); > nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the > Z-axis value of //reconstructed volume > nameGenerator->SetIncrementIndex(1); > writer->SetFileNames(nameGenerator->GetFileNames()); > writer->SetUseCompression(true); > writer->Update(); > > PS: My reconstruction works fine. > > Thanks and Regards > > AMJAD N > > > > _______________________________________________ > Rtk-users mailing listRtk-users at public.kitware.comhttp://public.kitware.com/mailman/listinfo/rtk-users > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyril.mory at uclouvain.be Wed May 4 08:56:14 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Wed, 4 May 2016 14:56:14 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: References: <5729DC9C.10105@uclouvain.be> Message-ID: <5729F16E.5020402@uclouvain.be> Thanks Chao Wu, You're right, I was mistaken : the cast filter is not required in this case. It is needed, on the other hand, to increase the dimension of an image. So in this case, Amjad, you don't need it. Cyril On 05/04/2016 02:44 PM, Chao Wu wrote: > A small add-on (copied from ITK document): > > ExtractImageFilter also collapses dimensions so that the input image > may have more dimensions than the output image (i.e. 4-D input image > to a 3-D output image). To specify what dimensions to collapse, the > ExtractionRegion must be specified. For any dimension dim where > ExtractionRegion.Size[dim] = 0, that dimension is collapsed. The index > to collapse on is specified by ExtractionRegion.Index[dim]. For > example, we have a image 4D = a 4x4x4x4 image, and we want to get a 3D > image, 3D = a 4x4x4 image, specified as [x,y,z,2] from 4D (i.e. the > 3rd "time" slice from 4D). The ExtractionRegion.Size = [4,4,4,0] and > ExtractionRegion.Index = [0,0,0,2]. > > Regards, > Chao > > 2016-05-04 13:27 GMT+02:00 Cyril Mory >: > > Hi Amjad, > > You can use an ITK extract filter to extract a region that > corresponds to one of your slices (along the axis you want). The > output of the extract filter will be 3D, so you will need to cast > it into a 2D images using an ITK cast filter. > > Cyril > > > On 05/04/2016 11:04 AM, AMJAD N wrote: >> Hi all, >> >> I have wrote code for saving output volume stack as *.tiff. >> Currently I am getting output of XY axis. What should I do in >> order to get the other axes. >> My code is shown below. >> >> typedef itk::StreamingImageFilter> FloatImageType> StreamerType; >> StreamerType::Pointer streamerBP = StreamerType::New(); >> streamerBP->SetInput(feldkampCUDA->GetOutput()); >> streamerBP->SetNumberOfStreamDivisions(8); >> >> typedef itk::Image< float, 2 > Image2DType; >> typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > >> WriterType; >> WriterType::Pointer writer = WriterType::New(); >> writer->SetInput(streamerBP->GetOutput()); >> >> typedef itk::NumericSeriesFileNames NameGeneratorType; >> NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); >> nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); >> nameGenerator->SetStartIndex(0); >> nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] >> is the Z-axis value of //reconstructed volume >> nameGenerator->SetIncrementIndex(1); >> writer->SetFileNames(nameGenerator->GetFileNames()); >> writer->SetUseCompression(true); >> writer->Update(); >> >> PS: My reconstruction works fine. >> >> Thanks and Regards >> >> AMJAD N >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From solomoncztang at gmail.com Thu May 5 19:45:43 2016 From: solomoncztang at gmail.com (Solomon Tang) Date: Thu, 5 May 2016 16:45:43 -0700 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Hi Simon, I added the line as you suggested and it does not change the output (still blank). Sorry for the delayed response. Thanks for looking into it! On Wed, May 4, 2016 at 12:16 AM, Simon Rit wrote: > Dear Solomon, > Thanks for the report. It looks like a bug to me. I checked and > itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in > the itkGPUImage and the itkCudaImage, this function does not check > consistency between CPU and GPU data. I'll work on a minimal example to > check this but can you test that your problem is solved if you add > m_DataManager->UpdateCPUBuffer(); > before > m_DataManager->SetGPUBufferDirty(); > in itkCudaImage.h line 121? > Thanks, > Simon > > On Mon, May 2, 2016 at 10:42 PM, Solomon Tang > wrote: > >> Thanks for the tip Simon, >> >> I think I may have figured it out. I initially read as a CUDA Image, and >> then passed the CUDA image through ChangeInformationImageFilter to change >> the offset of the image. >> >> template >> typename itk::CudaImage::Pointer ShiftOffset( >> const typename itk::CudaImage::Pointer image, >> const typename itk::Image::PointType origin) >> { >> typedef itk::ChangeInformationImageFilter< itk::CudaImage > >> FilterType; >> FilterType::Pointer filter = FilterType::New(); >> filter -> SetInput(image); >> filter -> SetOutputOrigin(origin); >> filter -> ChangeOriginOn(); >> filter -> UpdateOutputInformation(); >> filter -> Update(); >> return filter->GetOutput(); >> } >> >> If I pass the offset image pointer to ForwardProjection, it outputs a >> blank image. >> >> However, when I write the offset image and then read it again as a CUDA >> image, then the ForwardProjection works as intended. Perhaps using the CUDA >> version of ITK would fix this. >> >> >> On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < >> simon.rit at creatis.insa-lyon.fr> wrote: >> >>> Hi Solomon, >>> Hard to say without the full code. Maybe the cudaness of your output >>> image is lost further in the code. Try accessing the CPU buffer at the end, >>> after the update, to be sure that the GPU image is transferred to CPU, e.g. >>> std::cout << forwardProjection->GetOutput()->GetPointer() <>> Simon >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 10 01:29:44 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 10 May 2016 07:29:44 +0200 Subject: [Rtk-users] Cmake build error help In-Reply-To: References: Message-ID: <573171C8.80400@creatis.insa-lyon.fr> Hi, Can you update GetGitRevisionDescription.cmake and GetGitRevisionDescription.cmake.in from https://github.com/rpavlik/cmake-modules and see if the new versions fix this issue? Thanks, Simon PS: plead keep using the mailing list On 10/05/2016 03:09, Solomon Tang wrote: > Hi Simon, > > I am rebuilding RTK after moving to Visual Studio 2015 with cmake > 3.5.2 and am running into the following error: > > CMake Error at build/applications/CMakeFiles/git-data/grabRef.cmake:36 > (file): > file failed to open for reading (No such file or directory): > > C:/Work/Tools/Current/RTK-1.2.0/build/applications/CMakeFiles/git-data/head-ref > Call Stack (most recent call first): > cmake/GetGitRevisionDescription.cmake:77 (include) > applications/CMakeLists.txt:5 (get_git_head_revision) > > I am using ITK 4.9.0 and fresh download of RTK 1.2.0. > > How do I resolve this issue? > > Thanks again, > > Solomon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Thu May 12 00:12:17 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Thu, 12 May 2016 09:42:17 +0530 Subject: [Rtk-users] Reconstruction Volume. Message-ID: Hello users, I have successfully implemented CBCT reconstruction using both CUDA and CPU method. For finding the reconstruction volume size, I measured the actual object size. divided by respective axis number of pixels to get spacing. eg: If my object is 10x15x20 cm. I measure that dimensions. If the required volume is 500x600x700 px, to get spacing i used 10/500,15/600,20/700. But this is not practically possible for every object. Is there any way to find the reconstruction volume spacing other than doing the above method. I have SDD(Source Detector Distance), SID(Source Isocenter Distance), Detector physical size,pixel density. Thanks and Regards AMJAD N -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 12 01:31:51 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 12 May 2016 07:31:51 +0200 Subject: [Rtk-users] Reconstruction Volume. In-Reply-To: References: Message-ID: Hi, The typical solution (e.g., in clincial scanners) is to reconstruct the field-of-view of the scanner (every point in space that is seen by all source positions) because you know this is the only area of space where your reconstruction is going to be accurate. rtkfieldofview generates this FOV. Simon On Thu, May 12, 2016 at 6:12 AM, AMJAD N wrote: > Hello users, > > I have successfully implemented CBCT reconstruction using both CUDA and > CPU method. For finding the reconstruction volume size, I measured the > actual object size. divided by respective axis number of pixels to get > spacing. > > eg: If my object is 10x15x20 cm. I measure that dimensions. If the > required volume is 500x600x700 px, to get spacing i used > 10/500,15/600,20/700. > > But this is not practically possible for every object. Is there any way to > find the reconstruction volume spacing other than doing the above method. > > I have SDD(Source Detector Distance), SID(Source Isocenter Distance), > Detector physical size,pixel density. > > Thanks and Regards > > AMJAD N > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Fri May 13 04:30:33 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Fri, 13 May 2016 14:00:33 +0530 Subject: [Rtk-users] Object isocenter shift Message-ID: Hello users, During acquisition it is found that my object isocenter is shifted from turntable isocenter by DX and DY values. Source , turntable isocenter and detector center is aligned perfectly. Is there any method in RTK we can make use of to nullify the effect due to this isocenter shift? Thanks and Regards AMJAD -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 13 08:36:48 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 13 May 2016 14:36:48 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: Hi, I don't understand the question. The isocenter is by definition the center of rotation in RTK and we assume it's at the origin of the reconstructed volume. There is no such thing as an "object isocenter". DX and DY values are the shift of the projection origin (which can be anywhere) with respect to the central ray (source to isocenter ray). It is not the turntable isocenter. If you want to have dx=0 and dy=0, the projection origin must be changed. But it has to be constant for the whole projection stack. I hope it helps, Simon On Fri, May 13, 2016 at 10:30 AM, AMJAD N wrote: > Hello users, > During acquisition it is found that my object isocenter is shifted from > turntable isocenter by DX and DY values. Source , turntable isocenter and > detector center is aligned perfectly. Is there any method in RTK we can > make use of to nullify the effect due to this isocenter shift? > > Thanks and Regards > AMJAD > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Fri May 13 11:35:57 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Fri, 13 May 2016 17:35:57 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Message-ID: <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 13 12:15:09 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 13 May 2016 18:15:09 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Message-ID: Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein wrote: > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Sat May 14 05:48:01 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Sat, 14 May 2016 11:48:01 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Message-ID: <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Hello Simon, Thanks for your advice so far. I?m getting to know this filter better. At least I can now use it and save the result into a file. I updated my code which now uses a volume. The values of the input and output volume are equal except of the z-dimension of the output which I changed to the number of projection images. const unsigned int Dimension = 3; ?Reading image? ImageType::Pointer inputImage = reader->GetOutput(); ImageType::Pointer outputImage = ImageType::New(); RegionType inputRegion = inputImage->GetLargestPossibleRegion(); const unsigned int NumberOfProjectionImages = 45; ImageType::IndexType start; start[0] = inputRegion.GetIndex()[0]; start[1] = inputRegion.GetIndex()[1]; start[2] = inputRegion.GetIndex()[2]; RegionType::SizeType size; size[0] = inputRegion.GetSize()[0]; size[1] = inputRegion.GetSize()[1]; size[2] = NumberOfProjectionImages; RegionType region; region.SetSize(size); region.SetIndex(start); ImageType::SpacingType spacing; spacing[0] = inputImage->GetSpacing()[0]; spacing[1] = inputImage->GetSpacing()[1]; spacing[2] = inputImage->GetSpacing()[2]; ImageType::PointType origin; origin[0] = inputImage->GetOrigin()[0]; origin[1] = inputImage->GetOrigin()[1]; origin[2] = inputImage->GetOrigin()[2]; outputImage->SetRegions(region); outputImage->SetSpacing(spacing); outputImage->SetOrigin(origin); outputImage->Allocate(); outputImage->FillBuffer(size[0] * size[1] * size[2]); // Geometry typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(510., 510., i*8.); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->SetGeometry(geometry); forward->Update(); I?m not sure how I have to add projection for the geometry to get a result which I?m familiar with. Can you describe how do I have to interpret the result of the Joseph-Filter? I am familiar with sinograms and how they are computed, but one sinogram is created by the projections of one image slice as far as I understood it. What I want is to manipulate the image in the radon space and then perform a filtered back projection. Typically the articles describe techniques to reduce metal artifacts by using one 2D Slice. Is it possible to achieve something like that with the JosephFilter? I?m guessing since this filter won?t work well for 2D I have to use another filter. Can you give me a hint if I can do something like that with RTK or another ITK-based framework? Here a diagram which shows an example what I want to try. I tried also to use my code with one slice and added a zero padding like that: typedef itk::ConstantPadImageFilter ConstantPadImageFilterType; ConstantPadImageFilterType::Pointer padFilter = ConstantPadImageFilterType::New(); padFilter->SetInput(inputImage); ImageType::SizeType extendRegion; extendRegion[0] = 0; extendRegion[1] = 0; extendRegion[2] = 0; padFilter->SetPadLowerBound(extendRegion); padFilter->SetPadUpperBound(extendRegion); padFilter->SetConstant(1); padFilter->Update(); But the result of my png is a black square. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Freitag, 13. Mai 2016 18:15 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto: simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein < tstein at stud.hs-heilbronn.de> Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Sat May 14 06:17:18 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sat, 14 May 2016 12:17:18 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Message-ID: The output of the Joseph filter (of any forward projector) is a stack of projection images, i.e., a 3D image. If you slice this 3D image in the z direction, you get one projection images. If you slice this 3D image in the y direction, you get a sinogram, e.g., the 2D sinogram of the central slice (plane of the source trajectory) if y=0. The best way to have this sinogram is to set size[1]=1 and there is no better way to do it in RTK. For zero-padding, you need to set extendRegion[?]=1, with (for all dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that your image is a black square, something else must be going on. One thing to remember, the typical RTK rotation is around the y axis so your 3D slice must be 1 in the y direction. A simple way to change the orientation of one slice is to change its direction with ChangeImageFilter Simon On Sat, May 14, 2016 at 11:48 AM, Tobias Stein wrote: > Hello Simon, > > > > Thanks for your advice so far. I?m getting to know this filter better. At > least I can now use it and save the result into a file. > > > > I updated my code which now uses a volume. > > The values of the input and output volume are equal except of the > z-dimension of the output which I changed to the number of projection > images. > > const unsigned int Dimension = 3; > > ?Reading image? > > ImageType::Pointer inputImage = reader->GetOutput(); > > ImageType::Pointer outputImage = ImageType::New(); > > > > RegionType inputRegion = inputImage->GetLargestPossibleRegion(); > > > > const unsigned int NumberOfProjectionImages = 45; > > > > ImageType::IndexType start; > > start[0] = inputRegion.GetIndex()[0]; > > start[1] = inputRegion.GetIndex()[1]; > > start[2] = inputRegion.GetIndex()[2]; > > > > RegionType::SizeType size; > > size[0] = inputRegion.GetSize()[0]; > > size[1] = inputRegion.GetSize()[1]; > > size[2] = NumberOfProjectionImages; > > > > RegionType region; > > region.SetSize(size); > > region.SetIndex(start); > > > > ImageType::SpacingType spacing; > > spacing[0] = inputImage->GetSpacing()[0]; > > spacing[1] = inputImage->GetSpacing()[1]; > > spacing[2] = inputImage->GetSpacing()[2]; > > > > ImageType::PointType origin; > > origin[0] = inputImage->GetOrigin()[0]; > > origin[1] = inputImage->GetOrigin()[1]; > > origin[2] = inputImage->GetOrigin()[2]; > > > > outputImage->SetRegions(region); > > outputImage->SetSpacing(spacing); > > outputImage->SetOrigin(origin); > > outputImage->Allocate(); > > outputImage->FillBuffer(size[0] * size[1] * size[2]); > > > > // Geometry > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(510., 510., i*8.); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->SetGeometry(geometry); > > forward->Update(); > > > > I?m not sure how I have to add projection for the geometry to get a result > which I?m familiar with. > > > > Can you describe how do I have to interpret the result of the > Joseph-Filter? I am familiar with sinograms and how they are computed, but > one sinogram is created by the projections of one image slice as far as I > understood it. What I want is to manipulate the image in the radon space > and then perform a filtered back projection. Typically the articles > describe techniques to reduce metal artifacts by using one 2D Slice. Is it > possible to achieve something like that with the JosephFilter? I?m guessing > since this filter won?t work well for 2D I have to use another filter. Can > you give me a hint if I can do something like that with RTK or another > ITK-based framework? Here a diagram > which shows an example what I want to try. > > > > I tried also to use my code with one slice and added a zero padding like > that: > > typedef itk::ConstantPadImageFilter > ConstantPadImageFilterType; > > ConstantPadImageFilterType::Pointer padFilter = > ConstantPadImageFilterType::New(); > > padFilter->SetInput(inputImage); > > > > ImageType::SizeType extendRegion; > > extendRegion[0] = 0; > > extendRegion[1] = 0; > > extendRegion[2] = 0; > > > > padFilter->SetPadLowerBound(extendRegion); > > padFilter->SetPadUpperBound(extendRegion); > > padFilter->SetConstant(1); > > padFilter->Update(); > > But the result of my png is a black square. > > Tobias > > > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Freitag, 13. Mai 2016 18:15 > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > If you intialize the data of your itk::Image with FillBuffer with the > corresponding constant value, it is quite similar. The constant image value > allow us to stream the computation whereas you have to allocate the whole > image if you pass directly itk::Image. > > We only work in 3D and probably our projector don't work with 2D, that is > probably the problem here. You would have to correct the code for 2D but > that's a lot of work, we generally prefer pseudo 2D, see next point. > > I doubt that our forward projector will work well with one slice only if > you use 3D, we assume that the volume starts at the first pixel and ends at > the last pixel. You should probably add a zero border around with > itk::PadImage to see something. > > To avoid aliasing, you can cut frequencies in the ramp filter (look for > CutFrequency in the doxygen of rtk::FFTRampImageFilter). > > Simon > > > > On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: > > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Sat May 14 06:18:57 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sat, 14 May 2016 12:18:57 +0200 Subject: [Rtk-users] RTK training - June 17 2016 Message-ID: Dear all, The training on June 17 in Lyon is confirmed. Please register asap if you'd like to attend. Looking forward to meeting our users, Simon On Thu, Mar 10, 2016 at 11:02 AM, Simon Rit wrote: > Dear all, > The new date for the RTK training is Friday June 17. > I'm looking forward to meeting you there, > Simon > > On Sun, Mar 6, 2016 at 12:57 PM, Simon Rit > wrote: > >> Dear all, >> We have to fix another date for the RTK training due to a conflicting >> meeting. If you are interested, please fill in the foodle >> so that >> we fix a date that suits everyone. If none of these dates works for you, >> please let me know and we'll try to extend the foodle. >> Please answer before Tuesday, we'll fix the date on Tuesday evening. >> Thanks for your cooperation and apologies for the mess, >> Simon >> >> On Tue, Feb 9, 2016 at 11:49 AM, Simon Rit < >> simon.rit at creatis.insa-lyon.fr> wrote: >> >>> Dear RTK users, >>> We will organize a new training >>> session on June 22 2016 in >>> Lyon. Follow the instructions on the webpage >>> to register. The training is >>> for both users and developers. We are happy to answer any question that you >>> might have and we are looking forward to this new training session. >>> Simon >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Sun May 15 08:38:40 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Sun, 15 May 2016 14:38:40 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Message-ID: <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> If I understood you correct, the input of the Joseph-Filter needs to be oriented in the y-direction when I am dealing with axial oriented slices. Now I changed the direction of the 3D Slice by rotating it 90 degrees around the x-axis with the itk::ChangeInformationImageFilter to have my slice in the xz-layer in the y-direction: double rotationX = 90; itk::Versor< double > rotation; const double angleInRadians = rotationX * vnl_math::pi / 180.0; rotation.SetRotationAroundX(angleInRadians); const ImageType::DirectionType direction = inputImage->GetDirection(); const ImageType::DirectionType newDirection = direction * rotation.GetMatrix(); changeFilter->SetOutputDirection(newDirection); changeFilter->ChangeAll(); changeFilter->SetInput(inputImage); changeFilter->UpdateOutputInformation(); Then I added a zero-border as you told me (This changed the size of my region from [512, 512, 1] to [514, 514, 3]). While executing the Joseph Filter I got an error because a vector subscript was out of range. Maybe that?s because the index of the region is [-1,-1,-1] caused by the padding. I tried the padding after the Joseph Filter, and got a result which has a size [514, 3, 45], while 45 was the number of projection images but the image was still empty. I also tried the Jospeh Filter with a real 3D volume stack of slices, rotated it as described below and got a result. Now I am confused how I should create the geometry of the Joseph Filter to get a good result. typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(300., 500., i * 180 / NumberOfProjectionImages); I am trying to use a 180-degree rotation, but i don?t have the feeling for the distance values. I this code example I used an 3D Image with dimensions = [256, 256, 49] My idea was, since there is no way to get a result with a single 3D slice, I would use a stack of slices as input and slice the output volume in y-direction to get my sinogram as you said. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Samstag, 14. Mai 2016 12:17 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK The output of the Joseph filter (of any forward projector) is a stack of projection images, i.e., a 3D image. If you slice this 3D image in the z direction, you get one projection images. If you slice this 3D image in the y direction, you get a sinogram, e.g., the 2D sinogram of the central slice (plane of the source trajectory) if y=0. The best way to have this sinogram is to set size[1]=1 and there is no better way to do it in RTK. For zero-padding, you need to set extendRegion[?]=1, with (for all dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that your image is a black square, something else must be going on. One thing to remember, the typical RTK rotation is around the y axis so your 3D slice must be 1 in the y direction. A simple way to change the orientation of one slice is to change its direction with ChangeImageFilter Simon On Sat, May 14, 2016 at 11:48 AM, Tobias Stein > wrote: Hello Simon, Thanks for your advice so far. I?m getting to know this filter better. At least I can now use it and save the result into a file. I updated my code which now uses a volume. The values of the input and output volume are equal except of the z-dimension of the output which I changed to the number of projection images. const unsigned int Dimension = 3; ?Reading image? ImageType::Pointer inputImage = reader->GetOutput(); ImageType::Pointer outputImage = ImageType::New(); RegionType inputRegion = inputImage->GetLargestPossibleRegion(); const unsigned int NumberOfProjectionImages = 45; ImageType::IndexType start; start[0] = inputRegion.GetIndex()[0]; start[1] = inputRegion.GetIndex()[1]; start[2] = inputRegion.GetIndex()[2]; RegionType::SizeType size; size[0] = inputRegion.GetSize()[0]; size[1] = inputRegion.GetSize()[1]; size[2] = NumberOfProjectionImages; RegionType region; region.SetSize(size); region.SetIndex(start); ImageType::SpacingType spacing; spacing[0] = inputImage->GetSpacing()[0]; spacing[1] = inputImage->GetSpacing()[1]; spacing[2] = inputImage->GetSpacing()[2]; ImageType::PointType origin; origin[0] = inputImage->GetOrigin()[0]; origin[1] = inputImage->GetOrigin()[1]; origin[2] = inputImage->GetOrigin()[2]; outputImage->SetRegions(region); outputImage->SetSpacing(spacing); outputImage->SetOrigin(origin); outputImage->Allocate(); outputImage->FillBuffer(size[0] * size[1] * size[2]); // Geometry typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(510., 510., i*8.); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->SetGeometry(geometry); forward->Update(); I?m not sure how I have to add projection for the geometry to get a result which I?m familiar with. Can you describe how do I have to interpret the result of the Joseph-Filter? I am familiar with sinograms and how they are computed, but one sinogram is created by the projections of one image slice as far as I understood it. What I want is to manipulate the image in the radon space and then perform a filtered back projection. Typically the articles describe techniques to reduce metal artifacts by using one 2D Slice. Is it possible to achieve something like that with the JosephFilter? I?m guessing since this filter won?t work well for 2D I have to use another filter. Can you give me a hint if I can do something like that with RTK or another ITK-based framework? Here a diagram which shows an example what I want to try. I tried also to use my code with one slice and added a zero padding like that: typedef itk::ConstantPadImageFilter ConstantPadImageFilterType; ConstantPadImageFilterType::Pointer padFilter = ConstantPadImageFilterType::New(); padFilter->SetInput(inputImage); ImageType::SizeType extendRegion; extendRegion[0] = 0; extendRegion[1] = 0; extendRegion[2] = 0; padFilter->SetPadLowerBound(extendRegion); padFilter->SetPadUpperBound(extendRegion); padFilter->SetConstant(1); padFilter->Update(); But the result of my png is a black square. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com ] Im Auftrag von Simon Rit Gesendet: Freitag, 13. Mai 2016 18:15 An: Tobias Stein > Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto: simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein < tstein at stud.hs-heilbronn.de> Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 16 05:50:41 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 16 May 2016 11:50:41 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> Message-ID: Answers below. I think you need to understand better the coordinate system of an ITK image, maybe check ITK's doc. Simon On Sun, May 15, 2016 at 2:38 PM, Tobias Stein wrote: > If I understood you correct, the input of the Joseph-Filter needs to be > oriented in the y-direction when I am dealing with axial oriented slices. > Yes, or in other words, if you want to take projections around the axial axis, be aware that y is the default axis of rotation in RTK. > Now I changed the direction of the 3D Slice by rotating it 90 degrees > around the x-axis with the itk::ChangeInformationImageFilter to have my > slice in the xz-layer in the y-direction: > > double rotationX = 90; > > itk::Versor< double > rotation; > > const double angleInRadians = rotationX * vnl_math::pi / 180.0; > > rotation.SetRotationAroundX(angleInRadians); > > const ImageType::DirectionType direction = > inputImage->GetDirection(); > > const ImageType::DirectionType newDirection = direction * > rotation.GetMatrix(); > > changeFilter->SetOutputDirection(newDirection); > > changeFilter->ChangeAll(); > > changeFilter->SetInput(inputImage); > > changeFilter->UpdateOutputInformation(); > > > > Then I added a zero-border as you told me (This changed the size of my > region from [512, 512, 1] to [514, 514, 3]). > > While executing the Joseph Filter I got an error because a vector > subscript was out of range. Maybe that?s because the index of the region is > [-1,-1,-1] caused by the padding. > That should not have been a problem but that might be a bug... > I tried the padding after the Joseph Filter, and got a result which has a > size [514, 3, 45], while 45 was the number of projection images but the > image was still empty. > I guess you should check the origin of your projected volume and your projections. A simple test is to center your volume (check using ITK doc how you can define the origin so that (0,0,0) is at the center) and your projection (for the projection stack, only the first 2 coordinates count). > > > I also tried the Jospeh Filter with a real 3D volume stack of slices, > rotated it as described below and got a result. > > Now I am confused how I should create the geometry of the Joseph Filter to > get a good result. > > > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(300., 500., i * 180 / > NumberOfProjectionImages); > > > > I am trying to use a 180-degree rotation, but i don?t have the feeling for > the distance values. > > I this code example I used an 3D Image with dimensions = [256, 256, 49] > This doesn't tell you anything about the size of your volume, we also need the origin and the spacing. Look at the ITK doc to understand the ITK coordinate systems. > > > My idea was, since there is no way to get a result with a single 3D slice, > I would use a stack of slices as input and slice the output volume in > y-direction to get my sinogram as you said. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Samstag, 14. Mai 2016 12:17 > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > The output of the Joseph filter (of any forward projector) is a stack of > projection images, i.e., a 3D image. If you slice this 3D image in the z > direction, you get one projection images. If you slice this 3D image in the > y direction, you get a sinogram, e.g., the 2D sinogram of the central slice > (plane of the source trajectory) if y=0. The best way to have this sinogram > is to set size[1]=1 and there is no better way to do it in RTK. > > For zero-padding, you need to set extendRegion[?]=1, with (for all > dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that > your image is a black square, something else must be going on. One thing to > remember, the typical RTK rotation is around the y axis so your 3D slice > must be 1 in the y direction. A simple way to change the orientation of one > slice is to change its direction with ChangeImageFilter > > Simon > > > > > > On Sat, May 14, 2016 at 11:48 AM, Tobias Stein < > tstein at stud.hs-heilbronn.de> wrote: > > Hello Simon, > > > > Thanks for your advice so far. I?m getting to know this filter better. At > least I can now use it and save the result into a file. > > > > I updated my code which now uses a volume. > > The values of the input and output volume are equal except of the > z-dimension of the output which I changed to the number of projection > images. > > const unsigned int Dimension = 3; > > ?Reading image? > > ImageType::Pointer inputImage = reader->GetOutput(); > > ImageType::Pointer outputImage = ImageType::New(); > > > > RegionType inputRegion = inputImage->GetLargestPossibleRegion(); > > > > const unsigned int NumberOfProjectionImages = 45; > > > > ImageType::IndexType start; > > start[0] = inputRegion.GetIndex()[0]; > > start[1] = inputRegion.GetIndex()[1]; > > start[2] = inputRegion.GetIndex()[2]; > > > > RegionType::SizeType size; > > size[0] = inputRegion.GetSize()[0]; > > size[1] = inputRegion.GetSize()[1]; > > size[2] = NumberOfProjectionImages; > > > > RegionType region; > > region.SetSize(size); > > region.SetIndex(start); > > > > ImageType::SpacingType spacing; > > spacing[0] = inputImage->GetSpacing()[0]; > > spacing[1] = inputImage->GetSpacing()[1]; > > spacing[2] = inputImage->GetSpacing()[2]; > > > > ImageType::PointType origin; > > origin[0] = inputImage->GetOrigin()[0]; > > origin[1] = inputImage->GetOrigin()[1]; > > origin[2] = inputImage->GetOrigin()[2]; > > > > outputImage->SetRegions(region); > > outputImage->SetSpacing(spacing); > > outputImage->SetOrigin(origin); > > outputImage->Allocate(); > > outputImage->FillBuffer(size[0] * size[1] * size[2]); > > > > // Geometry > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(510., 510., i*8.); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->SetGeometry(geometry); > > forward->Update(); > > > > I?m not sure how I have to add projection for the geometry to get a result > which I?m familiar with. > > > > Can you describe how do I have to interpret the result of the > Joseph-Filter? I am familiar with sinograms and how they are computed, but > one sinogram is created by the projections of one image slice as far as I > understood it. What I want is to manipulate the image in the radon space > and then perform a filtered back projection. Typically the articles > describe techniques to reduce metal artifacts by using one 2D Slice. Is it > possible to achieve something like that with the JosephFilter? I?m guessing > since this filter won?t work well for 2D I have to use another filter. Can > you give me a hint if I can do something like that with RTK or another > ITK-based framework? Here a diagram > which shows an example what I want to try. > > > > I tried also to use my code with one slice and added a zero padding like > that: > > typedef itk::ConstantPadImageFilter > ConstantPadImageFilterType; > > ConstantPadImageFilterType::Pointer padFilter = > ConstantPadImageFilterType::New(); > > padFilter->SetInput(inputImage); > > > > ImageType::SizeType extendRegion; > > extendRegion[0] = 0; > > extendRegion[1] = 0; > > extendRegion[2] = 0; > > > > padFilter->SetPadLowerBound(extendRegion); > > padFilter->SetPadUpperBound(extendRegion); > > padFilter->SetConstant(1); > > padFilter->Update(); > > But the result of my png is a black square. > > Tobias > > > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Freitag, 13. Mai 2016 18:15 > > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > If you intialize the data of your itk::Image with FillBuffer with the > corresponding constant value, it is quite similar. The constant image value > allow us to stream the computation whereas you have to allocate the whole > image if you pass directly itk::Image. > > We only work in 3D and probably our projector don't work with 2D, that is > probably the problem here. You would have to correct the code for 2D but > that's a lot of work, we generally prefer pseudo 2D, see next point. > > I doubt that our forward projector will work well with one slice only if > you use 3D, we assume that the volume starts at the first pixel and ends at > the last pixel. You should probably add a zero border around with > itk::PadImage to see something. > > To avoid aliasing, you can cut frequencies in the ramp filter (look for > CutFrequency in the doxygen of rtk::FFTRampImageFilter). > > Simon > > > > On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: > > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Tue May 17 07:07:20 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Tue, 17 May 2016 16:37:20 +0530 Subject: [Rtk-users] Object isocenter shift Message-ID: Hello, As my previous thread caused some confusion, I am attaching an image showing the same in detail. As you can see my object center is not aligned with isocenter line. Besides it is offset by DX and DY values. In my case you can see the object center as red dot. Is there any method in RTK to nullify this offset effect? Will the rotation of turntable affect the reconstruction due to this offset? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: objectoffset.png Type: image/png Size: 12365 bytes Desc: not available URL: From cyril.mory at uclouvain.be Tue May 17 08:19:38 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Tue, 17 May 2016 14:19:38 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: <573B0C5A.4030001@uclouvain.be> Well, if it's just that, you should not worry about it : you cannot perfectly center your object, even if you try. And most objects (e.g. patients) do not even have a "center". So it does not make sense to struggle to have the center of the object perfectly match the isocenter of the acquisition device. You can either live with that (it is perfectly fine for most applications), or try one of these things: - If you can re-do the acquisition, you should try to have your object's center _roughly_ match the system's isocenter, because that's where you will have the least artifacts - Reconstruct your object as it is (it will work fine, unless there are other problems), but select the origin and size of your reconstructed volume carefully to have your object's center roughly at the center of your reconstructed volume. If you are not familiar with the exact definition of "origin", "spacing" and "size" of an itk::image, read section 4.1.4 of the ITK software guide (https://itk.org/ItkSoftwareGuide.pdf). This is both clear, short, and something extremely important to understand. I hope it helps, Cyril On 05/17/2016 01:07 PM, AMJAD N wrote: > Hello, > > As my previous thread caused some confusion, I am attaching an image > showing the same in detail. > > As you can see my object center is not aligned with isocenter line. > Besides it is offset by DX and DY values. In my case you can see the > object center as red dot. > > Is there any method in RTK to nullify this offset effect? > Will the rotation of turntable affect the reconstruction due to this > offset? > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From wuchao04 at gmail.com Tue May 17 09:24:58 2016 From: wuchao04 at gmail.com (Chao Wu) Date: Tue, 17 May 2016 15:24:58 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: There's nothing to correct or compensate for DURING reconstruction in your case. Where you put your object dose not change the geometry of the CT system at all. As long as the object is still inside FOV, a normal reconstruction will give you a correct result. In the resulting image, the origin is at the center of rotation, and the object is off-center by DX and DY, that's it. If you want the origin to be at the center of the object, you can shift it by DX/DY AFTER reconstruction. Regards, Chao 2016-05-17 13:07 GMT+02:00 AMJAD N : > Hello, > > As my previous thread caused some confusion, I am attaching an image > showing the same in detail. > > As you can see my object center is not aligned with isocenter line. > Besides it is offset by DX and DY values. In my case you can see the object > center as red dot. > > Is there any method in RTK to nullify this offset effect? > Will the rotation of turntable affect the reconstruction due to this > offset? > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shiraska at gmail.com Thu May 19 04:41:54 2016 From: shiraska at gmail.com (Shiras Abdurahman) Date: Thu, 19 May 2016 10:41:54 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction Message-ID: Dear all, I am trying to simulate Tomosynthesis reconstruction with stationary flat panel detector where source rotates around Y axis to acquire 21 projections (system geometry diagram is attached). Geometry file geometry.xml is generated with Reg23ProjectionGeometry. I generated projection images of a cube volume and then I tried to reconstruct with FDK algorithm. Even though I am able to generate projections, FDK reconstruction yields the volume with all voxel values zero. The commands I used for generating projections and reconstructing volume are rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 --dimension=256,256,256 --hardware=cuda I am also attaching geometry xml file, mhd header files of the original volume, projections and reconstructed volume. With regards, Shiras -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: geometry.xml Type: text/xml Size: 11889 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fdk.mhd Type: application/octet-stream Size: 322 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: projections.mhd Type: application/octet-stream Size: 335 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: volume.mhd Type: application/octet-stream Size: 355 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: system_geometry.PNG Type: image/png Size: 50006 bytes Desc: not available URL: From cyril.mory at uclouvain.be Fri May 20 04:38:22 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Fri, 20 May 2016 10:38:22 +0200 Subject: [Rtk-users] Compiler RTK In-Reply-To: <573E430F.5030704@uclouvain.be> References: <573E430F.5030704@uclouvain.be> Message-ID: <573ECCFE.3070500@uclouvain.be> Hi Kevin, I'm replying to the RTK users mailing list. Next time, please send your questions to this list instead of just me (except when it specifically involves reggui, for example). I have tried to reproduce the error but the compilation runs fine on my machine. Can you send information on your compiler ? Maybe someone else on the list can help ? Cyril On 05/20/2016 12:49 AM, Kevin Souris wrote: > Bonjour, > > Je viens de t?l?charger la derni?re version de RTK sur Github. > J'essaye maintenant de compiler sur une machine linux et j'obtiens > cette erreur: > > /home/pen/RTK/RTK-master/applications/rtkprojections/rtkprojections.cxx: > In function ?int main(int, char**)?: > /home/pen/RTK/RTK-master/applications/rtkprojections*/**rtkprojections.cxx:27: > error: invalid conversion from ?const char*? to ?char*?* > /home/pen/RTK/RTK-master/applications/rtkprojections/rtkprojections.cxx:27: > error: initializing argument 1 of ?int > cmdline_parser_rtkprojections_config_file(char*, > args_info_rtkprojections*, cmdline_parser_rtkprojections_params*)? > > Comment puis-je r?parer ?a ? > Merci > > Kevin > > > > > -- > Kevin Souris, PhD student > Universit? catholique de Louvain > Molecular Imagery, Radiotherapy and Oncology (MIRO) -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 25 15:45:57 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 25 May 2016 21:45:57 +0200 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Hi Solomon, I had still to look into this on my todo list. I did again but now I think I overlooked something in your email. You say that going through ChangeInformationImageFilter might be the problem. But now, I wonder if the problem is not that the origin that you set is wrong and then the volume or the projections are completely off (hence the projections). So, here is my question : what happens if you replace filter -> SetOutputOrigin(origin); with filter -> SetOutputOrigin(image->GetOutputOrigin()); Of course, it's not what you want to do but it might point to a wrong choice of origin... Simon On Fri, May 6, 2016 at 1:45 AM, Solomon Tang wrote: > Hi Simon, > > I added the line as you suggested and it does not change the output (still > blank). Sorry for the delayed response. > > Thanks for looking into it! > > On Wed, May 4, 2016 at 12:16 AM, Simon Rit > wrote: > >> Dear Solomon, >> Thanks for the report. It looks like a bug to me. I checked and >> itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in >> the itkGPUImage and the itkCudaImage, this function does not check >> consistency between CPU and GPU data. I'll work on a minimal example to >> check this but can you test that your problem is solved if you add >> m_DataManager->UpdateCPUBuffer(); >> before >> m_DataManager->SetGPUBufferDirty(); >> in itkCudaImage.h line 121? >> Thanks, >> Simon >> >> On Mon, May 2, 2016 at 10:42 PM, Solomon Tang >> wrote: >> >>> Thanks for the tip Simon, >>> >>> I think I may have figured it out. I initially read as a CUDA Image, and >>> then passed the CUDA image through ChangeInformationImageFilter to change >>> the offset of the image. >>> >>> template >>> typename itk::CudaImage::Pointer ShiftOffset( >>> const typename itk::CudaImage::Pointer image, >>> const typename itk::Image::PointType origin) >>> { >>> typedef itk::ChangeInformationImageFilter< itk::CudaImage > >>> FilterType; >>> FilterType::Pointer filter = FilterType::New(); >>> filter -> SetInput(image); >>> filter -> SetOutputOrigin(origin); >>> filter -> ChangeOriginOn(); >>> filter -> UpdateOutputInformation(); >>> filter -> Update(); >>> return filter->GetOutput(); >>> } >>> >>> If I pass the offset image pointer to ForwardProjection, it outputs a >>> blank image. >>> >>> However, when I write the offset image and then read it again as a CUDA >>> image, then the ForwardProjection works as intended. Perhaps using the CUDA >>> version of ITK would fix this. >>> >>> >>> On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < >>> simon.rit at creatis.insa-lyon.fr> wrote: >>> >>>> Hi Solomon, >>>> Hard to say without the full code. Maybe the cudaness of your output >>>> image is lost further in the code. Try accessing the CPU buffer at the end, >>>> after the update, to be sure that the GPU image is transferred to CPU, e.g. >>>> std::cout << forwardProjection->GetOutput()->GetPointer() <>>> Simon >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 26 12:04:47 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 26 May 2016 18:04:47 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Hi Shiras, I generated a volume to look at your problem: rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 --offset 0,0,1.7 Then I obtained the same issue as you. I think the problem is that rtkfdk is meant for circular CBCT and it includes pre-weighting for displaced detector and short scan. I'm not sure why you don't get a warning but these are probably responsible for the blank output. A simple solution is to do only the 3 FDK steps using in order the command tools: rtktwodweights rtkramp rtkbackprojections You can also try to shunt the preweighting by modifying rtkfdk.cxx. It's interesting that you try out tomosynthesis but you'll encounter some problem. When I ran the above commands, I get very weird results because the first and the last projections get a lot more weight than the others since it looks at the angular weight with the previous and the next projections. A simple solution is to blank out these two projections. Good luck and keep us posted if you get interesting results, Simon On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman wrote: > Dear all, > > I am trying to simulate Tomosynthesis reconstruction with stationary flat > panel detector where source rotates around Y axis to acquire 21 projections > (system geometry diagram is attached). Geometry file geometry.xml is > generated with Reg23ProjectionGeometry. I generated projection images of > a cube volume and then I tried to reconstruct with FDK algorithm. Even > though I am able to generate projections, FDK reconstruction yields the > volume with all voxel values zero. The commands I used for generating > projections and reconstructing volume are > > rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd > --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast > rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml > --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 > --dimension=256,256,256 --hardware=cuda > > I am also attaching geometry xml file, mhd header files of the original > volume, projections and reconstructed volume. > > With regards, > Shiras > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shiraska at gmail.com Fri May 27 11:31:52 2016 From: shiraska at gmail.com (Shiras Abdurahman) Date: Fri, 27 May 2016 17:31:52 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Dear Simon, Thank you very much for the reply. I tried to reconstruct with only ramp filtering and back projection and the results are looking good without any weighting of the projections. I also reconstructed the volume with rtksart with 10 iterations and the results are better than rtkfdk. With these experiments, I also confirmed that my geometry file is accurate. Thank you very much for your help. With regards, Shiras On Thu, May 26, 2016 at 6:04 PM, Simon Rit wrote: > Hi Shiras, > I generated a volume to look at your problem: > rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 > --offset 0,0,1.7 > Then I obtained the same issue as you. I think the problem is that rtkfdk > is meant for circular CBCT and it includes pre-weighting for displaced > detector and short scan. I'm not sure why you don't get a warning but these > are probably responsible for the blank output. A simple solution is to do > only the 3 FDK steps using in order the command tools: > rtktwodweights > rtkramp > rtkbackprojections > You can also try to shunt the preweighting by modifying rtkfdk.cxx. > > It's interesting that you try out tomosynthesis but you'll encounter some > problem. When I ran the above commands, I get very weird results because > the first and the last projections get a lot more weight than the others > since it looks at the angular weight with the previous and the next > projections. A simple solution is to blank out these two projections. > Good luck and keep us posted if you get interesting results, > Simon > > On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman > wrote: > >> Dear all, >> >> I am trying to simulate Tomosynthesis reconstruction with stationary flat >> panel detector where source rotates around Y axis to acquire 21 projections >> (system geometry diagram is attached). Geometry file geometry.xml is >> generated with Reg23ProjectionGeometry. I generated projection images of >> a cube volume and then I tried to reconstruct with FDK algorithm. Even >> though I am able to generate projections, FDK reconstruction yields the >> volume with all voxel values zero. The commands I used for generating >> projections and reconstructing volume are >> >> rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd >> --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast >> rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml >> --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 >> --dimension=256,256,256 --hardware=cuda >> >> I am also attaching geometry xml file, mhd header files of the original >> volume, projections and reconstructed volume. >> >> With regards, >> Shiras >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 27 12:00:56 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 27 May 2016 18:00:56 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Indeed, the angular weighting resulting from the discretization of the back projection occurs in rtkfdktwodweights so skipping this might help. Simon On 27 May 2016 5:32 p.m., "Shiras Abdurahman" wrote: Dear Simon, Thank you very much for the reply. I tried to reconstruct with only ramp filtering and back projection and the results are looking good without any weighting of the projections. I also reconstructed the volume with rtksart with 10 iterations and the results are better than rtkfdk. With these experiments, I also confirmed that my geometry file is accurate. Thank you very much for your help. With regards, Shiras On Thu, May 26, 2016 at 6:04 PM, Simon Rit wrote: > Hi Shiras, > I generated a volume to look at your problem: > rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 > --offset 0,0,1.7 > Then I obtained the same issue as you. I think the problem is that rtkfdk > is meant for circular CBCT and it includes pre-weighting for displaced > detector and short scan. I'm not sure why you don't get a warning but these > are probably responsible for the blank output. A simple solution is to do > only the 3 FDK steps using in order the command tools: > rtktwodweights > rtkramp > rtkbackprojections > You can also try to shunt the preweighting by modifying rtkfdk.cxx. > > It's interesting that you try out tomosynthesis but you'll encounter some > problem. When I ran the above commands, I get very weird results because > the first and the last projections get a lot more weight than the others > since it looks at the angular weight with the previous and the next > projections. A simple solution is to blank out these two projections. > Good luck and keep us posted if you get interesting results, > Simon > > On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman > wrote: > >> Dear all, >> >> I am trying to simulate Tomosynthesis reconstruction with stationary flat >> panel detector where source rotates around Y axis to acquire 21 projections >> (system geometry diagram is attached). Geometry file geometry.xml is >> generated with Reg23ProjectionGeometry. I generated projection images of >> a cube volume and then I tried to reconstruct with FDK algorithm. Even >> though I am able to generate projections, FDK reconstruction yields the >> volume with all voxel values zero. The commands I used for generating >> projections and reconstructing volume are >> >> rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd >> --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast >> rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml >> --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 >> --dimension=256,256,256 --hardware=cuda >> >> I am also attaching geometry xml file, mhd header files of the original >> volume, projections and reconstructed volume. >> >> With regards, >> Shiras >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 31 12:02:32 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 31 May 2016 18:02:32 +0200 Subject: [Rtk-users] Rooster In-Reply-To: References: Message-ID: Hi Guillaume, I'm adding RTK user list to this conversation, it's better to have these conversations on the mailing list IMO. Can you tell us what's the volume size and the GPU? Cyril is ROOSTER's dev, maybe he could comment on recon times. Simon On Tue, May 31, 2016 at 5:29 PM, wrote: > Hi Simon, > > I tried the rooster recon. I used the parameters from the example page. The results looks rather nice but it took several hours to run (5-6). Its a big dataset of about 2000 256x256 projections. > > Guillaume From G.Landry at physik.uni-muenchen.de Tue May 31 13:48:28 2016 From: G.Landry at physik.uni-muenchen.de (G.Landry at physik.uni-muenchen.de) Date: Tue, 31 May 2016 19:48:28 +0200 Subject: [Rtk-users] Rooster In-Reply-To: References: Message-ID: <20160531194828.Horde.Im1irUOnkCrL1p8oGSue_A5@webmail.physik.lmu.de> Hi Simon, Thanks for mailing list suggestion. My initial question was about typical reconstruction times for rtkfourdrooster. What I tried is summarized below: -Volume size was 410 410 264 and could be easily reduced by a good margin. -The GPU is quadro M4000 with 8GB -about 2300 256x256 projections with shifted elekta panel (so called M20) -10 phases -for the motion mask at the moment I just used the FOV mask for first try. --gamma_time 0.0001 --gamma_space 0.0001 - spacing 1 1 1 --niter 30 --cgiter 4 --tviter 10 Recon time was about 5-6 hours. I saw about 4 Gb used on the card. The image looked nice, albeit with the TV "feel/plastic-y". Thanks for your feedback Guillaume Quoting Simon Rit : > Hi Guillaume, > I'm adding RTK user list to this conversation, it's better to have > these conversations on the mailing list IMO. Can you tell us what's > the volume size and the GPU? > Cyril is ROOSTER's dev, maybe he could comment on recon times. > Simon > > On Tue, May 31, 2016 at 5:29 PM, wrote: >> Hi Simon, >> >> I tried the rooster recon. I used the parameters from the example >> page. The results looks rather nice but it took several hours to >> run (5-6). Its a big dataset of about 2000 256x256 projections. >> >> Guillaume -- Dr. Guillaume Landry Ludwig Maximilians University (LMU) Munich Medical Physics Am Coulombwall 1 85748 Garching Tel:+49 (0) 89 289-14077 Fax:+49 (0) 89 289-14072 From solomoncztang at gmail.com Mon May 2 16:42:44 2016 From: solomoncztang at gmail.com (Solomon Tang) Date: Mon, 2 May 2016 13:42:44 -0700 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Thanks for the tip Simon, I think I may have figured it out. I initially read as a CUDA Image, and then passed the CUDA image through ChangeInformationImageFilter to change the offset of the image. template typename itk::CudaImage::Pointer ShiftOffset( const typename itk::CudaImage::Pointer image, const typename itk::Image::PointType origin) { typedef itk::ChangeInformationImageFilter< itk::CudaImage > FilterType; FilterType::Pointer filter = FilterType::New(); filter -> SetInput(image); filter -> SetOutputOrigin(origin); filter -> ChangeOriginOn(); filter -> UpdateOutputInformation(); filter -> Update(); return filter->GetOutput(); } If I pass the offset image pointer to ForwardProjection, it outputs a blank image. However, when I write the offset image and then read it again as a CUDA image, then the ForwardProjection works as intended. Perhaps using the CUDA version of ITK would fix this. On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit wrote: > Hi Solomon, > Hard to say without the full code. Maybe the cudaness of your output image > is lost further in the code. Try accessing the CPU buffer at the end, after > the update, to be sure that the GPU image is transferred to CPU, e.g. > std::cout << forwardProjection->GetOutput()->GetPointer() < Simon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Tue May 3 18:59:03 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Wed, 4 May 2016 00:59:03 +0200 Subject: [Rtk-users] forward and back projection - MITK Message-ID: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I've seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I've also seen the test for this class but I don't get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I've got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 4 03:02:05 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 4 May 2016 09:02:05 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Message-ID: Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein wrote: > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 4 03:16:33 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 4 May 2016 09:16:33 +0200 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Dear Solomon, Thanks for the report. It looks like a bug to me. I checked and itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in the itkGPUImage and the itkCudaImage, this function does not check consistency between CPU and GPU data. I'll work on a minimal example to check this but can you test that your problem is solved if you add m_DataManager->UpdateCPUBuffer(); before m_DataManager->SetGPUBufferDirty(); in itkCudaImage.h line 121? Thanks, Simon On Mon, May 2, 2016 at 10:42 PM, Solomon Tang wrote: > Thanks for the tip Simon, > > I think I may have figured it out. I initially read as a CUDA Image, and > then passed the CUDA image through ChangeInformationImageFilter to change > the offset of the image. > > template > typename itk::CudaImage::Pointer ShiftOffset( > const typename itk::CudaImage::Pointer image, > const typename itk::Image::PointType origin) > { > typedef itk::ChangeInformationImageFilter< itk::CudaImage > > FilterType; > FilterType::Pointer filter = FilterType::New(); > filter -> SetInput(image); > filter -> SetOutputOrigin(origin); > filter -> ChangeOriginOn(); > filter -> UpdateOutputInformation(); > filter -> Update(); > return filter->GetOutput(); > } > > If I pass the offset image pointer to ForwardProjection, it outputs a > blank image. > > However, when I write the offset image and then read it again as a CUDA > image, then the ForwardProjection works as intended. Perhaps using the CUDA > version of ITK would fix this. > > > On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < > simon.rit at creatis.insa-lyon.fr> wrote: > >> Hi Solomon, >> Hard to say without the full code. Maybe the cudaness of your output >> image is lost further in the code. Try accessing the CPU buffer at the end, >> after the update, to be sure that the GPU image is transferred to CPU, e.g. >> std::cout << forwardProjection->GetOutput()->GetPointer() <> Simon >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Wed May 4 05:04:28 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Wed, 4 May 2016 14:34:28 +0530 Subject: [Rtk-users] Reconstructed Slice save as tiff Message-ID: Hi all, I have wrote code for saving output volume stack as *.tiff. Currently I am getting output of XY axis. What should I do in order to get the other axes. My code is shown below. typedef itk::StreamingImageFilter StreamerType; StreamerType::Pointer streamerBP = StreamerType::New(); streamerBP->SetInput(feldkampCUDA->GetOutput()); streamerBP->SetNumberOfStreamDivisions(8); typedef itk::Image< float, 2 > Image2DType; typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; WriterType::Pointer writer = WriterType::New(); writer->SetInput(streamerBP->GetOutput()); typedef itk::NumericSeriesFileNames NameGeneratorType; NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); nameGenerator->SetStartIndex(0); nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the Z-axis value of //reconstructed volume nameGenerator->SetIncrementIndex(1); writer->SetFileNames(nameGenerator->GetFileNames()); writer->SetUseCompression(true); writer->Update(); PS: My reconstruction works fine. Thanks and Regards AMJAD N -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyril.mory at uclouvain.be Wed May 4 07:27:24 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Wed, 4 May 2016 13:27:24 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: References: Message-ID: <5729DC9C.10105@uclouvain.be> Hi Amjad, You can use an ITK extract filter to extract a region that corresponds to one of your slices (along the axis you want). The output of the extract filter will be 3D, so you will need to cast it into a 2D images using an ITK cast filter. Cyril On 05/04/2016 11:04 AM, AMJAD N wrote: > Hi all, > > I have wrote code for saving output volume stack as *.tiff. Currently > I am getting output of XY axis. What should I do in order to get the > other axes. > My code is shown below. > > typedef itk::StreamingImageFilter FloatImageType> StreamerType; > StreamerType::Pointer streamerBP = StreamerType::New(); > streamerBP->SetInput(feldkampCUDA->GetOutput()); > streamerBP->SetNumberOfStreamDivisions(8); > > typedef itk::Image< float, 2 > Image2DType; > typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; > WriterType::Pointer writer = WriterType::New(); > writer->SetInput(streamerBP->GetOutput()); > > typedef itk::NumericSeriesFileNames NameGeneratorType; > NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); > nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); > nameGenerator->SetStartIndex(0); > nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the > Z-axis value of //reconstructed volume > nameGenerator->SetIncrementIndex(1); > writer->SetFileNames(nameGenerator->GetFileNames()); > writer->SetUseCompression(true); > writer->Update(); > > PS: My reconstruction works fine. > > Thanks and Regards > > AMJAD N > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From wuchao04 at gmail.com Wed May 4 08:44:37 2016 From: wuchao04 at gmail.com (Chao Wu) Date: Wed, 4 May 2016 14:44:37 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: <5729DC9C.10105@uclouvain.be> References: <5729DC9C.10105@uclouvain.be> Message-ID: A small add-on (copied from ITK document): ExtractImageFilter also collapses dimensions so that the input image may have more dimensions than the output image (i.e. 4-D input image to a 3-D output image). To specify what dimensions to collapse, the ExtractionRegion must be specified. For any dimension dim where ExtractionRegion.Size[dim] = 0, that dimension is collapsed. The index to collapse on is specified by ExtractionRegion.Index[dim]. For example, we have a image 4D = a 4x4x4x4 image, and we want to get a 3D image, 3D = a 4x4x4 image, specified as [x,y,z,2] from 4D (i.e. the 3rd "time" slice from 4D). The ExtractionRegion.Size = [4,4,4,0] and ExtractionRegion.Index = [0,0,0,2]. Regards, Chao 2016-05-04 13:27 GMT+02:00 Cyril Mory : > Hi Amjad, > > You can use an ITK extract filter to extract a region that corresponds to > one of your slices (along the axis you want). The output of the extract > filter will be 3D, so you will need to cast it into a 2D images using an > ITK cast filter. > > Cyril > > > On 05/04/2016 11:04 AM, AMJAD N wrote: > > Hi all, > > I have wrote code for saving output volume stack as *.tiff. Currently I am > getting output of XY axis. What should I do in order to get the other axes. > My code is shown below. > > typedef itk::StreamingImageFilter > StreamerType; > StreamerType::Pointer streamerBP = StreamerType::New(); > streamerBP->SetInput(feldkampCUDA->GetOutput()); > streamerBP->SetNumberOfStreamDivisions(8); > > typedef itk::Image< float, 2 > Image2DType; > typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; > WriterType::Pointer writer = WriterType::New(); > writer->SetInput(streamerBP->GetOutput()); > > typedef itk::NumericSeriesFileNames NameGeneratorType; > NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); > nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); > nameGenerator->SetStartIndex(0); > nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the > Z-axis value of //reconstructed volume > nameGenerator->SetIncrementIndex(1); > writer->SetFileNames(nameGenerator->GetFileNames()); > writer->SetUseCompression(true); > writer->Update(); > > PS: My reconstruction works fine. > > Thanks and Regards > > AMJAD N > > > > _______________________________________________ > Rtk-users mailing listRtk-users at public.kitware.comhttp://public.kitware.com/mailman/listinfo/rtk-users > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyril.mory at uclouvain.be Wed May 4 08:56:14 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Wed, 4 May 2016 14:56:14 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: References: <5729DC9C.10105@uclouvain.be> Message-ID: <5729F16E.5020402@uclouvain.be> Thanks Chao Wu, You're right, I was mistaken : the cast filter is not required in this case. It is needed, on the other hand, to increase the dimension of an image. So in this case, Amjad, you don't need it. Cyril On 05/04/2016 02:44 PM, Chao Wu wrote: > A small add-on (copied from ITK document): > > ExtractImageFilter also collapses dimensions so that the input image > may have more dimensions than the output image (i.e. 4-D input image > to a 3-D output image). To specify what dimensions to collapse, the > ExtractionRegion must be specified. For any dimension dim where > ExtractionRegion.Size[dim] = 0, that dimension is collapsed. The index > to collapse on is specified by ExtractionRegion.Index[dim]. For > example, we have a image 4D = a 4x4x4x4 image, and we want to get a 3D > image, 3D = a 4x4x4 image, specified as [x,y,z,2] from 4D (i.e. the > 3rd "time" slice from 4D). The ExtractionRegion.Size = [4,4,4,0] and > ExtractionRegion.Index = [0,0,0,2]. > > Regards, > Chao > > 2016-05-04 13:27 GMT+02:00 Cyril Mory >: > > Hi Amjad, > > You can use an ITK extract filter to extract a region that > corresponds to one of your slices (along the axis you want). The > output of the extract filter will be 3D, so you will need to cast > it into a 2D images using an ITK cast filter. > > Cyril > > > On 05/04/2016 11:04 AM, AMJAD N wrote: >> Hi all, >> >> I have wrote code for saving output volume stack as *.tiff. >> Currently I am getting output of XY axis. What should I do in >> order to get the other axes. >> My code is shown below. >> >> typedef itk::StreamingImageFilter> FloatImageType> StreamerType; >> StreamerType::Pointer streamerBP = StreamerType::New(); >> streamerBP->SetInput(feldkampCUDA->GetOutput()); >> streamerBP->SetNumberOfStreamDivisions(8); >> >> typedef itk::Image< float, 2 > Image2DType; >> typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > >> WriterType; >> WriterType::Pointer writer = WriterType::New(); >> writer->SetInput(streamerBP->GetOutput()); >> >> typedef itk::NumericSeriesFileNames NameGeneratorType; >> NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); >> nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); >> nameGenerator->SetStartIndex(0); >> nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] >> is the Z-axis value of //reconstructed volume >> nameGenerator->SetIncrementIndex(1); >> writer->SetFileNames(nameGenerator->GetFileNames()); >> writer->SetUseCompression(true); >> writer->Update(); >> >> PS: My reconstruction works fine. >> >> Thanks and Regards >> >> AMJAD N >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From solomoncztang at gmail.com Thu May 5 19:45:43 2016 From: solomoncztang at gmail.com (Solomon Tang) Date: Thu, 5 May 2016 16:45:43 -0700 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Hi Simon, I added the line as you suggested and it does not change the output (still blank). Sorry for the delayed response. Thanks for looking into it! On Wed, May 4, 2016 at 12:16 AM, Simon Rit wrote: > Dear Solomon, > Thanks for the report. It looks like a bug to me. I checked and > itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in > the itkGPUImage and the itkCudaImage, this function does not check > consistency between CPU and GPU data. I'll work on a minimal example to > check this but can you test that your problem is solved if you add > m_DataManager->UpdateCPUBuffer(); > before > m_DataManager->SetGPUBufferDirty(); > in itkCudaImage.h line 121? > Thanks, > Simon > > On Mon, May 2, 2016 at 10:42 PM, Solomon Tang > wrote: > >> Thanks for the tip Simon, >> >> I think I may have figured it out. I initially read as a CUDA Image, and >> then passed the CUDA image through ChangeInformationImageFilter to change >> the offset of the image. >> >> template >> typename itk::CudaImage::Pointer ShiftOffset( >> const typename itk::CudaImage::Pointer image, >> const typename itk::Image::PointType origin) >> { >> typedef itk::ChangeInformationImageFilter< itk::CudaImage > >> FilterType; >> FilterType::Pointer filter = FilterType::New(); >> filter -> SetInput(image); >> filter -> SetOutputOrigin(origin); >> filter -> ChangeOriginOn(); >> filter -> UpdateOutputInformation(); >> filter -> Update(); >> return filter->GetOutput(); >> } >> >> If I pass the offset image pointer to ForwardProjection, it outputs a >> blank image. >> >> However, when I write the offset image and then read it again as a CUDA >> image, then the ForwardProjection works as intended. Perhaps using the CUDA >> version of ITK would fix this. >> >> >> On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < >> simon.rit at creatis.insa-lyon.fr> wrote: >> >>> Hi Solomon, >>> Hard to say without the full code. Maybe the cudaness of your output >>> image is lost further in the code. Try accessing the CPU buffer at the end, >>> after the update, to be sure that the GPU image is transferred to CPU, e.g. >>> std::cout << forwardProjection->GetOutput()->GetPointer() <>> Simon >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 10 01:29:44 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 10 May 2016 07:29:44 +0200 Subject: [Rtk-users] Cmake build error help In-Reply-To: References: Message-ID: <573171C8.80400@creatis.insa-lyon.fr> Hi, Can you update GetGitRevisionDescription.cmake and GetGitRevisionDescription.cmake.in from https://github.com/rpavlik/cmake-modules and see if the new versions fix this issue? Thanks, Simon PS: plead keep using the mailing list On 10/05/2016 03:09, Solomon Tang wrote: > Hi Simon, > > I am rebuilding RTK after moving to Visual Studio 2015 with cmake > 3.5.2 and am running into the following error: > > CMake Error at build/applications/CMakeFiles/git-data/grabRef.cmake:36 > (file): > file failed to open for reading (No such file or directory): > > C:/Work/Tools/Current/RTK-1.2.0/build/applications/CMakeFiles/git-data/head-ref > Call Stack (most recent call first): > cmake/GetGitRevisionDescription.cmake:77 (include) > applications/CMakeLists.txt:5 (get_git_head_revision) > > I am using ITK 4.9.0 and fresh download of RTK 1.2.0. > > How do I resolve this issue? > > Thanks again, > > Solomon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Thu May 12 00:12:17 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Thu, 12 May 2016 09:42:17 +0530 Subject: [Rtk-users] Reconstruction Volume. Message-ID: Hello users, I have successfully implemented CBCT reconstruction using both CUDA and CPU method. For finding the reconstruction volume size, I measured the actual object size. divided by respective axis number of pixels to get spacing. eg: If my object is 10x15x20 cm. I measure that dimensions. If the required volume is 500x600x700 px, to get spacing i used 10/500,15/600,20/700. But this is not practically possible for every object. Is there any way to find the reconstruction volume spacing other than doing the above method. I have SDD(Source Detector Distance), SID(Source Isocenter Distance), Detector physical size,pixel density. Thanks and Regards AMJAD N -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 12 01:31:51 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 12 May 2016 07:31:51 +0200 Subject: [Rtk-users] Reconstruction Volume. In-Reply-To: References: Message-ID: Hi, The typical solution (e.g., in clincial scanners) is to reconstruct the field-of-view of the scanner (every point in space that is seen by all source positions) because you know this is the only area of space where your reconstruction is going to be accurate. rtkfieldofview generates this FOV. Simon On Thu, May 12, 2016 at 6:12 AM, AMJAD N wrote: > Hello users, > > I have successfully implemented CBCT reconstruction using both CUDA and > CPU method. For finding the reconstruction volume size, I measured the > actual object size. divided by respective axis number of pixels to get > spacing. > > eg: If my object is 10x15x20 cm. I measure that dimensions. If the > required volume is 500x600x700 px, to get spacing i used > 10/500,15/600,20/700. > > But this is not practically possible for every object. Is there any way to > find the reconstruction volume spacing other than doing the above method. > > I have SDD(Source Detector Distance), SID(Source Isocenter Distance), > Detector physical size,pixel density. > > Thanks and Regards > > AMJAD N > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Fri May 13 04:30:33 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Fri, 13 May 2016 14:00:33 +0530 Subject: [Rtk-users] Object isocenter shift Message-ID: Hello users, During acquisition it is found that my object isocenter is shifted from turntable isocenter by DX and DY values. Source , turntable isocenter and detector center is aligned perfectly. Is there any method in RTK we can make use of to nullify the effect due to this isocenter shift? Thanks and Regards AMJAD -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 13 08:36:48 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 13 May 2016 14:36:48 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: Hi, I don't understand the question. The isocenter is by definition the center of rotation in RTK and we assume it's at the origin of the reconstructed volume. There is no such thing as an "object isocenter". DX and DY values are the shift of the projection origin (which can be anywhere) with respect to the central ray (source to isocenter ray). It is not the turntable isocenter. If you want to have dx=0 and dy=0, the projection origin must be changed. But it has to be constant for the whole projection stack. I hope it helps, Simon On Fri, May 13, 2016 at 10:30 AM, AMJAD N wrote: > Hello users, > During acquisition it is found that my object isocenter is shifted from > turntable isocenter by DX and DY values. Source , turntable isocenter and > detector center is aligned perfectly. Is there any method in RTK we can > make use of to nullify the effect due to this isocenter shift? > > Thanks and Regards > AMJAD > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Fri May 13 11:35:57 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Fri, 13 May 2016 17:35:57 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Message-ID: <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 13 12:15:09 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 13 May 2016 18:15:09 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Message-ID: Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein wrote: > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Sat May 14 05:48:01 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Sat, 14 May 2016 11:48:01 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Message-ID: <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Hello Simon, Thanks for your advice so far. I?m getting to know this filter better. At least I can now use it and save the result into a file. I updated my code which now uses a volume. The values of the input and output volume are equal except of the z-dimension of the output which I changed to the number of projection images. const unsigned int Dimension = 3; ?Reading image? ImageType::Pointer inputImage = reader->GetOutput(); ImageType::Pointer outputImage = ImageType::New(); RegionType inputRegion = inputImage->GetLargestPossibleRegion(); const unsigned int NumberOfProjectionImages = 45; ImageType::IndexType start; start[0] = inputRegion.GetIndex()[0]; start[1] = inputRegion.GetIndex()[1]; start[2] = inputRegion.GetIndex()[2]; RegionType::SizeType size; size[0] = inputRegion.GetSize()[0]; size[1] = inputRegion.GetSize()[1]; size[2] = NumberOfProjectionImages; RegionType region; region.SetSize(size); region.SetIndex(start); ImageType::SpacingType spacing; spacing[0] = inputImage->GetSpacing()[0]; spacing[1] = inputImage->GetSpacing()[1]; spacing[2] = inputImage->GetSpacing()[2]; ImageType::PointType origin; origin[0] = inputImage->GetOrigin()[0]; origin[1] = inputImage->GetOrigin()[1]; origin[2] = inputImage->GetOrigin()[2]; outputImage->SetRegions(region); outputImage->SetSpacing(spacing); outputImage->SetOrigin(origin); outputImage->Allocate(); outputImage->FillBuffer(size[0] * size[1] * size[2]); // Geometry typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(510., 510., i*8.); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->SetGeometry(geometry); forward->Update(); I?m not sure how I have to add projection for the geometry to get a result which I?m familiar with. Can you describe how do I have to interpret the result of the Joseph-Filter? I am familiar with sinograms and how they are computed, but one sinogram is created by the projections of one image slice as far as I understood it. What I want is to manipulate the image in the radon space and then perform a filtered back projection. Typically the articles describe techniques to reduce metal artifacts by using one 2D Slice. Is it possible to achieve something like that with the JosephFilter? I?m guessing since this filter won?t work well for 2D I have to use another filter. Can you give me a hint if I can do something like that with RTK or another ITK-based framework? Here a diagram which shows an example what I want to try. I tried also to use my code with one slice and added a zero padding like that: typedef itk::ConstantPadImageFilter ConstantPadImageFilterType; ConstantPadImageFilterType::Pointer padFilter = ConstantPadImageFilterType::New(); padFilter->SetInput(inputImage); ImageType::SizeType extendRegion; extendRegion[0] = 0; extendRegion[1] = 0; extendRegion[2] = 0; padFilter->SetPadLowerBound(extendRegion); padFilter->SetPadUpperBound(extendRegion); padFilter->SetConstant(1); padFilter->Update(); But the result of my png is a black square. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Freitag, 13. Mai 2016 18:15 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto: simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein < tstein at stud.hs-heilbronn.de> Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Sat May 14 06:17:18 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sat, 14 May 2016 12:17:18 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Message-ID: The output of the Joseph filter (of any forward projector) is a stack of projection images, i.e., a 3D image. If you slice this 3D image in the z direction, you get one projection images. If you slice this 3D image in the y direction, you get a sinogram, e.g., the 2D sinogram of the central slice (plane of the source trajectory) if y=0. The best way to have this sinogram is to set size[1]=1 and there is no better way to do it in RTK. For zero-padding, you need to set extendRegion[?]=1, with (for all dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that your image is a black square, something else must be going on. One thing to remember, the typical RTK rotation is around the y axis so your 3D slice must be 1 in the y direction. A simple way to change the orientation of one slice is to change its direction with ChangeImageFilter Simon On Sat, May 14, 2016 at 11:48 AM, Tobias Stein wrote: > Hello Simon, > > > > Thanks for your advice so far. I?m getting to know this filter better. At > least I can now use it and save the result into a file. > > > > I updated my code which now uses a volume. > > The values of the input and output volume are equal except of the > z-dimension of the output which I changed to the number of projection > images. > > const unsigned int Dimension = 3; > > ?Reading image? > > ImageType::Pointer inputImage = reader->GetOutput(); > > ImageType::Pointer outputImage = ImageType::New(); > > > > RegionType inputRegion = inputImage->GetLargestPossibleRegion(); > > > > const unsigned int NumberOfProjectionImages = 45; > > > > ImageType::IndexType start; > > start[0] = inputRegion.GetIndex()[0]; > > start[1] = inputRegion.GetIndex()[1]; > > start[2] = inputRegion.GetIndex()[2]; > > > > RegionType::SizeType size; > > size[0] = inputRegion.GetSize()[0]; > > size[1] = inputRegion.GetSize()[1]; > > size[2] = NumberOfProjectionImages; > > > > RegionType region; > > region.SetSize(size); > > region.SetIndex(start); > > > > ImageType::SpacingType spacing; > > spacing[0] = inputImage->GetSpacing()[0]; > > spacing[1] = inputImage->GetSpacing()[1]; > > spacing[2] = inputImage->GetSpacing()[2]; > > > > ImageType::PointType origin; > > origin[0] = inputImage->GetOrigin()[0]; > > origin[1] = inputImage->GetOrigin()[1]; > > origin[2] = inputImage->GetOrigin()[2]; > > > > outputImage->SetRegions(region); > > outputImage->SetSpacing(spacing); > > outputImage->SetOrigin(origin); > > outputImage->Allocate(); > > outputImage->FillBuffer(size[0] * size[1] * size[2]); > > > > // Geometry > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(510., 510., i*8.); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->SetGeometry(geometry); > > forward->Update(); > > > > I?m not sure how I have to add projection for the geometry to get a result > which I?m familiar with. > > > > Can you describe how do I have to interpret the result of the > Joseph-Filter? I am familiar with sinograms and how they are computed, but > one sinogram is created by the projections of one image slice as far as I > understood it. What I want is to manipulate the image in the radon space > and then perform a filtered back projection. Typically the articles > describe techniques to reduce metal artifacts by using one 2D Slice. Is it > possible to achieve something like that with the JosephFilter? I?m guessing > since this filter won?t work well for 2D I have to use another filter. Can > you give me a hint if I can do something like that with RTK or another > ITK-based framework? Here a diagram > which shows an example what I want to try. > > > > I tried also to use my code with one slice and added a zero padding like > that: > > typedef itk::ConstantPadImageFilter > ConstantPadImageFilterType; > > ConstantPadImageFilterType::Pointer padFilter = > ConstantPadImageFilterType::New(); > > padFilter->SetInput(inputImage); > > > > ImageType::SizeType extendRegion; > > extendRegion[0] = 0; > > extendRegion[1] = 0; > > extendRegion[2] = 0; > > > > padFilter->SetPadLowerBound(extendRegion); > > padFilter->SetPadUpperBound(extendRegion); > > padFilter->SetConstant(1); > > padFilter->Update(); > > But the result of my png is a black square. > > Tobias > > > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Freitag, 13. Mai 2016 18:15 > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > If you intialize the data of your itk::Image with FillBuffer with the > corresponding constant value, it is quite similar. The constant image value > allow us to stream the computation whereas you have to allocate the whole > image if you pass directly itk::Image. > > We only work in 3D and probably our projector don't work with 2D, that is > probably the problem here. You would have to correct the code for 2D but > that's a lot of work, we generally prefer pseudo 2D, see next point. > > I doubt that our forward projector will work well with one slice only if > you use 3D, we assume that the volume starts at the first pixel and ends at > the last pixel. You should probably add a zero border around with > itk::PadImage to see something. > > To avoid aliasing, you can cut frequencies in the ramp filter (look for > CutFrequency in the doxygen of rtk::FFTRampImageFilter). > > Simon > > > > On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: > > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Sat May 14 06:18:57 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sat, 14 May 2016 12:18:57 +0200 Subject: [Rtk-users] RTK training - June 17 2016 Message-ID: Dear all, The training on June 17 in Lyon is confirmed. Please register asap if you'd like to attend. Looking forward to meeting our users, Simon On Thu, Mar 10, 2016 at 11:02 AM, Simon Rit wrote: > Dear all, > The new date for the RTK training is Friday June 17. > I'm looking forward to meeting you there, > Simon > > On Sun, Mar 6, 2016 at 12:57 PM, Simon Rit > wrote: > >> Dear all, >> We have to fix another date for the RTK training due to a conflicting >> meeting. If you are interested, please fill in the foodle >> so that >> we fix a date that suits everyone. If none of these dates works for you, >> please let me know and we'll try to extend the foodle. >> Please answer before Tuesday, we'll fix the date on Tuesday evening. >> Thanks for your cooperation and apologies for the mess, >> Simon >> >> On Tue, Feb 9, 2016 at 11:49 AM, Simon Rit < >> simon.rit at creatis.insa-lyon.fr> wrote: >> >>> Dear RTK users, >>> We will organize a new training >>> session on June 22 2016 in >>> Lyon. Follow the instructions on the webpage >>> to register. The training is >>> for both users and developers. We are happy to answer any question that you >>> might have and we are looking forward to this new training session. >>> Simon >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Sun May 15 08:38:40 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Sun, 15 May 2016 14:38:40 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Message-ID: <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> If I understood you correct, the input of the Joseph-Filter needs to be oriented in the y-direction when I am dealing with axial oriented slices. Now I changed the direction of the 3D Slice by rotating it 90 degrees around the x-axis with the itk::ChangeInformationImageFilter to have my slice in the xz-layer in the y-direction: double rotationX = 90; itk::Versor< double > rotation; const double angleInRadians = rotationX * vnl_math::pi / 180.0; rotation.SetRotationAroundX(angleInRadians); const ImageType::DirectionType direction = inputImage->GetDirection(); const ImageType::DirectionType newDirection = direction * rotation.GetMatrix(); changeFilter->SetOutputDirection(newDirection); changeFilter->ChangeAll(); changeFilter->SetInput(inputImage); changeFilter->UpdateOutputInformation(); Then I added a zero-border as you told me (This changed the size of my region from [512, 512, 1] to [514, 514, 3]). While executing the Joseph Filter I got an error because a vector subscript was out of range. Maybe that?s because the index of the region is [-1,-1,-1] caused by the padding. I tried the padding after the Joseph Filter, and got a result which has a size [514, 3, 45], while 45 was the number of projection images but the image was still empty. I also tried the Jospeh Filter with a real 3D volume stack of slices, rotated it as described below and got a result. Now I am confused how I should create the geometry of the Joseph Filter to get a good result. typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(300., 500., i * 180 / NumberOfProjectionImages); I am trying to use a 180-degree rotation, but i don?t have the feeling for the distance values. I this code example I used an 3D Image with dimensions = [256, 256, 49] My idea was, since there is no way to get a result with a single 3D slice, I would use a stack of slices as input and slice the output volume in y-direction to get my sinogram as you said. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Samstag, 14. Mai 2016 12:17 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK The output of the Joseph filter (of any forward projector) is a stack of projection images, i.e., a 3D image. If you slice this 3D image in the z direction, you get one projection images. If you slice this 3D image in the y direction, you get a sinogram, e.g., the 2D sinogram of the central slice (plane of the source trajectory) if y=0. The best way to have this sinogram is to set size[1]=1 and there is no better way to do it in RTK. For zero-padding, you need to set extendRegion[?]=1, with (for all dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that your image is a black square, something else must be going on. One thing to remember, the typical RTK rotation is around the y axis so your 3D slice must be 1 in the y direction. A simple way to change the orientation of one slice is to change its direction with ChangeImageFilter Simon On Sat, May 14, 2016 at 11:48 AM, Tobias Stein > wrote: Hello Simon, Thanks for your advice so far. I?m getting to know this filter better. At least I can now use it and save the result into a file. I updated my code which now uses a volume. The values of the input and output volume are equal except of the z-dimension of the output which I changed to the number of projection images. const unsigned int Dimension = 3; ?Reading image? ImageType::Pointer inputImage = reader->GetOutput(); ImageType::Pointer outputImage = ImageType::New(); RegionType inputRegion = inputImage->GetLargestPossibleRegion(); const unsigned int NumberOfProjectionImages = 45; ImageType::IndexType start; start[0] = inputRegion.GetIndex()[0]; start[1] = inputRegion.GetIndex()[1]; start[2] = inputRegion.GetIndex()[2]; RegionType::SizeType size; size[0] = inputRegion.GetSize()[0]; size[1] = inputRegion.GetSize()[1]; size[2] = NumberOfProjectionImages; RegionType region; region.SetSize(size); region.SetIndex(start); ImageType::SpacingType spacing; spacing[0] = inputImage->GetSpacing()[0]; spacing[1] = inputImage->GetSpacing()[1]; spacing[2] = inputImage->GetSpacing()[2]; ImageType::PointType origin; origin[0] = inputImage->GetOrigin()[0]; origin[1] = inputImage->GetOrigin()[1]; origin[2] = inputImage->GetOrigin()[2]; outputImage->SetRegions(region); outputImage->SetSpacing(spacing); outputImage->SetOrigin(origin); outputImage->Allocate(); outputImage->FillBuffer(size[0] * size[1] * size[2]); // Geometry typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(510., 510., i*8.); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->SetGeometry(geometry); forward->Update(); I?m not sure how I have to add projection for the geometry to get a result which I?m familiar with. Can you describe how do I have to interpret the result of the Joseph-Filter? I am familiar with sinograms and how they are computed, but one sinogram is created by the projections of one image slice as far as I understood it. What I want is to manipulate the image in the radon space and then perform a filtered back projection. Typically the articles describe techniques to reduce metal artifacts by using one 2D Slice. Is it possible to achieve something like that with the JosephFilter? I?m guessing since this filter won?t work well for 2D I have to use another filter. Can you give me a hint if I can do something like that with RTK or another ITK-based framework? Here a diagram which shows an example what I want to try. I tried also to use my code with one slice and added a zero padding like that: typedef itk::ConstantPadImageFilter ConstantPadImageFilterType; ConstantPadImageFilterType::Pointer padFilter = ConstantPadImageFilterType::New(); padFilter->SetInput(inputImage); ImageType::SizeType extendRegion; extendRegion[0] = 0; extendRegion[1] = 0; extendRegion[2] = 0; padFilter->SetPadLowerBound(extendRegion); padFilter->SetPadUpperBound(extendRegion); padFilter->SetConstant(1); padFilter->Update(); But the result of my png is a black square. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com ] Im Auftrag von Simon Rit Gesendet: Freitag, 13. Mai 2016 18:15 An: Tobias Stein > Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto: simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein < tstein at stud.hs-heilbronn.de> Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 16 05:50:41 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 16 May 2016 11:50:41 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> Message-ID: Answers below. I think you need to understand better the coordinate system of an ITK image, maybe check ITK's doc. Simon On Sun, May 15, 2016 at 2:38 PM, Tobias Stein wrote: > If I understood you correct, the input of the Joseph-Filter needs to be > oriented in the y-direction when I am dealing with axial oriented slices. > Yes, or in other words, if you want to take projections around the axial axis, be aware that y is the default axis of rotation in RTK. > Now I changed the direction of the 3D Slice by rotating it 90 degrees > around the x-axis with the itk::ChangeInformationImageFilter to have my > slice in the xz-layer in the y-direction: > > double rotationX = 90; > > itk::Versor< double > rotation; > > const double angleInRadians = rotationX * vnl_math::pi / 180.0; > > rotation.SetRotationAroundX(angleInRadians); > > const ImageType::DirectionType direction = > inputImage->GetDirection(); > > const ImageType::DirectionType newDirection = direction * > rotation.GetMatrix(); > > changeFilter->SetOutputDirection(newDirection); > > changeFilter->ChangeAll(); > > changeFilter->SetInput(inputImage); > > changeFilter->UpdateOutputInformation(); > > > > Then I added a zero-border as you told me (This changed the size of my > region from [512, 512, 1] to [514, 514, 3]). > > While executing the Joseph Filter I got an error because a vector > subscript was out of range. Maybe that?s because the index of the region is > [-1,-1,-1] caused by the padding. > That should not have been a problem but that might be a bug... > I tried the padding after the Joseph Filter, and got a result which has a > size [514, 3, 45], while 45 was the number of projection images but the > image was still empty. > I guess you should check the origin of your projected volume and your projections. A simple test is to center your volume (check using ITK doc how you can define the origin so that (0,0,0) is at the center) and your projection (for the projection stack, only the first 2 coordinates count). > > > I also tried the Jospeh Filter with a real 3D volume stack of slices, > rotated it as described below and got a result. > > Now I am confused how I should create the geometry of the Joseph Filter to > get a good result. > > > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(300., 500., i * 180 / > NumberOfProjectionImages); > > > > I am trying to use a 180-degree rotation, but i don?t have the feeling for > the distance values. > > I this code example I used an 3D Image with dimensions = [256, 256, 49] > This doesn't tell you anything about the size of your volume, we also need the origin and the spacing. Look at the ITK doc to understand the ITK coordinate systems. > > > My idea was, since there is no way to get a result with a single 3D slice, > I would use a stack of slices as input and slice the output volume in > y-direction to get my sinogram as you said. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Samstag, 14. Mai 2016 12:17 > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > The output of the Joseph filter (of any forward projector) is a stack of > projection images, i.e., a 3D image. If you slice this 3D image in the z > direction, you get one projection images. If you slice this 3D image in the > y direction, you get a sinogram, e.g., the 2D sinogram of the central slice > (plane of the source trajectory) if y=0. The best way to have this sinogram > is to set size[1]=1 and there is no better way to do it in RTK. > > For zero-padding, you need to set extendRegion[?]=1, with (for all > dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that > your image is a black square, something else must be going on. One thing to > remember, the typical RTK rotation is around the y axis so your 3D slice > must be 1 in the y direction. A simple way to change the orientation of one > slice is to change its direction with ChangeImageFilter > > Simon > > > > > > On Sat, May 14, 2016 at 11:48 AM, Tobias Stein < > tstein at stud.hs-heilbronn.de> wrote: > > Hello Simon, > > > > Thanks for your advice so far. I?m getting to know this filter better. At > least I can now use it and save the result into a file. > > > > I updated my code which now uses a volume. > > The values of the input and output volume are equal except of the > z-dimension of the output which I changed to the number of projection > images. > > const unsigned int Dimension = 3; > > ?Reading image? > > ImageType::Pointer inputImage = reader->GetOutput(); > > ImageType::Pointer outputImage = ImageType::New(); > > > > RegionType inputRegion = inputImage->GetLargestPossibleRegion(); > > > > const unsigned int NumberOfProjectionImages = 45; > > > > ImageType::IndexType start; > > start[0] = inputRegion.GetIndex()[0]; > > start[1] = inputRegion.GetIndex()[1]; > > start[2] = inputRegion.GetIndex()[2]; > > > > RegionType::SizeType size; > > size[0] = inputRegion.GetSize()[0]; > > size[1] = inputRegion.GetSize()[1]; > > size[2] = NumberOfProjectionImages; > > > > RegionType region; > > region.SetSize(size); > > region.SetIndex(start); > > > > ImageType::SpacingType spacing; > > spacing[0] = inputImage->GetSpacing()[0]; > > spacing[1] = inputImage->GetSpacing()[1]; > > spacing[2] = inputImage->GetSpacing()[2]; > > > > ImageType::PointType origin; > > origin[0] = inputImage->GetOrigin()[0]; > > origin[1] = inputImage->GetOrigin()[1]; > > origin[2] = inputImage->GetOrigin()[2]; > > > > outputImage->SetRegions(region); > > outputImage->SetSpacing(spacing); > > outputImage->SetOrigin(origin); > > outputImage->Allocate(); > > outputImage->FillBuffer(size[0] * size[1] * size[2]); > > > > // Geometry > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(510., 510., i*8.); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->SetGeometry(geometry); > > forward->Update(); > > > > I?m not sure how I have to add projection for the geometry to get a result > which I?m familiar with. > > > > Can you describe how do I have to interpret the result of the > Joseph-Filter? I am familiar with sinograms and how they are computed, but > one sinogram is created by the projections of one image slice as far as I > understood it. What I want is to manipulate the image in the radon space > and then perform a filtered back projection. Typically the articles > describe techniques to reduce metal artifacts by using one 2D Slice. Is it > possible to achieve something like that with the JosephFilter? I?m guessing > since this filter won?t work well for 2D I have to use another filter. Can > you give me a hint if I can do something like that with RTK or another > ITK-based framework? Here a diagram > which shows an example what I want to try. > > > > I tried also to use my code with one slice and added a zero padding like > that: > > typedef itk::ConstantPadImageFilter > ConstantPadImageFilterType; > > ConstantPadImageFilterType::Pointer padFilter = > ConstantPadImageFilterType::New(); > > padFilter->SetInput(inputImage); > > > > ImageType::SizeType extendRegion; > > extendRegion[0] = 0; > > extendRegion[1] = 0; > > extendRegion[2] = 0; > > > > padFilter->SetPadLowerBound(extendRegion); > > padFilter->SetPadUpperBound(extendRegion); > > padFilter->SetConstant(1); > > padFilter->Update(); > > But the result of my png is a black square. > > Tobias > > > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Freitag, 13. Mai 2016 18:15 > > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > If you intialize the data of your itk::Image with FillBuffer with the > corresponding constant value, it is quite similar. The constant image value > allow us to stream the computation whereas you have to allocate the whole > image if you pass directly itk::Image. > > We only work in 3D and probably our projector don't work with 2D, that is > probably the problem here. You would have to correct the code for 2D but > that's a lot of work, we generally prefer pseudo 2D, see next point. > > I doubt that our forward projector will work well with one slice only if > you use 3D, we assume that the volume starts at the first pixel and ends at > the last pixel. You should probably add a zero border around with > itk::PadImage to see something. > > To avoid aliasing, you can cut frequencies in the ramp filter (look for > CutFrequency in the doxygen of rtk::FFTRampImageFilter). > > Simon > > > > On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: > > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Tue May 17 07:07:20 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Tue, 17 May 2016 16:37:20 +0530 Subject: [Rtk-users] Object isocenter shift Message-ID: Hello, As my previous thread caused some confusion, I am attaching an image showing the same in detail. As you can see my object center is not aligned with isocenter line. Besides it is offset by DX and DY values. In my case you can see the object center as red dot. Is there any method in RTK to nullify this offset effect? Will the rotation of turntable affect the reconstruction due to this offset? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: objectoffset.png Type: image/png Size: 12365 bytes Desc: not available URL: From cyril.mory at uclouvain.be Tue May 17 08:19:38 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Tue, 17 May 2016 14:19:38 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: <573B0C5A.4030001@uclouvain.be> Well, if it's just that, you should not worry about it : you cannot perfectly center your object, even if you try. And most objects (e.g. patients) do not even have a "center". So it does not make sense to struggle to have the center of the object perfectly match the isocenter of the acquisition device. You can either live with that (it is perfectly fine for most applications), or try one of these things: - If you can re-do the acquisition, you should try to have your object's center _roughly_ match the system's isocenter, because that's where you will have the least artifacts - Reconstruct your object as it is (it will work fine, unless there are other problems), but select the origin and size of your reconstructed volume carefully to have your object's center roughly at the center of your reconstructed volume. If you are not familiar with the exact definition of "origin", "spacing" and "size" of an itk::image, read section 4.1.4 of the ITK software guide (https://itk.org/ItkSoftwareGuide.pdf). This is both clear, short, and something extremely important to understand. I hope it helps, Cyril On 05/17/2016 01:07 PM, AMJAD N wrote: > Hello, > > As my previous thread caused some confusion, I am attaching an image > showing the same in detail. > > As you can see my object center is not aligned with isocenter line. > Besides it is offset by DX and DY values. In my case you can see the > object center as red dot. > > Is there any method in RTK to nullify this offset effect? > Will the rotation of turntable affect the reconstruction due to this > offset? > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From wuchao04 at gmail.com Tue May 17 09:24:58 2016 From: wuchao04 at gmail.com (Chao Wu) Date: Tue, 17 May 2016 15:24:58 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: There's nothing to correct or compensate for DURING reconstruction in your case. Where you put your object dose not change the geometry of the CT system at all. As long as the object is still inside FOV, a normal reconstruction will give you a correct result. In the resulting image, the origin is at the center of rotation, and the object is off-center by DX and DY, that's it. If you want the origin to be at the center of the object, you can shift it by DX/DY AFTER reconstruction. Regards, Chao 2016-05-17 13:07 GMT+02:00 AMJAD N : > Hello, > > As my previous thread caused some confusion, I am attaching an image > showing the same in detail. > > As you can see my object center is not aligned with isocenter line. > Besides it is offset by DX and DY values. In my case you can see the object > center as red dot. > > Is there any method in RTK to nullify this offset effect? > Will the rotation of turntable affect the reconstruction due to this > offset? > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shiraska at gmail.com Thu May 19 04:41:54 2016 From: shiraska at gmail.com (Shiras Abdurahman) Date: Thu, 19 May 2016 10:41:54 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction Message-ID: Dear all, I am trying to simulate Tomosynthesis reconstruction with stationary flat panel detector where source rotates around Y axis to acquire 21 projections (system geometry diagram is attached). Geometry file geometry.xml is generated with Reg23ProjectionGeometry. I generated projection images of a cube volume and then I tried to reconstruct with FDK algorithm. Even though I am able to generate projections, FDK reconstruction yields the volume with all voxel values zero. The commands I used for generating projections and reconstructing volume are rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 --dimension=256,256,256 --hardware=cuda I am also attaching geometry xml file, mhd header files of the original volume, projections and reconstructed volume. With regards, Shiras -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: geometry.xml Type: text/xml Size: 11889 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fdk.mhd Type: application/octet-stream Size: 322 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: projections.mhd Type: application/octet-stream Size: 335 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: volume.mhd Type: application/octet-stream Size: 355 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: system_geometry.PNG Type: image/png Size: 50006 bytes Desc: not available URL: From cyril.mory at uclouvain.be Fri May 20 04:38:22 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Fri, 20 May 2016 10:38:22 +0200 Subject: [Rtk-users] Compiler RTK In-Reply-To: <573E430F.5030704@uclouvain.be> References: <573E430F.5030704@uclouvain.be> Message-ID: <573ECCFE.3070500@uclouvain.be> Hi Kevin, I'm replying to the RTK users mailing list. Next time, please send your questions to this list instead of just me (except when it specifically involves reggui, for example). I have tried to reproduce the error but the compilation runs fine on my machine. Can you send information on your compiler ? Maybe someone else on the list can help ? Cyril On 05/20/2016 12:49 AM, Kevin Souris wrote: > Bonjour, > > Je viens de t?l?charger la derni?re version de RTK sur Github. > J'essaye maintenant de compiler sur une machine linux et j'obtiens > cette erreur: > > /home/pen/RTK/RTK-master/applications/rtkprojections/rtkprojections.cxx: > In function ?int main(int, char**)?: > /home/pen/RTK/RTK-master/applications/rtkprojections*/**rtkprojections.cxx:27: > error: invalid conversion from ?const char*? to ?char*?* > /home/pen/RTK/RTK-master/applications/rtkprojections/rtkprojections.cxx:27: > error: initializing argument 1 of ?int > cmdline_parser_rtkprojections_config_file(char*, > args_info_rtkprojections*, cmdline_parser_rtkprojections_params*)? > > Comment puis-je r?parer ?a ? > Merci > > Kevin > > > > > -- > Kevin Souris, PhD student > Universit? catholique de Louvain > Molecular Imagery, Radiotherapy and Oncology (MIRO) -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 25 15:45:57 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 25 May 2016 21:45:57 +0200 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Hi Solomon, I had still to look into this on my todo list. I did again but now I think I overlooked something in your email. You say that going through ChangeInformationImageFilter might be the problem. But now, I wonder if the problem is not that the origin that you set is wrong and then the volume or the projections are completely off (hence the projections). So, here is my question : what happens if you replace filter -> SetOutputOrigin(origin); with filter -> SetOutputOrigin(image->GetOutputOrigin()); Of course, it's not what you want to do but it might point to a wrong choice of origin... Simon On Fri, May 6, 2016 at 1:45 AM, Solomon Tang wrote: > Hi Simon, > > I added the line as you suggested and it does not change the output (still > blank). Sorry for the delayed response. > > Thanks for looking into it! > > On Wed, May 4, 2016 at 12:16 AM, Simon Rit > wrote: > >> Dear Solomon, >> Thanks for the report. It looks like a bug to me. I checked and >> itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in >> the itkGPUImage and the itkCudaImage, this function does not check >> consistency between CPU and GPU data. I'll work on a minimal example to >> check this but can you test that your problem is solved if you add >> m_DataManager->UpdateCPUBuffer(); >> before >> m_DataManager->SetGPUBufferDirty(); >> in itkCudaImage.h line 121? >> Thanks, >> Simon >> >> On Mon, May 2, 2016 at 10:42 PM, Solomon Tang >> wrote: >> >>> Thanks for the tip Simon, >>> >>> I think I may have figured it out. I initially read as a CUDA Image, and >>> then passed the CUDA image through ChangeInformationImageFilter to change >>> the offset of the image. >>> >>> template >>> typename itk::CudaImage::Pointer ShiftOffset( >>> const typename itk::CudaImage::Pointer image, >>> const typename itk::Image::PointType origin) >>> { >>> typedef itk::ChangeInformationImageFilter< itk::CudaImage > >>> FilterType; >>> FilterType::Pointer filter = FilterType::New(); >>> filter -> SetInput(image); >>> filter -> SetOutputOrigin(origin); >>> filter -> ChangeOriginOn(); >>> filter -> UpdateOutputInformation(); >>> filter -> Update(); >>> return filter->GetOutput(); >>> } >>> >>> If I pass the offset image pointer to ForwardProjection, it outputs a >>> blank image. >>> >>> However, when I write the offset image and then read it again as a CUDA >>> image, then the ForwardProjection works as intended. Perhaps using the CUDA >>> version of ITK would fix this. >>> >>> >>> On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < >>> simon.rit at creatis.insa-lyon.fr> wrote: >>> >>>> Hi Solomon, >>>> Hard to say without the full code. Maybe the cudaness of your output >>>> image is lost further in the code. Try accessing the CPU buffer at the end, >>>> after the update, to be sure that the GPU image is transferred to CPU, e.g. >>>> std::cout << forwardProjection->GetOutput()->GetPointer() <>>> Simon >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 26 12:04:47 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 26 May 2016 18:04:47 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Hi Shiras, I generated a volume to look at your problem: rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 --offset 0,0,1.7 Then I obtained the same issue as you. I think the problem is that rtkfdk is meant for circular CBCT and it includes pre-weighting for displaced detector and short scan. I'm not sure why you don't get a warning but these are probably responsible for the blank output. A simple solution is to do only the 3 FDK steps using in order the command tools: rtktwodweights rtkramp rtkbackprojections You can also try to shunt the preweighting by modifying rtkfdk.cxx. It's interesting that you try out tomosynthesis but you'll encounter some problem. When I ran the above commands, I get very weird results because the first and the last projections get a lot more weight than the others since it looks at the angular weight with the previous and the next projections. A simple solution is to blank out these two projections. Good luck and keep us posted if you get interesting results, Simon On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman wrote: > Dear all, > > I am trying to simulate Tomosynthesis reconstruction with stationary flat > panel detector where source rotates around Y axis to acquire 21 projections > (system geometry diagram is attached). Geometry file geometry.xml is > generated with Reg23ProjectionGeometry. I generated projection images of > a cube volume and then I tried to reconstruct with FDK algorithm. Even > though I am able to generate projections, FDK reconstruction yields the > volume with all voxel values zero. The commands I used for generating > projections and reconstructing volume are > > rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd > --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast > rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml > --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 > --dimension=256,256,256 --hardware=cuda > > I am also attaching geometry xml file, mhd header files of the original > volume, projections and reconstructed volume. > > With regards, > Shiras > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shiraska at gmail.com Fri May 27 11:31:52 2016 From: shiraska at gmail.com (Shiras Abdurahman) Date: Fri, 27 May 2016 17:31:52 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Dear Simon, Thank you very much for the reply. I tried to reconstruct with only ramp filtering and back projection and the results are looking good without any weighting of the projections. I also reconstructed the volume with rtksart with 10 iterations and the results are better than rtkfdk. With these experiments, I also confirmed that my geometry file is accurate. Thank you very much for your help. With regards, Shiras On Thu, May 26, 2016 at 6:04 PM, Simon Rit wrote: > Hi Shiras, > I generated a volume to look at your problem: > rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 > --offset 0,0,1.7 > Then I obtained the same issue as you. I think the problem is that rtkfdk > is meant for circular CBCT and it includes pre-weighting for displaced > detector and short scan. I'm not sure why you don't get a warning but these > are probably responsible for the blank output. A simple solution is to do > only the 3 FDK steps using in order the command tools: > rtktwodweights > rtkramp > rtkbackprojections > You can also try to shunt the preweighting by modifying rtkfdk.cxx. > > It's interesting that you try out tomosynthesis but you'll encounter some > problem. When I ran the above commands, I get very weird results because > the first and the last projections get a lot more weight than the others > since it looks at the angular weight with the previous and the next > projections. A simple solution is to blank out these two projections. > Good luck and keep us posted if you get interesting results, > Simon > > On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman > wrote: > >> Dear all, >> >> I am trying to simulate Tomosynthesis reconstruction with stationary flat >> panel detector where source rotates around Y axis to acquire 21 projections >> (system geometry diagram is attached). Geometry file geometry.xml is >> generated with Reg23ProjectionGeometry. I generated projection images of >> a cube volume and then I tried to reconstruct with FDK algorithm. Even >> though I am able to generate projections, FDK reconstruction yields the >> volume with all voxel values zero. The commands I used for generating >> projections and reconstructing volume are >> >> rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd >> --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast >> rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml >> --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 >> --dimension=256,256,256 --hardware=cuda >> >> I am also attaching geometry xml file, mhd header files of the original >> volume, projections and reconstructed volume. >> >> With regards, >> Shiras >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 27 12:00:56 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 27 May 2016 18:00:56 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Indeed, the angular weighting resulting from the discretization of the back projection occurs in rtkfdktwodweights so skipping this might help. Simon On 27 May 2016 5:32 p.m., "Shiras Abdurahman" wrote: Dear Simon, Thank you very much for the reply. I tried to reconstruct with only ramp filtering and back projection and the results are looking good without any weighting of the projections. I also reconstructed the volume with rtksart with 10 iterations and the results are better than rtkfdk. With these experiments, I also confirmed that my geometry file is accurate. Thank you very much for your help. With regards, Shiras On Thu, May 26, 2016 at 6:04 PM, Simon Rit wrote: > Hi Shiras, > I generated a volume to look at your problem: > rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 > --offset 0,0,1.7 > Then I obtained the same issue as you. I think the problem is that rtkfdk > is meant for circular CBCT and it includes pre-weighting for displaced > detector and short scan. I'm not sure why you don't get a warning but these > are probably responsible for the blank output. A simple solution is to do > only the 3 FDK steps using in order the command tools: > rtktwodweights > rtkramp > rtkbackprojections > You can also try to shunt the preweighting by modifying rtkfdk.cxx. > > It's interesting that you try out tomosynthesis but you'll encounter some > problem. When I ran the above commands, I get very weird results because > the first and the last projections get a lot more weight than the others > since it looks at the angular weight with the previous and the next > projections. A simple solution is to blank out these two projections. > Good luck and keep us posted if you get interesting results, > Simon > > On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman > wrote: > >> Dear all, >> >> I am trying to simulate Tomosynthesis reconstruction with stationary flat >> panel detector where source rotates around Y axis to acquire 21 projections >> (system geometry diagram is attached). Geometry file geometry.xml is >> generated with Reg23ProjectionGeometry. I generated projection images of >> a cube volume and then I tried to reconstruct with FDK algorithm. Even >> though I am able to generate projections, FDK reconstruction yields the >> volume with all voxel values zero. The commands I used for generating >> projections and reconstructing volume are >> >> rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd >> --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast >> rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml >> --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 >> --dimension=256,256,256 --hardware=cuda >> >> I am also attaching geometry xml file, mhd header files of the original >> volume, projections and reconstructed volume. >> >> With regards, >> Shiras >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 31 12:02:32 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 31 May 2016 18:02:32 +0200 Subject: [Rtk-users] Rooster In-Reply-To: References: Message-ID: Hi Guillaume, I'm adding RTK user list to this conversation, it's better to have these conversations on the mailing list IMO. Can you tell us what's the volume size and the GPU? Cyril is ROOSTER's dev, maybe he could comment on recon times. Simon On Tue, May 31, 2016 at 5:29 PM, wrote: > Hi Simon, > > I tried the rooster recon. I used the parameters from the example page. The results looks rather nice but it took several hours to run (5-6). Its a big dataset of about 2000 256x256 projections. > > Guillaume From G.Landry at physik.uni-muenchen.de Tue May 31 13:48:28 2016 From: G.Landry at physik.uni-muenchen.de (G.Landry at physik.uni-muenchen.de) Date: Tue, 31 May 2016 19:48:28 +0200 Subject: [Rtk-users] Rooster In-Reply-To: References: Message-ID: <20160531194828.Horde.Im1irUOnkCrL1p8oGSue_A5@webmail.physik.lmu.de> Hi Simon, Thanks for mailing list suggestion. My initial question was about typical reconstruction times for rtkfourdrooster. What I tried is summarized below: -Volume size was 410 410 264 and could be easily reduced by a good margin. -The GPU is quadro M4000 with 8GB -about 2300 256x256 projections with shifted elekta panel (so called M20) -10 phases -for the motion mask at the moment I just used the FOV mask for first try. --gamma_time 0.0001 --gamma_space 0.0001 - spacing 1 1 1 --niter 30 --cgiter 4 --tviter 10 Recon time was about 5-6 hours. I saw about 4 Gb used on the card. The image looked nice, albeit with the TV "feel/plastic-y". Thanks for your feedback Guillaume Quoting Simon Rit : > Hi Guillaume, > I'm adding RTK user list to this conversation, it's better to have > these conversations on the mailing list IMO. Can you tell us what's > the volume size and the GPU? > Cyril is ROOSTER's dev, maybe he could comment on recon times. > Simon > > On Tue, May 31, 2016 at 5:29 PM, wrote: >> Hi Simon, >> >> I tried the rooster recon. I used the parameters from the example >> page. The results looks rather nice but it took several hours to >> run (5-6). Its a big dataset of about 2000 256x256 projections. >> >> Guillaume -- Dr. Guillaume Landry Ludwig Maximilians University (LMU) Munich Medical Physics Am Coulombwall 1 85748 Garching Tel:+49 (0) 89 289-14077 Fax:+49 (0) 89 289-14072 From solomoncztang at gmail.com Mon May 2 16:42:44 2016 From: solomoncztang at gmail.com (Solomon Tang) Date: Mon, 2 May 2016 13:42:44 -0700 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Thanks for the tip Simon, I think I may have figured it out. I initially read as a CUDA Image, and then passed the CUDA image through ChangeInformationImageFilter to change the offset of the image. template typename itk::CudaImage::Pointer ShiftOffset( const typename itk::CudaImage::Pointer image, const typename itk::Image::PointType origin) { typedef itk::ChangeInformationImageFilter< itk::CudaImage > FilterType; FilterType::Pointer filter = FilterType::New(); filter -> SetInput(image); filter -> SetOutputOrigin(origin); filter -> ChangeOriginOn(); filter -> UpdateOutputInformation(); filter -> Update(); return filter->GetOutput(); } If I pass the offset image pointer to ForwardProjection, it outputs a blank image. However, when I write the offset image and then read it again as a CUDA image, then the ForwardProjection works as intended. Perhaps using the CUDA version of ITK would fix this. On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit wrote: > Hi Solomon, > Hard to say without the full code. Maybe the cudaness of your output image > is lost further in the code. Try accessing the CPU buffer at the end, after > the update, to be sure that the GPU image is transferred to CPU, e.g. > std::cout << forwardProjection->GetOutput()->GetPointer() < Simon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Tue May 3 18:59:03 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Wed, 4 May 2016 00:59:03 +0200 Subject: [Rtk-users] forward and back projection - MITK Message-ID: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I've seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I've also seen the test for this class but I don't get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I've got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 4 03:02:05 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 4 May 2016 09:02:05 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Message-ID: Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein wrote: > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 4 03:16:33 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 4 May 2016 09:16:33 +0200 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Dear Solomon, Thanks for the report. It looks like a bug to me. I checked and itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in the itkGPUImage and the itkCudaImage, this function does not check consistency between CPU and GPU data. I'll work on a minimal example to check this but can you test that your problem is solved if you add m_DataManager->UpdateCPUBuffer(); before m_DataManager->SetGPUBufferDirty(); in itkCudaImage.h line 121? Thanks, Simon On Mon, May 2, 2016 at 10:42 PM, Solomon Tang wrote: > Thanks for the tip Simon, > > I think I may have figured it out. I initially read as a CUDA Image, and > then passed the CUDA image through ChangeInformationImageFilter to change > the offset of the image. > > template > typename itk::CudaImage::Pointer ShiftOffset( > const typename itk::CudaImage::Pointer image, > const typename itk::Image::PointType origin) > { > typedef itk::ChangeInformationImageFilter< itk::CudaImage > > FilterType; > FilterType::Pointer filter = FilterType::New(); > filter -> SetInput(image); > filter -> SetOutputOrigin(origin); > filter -> ChangeOriginOn(); > filter -> UpdateOutputInformation(); > filter -> Update(); > return filter->GetOutput(); > } > > If I pass the offset image pointer to ForwardProjection, it outputs a > blank image. > > However, when I write the offset image and then read it again as a CUDA > image, then the ForwardProjection works as intended. Perhaps using the CUDA > version of ITK would fix this. > > > On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < > simon.rit at creatis.insa-lyon.fr> wrote: > >> Hi Solomon, >> Hard to say without the full code. Maybe the cudaness of your output >> image is lost further in the code. Try accessing the CPU buffer at the end, >> after the update, to be sure that the GPU image is transferred to CPU, e.g. >> std::cout << forwardProjection->GetOutput()->GetPointer() <> Simon >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Wed May 4 05:04:28 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Wed, 4 May 2016 14:34:28 +0530 Subject: [Rtk-users] Reconstructed Slice save as tiff Message-ID: Hi all, I have wrote code for saving output volume stack as *.tiff. Currently I am getting output of XY axis. What should I do in order to get the other axes. My code is shown below. typedef itk::StreamingImageFilter StreamerType; StreamerType::Pointer streamerBP = StreamerType::New(); streamerBP->SetInput(feldkampCUDA->GetOutput()); streamerBP->SetNumberOfStreamDivisions(8); typedef itk::Image< float, 2 > Image2DType; typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; WriterType::Pointer writer = WriterType::New(); writer->SetInput(streamerBP->GetOutput()); typedef itk::NumericSeriesFileNames NameGeneratorType; NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); nameGenerator->SetStartIndex(0); nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the Z-axis value of //reconstructed volume nameGenerator->SetIncrementIndex(1); writer->SetFileNames(nameGenerator->GetFileNames()); writer->SetUseCompression(true); writer->Update(); PS: My reconstruction works fine. Thanks and Regards AMJAD N -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyril.mory at uclouvain.be Wed May 4 07:27:24 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Wed, 4 May 2016 13:27:24 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: References: Message-ID: <5729DC9C.10105@uclouvain.be> Hi Amjad, You can use an ITK extract filter to extract a region that corresponds to one of your slices (along the axis you want). The output of the extract filter will be 3D, so you will need to cast it into a 2D images using an ITK cast filter. Cyril On 05/04/2016 11:04 AM, AMJAD N wrote: > Hi all, > > I have wrote code for saving output volume stack as *.tiff. Currently > I am getting output of XY axis. What should I do in order to get the > other axes. > My code is shown below. > > typedef itk::StreamingImageFilter FloatImageType> StreamerType; > StreamerType::Pointer streamerBP = StreamerType::New(); > streamerBP->SetInput(feldkampCUDA->GetOutput()); > streamerBP->SetNumberOfStreamDivisions(8); > > typedef itk::Image< float, 2 > Image2DType; > typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; > WriterType::Pointer writer = WriterType::New(); > writer->SetInput(streamerBP->GetOutput()); > > typedef itk::NumericSeriesFileNames NameGeneratorType; > NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); > nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); > nameGenerator->SetStartIndex(0); > nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the > Z-axis value of //reconstructed volume > nameGenerator->SetIncrementIndex(1); > writer->SetFileNames(nameGenerator->GetFileNames()); > writer->SetUseCompression(true); > writer->Update(); > > PS: My reconstruction works fine. > > Thanks and Regards > > AMJAD N > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From wuchao04 at gmail.com Wed May 4 08:44:37 2016 From: wuchao04 at gmail.com (Chao Wu) Date: Wed, 4 May 2016 14:44:37 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: <5729DC9C.10105@uclouvain.be> References: <5729DC9C.10105@uclouvain.be> Message-ID: A small add-on (copied from ITK document): ExtractImageFilter also collapses dimensions so that the input image may have more dimensions than the output image (i.e. 4-D input image to a 3-D output image). To specify what dimensions to collapse, the ExtractionRegion must be specified. For any dimension dim where ExtractionRegion.Size[dim] = 0, that dimension is collapsed. The index to collapse on is specified by ExtractionRegion.Index[dim]. For example, we have a image 4D = a 4x4x4x4 image, and we want to get a 3D image, 3D = a 4x4x4 image, specified as [x,y,z,2] from 4D (i.e. the 3rd "time" slice from 4D). The ExtractionRegion.Size = [4,4,4,0] and ExtractionRegion.Index = [0,0,0,2]. Regards, Chao 2016-05-04 13:27 GMT+02:00 Cyril Mory : > Hi Amjad, > > You can use an ITK extract filter to extract a region that corresponds to > one of your slices (along the axis you want). The output of the extract > filter will be 3D, so you will need to cast it into a 2D images using an > ITK cast filter. > > Cyril > > > On 05/04/2016 11:04 AM, AMJAD N wrote: > > Hi all, > > I have wrote code for saving output volume stack as *.tiff. Currently I am > getting output of XY axis. What should I do in order to get the other axes. > My code is shown below. > > typedef itk::StreamingImageFilter > StreamerType; > StreamerType::Pointer streamerBP = StreamerType::New(); > streamerBP->SetInput(feldkampCUDA->GetOutput()); > streamerBP->SetNumberOfStreamDivisions(8); > > typedef itk::Image< float, 2 > Image2DType; > typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; > WriterType::Pointer writer = WriterType::New(); > writer->SetInput(streamerBP->GetOutput()); > > typedef itk::NumericSeriesFileNames NameGeneratorType; > NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); > nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); > nameGenerator->SetStartIndex(0); > nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the > Z-axis value of //reconstructed volume > nameGenerator->SetIncrementIndex(1); > writer->SetFileNames(nameGenerator->GetFileNames()); > writer->SetUseCompression(true); > writer->Update(); > > PS: My reconstruction works fine. > > Thanks and Regards > > AMJAD N > > > > _______________________________________________ > Rtk-users mailing listRtk-users at public.kitware.comhttp://public.kitware.com/mailman/listinfo/rtk-users > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyril.mory at uclouvain.be Wed May 4 08:56:14 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Wed, 4 May 2016 14:56:14 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: References: <5729DC9C.10105@uclouvain.be> Message-ID: <5729F16E.5020402@uclouvain.be> Thanks Chao Wu, You're right, I was mistaken : the cast filter is not required in this case. It is needed, on the other hand, to increase the dimension of an image. So in this case, Amjad, you don't need it. Cyril On 05/04/2016 02:44 PM, Chao Wu wrote: > A small add-on (copied from ITK document): > > ExtractImageFilter also collapses dimensions so that the input image > may have more dimensions than the output image (i.e. 4-D input image > to a 3-D output image). To specify what dimensions to collapse, the > ExtractionRegion must be specified. For any dimension dim where > ExtractionRegion.Size[dim] = 0, that dimension is collapsed. The index > to collapse on is specified by ExtractionRegion.Index[dim]. For > example, we have a image 4D = a 4x4x4x4 image, and we want to get a 3D > image, 3D = a 4x4x4 image, specified as [x,y,z,2] from 4D (i.e. the > 3rd "time" slice from 4D). The ExtractionRegion.Size = [4,4,4,0] and > ExtractionRegion.Index = [0,0,0,2]. > > Regards, > Chao > > 2016-05-04 13:27 GMT+02:00 Cyril Mory >: > > Hi Amjad, > > You can use an ITK extract filter to extract a region that > corresponds to one of your slices (along the axis you want). The > output of the extract filter will be 3D, so you will need to cast > it into a 2D images using an ITK cast filter. > > Cyril > > > On 05/04/2016 11:04 AM, AMJAD N wrote: >> Hi all, >> >> I have wrote code for saving output volume stack as *.tiff. >> Currently I am getting output of XY axis. What should I do in >> order to get the other axes. >> My code is shown below. >> >> typedef itk::StreamingImageFilter> FloatImageType> StreamerType; >> StreamerType::Pointer streamerBP = StreamerType::New(); >> streamerBP->SetInput(feldkampCUDA->GetOutput()); >> streamerBP->SetNumberOfStreamDivisions(8); >> >> typedef itk::Image< float, 2 > Image2DType; >> typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > >> WriterType; >> WriterType::Pointer writer = WriterType::New(); >> writer->SetInput(streamerBP->GetOutput()); >> >> typedef itk::NumericSeriesFileNames NameGeneratorType; >> NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); >> nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); >> nameGenerator->SetStartIndex(0); >> nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] >> is the Z-axis value of //reconstructed volume >> nameGenerator->SetIncrementIndex(1); >> writer->SetFileNames(nameGenerator->GetFileNames()); >> writer->SetUseCompression(true); >> writer->Update(); >> >> PS: My reconstruction works fine. >> >> Thanks and Regards >> >> AMJAD N >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From solomoncztang at gmail.com Thu May 5 19:45:43 2016 From: solomoncztang at gmail.com (Solomon Tang) Date: Thu, 5 May 2016 16:45:43 -0700 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Hi Simon, I added the line as you suggested and it does not change the output (still blank). Sorry for the delayed response. Thanks for looking into it! On Wed, May 4, 2016 at 12:16 AM, Simon Rit wrote: > Dear Solomon, > Thanks for the report. It looks like a bug to me. I checked and > itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in > the itkGPUImage and the itkCudaImage, this function does not check > consistency between CPU and GPU data. I'll work on a minimal example to > check this but can you test that your problem is solved if you add > m_DataManager->UpdateCPUBuffer(); > before > m_DataManager->SetGPUBufferDirty(); > in itkCudaImage.h line 121? > Thanks, > Simon > > On Mon, May 2, 2016 at 10:42 PM, Solomon Tang > wrote: > >> Thanks for the tip Simon, >> >> I think I may have figured it out. I initially read as a CUDA Image, and >> then passed the CUDA image through ChangeInformationImageFilter to change >> the offset of the image. >> >> template >> typename itk::CudaImage::Pointer ShiftOffset( >> const typename itk::CudaImage::Pointer image, >> const typename itk::Image::PointType origin) >> { >> typedef itk::ChangeInformationImageFilter< itk::CudaImage > >> FilterType; >> FilterType::Pointer filter = FilterType::New(); >> filter -> SetInput(image); >> filter -> SetOutputOrigin(origin); >> filter -> ChangeOriginOn(); >> filter -> UpdateOutputInformation(); >> filter -> Update(); >> return filter->GetOutput(); >> } >> >> If I pass the offset image pointer to ForwardProjection, it outputs a >> blank image. >> >> However, when I write the offset image and then read it again as a CUDA >> image, then the ForwardProjection works as intended. Perhaps using the CUDA >> version of ITK would fix this. >> >> >> On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < >> simon.rit at creatis.insa-lyon.fr> wrote: >> >>> Hi Solomon, >>> Hard to say without the full code. Maybe the cudaness of your output >>> image is lost further in the code. Try accessing the CPU buffer at the end, >>> after the update, to be sure that the GPU image is transferred to CPU, e.g. >>> std::cout << forwardProjection->GetOutput()->GetPointer() <>> Simon >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 10 01:29:44 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 10 May 2016 07:29:44 +0200 Subject: [Rtk-users] Cmake build error help In-Reply-To: References: Message-ID: <573171C8.80400@creatis.insa-lyon.fr> Hi, Can you update GetGitRevisionDescription.cmake and GetGitRevisionDescription.cmake.in from https://github.com/rpavlik/cmake-modules and see if the new versions fix this issue? Thanks, Simon PS: plead keep using the mailing list On 10/05/2016 03:09, Solomon Tang wrote: > Hi Simon, > > I am rebuilding RTK after moving to Visual Studio 2015 with cmake > 3.5.2 and am running into the following error: > > CMake Error at build/applications/CMakeFiles/git-data/grabRef.cmake:36 > (file): > file failed to open for reading (No such file or directory): > > C:/Work/Tools/Current/RTK-1.2.0/build/applications/CMakeFiles/git-data/head-ref > Call Stack (most recent call first): > cmake/GetGitRevisionDescription.cmake:77 (include) > applications/CMakeLists.txt:5 (get_git_head_revision) > > I am using ITK 4.9.0 and fresh download of RTK 1.2.0. > > How do I resolve this issue? > > Thanks again, > > Solomon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Thu May 12 00:12:17 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Thu, 12 May 2016 09:42:17 +0530 Subject: [Rtk-users] Reconstruction Volume. Message-ID: Hello users, I have successfully implemented CBCT reconstruction using both CUDA and CPU method. For finding the reconstruction volume size, I measured the actual object size. divided by respective axis number of pixels to get spacing. eg: If my object is 10x15x20 cm. I measure that dimensions. If the required volume is 500x600x700 px, to get spacing i used 10/500,15/600,20/700. But this is not practically possible for every object. Is there any way to find the reconstruction volume spacing other than doing the above method. I have SDD(Source Detector Distance), SID(Source Isocenter Distance), Detector physical size,pixel density. Thanks and Regards AMJAD N -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 12 01:31:51 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 12 May 2016 07:31:51 +0200 Subject: [Rtk-users] Reconstruction Volume. In-Reply-To: References: Message-ID: Hi, The typical solution (e.g., in clincial scanners) is to reconstruct the field-of-view of the scanner (every point in space that is seen by all source positions) because you know this is the only area of space where your reconstruction is going to be accurate. rtkfieldofview generates this FOV. Simon On Thu, May 12, 2016 at 6:12 AM, AMJAD N wrote: > Hello users, > > I have successfully implemented CBCT reconstruction using both CUDA and > CPU method. For finding the reconstruction volume size, I measured the > actual object size. divided by respective axis number of pixels to get > spacing. > > eg: If my object is 10x15x20 cm. I measure that dimensions. If the > required volume is 500x600x700 px, to get spacing i used > 10/500,15/600,20/700. > > But this is not practically possible for every object. Is there any way to > find the reconstruction volume spacing other than doing the above method. > > I have SDD(Source Detector Distance), SID(Source Isocenter Distance), > Detector physical size,pixel density. > > Thanks and Regards > > AMJAD N > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Fri May 13 04:30:33 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Fri, 13 May 2016 14:00:33 +0530 Subject: [Rtk-users] Object isocenter shift Message-ID: Hello users, During acquisition it is found that my object isocenter is shifted from turntable isocenter by DX and DY values. Source , turntable isocenter and detector center is aligned perfectly. Is there any method in RTK we can make use of to nullify the effect due to this isocenter shift? Thanks and Regards AMJAD -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 13 08:36:48 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 13 May 2016 14:36:48 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: Hi, I don't understand the question. The isocenter is by definition the center of rotation in RTK and we assume it's at the origin of the reconstructed volume. There is no such thing as an "object isocenter". DX and DY values are the shift of the projection origin (which can be anywhere) with respect to the central ray (source to isocenter ray). It is not the turntable isocenter. If you want to have dx=0 and dy=0, the projection origin must be changed. But it has to be constant for the whole projection stack. I hope it helps, Simon On Fri, May 13, 2016 at 10:30 AM, AMJAD N wrote: > Hello users, > During acquisition it is found that my object isocenter is shifted from > turntable isocenter by DX and DY values. Source , turntable isocenter and > detector center is aligned perfectly. Is there any method in RTK we can > make use of to nullify the effect due to this isocenter shift? > > Thanks and Regards > AMJAD > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Fri May 13 11:35:57 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Fri, 13 May 2016 17:35:57 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Message-ID: <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 13 12:15:09 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 13 May 2016 18:15:09 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Message-ID: Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein wrote: > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Sat May 14 05:48:01 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Sat, 14 May 2016 11:48:01 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Message-ID: <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Hello Simon, Thanks for your advice so far. I?m getting to know this filter better. At least I can now use it and save the result into a file. I updated my code which now uses a volume. The values of the input and output volume are equal except of the z-dimension of the output which I changed to the number of projection images. const unsigned int Dimension = 3; ?Reading image? ImageType::Pointer inputImage = reader->GetOutput(); ImageType::Pointer outputImage = ImageType::New(); RegionType inputRegion = inputImage->GetLargestPossibleRegion(); const unsigned int NumberOfProjectionImages = 45; ImageType::IndexType start; start[0] = inputRegion.GetIndex()[0]; start[1] = inputRegion.GetIndex()[1]; start[2] = inputRegion.GetIndex()[2]; RegionType::SizeType size; size[0] = inputRegion.GetSize()[0]; size[1] = inputRegion.GetSize()[1]; size[2] = NumberOfProjectionImages; RegionType region; region.SetSize(size); region.SetIndex(start); ImageType::SpacingType spacing; spacing[0] = inputImage->GetSpacing()[0]; spacing[1] = inputImage->GetSpacing()[1]; spacing[2] = inputImage->GetSpacing()[2]; ImageType::PointType origin; origin[0] = inputImage->GetOrigin()[0]; origin[1] = inputImage->GetOrigin()[1]; origin[2] = inputImage->GetOrigin()[2]; outputImage->SetRegions(region); outputImage->SetSpacing(spacing); outputImage->SetOrigin(origin); outputImage->Allocate(); outputImage->FillBuffer(size[0] * size[1] * size[2]); // Geometry typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(510., 510., i*8.); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->SetGeometry(geometry); forward->Update(); I?m not sure how I have to add projection for the geometry to get a result which I?m familiar with. Can you describe how do I have to interpret the result of the Joseph-Filter? I am familiar with sinograms and how they are computed, but one sinogram is created by the projections of one image slice as far as I understood it. What I want is to manipulate the image in the radon space and then perform a filtered back projection. Typically the articles describe techniques to reduce metal artifacts by using one 2D Slice. Is it possible to achieve something like that with the JosephFilter? I?m guessing since this filter won?t work well for 2D I have to use another filter. Can you give me a hint if I can do something like that with RTK or another ITK-based framework? Here a diagram which shows an example what I want to try. I tried also to use my code with one slice and added a zero padding like that: typedef itk::ConstantPadImageFilter ConstantPadImageFilterType; ConstantPadImageFilterType::Pointer padFilter = ConstantPadImageFilterType::New(); padFilter->SetInput(inputImage); ImageType::SizeType extendRegion; extendRegion[0] = 0; extendRegion[1] = 0; extendRegion[2] = 0; padFilter->SetPadLowerBound(extendRegion); padFilter->SetPadUpperBound(extendRegion); padFilter->SetConstant(1); padFilter->Update(); But the result of my png is a black square. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Freitag, 13. Mai 2016 18:15 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto: simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein < tstein at stud.hs-heilbronn.de> Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Sat May 14 06:17:18 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sat, 14 May 2016 12:17:18 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Message-ID: The output of the Joseph filter (of any forward projector) is a stack of projection images, i.e., a 3D image. If you slice this 3D image in the z direction, you get one projection images. If you slice this 3D image in the y direction, you get a sinogram, e.g., the 2D sinogram of the central slice (plane of the source trajectory) if y=0. The best way to have this sinogram is to set size[1]=1 and there is no better way to do it in RTK. For zero-padding, you need to set extendRegion[?]=1, with (for all dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that your image is a black square, something else must be going on. One thing to remember, the typical RTK rotation is around the y axis so your 3D slice must be 1 in the y direction. A simple way to change the orientation of one slice is to change its direction with ChangeImageFilter Simon On Sat, May 14, 2016 at 11:48 AM, Tobias Stein wrote: > Hello Simon, > > > > Thanks for your advice so far. I?m getting to know this filter better. At > least I can now use it and save the result into a file. > > > > I updated my code which now uses a volume. > > The values of the input and output volume are equal except of the > z-dimension of the output which I changed to the number of projection > images. > > const unsigned int Dimension = 3; > > ?Reading image? > > ImageType::Pointer inputImage = reader->GetOutput(); > > ImageType::Pointer outputImage = ImageType::New(); > > > > RegionType inputRegion = inputImage->GetLargestPossibleRegion(); > > > > const unsigned int NumberOfProjectionImages = 45; > > > > ImageType::IndexType start; > > start[0] = inputRegion.GetIndex()[0]; > > start[1] = inputRegion.GetIndex()[1]; > > start[2] = inputRegion.GetIndex()[2]; > > > > RegionType::SizeType size; > > size[0] = inputRegion.GetSize()[0]; > > size[1] = inputRegion.GetSize()[1]; > > size[2] = NumberOfProjectionImages; > > > > RegionType region; > > region.SetSize(size); > > region.SetIndex(start); > > > > ImageType::SpacingType spacing; > > spacing[0] = inputImage->GetSpacing()[0]; > > spacing[1] = inputImage->GetSpacing()[1]; > > spacing[2] = inputImage->GetSpacing()[2]; > > > > ImageType::PointType origin; > > origin[0] = inputImage->GetOrigin()[0]; > > origin[1] = inputImage->GetOrigin()[1]; > > origin[2] = inputImage->GetOrigin()[2]; > > > > outputImage->SetRegions(region); > > outputImage->SetSpacing(spacing); > > outputImage->SetOrigin(origin); > > outputImage->Allocate(); > > outputImage->FillBuffer(size[0] * size[1] * size[2]); > > > > // Geometry > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(510., 510., i*8.); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->SetGeometry(geometry); > > forward->Update(); > > > > I?m not sure how I have to add projection for the geometry to get a result > which I?m familiar with. > > > > Can you describe how do I have to interpret the result of the > Joseph-Filter? I am familiar with sinograms and how they are computed, but > one sinogram is created by the projections of one image slice as far as I > understood it. What I want is to manipulate the image in the radon space > and then perform a filtered back projection. Typically the articles > describe techniques to reduce metal artifacts by using one 2D Slice. Is it > possible to achieve something like that with the JosephFilter? I?m guessing > since this filter won?t work well for 2D I have to use another filter. Can > you give me a hint if I can do something like that with RTK or another > ITK-based framework? Here a diagram > which shows an example what I want to try. > > > > I tried also to use my code with one slice and added a zero padding like > that: > > typedef itk::ConstantPadImageFilter > ConstantPadImageFilterType; > > ConstantPadImageFilterType::Pointer padFilter = > ConstantPadImageFilterType::New(); > > padFilter->SetInput(inputImage); > > > > ImageType::SizeType extendRegion; > > extendRegion[0] = 0; > > extendRegion[1] = 0; > > extendRegion[2] = 0; > > > > padFilter->SetPadLowerBound(extendRegion); > > padFilter->SetPadUpperBound(extendRegion); > > padFilter->SetConstant(1); > > padFilter->Update(); > > But the result of my png is a black square. > > Tobias > > > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Freitag, 13. Mai 2016 18:15 > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > If you intialize the data of your itk::Image with FillBuffer with the > corresponding constant value, it is quite similar. The constant image value > allow us to stream the computation whereas you have to allocate the whole > image if you pass directly itk::Image. > > We only work in 3D and probably our projector don't work with 2D, that is > probably the problem here. You would have to correct the code for 2D but > that's a lot of work, we generally prefer pseudo 2D, see next point. > > I doubt that our forward projector will work well with one slice only if > you use 3D, we assume that the volume starts at the first pixel and ends at > the last pixel. You should probably add a zero border around with > itk::PadImage to see something. > > To avoid aliasing, you can cut frequencies in the ramp filter (look for > CutFrequency in the doxygen of rtk::FFTRampImageFilter). > > Simon > > > > On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: > > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Sat May 14 06:18:57 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sat, 14 May 2016 12:18:57 +0200 Subject: [Rtk-users] RTK training - June 17 2016 Message-ID: Dear all, The training on June 17 in Lyon is confirmed. Please register asap if you'd like to attend. Looking forward to meeting our users, Simon On Thu, Mar 10, 2016 at 11:02 AM, Simon Rit wrote: > Dear all, > The new date for the RTK training is Friday June 17. > I'm looking forward to meeting you there, > Simon > > On Sun, Mar 6, 2016 at 12:57 PM, Simon Rit > wrote: > >> Dear all, >> We have to fix another date for the RTK training due to a conflicting >> meeting. If you are interested, please fill in the foodle >> so that >> we fix a date that suits everyone. If none of these dates works for you, >> please let me know and we'll try to extend the foodle. >> Please answer before Tuesday, we'll fix the date on Tuesday evening. >> Thanks for your cooperation and apologies for the mess, >> Simon >> >> On Tue, Feb 9, 2016 at 11:49 AM, Simon Rit < >> simon.rit at creatis.insa-lyon.fr> wrote: >> >>> Dear RTK users, >>> We will organize a new training >>> session on June 22 2016 in >>> Lyon. Follow the instructions on the webpage >>> to register. The training is >>> for both users and developers. We are happy to answer any question that you >>> might have and we are looking forward to this new training session. >>> Simon >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Sun May 15 08:38:40 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Sun, 15 May 2016 14:38:40 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Message-ID: <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> If I understood you correct, the input of the Joseph-Filter needs to be oriented in the y-direction when I am dealing with axial oriented slices. Now I changed the direction of the 3D Slice by rotating it 90 degrees around the x-axis with the itk::ChangeInformationImageFilter to have my slice in the xz-layer in the y-direction: double rotationX = 90; itk::Versor< double > rotation; const double angleInRadians = rotationX * vnl_math::pi / 180.0; rotation.SetRotationAroundX(angleInRadians); const ImageType::DirectionType direction = inputImage->GetDirection(); const ImageType::DirectionType newDirection = direction * rotation.GetMatrix(); changeFilter->SetOutputDirection(newDirection); changeFilter->ChangeAll(); changeFilter->SetInput(inputImage); changeFilter->UpdateOutputInformation(); Then I added a zero-border as you told me (This changed the size of my region from [512, 512, 1] to [514, 514, 3]). While executing the Joseph Filter I got an error because a vector subscript was out of range. Maybe that?s because the index of the region is [-1,-1,-1] caused by the padding. I tried the padding after the Joseph Filter, and got a result which has a size [514, 3, 45], while 45 was the number of projection images but the image was still empty. I also tried the Jospeh Filter with a real 3D volume stack of slices, rotated it as described below and got a result. Now I am confused how I should create the geometry of the Joseph Filter to get a good result. typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(300., 500., i * 180 / NumberOfProjectionImages); I am trying to use a 180-degree rotation, but i don?t have the feeling for the distance values. I this code example I used an 3D Image with dimensions = [256, 256, 49] My idea was, since there is no way to get a result with a single 3D slice, I would use a stack of slices as input and slice the output volume in y-direction to get my sinogram as you said. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Samstag, 14. Mai 2016 12:17 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK The output of the Joseph filter (of any forward projector) is a stack of projection images, i.e., a 3D image. If you slice this 3D image in the z direction, you get one projection images. If you slice this 3D image in the y direction, you get a sinogram, e.g., the 2D sinogram of the central slice (plane of the source trajectory) if y=0. The best way to have this sinogram is to set size[1]=1 and there is no better way to do it in RTK. For zero-padding, you need to set extendRegion[?]=1, with (for all dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that your image is a black square, something else must be going on. One thing to remember, the typical RTK rotation is around the y axis so your 3D slice must be 1 in the y direction. A simple way to change the orientation of one slice is to change its direction with ChangeImageFilter Simon On Sat, May 14, 2016 at 11:48 AM, Tobias Stein > wrote: Hello Simon, Thanks for your advice so far. I?m getting to know this filter better. At least I can now use it and save the result into a file. I updated my code which now uses a volume. The values of the input and output volume are equal except of the z-dimension of the output which I changed to the number of projection images. const unsigned int Dimension = 3; ?Reading image? ImageType::Pointer inputImage = reader->GetOutput(); ImageType::Pointer outputImage = ImageType::New(); RegionType inputRegion = inputImage->GetLargestPossibleRegion(); const unsigned int NumberOfProjectionImages = 45; ImageType::IndexType start; start[0] = inputRegion.GetIndex()[0]; start[1] = inputRegion.GetIndex()[1]; start[2] = inputRegion.GetIndex()[2]; RegionType::SizeType size; size[0] = inputRegion.GetSize()[0]; size[1] = inputRegion.GetSize()[1]; size[2] = NumberOfProjectionImages; RegionType region; region.SetSize(size); region.SetIndex(start); ImageType::SpacingType spacing; spacing[0] = inputImage->GetSpacing()[0]; spacing[1] = inputImage->GetSpacing()[1]; spacing[2] = inputImage->GetSpacing()[2]; ImageType::PointType origin; origin[0] = inputImage->GetOrigin()[0]; origin[1] = inputImage->GetOrigin()[1]; origin[2] = inputImage->GetOrigin()[2]; outputImage->SetRegions(region); outputImage->SetSpacing(spacing); outputImage->SetOrigin(origin); outputImage->Allocate(); outputImage->FillBuffer(size[0] * size[1] * size[2]); // Geometry typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(510., 510., i*8.); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->SetGeometry(geometry); forward->Update(); I?m not sure how I have to add projection for the geometry to get a result which I?m familiar with. Can you describe how do I have to interpret the result of the Joseph-Filter? I am familiar with sinograms and how they are computed, but one sinogram is created by the projections of one image slice as far as I understood it. What I want is to manipulate the image in the radon space and then perform a filtered back projection. Typically the articles describe techniques to reduce metal artifacts by using one 2D Slice. Is it possible to achieve something like that with the JosephFilter? I?m guessing since this filter won?t work well for 2D I have to use another filter. Can you give me a hint if I can do something like that with RTK or another ITK-based framework? Here a diagram which shows an example what I want to try. I tried also to use my code with one slice and added a zero padding like that: typedef itk::ConstantPadImageFilter ConstantPadImageFilterType; ConstantPadImageFilterType::Pointer padFilter = ConstantPadImageFilterType::New(); padFilter->SetInput(inputImage); ImageType::SizeType extendRegion; extendRegion[0] = 0; extendRegion[1] = 0; extendRegion[2] = 0; padFilter->SetPadLowerBound(extendRegion); padFilter->SetPadUpperBound(extendRegion); padFilter->SetConstant(1); padFilter->Update(); But the result of my png is a black square. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com ] Im Auftrag von Simon Rit Gesendet: Freitag, 13. Mai 2016 18:15 An: Tobias Stein > Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto: simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein < tstein at stud.hs-heilbronn.de> Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 16 05:50:41 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 16 May 2016 11:50:41 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> Message-ID: Answers below. I think you need to understand better the coordinate system of an ITK image, maybe check ITK's doc. Simon On Sun, May 15, 2016 at 2:38 PM, Tobias Stein wrote: > If I understood you correct, the input of the Joseph-Filter needs to be > oriented in the y-direction when I am dealing with axial oriented slices. > Yes, or in other words, if you want to take projections around the axial axis, be aware that y is the default axis of rotation in RTK. > Now I changed the direction of the 3D Slice by rotating it 90 degrees > around the x-axis with the itk::ChangeInformationImageFilter to have my > slice in the xz-layer in the y-direction: > > double rotationX = 90; > > itk::Versor< double > rotation; > > const double angleInRadians = rotationX * vnl_math::pi / 180.0; > > rotation.SetRotationAroundX(angleInRadians); > > const ImageType::DirectionType direction = > inputImage->GetDirection(); > > const ImageType::DirectionType newDirection = direction * > rotation.GetMatrix(); > > changeFilter->SetOutputDirection(newDirection); > > changeFilter->ChangeAll(); > > changeFilter->SetInput(inputImage); > > changeFilter->UpdateOutputInformation(); > > > > Then I added a zero-border as you told me (This changed the size of my > region from [512, 512, 1] to [514, 514, 3]). > > While executing the Joseph Filter I got an error because a vector > subscript was out of range. Maybe that?s because the index of the region is > [-1,-1,-1] caused by the padding. > That should not have been a problem but that might be a bug... > I tried the padding after the Joseph Filter, and got a result which has a > size [514, 3, 45], while 45 was the number of projection images but the > image was still empty. > I guess you should check the origin of your projected volume and your projections. A simple test is to center your volume (check using ITK doc how you can define the origin so that (0,0,0) is at the center) and your projection (for the projection stack, only the first 2 coordinates count). > > > I also tried the Jospeh Filter with a real 3D volume stack of slices, > rotated it as described below and got a result. > > Now I am confused how I should create the geometry of the Joseph Filter to > get a good result. > > > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(300., 500., i * 180 / > NumberOfProjectionImages); > > > > I am trying to use a 180-degree rotation, but i don?t have the feeling for > the distance values. > > I this code example I used an 3D Image with dimensions = [256, 256, 49] > This doesn't tell you anything about the size of your volume, we also need the origin and the spacing. Look at the ITK doc to understand the ITK coordinate systems. > > > My idea was, since there is no way to get a result with a single 3D slice, > I would use a stack of slices as input and slice the output volume in > y-direction to get my sinogram as you said. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Samstag, 14. Mai 2016 12:17 > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > The output of the Joseph filter (of any forward projector) is a stack of > projection images, i.e., a 3D image. If you slice this 3D image in the z > direction, you get one projection images. If you slice this 3D image in the > y direction, you get a sinogram, e.g., the 2D sinogram of the central slice > (plane of the source trajectory) if y=0. The best way to have this sinogram > is to set size[1]=1 and there is no better way to do it in RTK. > > For zero-padding, you need to set extendRegion[?]=1, with (for all > dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that > your image is a black square, something else must be going on. One thing to > remember, the typical RTK rotation is around the y axis so your 3D slice > must be 1 in the y direction. A simple way to change the orientation of one > slice is to change its direction with ChangeImageFilter > > Simon > > > > > > On Sat, May 14, 2016 at 11:48 AM, Tobias Stein < > tstein at stud.hs-heilbronn.de> wrote: > > Hello Simon, > > > > Thanks for your advice so far. I?m getting to know this filter better. At > least I can now use it and save the result into a file. > > > > I updated my code which now uses a volume. > > The values of the input and output volume are equal except of the > z-dimension of the output which I changed to the number of projection > images. > > const unsigned int Dimension = 3; > > ?Reading image? > > ImageType::Pointer inputImage = reader->GetOutput(); > > ImageType::Pointer outputImage = ImageType::New(); > > > > RegionType inputRegion = inputImage->GetLargestPossibleRegion(); > > > > const unsigned int NumberOfProjectionImages = 45; > > > > ImageType::IndexType start; > > start[0] = inputRegion.GetIndex()[0]; > > start[1] = inputRegion.GetIndex()[1]; > > start[2] = inputRegion.GetIndex()[2]; > > > > RegionType::SizeType size; > > size[0] = inputRegion.GetSize()[0]; > > size[1] = inputRegion.GetSize()[1]; > > size[2] = NumberOfProjectionImages; > > > > RegionType region; > > region.SetSize(size); > > region.SetIndex(start); > > > > ImageType::SpacingType spacing; > > spacing[0] = inputImage->GetSpacing()[0]; > > spacing[1] = inputImage->GetSpacing()[1]; > > spacing[2] = inputImage->GetSpacing()[2]; > > > > ImageType::PointType origin; > > origin[0] = inputImage->GetOrigin()[0]; > > origin[1] = inputImage->GetOrigin()[1]; > > origin[2] = inputImage->GetOrigin()[2]; > > > > outputImage->SetRegions(region); > > outputImage->SetSpacing(spacing); > > outputImage->SetOrigin(origin); > > outputImage->Allocate(); > > outputImage->FillBuffer(size[0] * size[1] * size[2]); > > > > // Geometry > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(510., 510., i*8.); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->SetGeometry(geometry); > > forward->Update(); > > > > I?m not sure how I have to add projection for the geometry to get a result > which I?m familiar with. > > > > Can you describe how do I have to interpret the result of the > Joseph-Filter? I am familiar with sinograms and how they are computed, but > one sinogram is created by the projections of one image slice as far as I > understood it. What I want is to manipulate the image in the radon space > and then perform a filtered back projection. Typically the articles > describe techniques to reduce metal artifacts by using one 2D Slice. Is it > possible to achieve something like that with the JosephFilter? I?m guessing > since this filter won?t work well for 2D I have to use another filter. Can > you give me a hint if I can do something like that with RTK or another > ITK-based framework? Here a diagram > which shows an example what I want to try. > > > > I tried also to use my code with one slice and added a zero padding like > that: > > typedef itk::ConstantPadImageFilter > ConstantPadImageFilterType; > > ConstantPadImageFilterType::Pointer padFilter = > ConstantPadImageFilterType::New(); > > padFilter->SetInput(inputImage); > > > > ImageType::SizeType extendRegion; > > extendRegion[0] = 0; > > extendRegion[1] = 0; > > extendRegion[2] = 0; > > > > padFilter->SetPadLowerBound(extendRegion); > > padFilter->SetPadUpperBound(extendRegion); > > padFilter->SetConstant(1); > > padFilter->Update(); > > But the result of my png is a black square. > > Tobias > > > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Freitag, 13. Mai 2016 18:15 > > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > If you intialize the data of your itk::Image with FillBuffer with the > corresponding constant value, it is quite similar. The constant image value > allow us to stream the computation whereas you have to allocate the whole > image if you pass directly itk::Image. > > We only work in 3D and probably our projector don't work with 2D, that is > probably the problem here. You would have to correct the code for 2D but > that's a lot of work, we generally prefer pseudo 2D, see next point. > > I doubt that our forward projector will work well with one slice only if > you use 3D, we assume that the volume starts at the first pixel and ends at > the last pixel. You should probably add a zero border around with > itk::PadImage to see something. > > To avoid aliasing, you can cut frequencies in the ramp filter (look for > CutFrequency in the doxygen of rtk::FFTRampImageFilter). > > Simon > > > > On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: > > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Tue May 17 07:07:20 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Tue, 17 May 2016 16:37:20 +0530 Subject: [Rtk-users] Object isocenter shift Message-ID: Hello, As my previous thread caused some confusion, I am attaching an image showing the same in detail. As you can see my object center is not aligned with isocenter line. Besides it is offset by DX and DY values. In my case you can see the object center as red dot. Is there any method in RTK to nullify this offset effect? Will the rotation of turntable affect the reconstruction due to this offset? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: objectoffset.png Type: image/png Size: 12365 bytes Desc: not available URL: From cyril.mory at uclouvain.be Tue May 17 08:19:38 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Tue, 17 May 2016 14:19:38 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: <573B0C5A.4030001@uclouvain.be> Well, if it's just that, you should not worry about it : you cannot perfectly center your object, even if you try. And most objects (e.g. patients) do not even have a "center". So it does not make sense to struggle to have the center of the object perfectly match the isocenter of the acquisition device. You can either live with that (it is perfectly fine for most applications), or try one of these things: - If you can re-do the acquisition, you should try to have your object's center _roughly_ match the system's isocenter, because that's where you will have the least artifacts - Reconstruct your object as it is (it will work fine, unless there are other problems), but select the origin and size of your reconstructed volume carefully to have your object's center roughly at the center of your reconstructed volume. If you are not familiar with the exact definition of "origin", "spacing" and "size" of an itk::image, read section 4.1.4 of the ITK software guide (https://itk.org/ItkSoftwareGuide.pdf). This is both clear, short, and something extremely important to understand. I hope it helps, Cyril On 05/17/2016 01:07 PM, AMJAD N wrote: > Hello, > > As my previous thread caused some confusion, I am attaching an image > showing the same in detail. > > As you can see my object center is not aligned with isocenter line. > Besides it is offset by DX and DY values. In my case you can see the > object center as red dot. > > Is there any method in RTK to nullify this offset effect? > Will the rotation of turntable affect the reconstruction due to this > offset? > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From wuchao04 at gmail.com Tue May 17 09:24:58 2016 From: wuchao04 at gmail.com (Chao Wu) Date: Tue, 17 May 2016 15:24:58 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: There's nothing to correct or compensate for DURING reconstruction in your case. Where you put your object dose not change the geometry of the CT system at all. As long as the object is still inside FOV, a normal reconstruction will give you a correct result. In the resulting image, the origin is at the center of rotation, and the object is off-center by DX and DY, that's it. If you want the origin to be at the center of the object, you can shift it by DX/DY AFTER reconstruction. Regards, Chao 2016-05-17 13:07 GMT+02:00 AMJAD N : > Hello, > > As my previous thread caused some confusion, I am attaching an image > showing the same in detail. > > As you can see my object center is not aligned with isocenter line. > Besides it is offset by DX and DY values. In my case you can see the object > center as red dot. > > Is there any method in RTK to nullify this offset effect? > Will the rotation of turntable affect the reconstruction due to this > offset? > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shiraska at gmail.com Thu May 19 04:41:54 2016 From: shiraska at gmail.com (Shiras Abdurahman) Date: Thu, 19 May 2016 10:41:54 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction Message-ID: Dear all, I am trying to simulate Tomosynthesis reconstruction with stationary flat panel detector where source rotates around Y axis to acquire 21 projections (system geometry diagram is attached). Geometry file geometry.xml is generated with Reg23ProjectionGeometry. I generated projection images of a cube volume and then I tried to reconstruct with FDK algorithm. Even though I am able to generate projections, FDK reconstruction yields the volume with all voxel values zero. The commands I used for generating projections and reconstructing volume are rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 --dimension=256,256,256 --hardware=cuda I am also attaching geometry xml file, mhd header files of the original volume, projections and reconstructed volume. With regards, Shiras -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: geometry.xml Type: text/xml Size: 11889 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fdk.mhd Type: application/octet-stream Size: 322 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: projections.mhd Type: application/octet-stream Size: 335 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: volume.mhd Type: application/octet-stream Size: 355 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: system_geometry.PNG Type: image/png Size: 50006 bytes Desc: not available URL: From cyril.mory at uclouvain.be Fri May 20 04:38:22 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Fri, 20 May 2016 10:38:22 +0200 Subject: [Rtk-users] Compiler RTK In-Reply-To: <573E430F.5030704@uclouvain.be> References: <573E430F.5030704@uclouvain.be> Message-ID: <573ECCFE.3070500@uclouvain.be> Hi Kevin, I'm replying to the RTK users mailing list. Next time, please send your questions to this list instead of just me (except when it specifically involves reggui, for example). I have tried to reproduce the error but the compilation runs fine on my machine. Can you send information on your compiler ? Maybe someone else on the list can help ? Cyril On 05/20/2016 12:49 AM, Kevin Souris wrote: > Bonjour, > > Je viens de t?l?charger la derni?re version de RTK sur Github. > J'essaye maintenant de compiler sur une machine linux et j'obtiens > cette erreur: > > /home/pen/RTK/RTK-master/applications/rtkprojections/rtkprojections.cxx: > In function ?int main(int, char**)?: > /home/pen/RTK/RTK-master/applications/rtkprojections*/**rtkprojections.cxx:27: > error: invalid conversion from ?const char*? to ?char*?* > /home/pen/RTK/RTK-master/applications/rtkprojections/rtkprojections.cxx:27: > error: initializing argument 1 of ?int > cmdline_parser_rtkprojections_config_file(char*, > args_info_rtkprojections*, cmdline_parser_rtkprojections_params*)? > > Comment puis-je r?parer ?a ? > Merci > > Kevin > > > > > -- > Kevin Souris, PhD student > Universit? catholique de Louvain > Molecular Imagery, Radiotherapy and Oncology (MIRO) -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 25 15:45:57 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 25 May 2016 21:45:57 +0200 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Hi Solomon, I had still to look into this on my todo list. I did again but now I think I overlooked something in your email. You say that going through ChangeInformationImageFilter might be the problem. But now, I wonder if the problem is not that the origin that you set is wrong and then the volume or the projections are completely off (hence the projections). So, here is my question : what happens if you replace filter -> SetOutputOrigin(origin); with filter -> SetOutputOrigin(image->GetOutputOrigin()); Of course, it's not what you want to do but it might point to a wrong choice of origin... Simon On Fri, May 6, 2016 at 1:45 AM, Solomon Tang wrote: > Hi Simon, > > I added the line as you suggested and it does not change the output (still > blank). Sorry for the delayed response. > > Thanks for looking into it! > > On Wed, May 4, 2016 at 12:16 AM, Simon Rit > wrote: > >> Dear Solomon, >> Thanks for the report. It looks like a bug to me. I checked and >> itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in >> the itkGPUImage and the itkCudaImage, this function does not check >> consistency between CPU and GPU data. I'll work on a minimal example to >> check this but can you test that your problem is solved if you add >> m_DataManager->UpdateCPUBuffer(); >> before >> m_DataManager->SetGPUBufferDirty(); >> in itkCudaImage.h line 121? >> Thanks, >> Simon >> >> On Mon, May 2, 2016 at 10:42 PM, Solomon Tang >> wrote: >> >>> Thanks for the tip Simon, >>> >>> I think I may have figured it out. I initially read as a CUDA Image, and >>> then passed the CUDA image through ChangeInformationImageFilter to change >>> the offset of the image. >>> >>> template >>> typename itk::CudaImage::Pointer ShiftOffset( >>> const typename itk::CudaImage::Pointer image, >>> const typename itk::Image::PointType origin) >>> { >>> typedef itk::ChangeInformationImageFilter< itk::CudaImage > >>> FilterType; >>> FilterType::Pointer filter = FilterType::New(); >>> filter -> SetInput(image); >>> filter -> SetOutputOrigin(origin); >>> filter -> ChangeOriginOn(); >>> filter -> UpdateOutputInformation(); >>> filter -> Update(); >>> return filter->GetOutput(); >>> } >>> >>> If I pass the offset image pointer to ForwardProjection, it outputs a >>> blank image. >>> >>> However, when I write the offset image and then read it again as a CUDA >>> image, then the ForwardProjection works as intended. Perhaps using the CUDA >>> version of ITK would fix this. >>> >>> >>> On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < >>> simon.rit at creatis.insa-lyon.fr> wrote: >>> >>>> Hi Solomon, >>>> Hard to say without the full code. Maybe the cudaness of your output >>>> image is lost further in the code. Try accessing the CPU buffer at the end, >>>> after the update, to be sure that the GPU image is transferred to CPU, e.g. >>>> std::cout << forwardProjection->GetOutput()->GetPointer() <>>> Simon >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 26 12:04:47 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 26 May 2016 18:04:47 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Hi Shiras, I generated a volume to look at your problem: rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 --offset 0,0,1.7 Then I obtained the same issue as you. I think the problem is that rtkfdk is meant for circular CBCT and it includes pre-weighting for displaced detector and short scan. I'm not sure why you don't get a warning but these are probably responsible for the blank output. A simple solution is to do only the 3 FDK steps using in order the command tools: rtktwodweights rtkramp rtkbackprojections You can also try to shunt the preweighting by modifying rtkfdk.cxx. It's interesting that you try out tomosynthesis but you'll encounter some problem. When I ran the above commands, I get very weird results because the first and the last projections get a lot more weight than the others since it looks at the angular weight with the previous and the next projections. A simple solution is to blank out these two projections. Good luck and keep us posted if you get interesting results, Simon On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman wrote: > Dear all, > > I am trying to simulate Tomosynthesis reconstruction with stationary flat > panel detector where source rotates around Y axis to acquire 21 projections > (system geometry diagram is attached). Geometry file geometry.xml is > generated with Reg23ProjectionGeometry. I generated projection images of > a cube volume and then I tried to reconstruct with FDK algorithm. Even > though I am able to generate projections, FDK reconstruction yields the > volume with all voxel values zero. The commands I used for generating > projections and reconstructing volume are > > rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd > --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast > rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml > --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 > --dimension=256,256,256 --hardware=cuda > > I am also attaching geometry xml file, mhd header files of the original > volume, projections and reconstructed volume. > > With regards, > Shiras > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shiraska at gmail.com Fri May 27 11:31:52 2016 From: shiraska at gmail.com (Shiras Abdurahman) Date: Fri, 27 May 2016 17:31:52 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Dear Simon, Thank you very much for the reply. I tried to reconstruct with only ramp filtering and back projection and the results are looking good without any weighting of the projections. I also reconstructed the volume with rtksart with 10 iterations and the results are better than rtkfdk. With these experiments, I also confirmed that my geometry file is accurate. Thank you very much for your help. With regards, Shiras On Thu, May 26, 2016 at 6:04 PM, Simon Rit wrote: > Hi Shiras, > I generated a volume to look at your problem: > rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 > --offset 0,0,1.7 > Then I obtained the same issue as you. I think the problem is that rtkfdk > is meant for circular CBCT and it includes pre-weighting for displaced > detector and short scan. I'm not sure why you don't get a warning but these > are probably responsible for the blank output. A simple solution is to do > only the 3 FDK steps using in order the command tools: > rtktwodweights > rtkramp > rtkbackprojections > You can also try to shunt the preweighting by modifying rtkfdk.cxx. > > It's interesting that you try out tomosynthesis but you'll encounter some > problem. When I ran the above commands, I get very weird results because > the first and the last projections get a lot more weight than the others > since it looks at the angular weight with the previous and the next > projections. A simple solution is to blank out these two projections. > Good luck and keep us posted if you get interesting results, > Simon > > On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman > wrote: > >> Dear all, >> >> I am trying to simulate Tomosynthesis reconstruction with stationary flat >> panel detector where source rotates around Y axis to acquire 21 projections >> (system geometry diagram is attached). Geometry file geometry.xml is >> generated with Reg23ProjectionGeometry. I generated projection images of >> a cube volume and then I tried to reconstruct with FDK algorithm. Even >> though I am able to generate projections, FDK reconstruction yields the >> volume with all voxel values zero. The commands I used for generating >> projections and reconstructing volume are >> >> rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd >> --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast >> rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml >> --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 >> --dimension=256,256,256 --hardware=cuda >> >> I am also attaching geometry xml file, mhd header files of the original >> volume, projections and reconstructed volume. >> >> With regards, >> Shiras >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 27 12:00:56 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 27 May 2016 18:00:56 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Indeed, the angular weighting resulting from the discretization of the back projection occurs in rtkfdktwodweights so skipping this might help. Simon On 27 May 2016 5:32 p.m., "Shiras Abdurahman" wrote: Dear Simon, Thank you very much for the reply. I tried to reconstruct with only ramp filtering and back projection and the results are looking good without any weighting of the projections. I also reconstructed the volume with rtksart with 10 iterations and the results are better than rtkfdk. With these experiments, I also confirmed that my geometry file is accurate. Thank you very much for your help. With regards, Shiras On Thu, May 26, 2016 at 6:04 PM, Simon Rit wrote: > Hi Shiras, > I generated a volume to look at your problem: > rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 > --offset 0,0,1.7 > Then I obtained the same issue as you. I think the problem is that rtkfdk > is meant for circular CBCT and it includes pre-weighting for displaced > detector and short scan. I'm not sure why you don't get a warning but these > are probably responsible for the blank output. A simple solution is to do > only the 3 FDK steps using in order the command tools: > rtktwodweights > rtkramp > rtkbackprojections > You can also try to shunt the preweighting by modifying rtkfdk.cxx. > > It's interesting that you try out tomosynthesis but you'll encounter some > problem. When I ran the above commands, I get very weird results because > the first and the last projections get a lot more weight than the others > since it looks at the angular weight with the previous and the next > projections. A simple solution is to blank out these two projections. > Good luck and keep us posted if you get interesting results, > Simon > > On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman > wrote: > >> Dear all, >> >> I am trying to simulate Tomosynthesis reconstruction with stationary flat >> panel detector where source rotates around Y axis to acquire 21 projections >> (system geometry diagram is attached). Geometry file geometry.xml is >> generated with Reg23ProjectionGeometry. I generated projection images of >> a cube volume and then I tried to reconstruct with FDK algorithm. Even >> though I am able to generate projections, FDK reconstruction yields the >> volume with all voxel values zero. The commands I used for generating >> projections and reconstructing volume are >> >> rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd >> --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast >> rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml >> --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 >> --dimension=256,256,256 --hardware=cuda >> >> I am also attaching geometry xml file, mhd header files of the original >> volume, projections and reconstructed volume. >> >> With regards, >> Shiras >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 31 12:02:32 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 31 May 2016 18:02:32 +0200 Subject: [Rtk-users] Rooster In-Reply-To: References: Message-ID: Hi Guillaume, I'm adding RTK user list to this conversation, it's better to have these conversations on the mailing list IMO. Can you tell us what's the volume size and the GPU? Cyril is ROOSTER's dev, maybe he could comment on recon times. Simon On Tue, May 31, 2016 at 5:29 PM, wrote: > Hi Simon, > > I tried the rooster recon. I used the parameters from the example page. The results looks rather nice but it took several hours to run (5-6). Its a big dataset of about 2000 256x256 projections. > > Guillaume From G.Landry at physik.uni-muenchen.de Tue May 31 13:48:28 2016 From: G.Landry at physik.uni-muenchen.de (G.Landry at physik.uni-muenchen.de) Date: Tue, 31 May 2016 19:48:28 +0200 Subject: [Rtk-users] Rooster In-Reply-To: References: Message-ID: <20160531194828.Horde.Im1irUOnkCrL1p8oGSue_A5@webmail.physik.lmu.de> Hi Simon, Thanks for mailing list suggestion. My initial question was about typical reconstruction times for rtkfourdrooster. What I tried is summarized below: -Volume size was 410 410 264 and could be easily reduced by a good margin. -The GPU is quadro M4000 with 8GB -about 2300 256x256 projections with shifted elekta panel (so called M20) -10 phases -for the motion mask at the moment I just used the FOV mask for first try. --gamma_time 0.0001 --gamma_space 0.0001 - spacing 1 1 1 --niter 30 --cgiter 4 --tviter 10 Recon time was about 5-6 hours. I saw about 4 Gb used on the card. The image looked nice, albeit with the TV "feel/plastic-y". Thanks for your feedback Guillaume Quoting Simon Rit : > Hi Guillaume, > I'm adding RTK user list to this conversation, it's better to have > these conversations on the mailing list IMO. Can you tell us what's > the volume size and the GPU? > Cyril is ROOSTER's dev, maybe he could comment on recon times. > Simon > > On Tue, May 31, 2016 at 5:29 PM, wrote: >> Hi Simon, >> >> I tried the rooster recon. I used the parameters from the example >> page. The results looks rather nice but it took several hours to >> run (5-6). Its a big dataset of about 2000 256x256 projections. >> >> Guillaume -- Dr. Guillaume Landry Ludwig Maximilians University (LMU) Munich Medical Physics Am Coulombwall 1 85748 Garching Tel:+49 (0) 89 289-14077 Fax:+49 (0) 89 289-14072 From solomoncztang at gmail.com Mon May 2 16:42:44 2016 From: solomoncztang at gmail.com (Solomon Tang) Date: Mon, 2 May 2016 13:42:44 -0700 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Thanks for the tip Simon, I think I may have figured it out. I initially read as a CUDA Image, and then passed the CUDA image through ChangeInformationImageFilter to change the offset of the image. template typename itk::CudaImage::Pointer ShiftOffset( const typename itk::CudaImage::Pointer image, const typename itk::Image::PointType origin) { typedef itk::ChangeInformationImageFilter< itk::CudaImage > FilterType; FilterType::Pointer filter = FilterType::New(); filter -> SetInput(image); filter -> SetOutputOrigin(origin); filter -> ChangeOriginOn(); filter -> UpdateOutputInformation(); filter -> Update(); return filter->GetOutput(); } If I pass the offset image pointer to ForwardProjection, it outputs a blank image. However, when I write the offset image and then read it again as a CUDA image, then the ForwardProjection works as intended. Perhaps using the CUDA version of ITK would fix this. On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit wrote: > Hi Solomon, > Hard to say without the full code. Maybe the cudaness of your output image > is lost further in the code. Try accessing the CPU buffer at the end, after > the update, to be sure that the GPU image is transferred to CPU, e.g. > std::cout << forwardProjection->GetOutput()->GetPointer() < Simon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Tue May 3 18:59:03 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Wed, 4 May 2016 00:59:03 +0200 Subject: [Rtk-users] forward and back projection - MITK Message-ID: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I've seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I've also seen the test for this class but I don't get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I've got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 4 03:02:05 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 4 May 2016 09:02:05 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Message-ID: Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein wrote: > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 4 03:16:33 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 4 May 2016 09:16:33 +0200 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Dear Solomon, Thanks for the report. It looks like a bug to me. I checked and itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in the itkGPUImage and the itkCudaImage, this function does not check consistency between CPU and GPU data. I'll work on a minimal example to check this but can you test that your problem is solved if you add m_DataManager->UpdateCPUBuffer(); before m_DataManager->SetGPUBufferDirty(); in itkCudaImage.h line 121? Thanks, Simon On Mon, May 2, 2016 at 10:42 PM, Solomon Tang wrote: > Thanks for the tip Simon, > > I think I may have figured it out. I initially read as a CUDA Image, and > then passed the CUDA image through ChangeInformationImageFilter to change > the offset of the image. > > template > typename itk::CudaImage::Pointer ShiftOffset( > const typename itk::CudaImage::Pointer image, > const typename itk::Image::PointType origin) > { > typedef itk::ChangeInformationImageFilter< itk::CudaImage > > FilterType; > FilterType::Pointer filter = FilterType::New(); > filter -> SetInput(image); > filter -> SetOutputOrigin(origin); > filter -> ChangeOriginOn(); > filter -> UpdateOutputInformation(); > filter -> Update(); > return filter->GetOutput(); > } > > If I pass the offset image pointer to ForwardProjection, it outputs a > blank image. > > However, when I write the offset image and then read it again as a CUDA > image, then the ForwardProjection works as intended. Perhaps using the CUDA > version of ITK would fix this. > > > On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < > simon.rit at creatis.insa-lyon.fr> wrote: > >> Hi Solomon, >> Hard to say without the full code. Maybe the cudaness of your output >> image is lost further in the code. Try accessing the CPU buffer at the end, >> after the update, to be sure that the GPU image is transferred to CPU, e.g. >> std::cout << forwardProjection->GetOutput()->GetPointer() <> Simon >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Wed May 4 05:04:28 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Wed, 4 May 2016 14:34:28 +0530 Subject: [Rtk-users] Reconstructed Slice save as tiff Message-ID: Hi all, I have wrote code for saving output volume stack as *.tiff. Currently I am getting output of XY axis. What should I do in order to get the other axes. My code is shown below. typedef itk::StreamingImageFilter StreamerType; StreamerType::Pointer streamerBP = StreamerType::New(); streamerBP->SetInput(feldkampCUDA->GetOutput()); streamerBP->SetNumberOfStreamDivisions(8); typedef itk::Image< float, 2 > Image2DType; typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; WriterType::Pointer writer = WriterType::New(); writer->SetInput(streamerBP->GetOutput()); typedef itk::NumericSeriesFileNames NameGeneratorType; NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); nameGenerator->SetStartIndex(0); nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the Z-axis value of //reconstructed volume nameGenerator->SetIncrementIndex(1); writer->SetFileNames(nameGenerator->GetFileNames()); writer->SetUseCompression(true); writer->Update(); PS: My reconstruction works fine. Thanks and Regards AMJAD N -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyril.mory at uclouvain.be Wed May 4 07:27:24 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Wed, 4 May 2016 13:27:24 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: References: Message-ID: <5729DC9C.10105@uclouvain.be> Hi Amjad, You can use an ITK extract filter to extract a region that corresponds to one of your slices (along the axis you want). The output of the extract filter will be 3D, so you will need to cast it into a 2D images using an ITK cast filter. Cyril On 05/04/2016 11:04 AM, AMJAD N wrote: > Hi all, > > I have wrote code for saving output volume stack as *.tiff. Currently > I am getting output of XY axis. What should I do in order to get the > other axes. > My code is shown below. > > typedef itk::StreamingImageFilter FloatImageType> StreamerType; > StreamerType::Pointer streamerBP = StreamerType::New(); > streamerBP->SetInput(feldkampCUDA->GetOutput()); > streamerBP->SetNumberOfStreamDivisions(8); > > typedef itk::Image< float, 2 > Image2DType; > typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; > WriterType::Pointer writer = WriterType::New(); > writer->SetInput(streamerBP->GetOutput()); > > typedef itk::NumericSeriesFileNames NameGeneratorType; > NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); > nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); > nameGenerator->SetStartIndex(0); > nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the > Z-axis value of //reconstructed volume > nameGenerator->SetIncrementIndex(1); > writer->SetFileNames(nameGenerator->GetFileNames()); > writer->SetUseCompression(true); > writer->Update(); > > PS: My reconstruction works fine. > > Thanks and Regards > > AMJAD N > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From wuchao04 at gmail.com Wed May 4 08:44:37 2016 From: wuchao04 at gmail.com (Chao Wu) Date: Wed, 4 May 2016 14:44:37 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: <5729DC9C.10105@uclouvain.be> References: <5729DC9C.10105@uclouvain.be> Message-ID: A small add-on (copied from ITK document): ExtractImageFilter also collapses dimensions so that the input image may have more dimensions than the output image (i.e. 4-D input image to a 3-D output image). To specify what dimensions to collapse, the ExtractionRegion must be specified. For any dimension dim where ExtractionRegion.Size[dim] = 0, that dimension is collapsed. The index to collapse on is specified by ExtractionRegion.Index[dim]. For example, we have a image 4D = a 4x4x4x4 image, and we want to get a 3D image, 3D = a 4x4x4 image, specified as [x,y,z,2] from 4D (i.e. the 3rd "time" slice from 4D). The ExtractionRegion.Size = [4,4,4,0] and ExtractionRegion.Index = [0,0,0,2]. Regards, Chao 2016-05-04 13:27 GMT+02:00 Cyril Mory : > Hi Amjad, > > You can use an ITK extract filter to extract a region that corresponds to > one of your slices (along the axis you want). The output of the extract > filter will be 3D, so you will need to cast it into a 2D images using an > ITK cast filter. > > Cyril > > > On 05/04/2016 11:04 AM, AMJAD N wrote: > > Hi all, > > I have wrote code for saving output volume stack as *.tiff. Currently I am > getting output of XY axis. What should I do in order to get the other axes. > My code is shown below. > > typedef itk::StreamingImageFilter > StreamerType; > StreamerType::Pointer streamerBP = StreamerType::New(); > streamerBP->SetInput(feldkampCUDA->GetOutput()); > streamerBP->SetNumberOfStreamDivisions(8); > > typedef itk::Image< float, 2 > Image2DType; > typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; > WriterType::Pointer writer = WriterType::New(); > writer->SetInput(streamerBP->GetOutput()); > > typedef itk::NumericSeriesFileNames NameGeneratorType; > NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); > nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); > nameGenerator->SetStartIndex(0); > nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the > Z-axis value of //reconstructed volume > nameGenerator->SetIncrementIndex(1); > writer->SetFileNames(nameGenerator->GetFileNames()); > writer->SetUseCompression(true); > writer->Update(); > > PS: My reconstruction works fine. > > Thanks and Regards > > AMJAD N > > > > _______________________________________________ > Rtk-users mailing listRtk-users at public.kitware.comhttp://public.kitware.com/mailman/listinfo/rtk-users > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyril.mory at uclouvain.be Wed May 4 08:56:14 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Wed, 4 May 2016 14:56:14 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: References: <5729DC9C.10105@uclouvain.be> Message-ID: <5729F16E.5020402@uclouvain.be> Thanks Chao Wu, You're right, I was mistaken : the cast filter is not required in this case. It is needed, on the other hand, to increase the dimension of an image. So in this case, Amjad, you don't need it. Cyril On 05/04/2016 02:44 PM, Chao Wu wrote: > A small add-on (copied from ITK document): > > ExtractImageFilter also collapses dimensions so that the input image > may have more dimensions than the output image (i.e. 4-D input image > to a 3-D output image). To specify what dimensions to collapse, the > ExtractionRegion must be specified. For any dimension dim where > ExtractionRegion.Size[dim] = 0, that dimension is collapsed. The index > to collapse on is specified by ExtractionRegion.Index[dim]. For > example, we have a image 4D = a 4x4x4x4 image, and we want to get a 3D > image, 3D = a 4x4x4 image, specified as [x,y,z,2] from 4D (i.e. the > 3rd "time" slice from 4D). The ExtractionRegion.Size = [4,4,4,0] and > ExtractionRegion.Index = [0,0,0,2]. > > Regards, > Chao > > 2016-05-04 13:27 GMT+02:00 Cyril Mory >: > > Hi Amjad, > > You can use an ITK extract filter to extract a region that > corresponds to one of your slices (along the axis you want). The > output of the extract filter will be 3D, so you will need to cast > it into a 2D images using an ITK cast filter. > > Cyril > > > On 05/04/2016 11:04 AM, AMJAD N wrote: >> Hi all, >> >> I have wrote code for saving output volume stack as *.tiff. >> Currently I am getting output of XY axis. What should I do in >> order to get the other axes. >> My code is shown below. >> >> typedef itk::StreamingImageFilter> FloatImageType> StreamerType; >> StreamerType::Pointer streamerBP = StreamerType::New(); >> streamerBP->SetInput(feldkampCUDA->GetOutput()); >> streamerBP->SetNumberOfStreamDivisions(8); >> >> typedef itk::Image< float, 2 > Image2DType; >> typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > >> WriterType; >> WriterType::Pointer writer = WriterType::New(); >> writer->SetInput(streamerBP->GetOutput()); >> >> typedef itk::NumericSeriesFileNames NameGeneratorType; >> NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); >> nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); >> nameGenerator->SetStartIndex(0); >> nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] >> is the Z-axis value of //reconstructed volume >> nameGenerator->SetIncrementIndex(1); >> writer->SetFileNames(nameGenerator->GetFileNames()); >> writer->SetUseCompression(true); >> writer->Update(); >> >> PS: My reconstruction works fine. >> >> Thanks and Regards >> >> AMJAD N >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From solomoncztang at gmail.com Thu May 5 19:45:43 2016 From: solomoncztang at gmail.com (Solomon Tang) Date: Thu, 5 May 2016 16:45:43 -0700 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Hi Simon, I added the line as you suggested and it does not change the output (still blank). Sorry for the delayed response. Thanks for looking into it! On Wed, May 4, 2016 at 12:16 AM, Simon Rit wrote: > Dear Solomon, > Thanks for the report. It looks like a bug to me. I checked and > itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in > the itkGPUImage and the itkCudaImage, this function does not check > consistency between CPU and GPU data. I'll work on a minimal example to > check this but can you test that your problem is solved if you add > m_DataManager->UpdateCPUBuffer(); > before > m_DataManager->SetGPUBufferDirty(); > in itkCudaImage.h line 121? > Thanks, > Simon > > On Mon, May 2, 2016 at 10:42 PM, Solomon Tang > wrote: > >> Thanks for the tip Simon, >> >> I think I may have figured it out. I initially read as a CUDA Image, and >> then passed the CUDA image through ChangeInformationImageFilter to change >> the offset of the image. >> >> template >> typename itk::CudaImage::Pointer ShiftOffset( >> const typename itk::CudaImage::Pointer image, >> const typename itk::Image::PointType origin) >> { >> typedef itk::ChangeInformationImageFilter< itk::CudaImage > >> FilterType; >> FilterType::Pointer filter = FilterType::New(); >> filter -> SetInput(image); >> filter -> SetOutputOrigin(origin); >> filter -> ChangeOriginOn(); >> filter -> UpdateOutputInformation(); >> filter -> Update(); >> return filter->GetOutput(); >> } >> >> If I pass the offset image pointer to ForwardProjection, it outputs a >> blank image. >> >> However, when I write the offset image and then read it again as a CUDA >> image, then the ForwardProjection works as intended. Perhaps using the CUDA >> version of ITK would fix this. >> >> >> On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < >> simon.rit at creatis.insa-lyon.fr> wrote: >> >>> Hi Solomon, >>> Hard to say without the full code. Maybe the cudaness of your output >>> image is lost further in the code. Try accessing the CPU buffer at the end, >>> after the update, to be sure that the GPU image is transferred to CPU, e.g. >>> std::cout << forwardProjection->GetOutput()->GetPointer() <>> Simon >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 10 01:29:44 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 10 May 2016 07:29:44 +0200 Subject: [Rtk-users] Cmake build error help In-Reply-To: References: Message-ID: <573171C8.80400@creatis.insa-lyon.fr> Hi, Can you update GetGitRevisionDescription.cmake and GetGitRevisionDescription.cmake.in from https://github.com/rpavlik/cmake-modules and see if the new versions fix this issue? Thanks, Simon PS: plead keep using the mailing list On 10/05/2016 03:09, Solomon Tang wrote: > Hi Simon, > > I am rebuilding RTK after moving to Visual Studio 2015 with cmake > 3.5.2 and am running into the following error: > > CMake Error at build/applications/CMakeFiles/git-data/grabRef.cmake:36 > (file): > file failed to open for reading (No such file or directory): > > C:/Work/Tools/Current/RTK-1.2.0/build/applications/CMakeFiles/git-data/head-ref > Call Stack (most recent call first): > cmake/GetGitRevisionDescription.cmake:77 (include) > applications/CMakeLists.txt:5 (get_git_head_revision) > > I am using ITK 4.9.0 and fresh download of RTK 1.2.0. > > How do I resolve this issue? > > Thanks again, > > Solomon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Thu May 12 00:12:17 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Thu, 12 May 2016 09:42:17 +0530 Subject: [Rtk-users] Reconstruction Volume. Message-ID: Hello users, I have successfully implemented CBCT reconstruction using both CUDA and CPU method. For finding the reconstruction volume size, I measured the actual object size. divided by respective axis number of pixels to get spacing. eg: If my object is 10x15x20 cm. I measure that dimensions. If the required volume is 500x600x700 px, to get spacing i used 10/500,15/600,20/700. But this is not practically possible for every object. Is there any way to find the reconstruction volume spacing other than doing the above method. I have SDD(Source Detector Distance), SID(Source Isocenter Distance), Detector physical size,pixel density. Thanks and Regards AMJAD N -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 12 01:31:51 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 12 May 2016 07:31:51 +0200 Subject: [Rtk-users] Reconstruction Volume. In-Reply-To: References: Message-ID: Hi, The typical solution (e.g., in clincial scanners) is to reconstruct the field-of-view of the scanner (every point in space that is seen by all source positions) because you know this is the only area of space where your reconstruction is going to be accurate. rtkfieldofview generates this FOV. Simon On Thu, May 12, 2016 at 6:12 AM, AMJAD N wrote: > Hello users, > > I have successfully implemented CBCT reconstruction using both CUDA and > CPU method. For finding the reconstruction volume size, I measured the > actual object size. divided by respective axis number of pixels to get > spacing. > > eg: If my object is 10x15x20 cm. I measure that dimensions. If the > required volume is 500x600x700 px, to get spacing i used > 10/500,15/600,20/700. > > But this is not practically possible for every object. Is there any way to > find the reconstruction volume spacing other than doing the above method. > > I have SDD(Source Detector Distance), SID(Source Isocenter Distance), > Detector physical size,pixel density. > > Thanks and Regards > > AMJAD N > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Fri May 13 04:30:33 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Fri, 13 May 2016 14:00:33 +0530 Subject: [Rtk-users] Object isocenter shift Message-ID: Hello users, During acquisition it is found that my object isocenter is shifted from turntable isocenter by DX and DY values. Source , turntable isocenter and detector center is aligned perfectly. Is there any method in RTK we can make use of to nullify the effect due to this isocenter shift? Thanks and Regards AMJAD -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 13 08:36:48 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 13 May 2016 14:36:48 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: Hi, I don't understand the question. The isocenter is by definition the center of rotation in RTK and we assume it's at the origin of the reconstructed volume. There is no such thing as an "object isocenter". DX and DY values are the shift of the projection origin (which can be anywhere) with respect to the central ray (source to isocenter ray). It is not the turntable isocenter. If you want to have dx=0 and dy=0, the projection origin must be changed. But it has to be constant for the whole projection stack. I hope it helps, Simon On Fri, May 13, 2016 at 10:30 AM, AMJAD N wrote: > Hello users, > During acquisition it is found that my object isocenter is shifted from > turntable isocenter by DX and DY values. Source , turntable isocenter and > detector center is aligned perfectly. Is there any method in RTK we can > make use of to nullify the effect due to this isocenter shift? > > Thanks and Regards > AMJAD > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Fri May 13 11:35:57 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Fri, 13 May 2016 17:35:57 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Message-ID: <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 13 12:15:09 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 13 May 2016 18:15:09 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Message-ID: Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein wrote: > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Sat May 14 05:48:01 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Sat, 14 May 2016 11:48:01 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Message-ID: <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Hello Simon, Thanks for your advice so far. I?m getting to know this filter better. At least I can now use it and save the result into a file. I updated my code which now uses a volume. The values of the input and output volume are equal except of the z-dimension of the output which I changed to the number of projection images. const unsigned int Dimension = 3; ?Reading image? ImageType::Pointer inputImage = reader->GetOutput(); ImageType::Pointer outputImage = ImageType::New(); RegionType inputRegion = inputImage->GetLargestPossibleRegion(); const unsigned int NumberOfProjectionImages = 45; ImageType::IndexType start; start[0] = inputRegion.GetIndex()[0]; start[1] = inputRegion.GetIndex()[1]; start[2] = inputRegion.GetIndex()[2]; RegionType::SizeType size; size[0] = inputRegion.GetSize()[0]; size[1] = inputRegion.GetSize()[1]; size[2] = NumberOfProjectionImages; RegionType region; region.SetSize(size); region.SetIndex(start); ImageType::SpacingType spacing; spacing[0] = inputImage->GetSpacing()[0]; spacing[1] = inputImage->GetSpacing()[1]; spacing[2] = inputImage->GetSpacing()[2]; ImageType::PointType origin; origin[0] = inputImage->GetOrigin()[0]; origin[1] = inputImage->GetOrigin()[1]; origin[2] = inputImage->GetOrigin()[2]; outputImage->SetRegions(region); outputImage->SetSpacing(spacing); outputImage->SetOrigin(origin); outputImage->Allocate(); outputImage->FillBuffer(size[0] * size[1] * size[2]); // Geometry typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(510., 510., i*8.); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->SetGeometry(geometry); forward->Update(); I?m not sure how I have to add projection for the geometry to get a result which I?m familiar with. Can you describe how do I have to interpret the result of the Joseph-Filter? I am familiar with sinograms and how they are computed, but one sinogram is created by the projections of one image slice as far as I understood it. What I want is to manipulate the image in the radon space and then perform a filtered back projection. Typically the articles describe techniques to reduce metal artifacts by using one 2D Slice. Is it possible to achieve something like that with the JosephFilter? I?m guessing since this filter won?t work well for 2D I have to use another filter. Can you give me a hint if I can do something like that with RTK or another ITK-based framework? Here a diagram which shows an example what I want to try. I tried also to use my code with one slice and added a zero padding like that: typedef itk::ConstantPadImageFilter ConstantPadImageFilterType; ConstantPadImageFilterType::Pointer padFilter = ConstantPadImageFilterType::New(); padFilter->SetInput(inputImage); ImageType::SizeType extendRegion; extendRegion[0] = 0; extendRegion[1] = 0; extendRegion[2] = 0; padFilter->SetPadLowerBound(extendRegion); padFilter->SetPadUpperBound(extendRegion); padFilter->SetConstant(1); padFilter->Update(); But the result of my png is a black square. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Freitag, 13. Mai 2016 18:15 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto: simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein < tstein at stud.hs-heilbronn.de> Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Sat May 14 06:17:18 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sat, 14 May 2016 12:17:18 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Message-ID: The output of the Joseph filter (of any forward projector) is a stack of projection images, i.e., a 3D image. If you slice this 3D image in the z direction, you get one projection images. If you slice this 3D image in the y direction, you get a sinogram, e.g., the 2D sinogram of the central slice (plane of the source trajectory) if y=0. The best way to have this sinogram is to set size[1]=1 and there is no better way to do it in RTK. For zero-padding, you need to set extendRegion[?]=1, with (for all dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that your image is a black square, something else must be going on. One thing to remember, the typical RTK rotation is around the y axis so your 3D slice must be 1 in the y direction. A simple way to change the orientation of one slice is to change its direction with ChangeImageFilter Simon On Sat, May 14, 2016 at 11:48 AM, Tobias Stein wrote: > Hello Simon, > > > > Thanks for your advice so far. I?m getting to know this filter better. At > least I can now use it and save the result into a file. > > > > I updated my code which now uses a volume. > > The values of the input and output volume are equal except of the > z-dimension of the output which I changed to the number of projection > images. > > const unsigned int Dimension = 3; > > ?Reading image? > > ImageType::Pointer inputImage = reader->GetOutput(); > > ImageType::Pointer outputImage = ImageType::New(); > > > > RegionType inputRegion = inputImage->GetLargestPossibleRegion(); > > > > const unsigned int NumberOfProjectionImages = 45; > > > > ImageType::IndexType start; > > start[0] = inputRegion.GetIndex()[0]; > > start[1] = inputRegion.GetIndex()[1]; > > start[2] = inputRegion.GetIndex()[2]; > > > > RegionType::SizeType size; > > size[0] = inputRegion.GetSize()[0]; > > size[1] = inputRegion.GetSize()[1]; > > size[2] = NumberOfProjectionImages; > > > > RegionType region; > > region.SetSize(size); > > region.SetIndex(start); > > > > ImageType::SpacingType spacing; > > spacing[0] = inputImage->GetSpacing()[0]; > > spacing[1] = inputImage->GetSpacing()[1]; > > spacing[2] = inputImage->GetSpacing()[2]; > > > > ImageType::PointType origin; > > origin[0] = inputImage->GetOrigin()[0]; > > origin[1] = inputImage->GetOrigin()[1]; > > origin[2] = inputImage->GetOrigin()[2]; > > > > outputImage->SetRegions(region); > > outputImage->SetSpacing(spacing); > > outputImage->SetOrigin(origin); > > outputImage->Allocate(); > > outputImage->FillBuffer(size[0] * size[1] * size[2]); > > > > // Geometry > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(510., 510., i*8.); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->SetGeometry(geometry); > > forward->Update(); > > > > I?m not sure how I have to add projection for the geometry to get a result > which I?m familiar with. > > > > Can you describe how do I have to interpret the result of the > Joseph-Filter? I am familiar with sinograms and how they are computed, but > one sinogram is created by the projections of one image slice as far as I > understood it. What I want is to manipulate the image in the radon space > and then perform a filtered back projection. Typically the articles > describe techniques to reduce metal artifacts by using one 2D Slice. Is it > possible to achieve something like that with the JosephFilter? I?m guessing > since this filter won?t work well for 2D I have to use another filter. Can > you give me a hint if I can do something like that with RTK or another > ITK-based framework? Here a diagram > which shows an example what I want to try. > > > > I tried also to use my code with one slice and added a zero padding like > that: > > typedef itk::ConstantPadImageFilter > ConstantPadImageFilterType; > > ConstantPadImageFilterType::Pointer padFilter = > ConstantPadImageFilterType::New(); > > padFilter->SetInput(inputImage); > > > > ImageType::SizeType extendRegion; > > extendRegion[0] = 0; > > extendRegion[1] = 0; > > extendRegion[2] = 0; > > > > padFilter->SetPadLowerBound(extendRegion); > > padFilter->SetPadUpperBound(extendRegion); > > padFilter->SetConstant(1); > > padFilter->Update(); > > But the result of my png is a black square. > > Tobias > > > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Freitag, 13. Mai 2016 18:15 > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > If you intialize the data of your itk::Image with FillBuffer with the > corresponding constant value, it is quite similar. The constant image value > allow us to stream the computation whereas you have to allocate the whole > image if you pass directly itk::Image. > > We only work in 3D and probably our projector don't work with 2D, that is > probably the problem here. You would have to correct the code for 2D but > that's a lot of work, we generally prefer pseudo 2D, see next point. > > I doubt that our forward projector will work well with one slice only if > you use 3D, we assume that the volume starts at the first pixel and ends at > the last pixel. You should probably add a zero border around with > itk::PadImage to see something. > > To avoid aliasing, you can cut frequencies in the ramp filter (look for > CutFrequency in the doxygen of rtk::FFTRampImageFilter). > > Simon > > > > On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: > > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Sat May 14 06:18:57 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sat, 14 May 2016 12:18:57 +0200 Subject: [Rtk-users] RTK training - June 17 2016 Message-ID: Dear all, The training on June 17 in Lyon is confirmed. Please register asap if you'd like to attend. Looking forward to meeting our users, Simon On Thu, Mar 10, 2016 at 11:02 AM, Simon Rit wrote: > Dear all, > The new date for the RTK training is Friday June 17. > I'm looking forward to meeting you there, > Simon > > On Sun, Mar 6, 2016 at 12:57 PM, Simon Rit > wrote: > >> Dear all, >> We have to fix another date for the RTK training due to a conflicting >> meeting. If you are interested, please fill in the foodle >> so that >> we fix a date that suits everyone. If none of these dates works for you, >> please let me know and we'll try to extend the foodle. >> Please answer before Tuesday, we'll fix the date on Tuesday evening. >> Thanks for your cooperation and apologies for the mess, >> Simon >> >> On Tue, Feb 9, 2016 at 11:49 AM, Simon Rit < >> simon.rit at creatis.insa-lyon.fr> wrote: >> >>> Dear RTK users, >>> We will organize a new training >>> session on June 22 2016 in >>> Lyon. Follow the instructions on the webpage >>> to register. The training is >>> for both users and developers. We are happy to answer any question that you >>> might have and we are looking forward to this new training session. >>> Simon >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Sun May 15 08:38:40 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Sun, 15 May 2016 14:38:40 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Message-ID: <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> If I understood you correct, the input of the Joseph-Filter needs to be oriented in the y-direction when I am dealing with axial oriented slices. Now I changed the direction of the 3D Slice by rotating it 90 degrees around the x-axis with the itk::ChangeInformationImageFilter to have my slice in the xz-layer in the y-direction: double rotationX = 90; itk::Versor< double > rotation; const double angleInRadians = rotationX * vnl_math::pi / 180.0; rotation.SetRotationAroundX(angleInRadians); const ImageType::DirectionType direction = inputImage->GetDirection(); const ImageType::DirectionType newDirection = direction * rotation.GetMatrix(); changeFilter->SetOutputDirection(newDirection); changeFilter->ChangeAll(); changeFilter->SetInput(inputImage); changeFilter->UpdateOutputInformation(); Then I added a zero-border as you told me (This changed the size of my region from [512, 512, 1] to [514, 514, 3]). While executing the Joseph Filter I got an error because a vector subscript was out of range. Maybe that?s because the index of the region is [-1,-1,-1] caused by the padding. I tried the padding after the Joseph Filter, and got a result which has a size [514, 3, 45], while 45 was the number of projection images but the image was still empty. I also tried the Jospeh Filter with a real 3D volume stack of slices, rotated it as described below and got a result. Now I am confused how I should create the geometry of the Joseph Filter to get a good result. typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(300., 500., i * 180 / NumberOfProjectionImages); I am trying to use a 180-degree rotation, but i don?t have the feeling for the distance values. I this code example I used an 3D Image with dimensions = [256, 256, 49] My idea was, since there is no way to get a result with a single 3D slice, I would use a stack of slices as input and slice the output volume in y-direction to get my sinogram as you said. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Samstag, 14. Mai 2016 12:17 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK The output of the Joseph filter (of any forward projector) is a stack of projection images, i.e., a 3D image. If you slice this 3D image in the z direction, you get one projection images. If you slice this 3D image in the y direction, you get a sinogram, e.g., the 2D sinogram of the central slice (plane of the source trajectory) if y=0. The best way to have this sinogram is to set size[1]=1 and there is no better way to do it in RTK. For zero-padding, you need to set extendRegion[?]=1, with (for all dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that your image is a black square, something else must be going on. One thing to remember, the typical RTK rotation is around the y axis so your 3D slice must be 1 in the y direction. A simple way to change the orientation of one slice is to change its direction with ChangeImageFilter Simon On Sat, May 14, 2016 at 11:48 AM, Tobias Stein > wrote: Hello Simon, Thanks for your advice so far. I?m getting to know this filter better. At least I can now use it and save the result into a file. I updated my code which now uses a volume. The values of the input and output volume are equal except of the z-dimension of the output which I changed to the number of projection images. const unsigned int Dimension = 3; ?Reading image? ImageType::Pointer inputImage = reader->GetOutput(); ImageType::Pointer outputImage = ImageType::New(); RegionType inputRegion = inputImage->GetLargestPossibleRegion(); const unsigned int NumberOfProjectionImages = 45; ImageType::IndexType start; start[0] = inputRegion.GetIndex()[0]; start[1] = inputRegion.GetIndex()[1]; start[2] = inputRegion.GetIndex()[2]; RegionType::SizeType size; size[0] = inputRegion.GetSize()[0]; size[1] = inputRegion.GetSize()[1]; size[2] = NumberOfProjectionImages; RegionType region; region.SetSize(size); region.SetIndex(start); ImageType::SpacingType spacing; spacing[0] = inputImage->GetSpacing()[0]; spacing[1] = inputImage->GetSpacing()[1]; spacing[2] = inputImage->GetSpacing()[2]; ImageType::PointType origin; origin[0] = inputImage->GetOrigin()[0]; origin[1] = inputImage->GetOrigin()[1]; origin[2] = inputImage->GetOrigin()[2]; outputImage->SetRegions(region); outputImage->SetSpacing(spacing); outputImage->SetOrigin(origin); outputImage->Allocate(); outputImage->FillBuffer(size[0] * size[1] * size[2]); // Geometry typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(510., 510., i*8.); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->SetGeometry(geometry); forward->Update(); I?m not sure how I have to add projection for the geometry to get a result which I?m familiar with. Can you describe how do I have to interpret the result of the Joseph-Filter? I am familiar with sinograms and how they are computed, but one sinogram is created by the projections of one image slice as far as I understood it. What I want is to manipulate the image in the radon space and then perform a filtered back projection. Typically the articles describe techniques to reduce metal artifacts by using one 2D Slice. Is it possible to achieve something like that with the JosephFilter? I?m guessing since this filter won?t work well for 2D I have to use another filter. Can you give me a hint if I can do something like that with RTK or another ITK-based framework? Here a diagram which shows an example what I want to try. I tried also to use my code with one slice and added a zero padding like that: typedef itk::ConstantPadImageFilter ConstantPadImageFilterType; ConstantPadImageFilterType::Pointer padFilter = ConstantPadImageFilterType::New(); padFilter->SetInput(inputImage); ImageType::SizeType extendRegion; extendRegion[0] = 0; extendRegion[1] = 0; extendRegion[2] = 0; padFilter->SetPadLowerBound(extendRegion); padFilter->SetPadUpperBound(extendRegion); padFilter->SetConstant(1); padFilter->Update(); But the result of my png is a black square. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com ] Im Auftrag von Simon Rit Gesendet: Freitag, 13. Mai 2016 18:15 An: Tobias Stein > Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto: simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein < tstein at stud.hs-heilbronn.de> Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 16 05:50:41 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 16 May 2016 11:50:41 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> Message-ID: Answers below. I think you need to understand better the coordinate system of an ITK image, maybe check ITK's doc. Simon On Sun, May 15, 2016 at 2:38 PM, Tobias Stein wrote: > If I understood you correct, the input of the Joseph-Filter needs to be > oriented in the y-direction when I am dealing with axial oriented slices. > Yes, or in other words, if you want to take projections around the axial axis, be aware that y is the default axis of rotation in RTK. > Now I changed the direction of the 3D Slice by rotating it 90 degrees > around the x-axis with the itk::ChangeInformationImageFilter to have my > slice in the xz-layer in the y-direction: > > double rotationX = 90; > > itk::Versor< double > rotation; > > const double angleInRadians = rotationX * vnl_math::pi / 180.0; > > rotation.SetRotationAroundX(angleInRadians); > > const ImageType::DirectionType direction = > inputImage->GetDirection(); > > const ImageType::DirectionType newDirection = direction * > rotation.GetMatrix(); > > changeFilter->SetOutputDirection(newDirection); > > changeFilter->ChangeAll(); > > changeFilter->SetInput(inputImage); > > changeFilter->UpdateOutputInformation(); > > > > Then I added a zero-border as you told me (This changed the size of my > region from [512, 512, 1] to [514, 514, 3]). > > While executing the Joseph Filter I got an error because a vector > subscript was out of range. Maybe that?s because the index of the region is > [-1,-1,-1] caused by the padding. > That should not have been a problem but that might be a bug... > I tried the padding after the Joseph Filter, and got a result which has a > size [514, 3, 45], while 45 was the number of projection images but the > image was still empty. > I guess you should check the origin of your projected volume and your projections. A simple test is to center your volume (check using ITK doc how you can define the origin so that (0,0,0) is at the center) and your projection (for the projection stack, only the first 2 coordinates count). > > > I also tried the Jospeh Filter with a real 3D volume stack of slices, > rotated it as described below and got a result. > > Now I am confused how I should create the geometry of the Joseph Filter to > get a good result. > > > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(300., 500., i * 180 / > NumberOfProjectionImages); > > > > I am trying to use a 180-degree rotation, but i don?t have the feeling for > the distance values. > > I this code example I used an 3D Image with dimensions = [256, 256, 49] > This doesn't tell you anything about the size of your volume, we also need the origin and the spacing. Look at the ITK doc to understand the ITK coordinate systems. > > > My idea was, since there is no way to get a result with a single 3D slice, > I would use a stack of slices as input and slice the output volume in > y-direction to get my sinogram as you said. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Samstag, 14. Mai 2016 12:17 > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > The output of the Joseph filter (of any forward projector) is a stack of > projection images, i.e., a 3D image. If you slice this 3D image in the z > direction, you get one projection images. If you slice this 3D image in the > y direction, you get a sinogram, e.g., the 2D sinogram of the central slice > (plane of the source trajectory) if y=0. The best way to have this sinogram > is to set size[1]=1 and there is no better way to do it in RTK. > > For zero-padding, you need to set extendRegion[?]=1, with (for all > dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that > your image is a black square, something else must be going on. One thing to > remember, the typical RTK rotation is around the y axis so your 3D slice > must be 1 in the y direction. A simple way to change the orientation of one > slice is to change its direction with ChangeImageFilter > > Simon > > > > > > On Sat, May 14, 2016 at 11:48 AM, Tobias Stein < > tstein at stud.hs-heilbronn.de> wrote: > > Hello Simon, > > > > Thanks for your advice so far. I?m getting to know this filter better. At > least I can now use it and save the result into a file. > > > > I updated my code which now uses a volume. > > The values of the input and output volume are equal except of the > z-dimension of the output which I changed to the number of projection > images. > > const unsigned int Dimension = 3; > > ?Reading image? > > ImageType::Pointer inputImage = reader->GetOutput(); > > ImageType::Pointer outputImage = ImageType::New(); > > > > RegionType inputRegion = inputImage->GetLargestPossibleRegion(); > > > > const unsigned int NumberOfProjectionImages = 45; > > > > ImageType::IndexType start; > > start[0] = inputRegion.GetIndex()[0]; > > start[1] = inputRegion.GetIndex()[1]; > > start[2] = inputRegion.GetIndex()[2]; > > > > RegionType::SizeType size; > > size[0] = inputRegion.GetSize()[0]; > > size[1] = inputRegion.GetSize()[1]; > > size[2] = NumberOfProjectionImages; > > > > RegionType region; > > region.SetSize(size); > > region.SetIndex(start); > > > > ImageType::SpacingType spacing; > > spacing[0] = inputImage->GetSpacing()[0]; > > spacing[1] = inputImage->GetSpacing()[1]; > > spacing[2] = inputImage->GetSpacing()[2]; > > > > ImageType::PointType origin; > > origin[0] = inputImage->GetOrigin()[0]; > > origin[1] = inputImage->GetOrigin()[1]; > > origin[2] = inputImage->GetOrigin()[2]; > > > > outputImage->SetRegions(region); > > outputImage->SetSpacing(spacing); > > outputImage->SetOrigin(origin); > > outputImage->Allocate(); > > outputImage->FillBuffer(size[0] * size[1] * size[2]); > > > > // Geometry > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(510., 510., i*8.); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->SetGeometry(geometry); > > forward->Update(); > > > > I?m not sure how I have to add projection for the geometry to get a result > which I?m familiar with. > > > > Can you describe how do I have to interpret the result of the > Joseph-Filter? I am familiar with sinograms and how they are computed, but > one sinogram is created by the projections of one image slice as far as I > understood it. What I want is to manipulate the image in the radon space > and then perform a filtered back projection. Typically the articles > describe techniques to reduce metal artifacts by using one 2D Slice. Is it > possible to achieve something like that with the JosephFilter? I?m guessing > since this filter won?t work well for 2D I have to use another filter. Can > you give me a hint if I can do something like that with RTK or another > ITK-based framework? Here a diagram > which shows an example what I want to try. > > > > I tried also to use my code with one slice and added a zero padding like > that: > > typedef itk::ConstantPadImageFilter > ConstantPadImageFilterType; > > ConstantPadImageFilterType::Pointer padFilter = > ConstantPadImageFilterType::New(); > > padFilter->SetInput(inputImage); > > > > ImageType::SizeType extendRegion; > > extendRegion[0] = 0; > > extendRegion[1] = 0; > > extendRegion[2] = 0; > > > > padFilter->SetPadLowerBound(extendRegion); > > padFilter->SetPadUpperBound(extendRegion); > > padFilter->SetConstant(1); > > padFilter->Update(); > > But the result of my png is a black square. > > Tobias > > > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Freitag, 13. Mai 2016 18:15 > > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > If you intialize the data of your itk::Image with FillBuffer with the > corresponding constant value, it is quite similar. The constant image value > allow us to stream the computation whereas you have to allocate the whole > image if you pass directly itk::Image. > > We only work in 3D and probably our projector don't work with 2D, that is > probably the problem here. You would have to correct the code for 2D but > that's a lot of work, we generally prefer pseudo 2D, see next point. > > I doubt that our forward projector will work well with one slice only if > you use 3D, we assume that the volume starts at the first pixel and ends at > the last pixel. You should probably add a zero border around with > itk::PadImage to see something. > > To avoid aliasing, you can cut frequencies in the ramp filter (look for > CutFrequency in the doxygen of rtk::FFTRampImageFilter). > > Simon > > > > On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: > > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Tue May 17 07:07:20 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Tue, 17 May 2016 16:37:20 +0530 Subject: [Rtk-users] Object isocenter shift Message-ID: Hello, As my previous thread caused some confusion, I am attaching an image showing the same in detail. As you can see my object center is not aligned with isocenter line. Besides it is offset by DX and DY values. In my case you can see the object center as red dot. Is there any method in RTK to nullify this offset effect? Will the rotation of turntable affect the reconstruction due to this offset? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: objectoffset.png Type: image/png Size: 12365 bytes Desc: not available URL: From cyril.mory at uclouvain.be Tue May 17 08:19:38 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Tue, 17 May 2016 14:19:38 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: <573B0C5A.4030001@uclouvain.be> Well, if it's just that, you should not worry about it : you cannot perfectly center your object, even if you try. And most objects (e.g. patients) do not even have a "center". So it does not make sense to struggle to have the center of the object perfectly match the isocenter of the acquisition device. You can either live with that (it is perfectly fine for most applications), or try one of these things: - If you can re-do the acquisition, you should try to have your object's center _roughly_ match the system's isocenter, because that's where you will have the least artifacts - Reconstruct your object as it is (it will work fine, unless there are other problems), but select the origin and size of your reconstructed volume carefully to have your object's center roughly at the center of your reconstructed volume. If you are not familiar with the exact definition of "origin", "spacing" and "size" of an itk::image, read section 4.1.4 of the ITK software guide (https://itk.org/ItkSoftwareGuide.pdf). This is both clear, short, and something extremely important to understand. I hope it helps, Cyril On 05/17/2016 01:07 PM, AMJAD N wrote: > Hello, > > As my previous thread caused some confusion, I am attaching an image > showing the same in detail. > > As you can see my object center is not aligned with isocenter line. > Besides it is offset by DX and DY values. In my case you can see the > object center as red dot. > > Is there any method in RTK to nullify this offset effect? > Will the rotation of turntable affect the reconstruction due to this > offset? > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From wuchao04 at gmail.com Tue May 17 09:24:58 2016 From: wuchao04 at gmail.com (Chao Wu) Date: Tue, 17 May 2016 15:24:58 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: There's nothing to correct or compensate for DURING reconstruction in your case. Where you put your object dose not change the geometry of the CT system at all. As long as the object is still inside FOV, a normal reconstruction will give you a correct result. In the resulting image, the origin is at the center of rotation, and the object is off-center by DX and DY, that's it. If you want the origin to be at the center of the object, you can shift it by DX/DY AFTER reconstruction. Regards, Chao 2016-05-17 13:07 GMT+02:00 AMJAD N : > Hello, > > As my previous thread caused some confusion, I am attaching an image > showing the same in detail. > > As you can see my object center is not aligned with isocenter line. > Besides it is offset by DX and DY values. In my case you can see the object > center as red dot. > > Is there any method in RTK to nullify this offset effect? > Will the rotation of turntable affect the reconstruction due to this > offset? > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shiraska at gmail.com Thu May 19 04:41:54 2016 From: shiraska at gmail.com (Shiras Abdurahman) Date: Thu, 19 May 2016 10:41:54 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction Message-ID: Dear all, I am trying to simulate Tomosynthesis reconstruction with stationary flat panel detector where source rotates around Y axis to acquire 21 projections (system geometry diagram is attached). Geometry file geometry.xml is generated with Reg23ProjectionGeometry. I generated projection images of a cube volume and then I tried to reconstruct with FDK algorithm. Even though I am able to generate projections, FDK reconstruction yields the volume with all voxel values zero. The commands I used for generating projections and reconstructing volume are rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 --dimension=256,256,256 --hardware=cuda I am also attaching geometry xml file, mhd header files of the original volume, projections and reconstructed volume. With regards, Shiras -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: geometry.xml Type: text/xml Size: 11889 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fdk.mhd Type: application/octet-stream Size: 322 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: projections.mhd Type: application/octet-stream Size: 335 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: volume.mhd Type: application/octet-stream Size: 355 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: system_geometry.PNG Type: image/png Size: 50006 bytes Desc: not available URL: From cyril.mory at uclouvain.be Fri May 20 04:38:22 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Fri, 20 May 2016 10:38:22 +0200 Subject: [Rtk-users] Compiler RTK In-Reply-To: <573E430F.5030704@uclouvain.be> References: <573E430F.5030704@uclouvain.be> Message-ID: <573ECCFE.3070500@uclouvain.be> Hi Kevin, I'm replying to the RTK users mailing list. Next time, please send your questions to this list instead of just me (except when it specifically involves reggui, for example). I have tried to reproduce the error but the compilation runs fine on my machine. Can you send information on your compiler ? Maybe someone else on the list can help ? Cyril On 05/20/2016 12:49 AM, Kevin Souris wrote: > Bonjour, > > Je viens de t?l?charger la derni?re version de RTK sur Github. > J'essaye maintenant de compiler sur une machine linux et j'obtiens > cette erreur: > > /home/pen/RTK/RTK-master/applications/rtkprojections/rtkprojections.cxx: > In function ?int main(int, char**)?: > /home/pen/RTK/RTK-master/applications/rtkprojections*/**rtkprojections.cxx:27: > error: invalid conversion from ?const char*? to ?char*?* > /home/pen/RTK/RTK-master/applications/rtkprojections/rtkprojections.cxx:27: > error: initializing argument 1 of ?int > cmdline_parser_rtkprojections_config_file(char*, > args_info_rtkprojections*, cmdline_parser_rtkprojections_params*)? > > Comment puis-je r?parer ?a ? > Merci > > Kevin > > > > > -- > Kevin Souris, PhD student > Universit? catholique de Louvain > Molecular Imagery, Radiotherapy and Oncology (MIRO) -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 25 15:45:57 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 25 May 2016 21:45:57 +0200 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Hi Solomon, I had still to look into this on my todo list. I did again but now I think I overlooked something in your email. You say that going through ChangeInformationImageFilter might be the problem. But now, I wonder if the problem is not that the origin that you set is wrong and then the volume or the projections are completely off (hence the projections). So, here is my question : what happens if you replace filter -> SetOutputOrigin(origin); with filter -> SetOutputOrigin(image->GetOutputOrigin()); Of course, it's not what you want to do but it might point to a wrong choice of origin... Simon On Fri, May 6, 2016 at 1:45 AM, Solomon Tang wrote: > Hi Simon, > > I added the line as you suggested and it does not change the output (still > blank). Sorry for the delayed response. > > Thanks for looking into it! > > On Wed, May 4, 2016 at 12:16 AM, Simon Rit > wrote: > >> Dear Solomon, >> Thanks for the report. It looks like a bug to me. I checked and >> itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in >> the itkGPUImage and the itkCudaImage, this function does not check >> consistency between CPU and GPU data. I'll work on a minimal example to >> check this but can you test that your problem is solved if you add >> m_DataManager->UpdateCPUBuffer(); >> before >> m_DataManager->SetGPUBufferDirty(); >> in itkCudaImage.h line 121? >> Thanks, >> Simon >> >> On Mon, May 2, 2016 at 10:42 PM, Solomon Tang >> wrote: >> >>> Thanks for the tip Simon, >>> >>> I think I may have figured it out. I initially read as a CUDA Image, and >>> then passed the CUDA image through ChangeInformationImageFilter to change >>> the offset of the image. >>> >>> template >>> typename itk::CudaImage::Pointer ShiftOffset( >>> const typename itk::CudaImage::Pointer image, >>> const typename itk::Image::PointType origin) >>> { >>> typedef itk::ChangeInformationImageFilter< itk::CudaImage > >>> FilterType; >>> FilterType::Pointer filter = FilterType::New(); >>> filter -> SetInput(image); >>> filter -> SetOutputOrigin(origin); >>> filter -> ChangeOriginOn(); >>> filter -> UpdateOutputInformation(); >>> filter -> Update(); >>> return filter->GetOutput(); >>> } >>> >>> If I pass the offset image pointer to ForwardProjection, it outputs a >>> blank image. >>> >>> However, when I write the offset image and then read it again as a CUDA >>> image, then the ForwardProjection works as intended. Perhaps using the CUDA >>> version of ITK would fix this. >>> >>> >>> On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < >>> simon.rit at creatis.insa-lyon.fr> wrote: >>> >>>> Hi Solomon, >>>> Hard to say without the full code. Maybe the cudaness of your output >>>> image is lost further in the code. Try accessing the CPU buffer at the end, >>>> after the update, to be sure that the GPU image is transferred to CPU, e.g. >>>> std::cout << forwardProjection->GetOutput()->GetPointer() <>>> Simon >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 26 12:04:47 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 26 May 2016 18:04:47 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Hi Shiras, I generated a volume to look at your problem: rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 --offset 0,0,1.7 Then I obtained the same issue as you. I think the problem is that rtkfdk is meant for circular CBCT and it includes pre-weighting for displaced detector and short scan. I'm not sure why you don't get a warning but these are probably responsible for the blank output. A simple solution is to do only the 3 FDK steps using in order the command tools: rtktwodweights rtkramp rtkbackprojections You can also try to shunt the preweighting by modifying rtkfdk.cxx. It's interesting that you try out tomosynthesis but you'll encounter some problem. When I ran the above commands, I get very weird results because the first and the last projections get a lot more weight than the others since it looks at the angular weight with the previous and the next projections. A simple solution is to blank out these two projections. Good luck and keep us posted if you get interesting results, Simon On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman wrote: > Dear all, > > I am trying to simulate Tomosynthesis reconstruction with stationary flat > panel detector where source rotates around Y axis to acquire 21 projections > (system geometry diagram is attached). Geometry file geometry.xml is > generated with Reg23ProjectionGeometry. I generated projection images of > a cube volume and then I tried to reconstruct with FDK algorithm. Even > though I am able to generate projections, FDK reconstruction yields the > volume with all voxel values zero. The commands I used for generating > projections and reconstructing volume are > > rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd > --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast > rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml > --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 > --dimension=256,256,256 --hardware=cuda > > I am also attaching geometry xml file, mhd header files of the original > volume, projections and reconstructed volume. > > With regards, > Shiras > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shiraska at gmail.com Fri May 27 11:31:52 2016 From: shiraska at gmail.com (Shiras Abdurahman) Date: Fri, 27 May 2016 17:31:52 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Dear Simon, Thank you very much for the reply. I tried to reconstruct with only ramp filtering and back projection and the results are looking good without any weighting of the projections. I also reconstructed the volume with rtksart with 10 iterations and the results are better than rtkfdk. With these experiments, I also confirmed that my geometry file is accurate. Thank you very much for your help. With regards, Shiras On Thu, May 26, 2016 at 6:04 PM, Simon Rit wrote: > Hi Shiras, > I generated a volume to look at your problem: > rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 > --offset 0,0,1.7 > Then I obtained the same issue as you. I think the problem is that rtkfdk > is meant for circular CBCT and it includes pre-weighting for displaced > detector and short scan. I'm not sure why you don't get a warning but these > are probably responsible for the blank output. A simple solution is to do > only the 3 FDK steps using in order the command tools: > rtktwodweights > rtkramp > rtkbackprojections > You can also try to shunt the preweighting by modifying rtkfdk.cxx. > > It's interesting that you try out tomosynthesis but you'll encounter some > problem. When I ran the above commands, I get very weird results because > the first and the last projections get a lot more weight than the others > since it looks at the angular weight with the previous and the next > projections. A simple solution is to blank out these two projections. > Good luck and keep us posted if you get interesting results, > Simon > > On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman > wrote: > >> Dear all, >> >> I am trying to simulate Tomosynthesis reconstruction with stationary flat >> panel detector where source rotates around Y axis to acquire 21 projections >> (system geometry diagram is attached). Geometry file geometry.xml is >> generated with Reg23ProjectionGeometry. I generated projection images of >> a cube volume and then I tried to reconstruct with FDK algorithm. Even >> though I am able to generate projections, FDK reconstruction yields the >> volume with all voxel values zero. The commands I used for generating >> projections and reconstructing volume are >> >> rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd >> --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast >> rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml >> --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 >> --dimension=256,256,256 --hardware=cuda >> >> I am also attaching geometry xml file, mhd header files of the original >> volume, projections and reconstructed volume. >> >> With regards, >> Shiras >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 27 12:00:56 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 27 May 2016 18:00:56 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Indeed, the angular weighting resulting from the discretization of the back projection occurs in rtkfdktwodweights so skipping this might help. Simon On 27 May 2016 5:32 p.m., "Shiras Abdurahman" wrote: Dear Simon, Thank you very much for the reply. I tried to reconstruct with only ramp filtering and back projection and the results are looking good without any weighting of the projections. I also reconstructed the volume with rtksart with 10 iterations and the results are better than rtkfdk. With these experiments, I also confirmed that my geometry file is accurate. Thank you very much for your help. With regards, Shiras On Thu, May 26, 2016 at 6:04 PM, Simon Rit wrote: > Hi Shiras, > I generated a volume to look at your problem: > rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 > --offset 0,0,1.7 > Then I obtained the same issue as you. I think the problem is that rtkfdk > is meant for circular CBCT and it includes pre-weighting for displaced > detector and short scan. I'm not sure why you don't get a warning but these > are probably responsible for the blank output. A simple solution is to do > only the 3 FDK steps using in order the command tools: > rtktwodweights > rtkramp > rtkbackprojections > You can also try to shunt the preweighting by modifying rtkfdk.cxx. > > It's interesting that you try out tomosynthesis but you'll encounter some > problem. When I ran the above commands, I get very weird results because > the first and the last projections get a lot more weight than the others > since it looks at the angular weight with the previous and the next > projections. A simple solution is to blank out these two projections. > Good luck and keep us posted if you get interesting results, > Simon > > On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman > wrote: > >> Dear all, >> >> I am trying to simulate Tomosynthesis reconstruction with stationary flat >> panel detector where source rotates around Y axis to acquire 21 projections >> (system geometry diagram is attached). Geometry file geometry.xml is >> generated with Reg23ProjectionGeometry. I generated projection images of >> a cube volume and then I tried to reconstruct with FDK algorithm. Even >> though I am able to generate projections, FDK reconstruction yields the >> volume with all voxel values zero. The commands I used for generating >> projections and reconstructing volume are >> >> rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd >> --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast >> rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml >> --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 >> --dimension=256,256,256 --hardware=cuda >> >> I am also attaching geometry xml file, mhd header files of the original >> volume, projections and reconstructed volume. >> >> With regards, >> Shiras >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 31 12:02:32 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 31 May 2016 18:02:32 +0200 Subject: [Rtk-users] Rooster In-Reply-To: References: Message-ID: Hi Guillaume, I'm adding RTK user list to this conversation, it's better to have these conversations on the mailing list IMO. Can you tell us what's the volume size and the GPU? Cyril is ROOSTER's dev, maybe he could comment on recon times. Simon On Tue, May 31, 2016 at 5:29 PM, wrote: > Hi Simon, > > I tried the rooster recon. I used the parameters from the example page. The results looks rather nice but it took several hours to run (5-6). Its a big dataset of about 2000 256x256 projections. > > Guillaume From G.Landry at physik.uni-muenchen.de Tue May 31 13:48:28 2016 From: G.Landry at physik.uni-muenchen.de (G.Landry at physik.uni-muenchen.de) Date: Tue, 31 May 2016 19:48:28 +0200 Subject: [Rtk-users] Rooster In-Reply-To: References: Message-ID: <20160531194828.Horde.Im1irUOnkCrL1p8oGSue_A5@webmail.physik.lmu.de> Hi Simon, Thanks for mailing list suggestion. My initial question was about typical reconstruction times for rtkfourdrooster. What I tried is summarized below: -Volume size was 410 410 264 and could be easily reduced by a good margin. -The GPU is quadro M4000 with 8GB -about 2300 256x256 projections with shifted elekta panel (so called M20) -10 phases -for the motion mask at the moment I just used the FOV mask for first try. --gamma_time 0.0001 --gamma_space 0.0001 - spacing 1 1 1 --niter 30 --cgiter 4 --tviter 10 Recon time was about 5-6 hours. I saw about 4 Gb used on the card. The image looked nice, albeit with the TV "feel/plastic-y". Thanks for your feedback Guillaume Quoting Simon Rit : > Hi Guillaume, > I'm adding RTK user list to this conversation, it's better to have > these conversations on the mailing list IMO. Can you tell us what's > the volume size and the GPU? > Cyril is ROOSTER's dev, maybe he could comment on recon times. > Simon > > On Tue, May 31, 2016 at 5:29 PM, wrote: >> Hi Simon, >> >> I tried the rooster recon. I used the parameters from the example >> page. The results looks rather nice but it took several hours to >> run (5-6). Its a big dataset of about 2000 256x256 projections. >> >> Guillaume -- Dr. Guillaume Landry Ludwig Maximilians University (LMU) Munich Medical Physics Am Coulombwall 1 85748 Garching Tel:+49 (0) 89 289-14077 Fax:+49 (0) 89 289-14072 From solomoncztang at gmail.com Mon May 2 16:42:44 2016 From: solomoncztang at gmail.com (Solomon Tang) Date: Mon, 2 May 2016 13:42:44 -0700 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Thanks for the tip Simon, I think I may have figured it out. I initially read as a CUDA Image, and then passed the CUDA image through ChangeInformationImageFilter to change the offset of the image. template typename itk::CudaImage::Pointer ShiftOffset( const typename itk::CudaImage::Pointer image, const typename itk::Image::PointType origin) { typedef itk::ChangeInformationImageFilter< itk::CudaImage > FilterType; FilterType::Pointer filter = FilterType::New(); filter -> SetInput(image); filter -> SetOutputOrigin(origin); filter -> ChangeOriginOn(); filter -> UpdateOutputInformation(); filter -> Update(); return filter->GetOutput(); } If I pass the offset image pointer to ForwardProjection, it outputs a blank image. However, when I write the offset image and then read it again as a CUDA image, then the ForwardProjection works as intended. Perhaps using the CUDA version of ITK would fix this. On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit wrote: > Hi Solomon, > Hard to say without the full code. Maybe the cudaness of your output image > is lost further in the code. Try accessing the CPU buffer at the end, after > the update, to be sure that the GPU image is transferred to CPU, e.g. > std::cout << forwardProjection->GetOutput()->GetPointer() < Simon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Tue May 3 18:59:03 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Wed, 4 May 2016 00:59:03 +0200 Subject: [Rtk-users] forward and back projection - MITK Message-ID: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I've seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I've also seen the test for this class but I don't get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I've got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 4 03:02:05 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 4 May 2016 09:02:05 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Message-ID: Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein wrote: > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 4 03:16:33 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 4 May 2016 09:16:33 +0200 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Dear Solomon, Thanks for the report. It looks like a bug to me. I checked and itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in the itkGPUImage and the itkCudaImage, this function does not check consistency between CPU and GPU data. I'll work on a minimal example to check this but can you test that your problem is solved if you add m_DataManager->UpdateCPUBuffer(); before m_DataManager->SetGPUBufferDirty(); in itkCudaImage.h line 121? Thanks, Simon On Mon, May 2, 2016 at 10:42 PM, Solomon Tang wrote: > Thanks for the tip Simon, > > I think I may have figured it out. I initially read as a CUDA Image, and > then passed the CUDA image through ChangeInformationImageFilter to change > the offset of the image. > > template > typename itk::CudaImage::Pointer ShiftOffset( > const typename itk::CudaImage::Pointer image, > const typename itk::Image::PointType origin) > { > typedef itk::ChangeInformationImageFilter< itk::CudaImage > > FilterType; > FilterType::Pointer filter = FilterType::New(); > filter -> SetInput(image); > filter -> SetOutputOrigin(origin); > filter -> ChangeOriginOn(); > filter -> UpdateOutputInformation(); > filter -> Update(); > return filter->GetOutput(); > } > > If I pass the offset image pointer to ForwardProjection, it outputs a > blank image. > > However, when I write the offset image and then read it again as a CUDA > image, then the ForwardProjection works as intended. Perhaps using the CUDA > version of ITK would fix this. > > > On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < > simon.rit at creatis.insa-lyon.fr> wrote: > >> Hi Solomon, >> Hard to say without the full code. Maybe the cudaness of your output >> image is lost further in the code. Try accessing the CPU buffer at the end, >> after the update, to be sure that the GPU image is transferred to CPU, e.g. >> std::cout << forwardProjection->GetOutput()->GetPointer() <> Simon >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Wed May 4 05:04:28 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Wed, 4 May 2016 14:34:28 +0530 Subject: [Rtk-users] Reconstructed Slice save as tiff Message-ID: Hi all, I have wrote code for saving output volume stack as *.tiff. Currently I am getting output of XY axis. What should I do in order to get the other axes. My code is shown below. typedef itk::StreamingImageFilter StreamerType; StreamerType::Pointer streamerBP = StreamerType::New(); streamerBP->SetInput(feldkampCUDA->GetOutput()); streamerBP->SetNumberOfStreamDivisions(8); typedef itk::Image< float, 2 > Image2DType; typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; WriterType::Pointer writer = WriterType::New(); writer->SetInput(streamerBP->GetOutput()); typedef itk::NumericSeriesFileNames NameGeneratorType; NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); nameGenerator->SetStartIndex(0); nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the Z-axis value of //reconstructed volume nameGenerator->SetIncrementIndex(1); writer->SetFileNames(nameGenerator->GetFileNames()); writer->SetUseCompression(true); writer->Update(); PS: My reconstruction works fine. Thanks and Regards AMJAD N -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyril.mory at uclouvain.be Wed May 4 07:27:24 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Wed, 4 May 2016 13:27:24 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: References: Message-ID: <5729DC9C.10105@uclouvain.be> Hi Amjad, You can use an ITK extract filter to extract a region that corresponds to one of your slices (along the axis you want). The output of the extract filter will be 3D, so you will need to cast it into a 2D images using an ITK cast filter. Cyril On 05/04/2016 11:04 AM, AMJAD N wrote: > Hi all, > > I have wrote code for saving output volume stack as *.tiff. Currently > I am getting output of XY axis. What should I do in order to get the > other axes. > My code is shown below. > > typedef itk::StreamingImageFilter FloatImageType> StreamerType; > StreamerType::Pointer streamerBP = StreamerType::New(); > streamerBP->SetInput(feldkampCUDA->GetOutput()); > streamerBP->SetNumberOfStreamDivisions(8); > > typedef itk::Image< float, 2 > Image2DType; > typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; > WriterType::Pointer writer = WriterType::New(); > writer->SetInput(streamerBP->GetOutput()); > > typedef itk::NumericSeriesFileNames NameGeneratorType; > NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); > nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); > nameGenerator->SetStartIndex(0); > nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the > Z-axis value of //reconstructed volume > nameGenerator->SetIncrementIndex(1); > writer->SetFileNames(nameGenerator->GetFileNames()); > writer->SetUseCompression(true); > writer->Update(); > > PS: My reconstruction works fine. > > Thanks and Regards > > AMJAD N > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From wuchao04 at gmail.com Wed May 4 08:44:37 2016 From: wuchao04 at gmail.com (Chao Wu) Date: Wed, 4 May 2016 14:44:37 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: <5729DC9C.10105@uclouvain.be> References: <5729DC9C.10105@uclouvain.be> Message-ID: A small add-on (copied from ITK document): ExtractImageFilter also collapses dimensions so that the input image may have more dimensions than the output image (i.e. 4-D input image to a 3-D output image). To specify what dimensions to collapse, the ExtractionRegion must be specified. For any dimension dim where ExtractionRegion.Size[dim] = 0, that dimension is collapsed. The index to collapse on is specified by ExtractionRegion.Index[dim]. For example, we have a image 4D = a 4x4x4x4 image, and we want to get a 3D image, 3D = a 4x4x4 image, specified as [x,y,z,2] from 4D (i.e. the 3rd "time" slice from 4D). The ExtractionRegion.Size = [4,4,4,0] and ExtractionRegion.Index = [0,0,0,2]. Regards, Chao 2016-05-04 13:27 GMT+02:00 Cyril Mory : > Hi Amjad, > > You can use an ITK extract filter to extract a region that corresponds to > one of your slices (along the axis you want). The output of the extract > filter will be 3D, so you will need to cast it into a 2D images using an > ITK cast filter. > > Cyril > > > On 05/04/2016 11:04 AM, AMJAD N wrote: > > Hi all, > > I have wrote code for saving output volume stack as *.tiff. Currently I am > getting output of XY axis. What should I do in order to get the other axes. > My code is shown below. > > typedef itk::StreamingImageFilter > StreamerType; > StreamerType::Pointer streamerBP = StreamerType::New(); > streamerBP->SetInput(feldkampCUDA->GetOutput()); > streamerBP->SetNumberOfStreamDivisions(8); > > typedef itk::Image< float, 2 > Image2DType; > typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; > WriterType::Pointer writer = WriterType::New(); > writer->SetInput(streamerBP->GetOutput()); > > typedef itk::NumericSeriesFileNames NameGeneratorType; > NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); > nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); > nameGenerator->SetStartIndex(0); > nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the > Z-axis value of //reconstructed volume > nameGenerator->SetIncrementIndex(1); > writer->SetFileNames(nameGenerator->GetFileNames()); > writer->SetUseCompression(true); > writer->Update(); > > PS: My reconstruction works fine. > > Thanks and Regards > > AMJAD N > > > > _______________________________________________ > Rtk-users mailing listRtk-users at public.kitware.comhttp://public.kitware.com/mailman/listinfo/rtk-users > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyril.mory at uclouvain.be Wed May 4 08:56:14 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Wed, 4 May 2016 14:56:14 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: References: <5729DC9C.10105@uclouvain.be> Message-ID: <5729F16E.5020402@uclouvain.be> Thanks Chao Wu, You're right, I was mistaken : the cast filter is not required in this case. It is needed, on the other hand, to increase the dimension of an image. So in this case, Amjad, you don't need it. Cyril On 05/04/2016 02:44 PM, Chao Wu wrote: > A small add-on (copied from ITK document): > > ExtractImageFilter also collapses dimensions so that the input image > may have more dimensions than the output image (i.e. 4-D input image > to a 3-D output image). To specify what dimensions to collapse, the > ExtractionRegion must be specified. For any dimension dim where > ExtractionRegion.Size[dim] = 0, that dimension is collapsed. The index > to collapse on is specified by ExtractionRegion.Index[dim]. For > example, we have a image 4D = a 4x4x4x4 image, and we want to get a 3D > image, 3D = a 4x4x4 image, specified as [x,y,z,2] from 4D (i.e. the > 3rd "time" slice from 4D). The ExtractionRegion.Size = [4,4,4,0] and > ExtractionRegion.Index = [0,0,0,2]. > > Regards, > Chao > > 2016-05-04 13:27 GMT+02:00 Cyril Mory >: > > Hi Amjad, > > You can use an ITK extract filter to extract a region that > corresponds to one of your slices (along the axis you want). The > output of the extract filter will be 3D, so you will need to cast > it into a 2D images using an ITK cast filter. > > Cyril > > > On 05/04/2016 11:04 AM, AMJAD N wrote: >> Hi all, >> >> I have wrote code for saving output volume stack as *.tiff. >> Currently I am getting output of XY axis. What should I do in >> order to get the other axes. >> My code is shown below. >> >> typedef itk::StreamingImageFilter> FloatImageType> StreamerType; >> StreamerType::Pointer streamerBP = StreamerType::New(); >> streamerBP->SetInput(feldkampCUDA->GetOutput()); >> streamerBP->SetNumberOfStreamDivisions(8); >> >> typedef itk::Image< float, 2 > Image2DType; >> typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > >> WriterType; >> WriterType::Pointer writer = WriterType::New(); >> writer->SetInput(streamerBP->GetOutput()); >> >> typedef itk::NumericSeriesFileNames NameGeneratorType; >> NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); >> nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); >> nameGenerator->SetStartIndex(0); >> nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] >> is the Z-axis value of //reconstructed volume >> nameGenerator->SetIncrementIndex(1); >> writer->SetFileNames(nameGenerator->GetFileNames()); >> writer->SetUseCompression(true); >> writer->Update(); >> >> PS: My reconstruction works fine. >> >> Thanks and Regards >> >> AMJAD N >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From solomoncztang at gmail.com Thu May 5 19:45:43 2016 From: solomoncztang at gmail.com (Solomon Tang) Date: Thu, 5 May 2016 16:45:43 -0700 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Hi Simon, I added the line as you suggested and it does not change the output (still blank). Sorry for the delayed response. Thanks for looking into it! On Wed, May 4, 2016 at 12:16 AM, Simon Rit wrote: > Dear Solomon, > Thanks for the report. It looks like a bug to me. I checked and > itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in > the itkGPUImage and the itkCudaImage, this function does not check > consistency between CPU and GPU data. I'll work on a minimal example to > check this but can you test that your problem is solved if you add > m_DataManager->UpdateCPUBuffer(); > before > m_DataManager->SetGPUBufferDirty(); > in itkCudaImage.h line 121? > Thanks, > Simon > > On Mon, May 2, 2016 at 10:42 PM, Solomon Tang > wrote: > >> Thanks for the tip Simon, >> >> I think I may have figured it out. I initially read as a CUDA Image, and >> then passed the CUDA image through ChangeInformationImageFilter to change >> the offset of the image. >> >> template >> typename itk::CudaImage::Pointer ShiftOffset( >> const typename itk::CudaImage::Pointer image, >> const typename itk::Image::PointType origin) >> { >> typedef itk::ChangeInformationImageFilter< itk::CudaImage > >> FilterType; >> FilterType::Pointer filter = FilterType::New(); >> filter -> SetInput(image); >> filter -> SetOutputOrigin(origin); >> filter -> ChangeOriginOn(); >> filter -> UpdateOutputInformation(); >> filter -> Update(); >> return filter->GetOutput(); >> } >> >> If I pass the offset image pointer to ForwardProjection, it outputs a >> blank image. >> >> However, when I write the offset image and then read it again as a CUDA >> image, then the ForwardProjection works as intended. Perhaps using the CUDA >> version of ITK would fix this. >> >> >> On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < >> simon.rit at creatis.insa-lyon.fr> wrote: >> >>> Hi Solomon, >>> Hard to say without the full code. Maybe the cudaness of your output >>> image is lost further in the code. Try accessing the CPU buffer at the end, >>> after the update, to be sure that the GPU image is transferred to CPU, e.g. >>> std::cout << forwardProjection->GetOutput()->GetPointer() <>> Simon >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 10 01:29:44 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 10 May 2016 07:29:44 +0200 Subject: [Rtk-users] Cmake build error help In-Reply-To: References: Message-ID: <573171C8.80400@creatis.insa-lyon.fr> Hi, Can you update GetGitRevisionDescription.cmake and GetGitRevisionDescription.cmake.in from https://github.com/rpavlik/cmake-modules and see if the new versions fix this issue? Thanks, Simon PS: plead keep using the mailing list On 10/05/2016 03:09, Solomon Tang wrote: > Hi Simon, > > I am rebuilding RTK after moving to Visual Studio 2015 with cmake > 3.5.2 and am running into the following error: > > CMake Error at build/applications/CMakeFiles/git-data/grabRef.cmake:36 > (file): > file failed to open for reading (No such file or directory): > > C:/Work/Tools/Current/RTK-1.2.0/build/applications/CMakeFiles/git-data/head-ref > Call Stack (most recent call first): > cmake/GetGitRevisionDescription.cmake:77 (include) > applications/CMakeLists.txt:5 (get_git_head_revision) > > I am using ITK 4.9.0 and fresh download of RTK 1.2.0. > > How do I resolve this issue? > > Thanks again, > > Solomon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Thu May 12 00:12:17 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Thu, 12 May 2016 09:42:17 +0530 Subject: [Rtk-users] Reconstruction Volume. Message-ID: Hello users, I have successfully implemented CBCT reconstruction using both CUDA and CPU method. For finding the reconstruction volume size, I measured the actual object size. divided by respective axis number of pixels to get spacing. eg: If my object is 10x15x20 cm. I measure that dimensions. If the required volume is 500x600x700 px, to get spacing i used 10/500,15/600,20/700. But this is not practically possible for every object. Is there any way to find the reconstruction volume spacing other than doing the above method. I have SDD(Source Detector Distance), SID(Source Isocenter Distance), Detector physical size,pixel density. Thanks and Regards AMJAD N -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 12 01:31:51 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 12 May 2016 07:31:51 +0200 Subject: [Rtk-users] Reconstruction Volume. In-Reply-To: References: Message-ID: Hi, The typical solution (e.g., in clincial scanners) is to reconstruct the field-of-view of the scanner (every point in space that is seen by all source positions) because you know this is the only area of space where your reconstruction is going to be accurate. rtkfieldofview generates this FOV. Simon On Thu, May 12, 2016 at 6:12 AM, AMJAD N wrote: > Hello users, > > I have successfully implemented CBCT reconstruction using both CUDA and > CPU method. For finding the reconstruction volume size, I measured the > actual object size. divided by respective axis number of pixels to get > spacing. > > eg: If my object is 10x15x20 cm. I measure that dimensions. If the > required volume is 500x600x700 px, to get spacing i used > 10/500,15/600,20/700. > > But this is not practically possible for every object. Is there any way to > find the reconstruction volume spacing other than doing the above method. > > I have SDD(Source Detector Distance), SID(Source Isocenter Distance), > Detector physical size,pixel density. > > Thanks and Regards > > AMJAD N > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Fri May 13 04:30:33 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Fri, 13 May 2016 14:00:33 +0530 Subject: [Rtk-users] Object isocenter shift Message-ID: Hello users, During acquisition it is found that my object isocenter is shifted from turntable isocenter by DX and DY values. Source , turntable isocenter and detector center is aligned perfectly. Is there any method in RTK we can make use of to nullify the effect due to this isocenter shift? Thanks and Regards AMJAD -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 13 08:36:48 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 13 May 2016 14:36:48 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: Hi, I don't understand the question. The isocenter is by definition the center of rotation in RTK and we assume it's at the origin of the reconstructed volume. There is no such thing as an "object isocenter". DX and DY values are the shift of the projection origin (which can be anywhere) with respect to the central ray (source to isocenter ray). It is not the turntable isocenter. If you want to have dx=0 and dy=0, the projection origin must be changed. But it has to be constant for the whole projection stack. I hope it helps, Simon On Fri, May 13, 2016 at 10:30 AM, AMJAD N wrote: > Hello users, > During acquisition it is found that my object isocenter is shifted from > turntable isocenter by DX and DY values. Source , turntable isocenter and > detector center is aligned perfectly. Is there any method in RTK we can > make use of to nullify the effect due to this isocenter shift? > > Thanks and Regards > AMJAD > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Fri May 13 11:35:57 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Fri, 13 May 2016 17:35:57 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Message-ID: <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 13 12:15:09 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 13 May 2016 18:15:09 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Message-ID: Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein wrote: > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Sat May 14 05:48:01 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Sat, 14 May 2016 11:48:01 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Message-ID: <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Hello Simon, Thanks for your advice so far. I?m getting to know this filter better. At least I can now use it and save the result into a file. I updated my code which now uses a volume. The values of the input and output volume are equal except of the z-dimension of the output which I changed to the number of projection images. const unsigned int Dimension = 3; ?Reading image? ImageType::Pointer inputImage = reader->GetOutput(); ImageType::Pointer outputImage = ImageType::New(); RegionType inputRegion = inputImage->GetLargestPossibleRegion(); const unsigned int NumberOfProjectionImages = 45; ImageType::IndexType start; start[0] = inputRegion.GetIndex()[0]; start[1] = inputRegion.GetIndex()[1]; start[2] = inputRegion.GetIndex()[2]; RegionType::SizeType size; size[0] = inputRegion.GetSize()[0]; size[1] = inputRegion.GetSize()[1]; size[2] = NumberOfProjectionImages; RegionType region; region.SetSize(size); region.SetIndex(start); ImageType::SpacingType spacing; spacing[0] = inputImage->GetSpacing()[0]; spacing[1] = inputImage->GetSpacing()[1]; spacing[2] = inputImage->GetSpacing()[2]; ImageType::PointType origin; origin[0] = inputImage->GetOrigin()[0]; origin[1] = inputImage->GetOrigin()[1]; origin[2] = inputImage->GetOrigin()[2]; outputImage->SetRegions(region); outputImage->SetSpacing(spacing); outputImage->SetOrigin(origin); outputImage->Allocate(); outputImage->FillBuffer(size[0] * size[1] * size[2]); // Geometry typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(510., 510., i*8.); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->SetGeometry(geometry); forward->Update(); I?m not sure how I have to add projection for the geometry to get a result which I?m familiar with. Can you describe how do I have to interpret the result of the Joseph-Filter? I am familiar with sinograms and how they are computed, but one sinogram is created by the projections of one image slice as far as I understood it. What I want is to manipulate the image in the radon space and then perform a filtered back projection. Typically the articles describe techniques to reduce metal artifacts by using one 2D Slice. Is it possible to achieve something like that with the JosephFilter? I?m guessing since this filter won?t work well for 2D I have to use another filter. Can you give me a hint if I can do something like that with RTK or another ITK-based framework? Here a diagram which shows an example what I want to try. I tried also to use my code with one slice and added a zero padding like that: typedef itk::ConstantPadImageFilter ConstantPadImageFilterType; ConstantPadImageFilterType::Pointer padFilter = ConstantPadImageFilterType::New(); padFilter->SetInput(inputImage); ImageType::SizeType extendRegion; extendRegion[0] = 0; extendRegion[1] = 0; extendRegion[2] = 0; padFilter->SetPadLowerBound(extendRegion); padFilter->SetPadUpperBound(extendRegion); padFilter->SetConstant(1); padFilter->Update(); But the result of my png is a black square. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Freitag, 13. Mai 2016 18:15 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto: simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein < tstein at stud.hs-heilbronn.de> Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Sat May 14 06:17:18 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sat, 14 May 2016 12:17:18 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Message-ID: The output of the Joseph filter (of any forward projector) is a stack of projection images, i.e., a 3D image. If you slice this 3D image in the z direction, you get one projection images. If you slice this 3D image in the y direction, you get a sinogram, e.g., the 2D sinogram of the central slice (plane of the source trajectory) if y=0. The best way to have this sinogram is to set size[1]=1 and there is no better way to do it in RTK. For zero-padding, you need to set extendRegion[?]=1, with (for all dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that your image is a black square, something else must be going on. One thing to remember, the typical RTK rotation is around the y axis so your 3D slice must be 1 in the y direction. A simple way to change the orientation of one slice is to change its direction with ChangeImageFilter Simon On Sat, May 14, 2016 at 11:48 AM, Tobias Stein wrote: > Hello Simon, > > > > Thanks for your advice so far. I?m getting to know this filter better. At > least I can now use it and save the result into a file. > > > > I updated my code which now uses a volume. > > The values of the input and output volume are equal except of the > z-dimension of the output which I changed to the number of projection > images. > > const unsigned int Dimension = 3; > > ?Reading image? > > ImageType::Pointer inputImage = reader->GetOutput(); > > ImageType::Pointer outputImage = ImageType::New(); > > > > RegionType inputRegion = inputImage->GetLargestPossibleRegion(); > > > > const unsigned int NumberOfProjectionImages = 45; > > > > ImageType::IndexType start; > > start[0] = inputRegion.GetIndex()[0]; > > start[1] = inputRegion.GetIndex()[1]; > > start[2] = inputRegion.GetIndex()[2]; > > > > RegionType::SizeType size; > > size[0] = inputRegion.GetSize()[0]; > > size[1] = inputRegion.GetSize()[1]; > > size[2] = NumberOfProjectionImages; > > > > RegionType region; > > region.SetSize(size); > > region.SetIndex(start); > > > > ImageType::SpacingType spacing; > > spacing[0] = inputImage->GetSpacing()[0]; > > spacing[1] = inputImage->GetSpacing()[1]; > > spacing[2] = inputImage->GetSpacing()[2]; > > > > ImageType::PointType origin; > > origin[0] = inputImage->GetOrigin()[0]; > > origin[1] = inputImage->GetOrigin()[1]; > > origin[2] = inputImage->GetOrigin()[2]; > > > > outputImage->SetRegions(region); > > outputImage->SetSpacing(spacing); > > outputImage->SetOrigin(origin); > > outputImage->Allocate(); > > outputImage->FillBuffer(size[0] * size[1] * size[2]); > > > > // Geometry > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(510., 510., i*8.); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->SetGeometry(geometry); > > forward->Update(); > > > > I?m not sure how I have to add projection for the geometry to get a result > which I?m familiar with. > > > > Can you describe how do I have to interpret the result of the > Joseph-Filter? I am familiar with sinograms and how they are computed, but > one sinogram is created by the projections of one image slice as far as I > understood it. What I want is to manipulate the image in the radon space > and then perform a filtered back projection. Typically the articles > describe techniques to reduce metal artifacts by using one 2D Slice. Is it > possible to achieve something like that with the JosephFilter? I?m guessing > since this filter won?t work well for 2D I have to use another filter. Can > you give me a hint if I can do something like that with RTK or another > ITK-based framework? Here a diagram > which shows an example what I want to try. > > > > I tried also to use my code with one slice and added a zero padding like > that: > > typedef itk::ConstantPadImageFilter > ConstantPadImageFilterType; > > ConstantPadImageFilterType::Pointer padFilter = > ConstantPadImageFilterType::New(); > > padFilter->SetInput(inputImage); > > > > ImageType::SizeType extendRegion; > > extendRegion[0] = 0; > > extendRegion[1] = 0; > > extendRegion[2] = 0; > > > > padFilter->SetPadLowerBound(extendRegion); > > padFilter->SetPadUpperBound(extendRegion); > > padFilter->SetConstant(1); > > padFilter->Update(); > > But the result of my png is a black square. > > Tobias > > > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Freitag, 13. Mai 2016 18:15 > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > If you intialize the data of your itk::Image with FillBuffer with the > corresponding constant value, it is quite similar. The constant image value > allow us to stream the computation whereas you have to allocate the whole > image if you pass directly itk::Image. > > We only work in 3D and probably our projector don't work with 2D, that is > probably the problem here. You would have to correct the code for 2D but > that's a lot of work, we generally prefer pseudo 2D, see next point. > > I doubt that our forward projector will work well with one slice only if > you use 3D, we assume that the volume starts at the first pixel and ends at > the last pixel. You should probably add a zero border around with > itk::PadImage to see something. > > To avoid aliasing, you can cut frequencies in the ramp filter (look for > CutFrequency in the doxygen of rtk::FFTRampImageFilter). > > Simon > > > > On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: > > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Sat May 14 06:18:57 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sat, 14 May 2016 12:18:57 +0200 Subject: [Rtk-users] RTK training - June 17 2016 Message-ID: Dear all, The training on June 17 in Lyon is confirmed. Please register asap if you'd like to attend. Looking forward to meeting our users, Simon On Thu, Mar 10, 2016 at 11:02 AM, Simon Rit wrote: > Dear all, > The new date for the RTK training is Friday June 17. > I'm looking forward to meeting you there, > Simon > > On Sun, Mar 6, 2016 at 12:57 PM, Simon Rit > wrote: > >> Dear all, >> We have to fix another date for the RTK training due to a conflicting >> meeting. If you are interested, please fill in the foodle >> so that >> we fix a date that suits everyone. If none of these dates works for you, >> please let me know and we'll try to extend the foodle. >> Please answer before Tuesday, we'll fix the date on Tuesday evening. >> Thanks for your cooperation and apologies for the mess, >> Simon >> >> On Tue, Feb 9, 2016 at 11:49 AM, Simon Rit < >> simon.rit at creatis.insa-lyon.fr> wrote: >> >>> Dear RTK users, >>> We will organize a new training >>> session on June 22 2016 in >>> Lyon. Follow the instructions on the webpage >>> to register. The training is >>> for both users and developers. We are happy to answer any question that you >>> might have and we are looking forward to this new training session. >>> Simon >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Sun May 15 08:38:40 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Sun, 15 May 2016 14:38:40 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Message-ID: <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> If I understood you correct, the input of the Joseph-Filter needs to be oriented in the y-direction when I am dealing with axial oriented slices. Now I changed the direction of the 3D Slice by rotating it 90 degrees around the x-axis with the itk::ChangeInformationImageFilter to have my slice in the xz-layer in the y-direction: double rotationX = 90; itk::Versor< double > rotation; const double angleInRadians = rotationX * vnl_math::pi / 180.0; rotation.SetRotationAroundX(angleInRadians); const ImageType::DirectionType direction = inputImage->GetDirection(); const ImageType::DirectionType newDirection = direction * rotation.GetMatrix(); changeFilter->SetOutputDirection(newDirection); changeFilter->ChangeAll(); changeFilter->SetInput(inputImage); changeFilter->UpdateOutputInformation(); Then I added a zero-border as you told me (This changed the size of my region from [512, 512, 1] to [514, 514, 3]). While executing the Joseph Filter I got an error because a vector subscript was out of range. Maybe that?s because the index of the region is [-1,-1,-1] caused by the padding. I tried the padding after the Joseph Filter, and got a result which has a size [514, 3, 45], while 45 was the number of projection images but the image was still empty. I also tried the Jospeh Filter with a real 3D volume stack of slices, rotated it as described below and got a result. Now I am confused how I should create the geometry of the Joseph Filter to get a good result. typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(300., 500., i * 180 / NumberOfProjectionImages); I am trying to use a 180-degree rotation, but i don?t have the feeling for the distance values. I this code example I used an 3D Image with dimensions = [256, 256, 49] My idea was, since there is no way to get a result with a single 3D slice, I would use a stack of slices as input and slice the output volume in y-direction to get my sinogram as you said. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Samstag, 14. Mai 2016 12:17 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK The output of the Joseph filter (of any forward projector) is a stack of projection images, i.e., a 3D image. If you slice this 3D image in the z direction, you get one projection images. If you slice this 3D image in the y direction, you get a sinogram, e.g., the 2D sinogram of the central slice (plane of the source trajectory) if y=0. The best way to have this sinogram is to set size[1]=1 and there is no better way to do it in RTK. For zero-padding, you need to set extendRegion[?]=1, with (for all dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that your image is a black square, something else must be going on. One thing to remember, the typical RTK rotation is around the y axis so your 3D slice must be 1 in the y direction. A simple way to change the orientation of one slice is to change its direction with ChangeImageFilter Simon On Sat, May 14, 2016 at 11:48 AM, Tobias Stein > wrote: Hello Simon, Thanks for your advice so far. I?m getting to know this filter better. At least I can now use it and save the result into a file. I updated my code which now uses a volume. The values of the input and output volume are equal except of the z-dimension of the output which I changed to the number of projection images. const unsigned int Dimension = 3; ?Reading image? ImageType::Pointer inputImage = reader->GetOutput(); ImageType::Pointer outputImage = ImageType::New(); RegionType inputRegion = inputImage->GetLargestPossibleRegion(); const unsigned int NumberOfProjectionImages = 45; ImageType::IndexType start; start[0] = inputRegion.GetIndex()[0]; start[1] = inputRegion.GetIndex()[1]; start[2] = inputRegion.GetIndex()[2]; RegionType::SizeType size; size[0] = inputRegion.GetSize()[0]; size[1] = inputRegion.GetSize()[1]; size[2] = NumberOfProjectionImages; RegionType region; region.SetSize(size); region.SetIndex(start); ImageType::SpacingType spacing; spacing[0] = inputImage->GetSpacing()[0]; spacing[1] = inputImage->GetSpacing()[1]; spacing[2] = inputImage->GetSpacing()[2]; ImageType::PointType origin; origin[0] = inputImage->GetOrigin()[0]; origin[1] = inputImage->GetOrigin()[1]; origin[2] = inputImage->GetOrigin()[2]; outputImage->SetRegions(region); outputImage->SetSpacing(spacing); outputImage->SetOrigin(origin); outputImage->Allocate(); outputImage->FillBuffer(size[0] * size[1] * size[2]); // Geometry typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(510., 510., i*8.); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->SetGeometry(geometry); forward->Update(); I?m not sure how I have to add projection for the geometry to get a result which I?m familiar with. Can you describe how do I have to interpret the result of the Joseph-Filter? I am familiar with sinograms and how they are computed, but one sinogram is created by the projections of one image slice as far as I understood it. What I want is to manipulate the image in the radon space and then perform a filtered back projection. Typically the articles describe techniques to reduce metal artifacts by using one 2D Slice. Is it possible to achieve something like that with the JosephFilter? I?m guessing since this filter won?t work well for 2D I have to use another filter. Can you give me a hint if I can do something like that with RTK or another ITK-based framework? Here a diagram which shows an example what I want to try. I tried also to use my code with one slice and added a zero padding like that: typedef itk::ConstantPadImageFilter ConstantPadImageFilterType; ConstantPadImageFilterType::Pointer padFilter = ConstantPadImageFilterType::New(); padFilter->SetInput(inputImage); ImageType::SizeType extendRegion; extendRegion[0] = 0; extendRegion[1] = 0; extendRegion[2] = 0; padFilter->SetPadLowerBound(extendRegion); padFilter->SetPadUpperBound(extendRegion); padFilter->SetConstant(1); padFilter->Update(); But the result of my png is a black square. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com ] Im Auftrag von Simon Rit Gesendet: Freitag, 13. Mai 2016 18:15 An: Tobias Stein > Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto: simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein < tstein at stud.hs-heilbronn.de> Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 16 05:50:41 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 16 May 2016 11:50:41 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> Message-ID: Answers below. I think you need to understand better the coordinate system of an ITK image, maybe check ITK's doc. Simon On Sun, May 15, 2016 at 2:38 PM, Tobias Stein wrote: > If I understood you correct, the input of the Joseph-Filter needs to be > oriented in the y-direction when I am dealing with axial oriented slices. > Yes, or in other words, if you want to take projections around the axial axis, be aware that y is the default axis of rotation in RTK. > Now I changed the direction of the 3D Slice by rotating it 90 degrees > around the x-axis with the itk::ChangeInformationImageFilter to have my > slice in the xz-layer in the y-direction: > > double rotationX = 90; > > itk::Versor< double > rotation; > > const double angleInRadians = rotationX * vnl_math::pi / 180.0; > > rotation.SetRotationAroundX(angleInRadians); > > const ImageType::DirectionType direction = > inputImage->GetDirection(); > > const ImageType::DirectionType newDirection = direction * > rotation.GetMatrix(); > > changeFilter->SetOutputDirection(newDirection); > > changeFilter->ChangeAll(); > > changeFilter->SetInput(inputImage); > > changeFilter->UpdateOutputInformation(); > > > > Then I added a zero-border as you told me (This changed the size of my > region from [512, 512, 1] to [514, 514, 3]). > > While executing the Joseph Filter I got an error because a vector > subscript was out of range. Maybe that?s because the index of the region is > [-1,-1,-1] caused by the padding. > That should not have been a problem but that might be a bug... > I tried the padding after the Joseph Filter, and got a result which has a > size [514, 3, 45], while 45 was the number of projection images but the > image was still empty. > I guess you should check the origin of your projected volume and your projections. A simple test is to center your volume (check using ITK doc how you can define the origin so that (0,0,0) is at the center) and your projection (for the projection stack, only the first 2 coordinates count). > > > I also tried the Jospeh Filter with a real 3D volume stack of slices, > rotated it as described below and got a result. > > Now I am confused how I should create the geometry of the Joseph Filter to > get a good result. > > > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(300., 500., i * 180 / > NumberOfProjectionImages); > > > > I am trying to use a 180-degree rotation, but i don?t have the feeling for > the distance values. > > I this code example I used an 3D Image with dimensions = [256, 256, 49] > This doesn't tell you anything about the size of your volume, we also need the origin and the spacing. Look at the ITK doc to understand the ITK coordinate systems. > > > My idea was, since there is no way to get a result with a single 3D slice, > I would use a stack of slices as input and slice the output volume in > y-direction to get my sinogram as you said. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Samstag, 14. Mai 2016 12:17 > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > The output of the Joseph filter (of any forward projector) is a stack of > projection images, i.e., a 3D image. If you slice this 3D image in the z > direction, you get one projection images. If you slice this 3D image in the > y direction, you get a sinogram, e.g., the 2D sinogram of the central slice > (plane of the source trajectory) if y=0. The best way to have this sinogram > is to set size[1]=1 and there is no better way to do it in RTK. > > For zero-padding, you need to set extendRegion[?]=1, with (for all > dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that > your image is a black square, something else must be going on. One thing to > remember, the typical RTK rotation is around the y axis so your 3D slice > must be 1 in the y direction. A simple way to change the orientation of one > slice is to change its direction with ChangeImageFilter > > Simon > > > > > > On Sat, May 14, 2016 at 11:48 AM, Tobias Stein < > tstein at stud.hs-heilbronn.de> wrote: > > Hello Simon, > > > > Thanks for your advice so far. I?m getting to know this filter better. At > least I can now use it and save the result into a file. > > > > I updated my code which now uses a volume. > > The values of the input and output volume are equal except of the > z-dimension of the output which I changed to the number of projection > images. > > const unsigned int Dimension = 3; > > ?Reading image? > > ImageType::Pointer inputImage = reader->GetOutput(); > > ImageType::Pointer outputImage = ImageType::New(); > > > > RegionType inputRegion = inputImage->GetLargestPossibleRegion(); > > > > const unsigned int NumberOfProjectionImages = 45; > > > > ImageType::IndexType start; > > start[0] = inputRegion.GetIndex()[0]; > > start[1] = inputRegion.GetIndex()[1]; > > start[2] = inputRegion.GetIndex()[2]; > > > > RegionType::SizeType size; > > size[0] = inputRegion.GetSize()[0]; > > size[1] = inputRegion.GetSize()[1]; > > size[2] = NumberOfProjectionImages; > > > > RegionType region; > > region.SetSize(size); > > region.SetIndex(start); > > > > ImageType::SpacingType spacing; > > spacing[0] = inputImage->GetSpacing()[0]; > > spacing[1] = inputImage->GetSpacing()[1]; > > spacing[2] = inputImage->GetSpacing()[2]; > > > > ImageType::PointType origin; > > origin[0] = inputImage->GetOrigin()[0]; > > origin[1] = inputImage->GetOrigin()[1]; > > origin[2] = inputImage->GetOrigin()[2]; > > > > outputImage->SetRegions(region); > > outputImage->SetSpacing(spacing); > > outputImage->SetOrigin(origin); > > outputImage->Allocate(); > > outputImage->FillBuffer(size[0] * size[1] * size[2]); > > > > // Geometry > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(510., 510., i*8.); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->SetGeometry(geometry); > > forward->Update(); > > > > I?m not sure how I have to add projection for the geometry to get a result > which I?m familiar with. > > > > Can you describe how do I have to interpret the result of the > Joseph-Filter? I am familiar with sinograms and how they are computed, but > one sinogram is created by the projections of one image slice as far as I > understood it. What I want is to manipulate the image in the radon space > and then perform a filtered back projection. Typically the articles > describe techniques to reduce metal artifacts by using one 2D Slice. Is it > possible to achieve something like that with the JosephFilter? I?m guessing > since this filter won?t work well for 2D I have to use another filter. Can > you give me a hint if I can do something like that with RTK or another > ITK-based framework? Here a diagram > which shows an example what I want to try. > > > > I tried also to use my code with one slice and added a zero padding like > that: > > typedef itk::ConstantPadImageFilter > ConstantPadImageFilterType; > > ConstantPadImageFilterType::Pointer padFilter = > ConstantPadImageFilterType::New(); > > padFilter->SetInput(inputImage); > > > > ImageType::SizeType extendRegion; > > extendRegion[0] = 0; > > extendRegion[1] = 0; > > extendRegion[2] = 0; > > > > padFilter->SetPadLowerBound(extendRegion); > > padFilter->SetPadUpperBound(extendRegion); > > padFilter->SetConstant(1); > > padFilter->Update(); > > But the result of my png is a black square. > > Tobias > > > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Freitag, 13. Mai 2016 18:15 > > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > If you intialize the data of your itk::Image with FillBuffer with the > corresponding constant value, it is quite similar. The constant image value > allow us to stream the computation whereas you have to allocate the whole > image if you pass directly itk::Image. > > We only work in 3D and probably our projector don't work with 2D, that is > probably the problem here. You would have to correct the code for 2D but > that's a lot of work, we generally prefer pseudo 2D, see next point. > > I doubt that our forward projector will work well with one slice only if > you use 3D, we assume that the volume starts at the first pixel and ends at > the last pixel. You should probably add a zero border around with > itk::PadImage to see something. > > To avoid aliasing, you can cut frequencies in the ramp filter (look for > CutFrequency in the doxygen of rtk::FFTRampImageFilter). > > Simon > > > > On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: > > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Tue May 17 07:07:20 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Tue, 17 May 2016 16:37:20 +0530 Subject: [Rtk-users] Object isocenter shift Message-ID: Hello, As my previous thread caused some confusion, I am attaching an image showing the same in detail. As you can see my object center is not aligned with isocenter line. Besides it is offset by DX and DY values. In my case you can see the object center as red dot. Is there any method in RTK to nullify this offset effect? Will the rotation of turntable affect the reconstruction due to this offset? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: objectoffset.png Type: image/png Size: 12365 bytes Desc: not available URL: From cyril.mory at uclouvain.be Tue May 17 08:19:38 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Tue, 17 May 2016 14:19:38 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: <573B0C5A.4030001@uclouvain.be> Well, if it's just that, you should not worry about it : you cannot perfectly center your object, even if you try. And most objects (e.g. patients) do not even have a "center". So it does not make sense to struggle to have the center of the object perfectly match the isocenter of the acquisition device. You can either live with that (it is perfectly fine for most applications), or try one of these things: - If you can re-do the acquisition, you should try to have your object's center _roughly_ match the system's isocenter, because that's where you will have the least artifacts - Reconstruct your object as it is (it will work fine, unless there are other problems), but select the origin and size of your reconstructed volume carefully to have your object's center roughly at the center of your reconstructed volume. If you are not familiar with the exact definition of "origin", "spacing" and "size" of an itk::image, read section 4.1.4 of the ITK software guide (https://itk.org/ItkSoftwareGuide.pdf). This is both clear, short, and something extremely important to understand. I hope it helps, Cyril On 05/17/2016 01:07 PM, AMJAD N wrote: > Hello, > > As my previous thread caused some confusion, I am attaching an image > showing the same in detail. > > As you can see my object center is not aligned with isocenter line. > Besides it is offset by DX and DY values. In my case you can see the > object center as red dot. > > Is there any method in RTK to nullify this offset effect? > Will the rotation of turntable affect the reconstruction due to this > offset? > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From wuchao04 at gmail.com Tue May 17 09:24:58 2016 From: wuchao04 at gmail.com (Chao Wu) Date: Tue, 17 May 2016 15:24:58 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: There's nothing to correct or compensate for DURING reconstruction in your case. Where you put your object dose not change the geometry of the CT system at all. As long as the object is still inside FOV, a normal reconstruction will give you a correct result. In the resulting image, the origin is at the center of rotation, and the object is off-center by DX and DY, that's it. If you want the origin to be at the center of the object, you can shift it by DX/DY AFTER reconstruction. Regards, Chao 2016-05-17 13:07 GMT+02:00 AMJAD N : > Hello, > > As my previous thread caused some confusion, I am attaching an image > showing the same in detail. > > As you can see my object center is not aligned with isocenter line. > Besides it is offset by DX and DY values. In my case you can see the object > center as red dot. > > Is there any method in RTK to nullify this offset effect? > Will the rotation of turntable affect the reconstruction due to this > offset? > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shiraska at gmail.com Thu May 19 04:41:54 2016 From: shiraska at gmail.com (Shiras Abdurahman) Date: Thu, 19 May 2016 10:41:54 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction Message-ID: Dear all, I am trying to simulate Tomosynthesis reconstruction with stationary flat panel detector where source rotates around Y axis to acquire 21 projections (system geometry diagram is attached). Geometry file geometry.xml is generated with Reg23ProjectionGeometry. I generated projection images of a cube volume and then I tried to reconstruct with FDK algorithm. Even though I am able to generate projections, FDK reconstruction yields the volume with all voxel values zero. The commands I used for generating projections and reconstructing volume are rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 --dimension=256,256,256 --hardware=cuda I am also attaching geometry xml file, mhd header files of the original volume, projections and reconstructed volume. With regards, Shiras -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: geometry.xml Type: text/xml Size: 11889 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fdk.mhd Type: application/octet-stream Size: 322 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: projections.mhd Type: application/octet-stream Size: 335 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: volume.mhd Type: application/octet-stream Size: 355 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: system_geometry.PNG Type: image/png Size: 50006 bytes Desc: not available URL: From cyril.mory at uclouvain.be Fri May 20 04:38:22 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Fri, 20 May 2016 10:38:22 +0200 Subject: [Rtk-users] Compiler RTK In-Reply-To: <573E430F.5030704@uclouvain.be> References: <573E430F.5030704@uclouvain.be> Message-ID: <573ECCFE.3070500@uclouvain.be> Hi Kevin, I'm replying to the RTK users mailing list. Next time, please send your questions to this list instead of just me (except when it specifically involves reggui, for example). I have tried to reproduce the error but the compilation runs fine on my machine. Can you send information on your compiler ? Maybe someone else on the list can help ? Cyril On 05/20/2016 12:49 AM, Kevin Souris wrote: > Bonjour, > > Je viens de t?l?charger la derni?re version de RTK sur Github. > J'essaye maintenant de compiler sur une machine linux et j'obtiens > cette erreur: > > /home/pen/RTK/RTK-master/applications/rtkprojections/rtkprojections.cxx: > In function ?int main(int, char**)?: > /home/pen/RTK/RTK-master/applications/rtkprojections*/**rtkprojections.cxx:27: > error: invalid conversion from ?const char*? to ?char*?* > /home/pen/RTK/RTK-master/applications/rtkprojections/rtkprojections.cxx:27: > error: initializing argument 1 of ?int > cmdline_parser_rtkprojections_config_file(char*, > args_info_rtkprojections*, cmdline_parser_rtkprojections_params*)? > > Comment puis-je r?parer ?a ? > Merci > > Kevin > > > > > -- > Kevin Souris, PhD student > Universit? catholique de Louvain > Molecular Imagery, Radiotherapy and Oncology (MIRO) -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 25 15:45:57 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 25 May 2016 21:45:57 +0200 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Hi Solomon, I had still to look into this on my todo list. I did again but now I think I overlooked something in your email. You say that going through ChangeInformationImageFilter might be the problem. But now, I wonder if the problem is not that the origin that you set is wrong and then the volume or the projections are completely off (hence the projections). So, here is my question : what happens if you replace filter -> SetOutputOrigin(origin); with filter -> SetOutputOrigin(image->GetOutputOrigin()); Of course, it's not what you want to do but it might point to a wrong choice of origin... Simon On Fri, May 6, 2016 at 1:45 AM, Solomon Tang wrote: > Hi Simon, > > I added the line as you suggested and it does not change the output (still > blank). Sorry for the delayed response. > > Thanks for looking into it! > > On Wed, May 4, 2016 at 12:16 AM, Simon Rit > wrote: > >> Dear Solomon, >> Thanks for the report. It looks like a bug to me. I checked and >> itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in >> the itkGPUImage and the itkCudaImage, this function does not check >> consistency between CPU and GPU data. I'll work on a minimal example to >> check this but can you test that your problem is solved if you add >> m_DataManager->UpdateCPUBuffer(); >> before >> m_DataManager->SetGPUBufferDirty(); >> in itkCudaImage.h line 121? >> Thanks, >> Simon >> >> On Mon, May 2, 2016 at 10:42 PM, Solomon Tang >> wrote: >> >>> Thanks for the tip Simon, >>> >>> I think I may have figured it out. I initially read as a CUDA Image, and >>> then passed the CUDA image through ChangeInformationImageFilter to change >>> the offset of the image. >>> >>> template >>> typename itk::CudaImage::Pointer ShiftOffset( >>> const typename itk::CudaImage::Pointer image, >>> const typename itk::Image::PointType origin) >>> { >>> typedef itk::ChangeInformationImageFilter< itk::CudaImage > >>> FilterType; >>> FilterType::Pointer filter = FilterType::New(); >>> filter -> SetInput(image); >>> filter -> SetOutputOrigin(origin); >>> filter -> ChangeOriginOn(); >>> filter -> UpdateOutputInformation(); >>> filter -> Update(); >>> return filter->GetOutput(); >>> } >>> >>> If I pass the offset image pointer to ForwardProjection, it outputs a >>> blank image. >>> >>> However, when I write the offset image and then read it again as a CUDA >>> image, then the ForwardProjection works as intended. Perhaps using the CUDA >>> version of ITK would fix this. >>> >>> >>> On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < >>> simon.rit at creatis.insa-lyon.fr> wrote: >>> >>>> Hi Solomon, >>>> Hard to say without the full code. Maybe the cudaness of your output >>>> image is lost further in the code. Try accessing the CPU buffer at the end, >>>> after the update, to be sure that the GPU image is transferred to CPU, e.g. >>>> std::cout << forwardProjection->GetOutput()->GetPointer() <>>> Simon >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 26 12:04:47 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 26 May 2016 18:04:47 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Hi Shiras, I generated a volume to look at your problem: rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 --offset 0,0,1.7 Then I obtained the same issue as you. I think the problem is that rtkfdk is meant for circular CBCT and it includes pre-weighting for displaced detector and short scan. I'm not sure why you don't get a warning but these are probably responsible for the blank output. A simple solution is to do only the 3 FDK steps using in order the command tools: rtktwodweights rtkramp rtkbackprojections You can also try to shunt the preweighting by modifying rtkfdk.cxx. It's interesting that you try out tomosynthesis but you'll encounter some problem. When I ran the above commands, I get very weird results because the first and the last projections get a lot more weight than the others since it looks at the angular weight with the previous and the next projections. A simple solution is to blank out these two projections. Good luck and keep us posted if you get interesting results, Simon On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman wrote: > Dear all, > > I am trying to simulate Tomosynthesis reconstruction with stationary flat > panel detector where source rotates around Y axis to acquire 21 projections > (system geometry diagram is attached). Geometry file geometry.xml is > generated with Reg23ProjectionGeometry. I generated projection images of > a cube volume and then I tried to reconstruct with FDK algorithm. Even > though I am able to generate projections, FDK reconstruction yields the > volume with all voxel values zero. The commands I used for generating > projections and reconstructing volume are > > rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd > --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast > rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml > --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 > --dimension=256,256,256 --hardware=cuda > > I am also attaching geometry xml file, mhd header files of the original > volume, projections and reconstructed volume. > > With regards, > Shiras > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shiraska at gmail.com Fri May 27 11:31:52 2016 From: shiraska at gmail.com (Shiras Abdurahman) Date: Fri, 27 May 2016 17:31:52 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Dear Simon, Thank you very much for the reply. I tried to reconstruct with only ramp filtering and back projection and the results are looking good without any weighting of the projections. I also reconstructed the volume with rtksart with 10 iterations and the results are better than rtkfdk. With these experiments, I also confirmed that my geometry file is accurate. Thank you very much for your help. With regards, Shiras On Thu, May 26, 2016 at 6:04 PM, Simon Rit wrote: > Hi Shiras, > I generated a volume to look at your problem: > rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 > --offset 0,0,1.7 > Then I obtained the same issue as you. I think the problem is that rtkfdk > is meant for circular CBCT and it includes pre-weighting for displaced > detector and short scan. I'm not sure why you don't get a warning but these > are probably responsible for the blank output. A simple solution is to do > only the 3 FDK steps using in order the command tools: > rtktwodweights > rtkramp > rtkbackprojections > You can also try to shunt the preweighting by modifying rtkfdk.cxx. > > It's interesting that you try out tomosynthesis but you'll encounter some > problem. When I ran the above commands, I get very weird results because > the first and the last projections get a lot more weight than the others > since it looks at the angular weight with the previous and the next > projections. A simple solution is to blank out these two projections. > Good luck and keep us posted if you get interesting results, > Simon > > On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman > wrote: > >> Dear all, >> >> I am trying to simulate Tomosynthesis reconstruction with stationary flat >> panel detector where source rotates around Y axis to acquire 21 projections >> (system geometry diagram is attached). Geometry file geometry.xml is >> generated with Reg23ProjectionGeometry. I generated projection images of >> a cube volume and then I tried to reconstruct with FDK algorithm. Even >> though I am able to generate projections, FDK reconstruction yields the >> volume with all voxel values zero. The commands I used for generating >> projections and reconstructing volume are >> >> rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd >> --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast >> rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml >> --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 >> --dimension=256,256,256 --hardware=cuda >> >> I am also attaching geometry xml file, mhd header files of the original >> volume, projections and reconstructed volume. >> >> With regards, >> Shiras >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 27 12:00:56 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 27 May 2016 18:00:56 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Indeed, the angular weighting resulting from the discretization of the back projection occurs in rtkfdktwodweights so skipping this might help. Simon On 27 May 2016 5:32 p.m., "Shiras Abdurahman" wrote: Dear Simon, Thank you very much for the reply. I tried to reconstruct with only ramp filtering and back projection and the results are looking good without any weighting of the projections. I also reconstructed the volume with rtksart with 10 iterations and the results are better than rtkfdk. With these experiments, I also confirmed that my geometry file is accurate. Thank you very much for your help. With regards, Shiras On Thu, May 26, 2016 at 6:04 PM, Simon Rit wrote: > Hi Shiras, > I generated a volume to look at your problem: > rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 > --offset 0,0,1.7 > Then I obtained the same issue as you. I think the problem is that rtkfdk > is meant for circular CBCT and it includes pre-weighting for displaced > detector and short scan. I'm not sure why you don't get a warning but these > are probably responsible for the blank output. A simple solution is to do > only the 3 FDK steps using in order the command tools: > rtktwodweights > rtkramp > rtkbackprojections > You can also try to shunt the preweighting by modifying rtkfdk.cxx. > > It's interesting that you try out tomosynthesis but you'll encounter some > problem. When I ran the above commands, I get very weird results because > the first and the last projections get a lot more weight than the others > since it looks at the angular weight with the previous and the next > projections. A simple solution is to blank out these two projections. > Good luck and keep us posted if you get interesting results, > Simon > > On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman > wrote: > >> Dear all, >> >> I am trying to simulate Tomosynthesis reconstruction with stationary flat >> panel detector where source rotates around Y axis to acquire 21 projections >> (system geometry diagram is attached). Geometry file geometry.xml is >> generated with Reg23ProjectionGeometry. I generated projection images of >> a cube volume and then I tried to reconstruct with FDK algorithm. Even >> though I am able to generate projections, FDK reconstruction yields the >> volume with all voxel values zero. The commands I used for generating >> projections and reconstructing volume are >> >> rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd >> --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast >> rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml >> --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 >> --dimension=256,256,256 --hardware=cuda >> >> I am also attaching geometry xml file, mhd header files of the original >> volume, projections and reconstructed volume. >> >> With regards, >> Shiras >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 31 12:02:32 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 31 May 2016 18:02:32 +0200 Subject: [Rtk-users] Rooster In-Reply-To: References: Message-ID: Hi Guillaume, I'm adding RTK user list to this conversation, it's better to have these conversations on the mailing list IMO. Can you tell us what's the volume size and the GPU? Cyril is ROOSTER's dev, maybe he could comment on recon times. Simon On Tue, May 31, 2016 at 5:29 PM, wrote: > Hi Simon, > > I tried the rooster recon. I used the parameters from the example page. The results looks rather nice but it took several hours to run (5-6). Its a big dataset of about 2000 256x256 projections. > > Guillaume From G.Landry at physik.uni-muenchen.de Tue May 31 13:48:28 2016 From: G.Landry at physik.uni-muenchen.de (G.Landry at physik.uni-muenchen.de) Date: Tue, 31 May 2016 19:48:28 +0200 Subject: [Rtk-users] Rooster In-Reply-To: References: Message-ID: <20160531194828.Horde.Im1irUOnkCrL1p8oGSue_A5@webmail.physik.lmu.de> Hi Simon, Thanks for mailing list suggestion. My initial question was about typical reconstruction times for rtkfourdrooster. What I tried is summarized below: -Volume size was 410 410 264 and could be easily reduced by a good margin. -The GPU is quadro M4000 with 8GB -about 2300 256x256 projections with shifted elekta panel (so called M20) -10 phases -for the motion mask at the moment I just used the FOV mask for first try. --gamma_time 0.0001 --gamma_space 0.0001 - spacing 1 1 1 --niter 30 --cgiter 4 --tviter 10 Recon time was about 5-6 hours. I saw about 4 Gb used on the card. The image looked nice, albeit with the TV "feel/plastic-y". Thanks for your feedback Guillaume Quoting Simon Rit : > Hi Guillaume, > I'm adding RTK user list to this conversation, it's better to have > these conversations on the mailing list IMO. Can you tell us what's > the volume size and the GPU? > Cyril is ROOSTER's dev, maybe he could comment on recon times. > Simon > > On Tue, May 31, 2016 at 5:29 PM, wrote: >> Hi Simon, >> >> I tried the rooster recon. I used the parameters from the example >> page. The results looks rather nice but it took several hours to >> run (5-6). Its a big dataset of about 2000 256x256 projections. >> >> Guillaume -- Dr. Guillaume Landry Ludwig Maximilians University (LMU) Munich Medical Physics Am Coulombwall 1 85748 Garching Tel:+49 (0) 89 289-14077 Fax:+49 (0) 89 289-14072 From solomoncztang at gmail.com Mon May 2 16:42:44 2016 From: solomoncztang at gmail.com (Solomon Tang) Date: Mon, 2 May 2016 13:42:44 -0700 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Thanks for the tip Simon, I think I may have figured it out. I initially read as a CUDA Image, and then passed the CUDA image through ChangeInformationImageFilter to change the offset of the image. template typename itk::CudaImage::Pointer ShiftOffset( const typename itk::CudaImage::Pointer image, const typename itk::Image::PointType origin) { typedef itk::ChangeInformationImageFilter< itk::CudaImage > FilterType; FilterType::Pointer filter = FilterType::New(); filter -> SetInput(image); filter -> SetOutputOrigin(origin); filter -> ChangeOriginOn(); filter -> UpdateOutputInformation(); filter -> Update(); return filter->GetOutput(); } If I pass the offset image pointer to ForwardProjection, it outputs a blank image. However, when I write the offset image and then read it again as a CUDA image, then the ForwardProjection works as intended. Perhaps using the CUDA version of ITK would fix this. On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit wrote: > Hi Solomon, > Hard to say without the full code. Maybe the cudaness of your output image > is lost further in the code. Try accessing the CPU buffer at the end, after > the update, to be sure that the GPU image is transferred to CPU, e.g. > std::cout << forwardProjection->GetOutput()->GetPointer() < Simon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Tue May 3 18:59:03 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Wed, 4 May 2016 00:59:03 +0200 Subject: [Rtk-users] forward and back projection - MITK Message-ID: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I've seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I've also seen the test for this class but I don't get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I've got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 4 03:02:05 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 4 May 2016 09:02:05 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Message-ID: Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein wrote: > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 4 03:16:33 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 4 May 2016 09:16:33 +0200 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Dear Solomon, Thanks for the report. It looks like a bug to me. I checked and itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in the itkGPUImage and the itkCudaImage, this function does not check consistency between CPU and GPU data. I'll work on a minimal example to check this but can you test that your problem is solved if you add m_DataManager->UpdateCPUBuffer(); before m_DataManager->SetGPUBufferDirty(); in itkCudaImage.h line 121? Thanks, Simon On Mon, May 2, 2016 at 10:42 PM, Solomon Tang wrote: > Thanks for the tip Simon, > > I think I may have figured it out. I initially read as a CUDA Image, and > then passed the CUDA image through ChangeInformationImageFilter to change > the offset of the image. > > template > typename itk::CudaImage::Pointer ShiftOffset( > const typename itk::CudaImage::Pointer image, > const typename itk::Image::PointType origin) > { > typedef itk::ChangeInformationImageFilter< itk::CudaImage > > FilterType; > FilterType::Pointer filter = FilterType::New(); > filter -> SetInput(image); > filter -> SetOutputOrigin(origin); > filter -> ChangeOriginOn(); > filter -> UpdateOutputInformation(); > filter -> Update(); > return filter->GetOutput(); > } > > If I pass the offset image pointer to ForwardProjection, it outputs a > blank image. > > However, when I write the offset image and then read it again as a CUDA > image, then the ForwardProjection works as intended. Perhaps using the CUDA > version of ITK would fix this. > > > On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < > simon.rit at creatis.insa-lyon.fr> wrote: > >> Hi Solomon, >> Hard to say without the full code. Maybe the cudaness of your output >> image is lost further in the code. Try accessing the CPU buffer at the end, >> after the update, to be sure that the GPU image is transferred to CPU, e.g. >> std::cout << forwardProjection->GetOutput()->GetPointer() <> Simon >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Wed May 4 05:04:28 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Wed, 4 May 2016 14:34:28 +0530 Subject: [Rtk-users] Reconstructed Slice save as tiff Message-ID: Hi all, I have wrote code for saving output volume stack as *.tiff. Currently I am getting output of XY axis. What should I do in order to get the other axes. My code is shown below. typedef itk::StreamingImageFilter StreamerType; StreamerType::Pointer streamerBP = StreamerType::New(); streamerBP->SetInput(feldkampCUDA->GetOutput()); streamerBP->SetNumberOfStreamDivisions(8); typedef itk::Image< float, 2 > Image2DType; typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; WriterType::Pointer writer = WriterType::New(); writer->SetInput(streamerBP->GetOutput()); typedef itk::NumericSeriesFileNames NameGeneratorType; NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); nameGenerator->SetStartIndex(0); nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the Z-axis value of //reconstructed volume nameGenerator->SetIncrementIndex(1); writer->SetFileNames(nameGenerator->GetFileNames()); writer->SetUseCompression(true); writer->Update(); PS: My reconstruction works fine. Thanks and Regards AMJAD N -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyril.mory at uclouvain.be Wed May 4 07:27:24 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Wed, 4 May 2016 13:27:24 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: References: Message-ID: <5729DC9C.10105@uclouvain.be> Hi Amjad, You can use an ITK extract filter to extract a region that corresponds to one of your slices (along the axis you want). The output of the extract filter will be 3D, so you will need to cast it into a 2D images using an ITK cast filter. Cyril On 05/04/2016 11:04 AM, AMJAD N wrote: > Hi all, > > I have wrote code for saving output volume stack as *.tiff. Currently > I am getting output of XY axis. What should I do in order to get the > other axes. > My code is shown below. > > typedef itk::StreamingImageFilter FloatImageType> StreamerType; > StreamerType::Pointer streamerBP = StreamerType::New(); > streamerBP->SetInput(feldkampCUDA->GetOutput()); > streamerBP->SetNumberOfStreamDivisions(8); > > typedef itk::Image< float, 2 > Image2DType; > typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; > WriterType::Pointer writer = WriterType::New(); > writer->SetInput(streamerBP->GetOutput()); > > typedef itk::NumericSeriesFileNames NameGeneratorType; > NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); > nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); > nameGenerator->SetStartIndex(0); > nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the > Z-axis value of //reconstructed volume > nameGenerator->SetIncrementIndex(1); > writer->SetFileNames(nameGenerator->GetFileNames()); > writer->SetUseCompression(true); > writer->Update(); > > PS: My reconstruction works fine. > > Thanks and Regards > > AMJAD N > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From wuchao04 at gmail.com Wed May 4 08:44:37 2016 From: wuchao04 at gmail.com (Chao Wu) Date: Wed, 4 May 2016 14:44:37 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: <5729DC9C.10105@uclouvain.be> References: <5729DC9C.10105@uclouvain.be> Message-ID: A small add-on (copied from ITK document): ExtractImageFilter also collapses dimensions so that the input image may have more dimensions than the output image (i.e. 4-D input image to a 3-D output image). To specify what dimensions to collapse, the ExtractionRegion must be specified. For any dimension dim where ExtractionRegion.Size[dim] = 0, that dimension is collapsed. The index to collapse on is specified by ExtractionRegion.Index[dim]. For example, we have a image 4D = a 4x4x4x4 image, and we want to get a 3D image, 3D = a 4x4x4 image, specified as [x,y,z,2] from 4D (i.e. the 3rd "time" slice from 4D). The ExtractionRegion.Size = [4,4,4,0] and ExtractionRegion.Index = [0,0,0,2]. Regards, Chao 2016-05-04 13:27 GMT+02:00 Cyril Mory : > Hi Amjad, > > You can use an ITK extract filter to extract a region that corresponds to > one of your slices (along the axis you want). The output of the extract > filter will be 3D, so you will need to cast it into a 2D images using an > ITK cast filter. > > Cyril > > > On 05/04/2016 11:04 AM, AMJAD N wrote: > > Hi all, > > I have wrote code for saving output volume stack as *.tiff. Currently I am > getting output of XY axis. What should I do in order to get the other axes. > My code is shown below. > > typedef itk::StreamingImageFilter > StreamerType; > StreamerType::Pointer streamerBP = StreamerType::New(); > streamerBP->SetInput(feldkampCUDA->GetOutput()); > streamerBP->SetNumberOfStreamDivisions(8); > > typedef itk::Image< float, 2 > Image2DType; > typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; > WriterType::Pointer writer = WriterType::New(); > writer->SetInput(streamerBP->GetOutput()); > > typedef itk::NumericSeriesFileNames NameGeneratorType; > NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); > nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); > nameGenerator->SetStartIndex(0); > nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the > Z-axis value of //reconstructed volume > nameGenerator->SetIncrementIndex(1); > writer->SetFileNames(nameGenerator->GetFileNames()); > writer->SetUseCompression(true); > writer->Update(); > > PS: My reconstruction works fine. > > Thanks and Regards > > AMJAD N > > > > _______________________________________________ > Rtk-users mailing listRtk-users at public.kitware.comhttp://public.kitware.com/mailman/listinfo/rtk-users > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyril.mory at uclouvain.be Wed May 4 08:56:14 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Wed, 4 May 2016 14:56:14 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: References: <5729DC9C.10105@uclouvain.be> Message-ID: <5729F16E.5020402@uclouvain.be> Thanks Chao Wu, You're right, I was mistaken : the cast filter is not required in this case. It is needed, on the other hand, to increase the dimension of an image. So in this case, Amjad, you don't need it. Cyril On 05/04/2016 02:44 PM, Chao Wu wrote: > A small add-on (copied from ITK document): > > ExtractImageFilter also collapses dimensions so that the input image > may have more dimensions than the output image (i.e. 4-D input image > to a 3-D output image). To specify what dimensions to collapse, the > ExtractionRegion must be specified. For any dimension dim where > ExtractionRegion.Size[dim] = 0, that dimension is collapsed. The index > to collapse on is specified by ExtractionRegion.Index[dim]. For > example, we have a image 4D = a 4x4x4x4 image, and we want to get a 3D > image, 3D = a 4x4x4 image, specified as [x,y,z,2] from 4D (i.e. the > 3rd "time" slice from 4D). The ExtractionRegion.Size = [4,4,4,0] and > ExtractionRegion.Index = [0,0,0,2]. > > Regards, > Chao > > 2016-05-04 13:27 GMT+02:00 Cyril Mory >: > > Hi Amjad, > > You can use an ITK extract filter to extract a region that > corresponds to one of your slices (along the axis you want). The > output of the extract filter will be 3D, so you will need to cast > it into a 2D images using an ITK cast filter. > > Cyril > > > On 05/04/2016 11:04 AM, AMJAD N wrote: >> Hi all, >> >> I have wrote code for saving output volume stack as *.tiff. >> Currently I am getting output of XY axis. What should I do in >> order to get the other axes. >> My code is shown below. >> >> typedef itk::StreamingImageFilter> FloatImageType> StreamerType; >> StreamerType::Pointer streamerBP = StreamerType::New(); >> streamerBP->SetInput(feldkampCUDA->GetOutput()); >> streamerBP->SetNumberOfStreamDivisions(8); >> >> typedef itk::Image< float, 2 > Image2DType; >> typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > >> WriterType; >> WriterType::Pointer writer = WriterType::New(); >> writer->SetInput(streamerBP->GetOutput()); >> >> typedef itk::NumericSeriesFileNames NameGeneratorType; >> NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); >> nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); >> nameGenerator->SetStartIndex(0); >> nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] >> is the Z-axis value of //reconstructed volume >> nameGenerator->SetIncrementIndex(1); >> writer->SetFileNames(nameGenerator->GetFileNames()); >> writer->SetUseCompression(true); >> writer->Update(); >> >> PS: My reconstruction works fine. >> >> Thanks and Regards >> >> AMJAD N >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From solomoncztang at gmail.com Thu May 5 19:45:43 2016 From: solomoncztang at gmail.com (Solomon Tang) Date: Thu, 5 May 2016 16:45:43 -0700 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Hi Simon, I added the line as you suggested and it does not change the output (still blank). Sorry for the delayed response. Thanks for looking into it! On Wed, May 4, 2016 at 12:16 AM, Simon Rit wrote: > Dear Solomon, > Thanks for the report. It looks like a bug to me. I checked and > itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in > the itkGPUImage and the itkCudaImage, this function does not check > consistency between CPU and GPU data. I'll work on a minimal example to > check this but can you test that your problem is solved if you add > m_DataManager->UpdateCPUBuffer(); > before > m_DataManager->SetGPUBufferDirty(); > in itkCudaImage.h line 121? > Thanks, > Simon > > On Mon, May 2, 2016 at 10:42 PM, Solomon Tang > wrote: > >> Thanks for the tip Simon, >> >> I think I may have figured it out. I initially read as a CUDA Image, and >> then passed the CUDA image through ChangeInformationImageFilter to change >> the offset of the image. >> >> template >> typename itk::CudaImage::Pointer ShiftOffset( >> const typename itk::CudaImage::Pointer image, >> const typename itk::Image::PointType origin) >> { >> typedef itk::ChangeInformationImageFilter< itk::CudaImage > >> FilterType; >> FilterType::Pointer filter = FilterType::New(); >> filter -> SetInput(image); >> filter -> SetOutputOrigin(origin); >> filter -> ChangeOriginOn(); >> filter -> UpdateOutputInformation(); >> filter -> Update(); >> return filter->GetOutput(); >> } >> >> If I pass the offset image pointer to ForwardProjection, it outputs a >> blank image. >> >> However, when I write the offset image and then read it again as a CUDA >> image, then the ForwardProjection works as intended. Perhaps using the CUDA >> version of ITK would fix this. >> >> >> On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < >> simon.rit at creatis.insa-lyon.fr> wrote: >> >>> Hi Solomon, >>> Hard to say without the full code. Maybe the cudaness of your output >>> image is lost further in the code. Try accessing the CPU buffer at the end, >>> after the update, to be sure that the GPU image is transferred to CPU, e.g. >>> std::cout << forwardProjection->GetOutput()->GetPointer() <>> Simon >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 10 01:29:44 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 10 May 2016 07:29:44 +0200 Subject: [Rtk-users] Cmake build error help In-Reply-To: References: Message-ID: <573171C8.80400@creatis.insa-lyon.fr> Hi, Can you update GetGitRevisionDescription.cmake and GetGitRevisionDescription.cmake.in from https://github.com/rpavlik/cmake-modules and see if the new versions fix this issue? Thanks, Simon PS: plead keep using the mailing list On 10/05/2016 03:09, Solomon Tang wrote: > Hi Simon, > > I am rebuilding RTK after moving to Visual Studio 2015 with cmake > 3.5.2 and am running into the following error: > > CMake Error at build/applications/CMakeFiles/git-data/grabRef.cmake:36 > (file): > file failed to open for reading (No such file or directory): > > C:/Work/Tools/Current/RTK-1.2.0/build/applications/CMakeFiles/git-data/head-ref > Call Stack (most recent call first): > cmake/GetGitRevisionDescription.cmake:77 (include) > applications/CMakeLists.txt:5 (get_git_head_revision) > > I am using ITK 4.9.0 and fresh download of RTK 1.2.0. > > How do I resolve this issue? > > Thanks again, > > Solomon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Thu May 12 00:12:17 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Thu, 12 May 2016 09:42:17 +0530 Subject: [Rtk-users] Reconstruction Volume. Message-ID: Hello users, I have successfully implemented CBCT reconstruction using both CUDA and CPU method. For finding the reconstruction volume size, I measured the actual object size. divided by respective axis number of pixels to get spacing. eg: If my object is 10x15x20 cm. I measure that dimensions. If the required volume is 500x600x700 px, to get spacing i used 10/500,15/600,20/700. But this is not practically possible for every object. Is there any way to find the reconstruction volume spacing other than doing the above method. I have SDD(Source Detector Distance), SID(Source Isocenter Distance), Detector physical size,pixel density. Thanks and Regards AMJAD N -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 12 01:31:51 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 12 May 2016 07:31:51 +0200 Subject: [Rtk-users] Reconstruction Volume. In-Reply-To: References: Message-ID: Hi, The typical solution (e.g., in clincial scanners) is to reconstruct the field-of-view of the scanner (every point in space that is seen by all source positions) because you know this is the only area of space where your reconstruction is going to be accurate. rtkfieldofview generates this FOV. Simon On Thu, May 12, 2016 at 6:12 AM, AMJAD N wrote: > Hello users, > > I have successfully implemented CBCT reconstruction using both CUDA and > CPU method. For finding the reconstruction volume size, I measured the > actual object size. divided by respective axis number of pixels to get > spacing. > > eg: If my object is 10x15x20 cm. I measure that dimensions. If the > required volume is 500x600x700 px, to get spacing i used > 10/500,15/600,20/700. > > But this is not practically possible for every object. Is there any way to > find the reconstruction volume spacing other than doing the above method. > > I have SDD(Source Detector Distance), SID(Source Isocenter Distance), > Detector physical size,pixel density. > > Thanks and Regards > > AMJAD N > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Fri May 13 04:30:33 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Fri, 13 May 2016 14:00:33 +0530 Subject: [Rtk-users] Object isocenter shift Message-ID: Hello users, During acquisition it is found that my object isocenter is shifted from turntable isocenter by DX and DY values. Source , turntable isocenter and detector center is aligned perfectly. Is there any method in RTK we can make use of to nullify the effect due to this isocenter shift? Thanks and Regards AMJAD -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 13 08:36:48 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 13 May 2016 14:36:48 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: Hi, I don't understand the question. The isocenter is by definition the center of rotation in RTK and we assume it's at the origin of the reconstructed volume. There is no such thing as an "object isocenter". DX and DY values are the shift of the projection origin (which can be anywhere) with respect to the central ray (source to isocenter ray). It is not the turntable isocenter. If you want to have dx=0 and dy=0, the projection origin must be changed. But it has to be constant for the whole projection stack. I hope it helps, Simon On Fri, May 13, 2016 at 10:30 AM, AMJAD N wrote: > Hello users, > During acquisition it is found that my object isocenter is shifted from > turntable isocenter by DX and DY values. Source , turntable isocenter and > detector center is aligned perfectly. Is there any method in RTK we can > make use of to nullify the effect due to this isocenter shift? > > Thanks and Regards > AMJAD > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Fri May 13 11:35:57 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Fri, 13 May 2016 17:35:57 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Message-ID: <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 13 12:15:09 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 13 May 2016 18:15:09 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Message-ID: Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein wrote: > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Sat May 14 05:48:01 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Sat, 14 May 2016 11:48:01 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Message-ID: <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Hello Simon, Thanks for your advice so far. I?m getting to know this filter better. At least I can now use it and save the result into a file. I updated my code which now uses a volume. The values of the input and output volume are equal except of the z-dimension of the output which I changed to the number of projection images. const unsigned int Dimension = 3; ?Reading image? ImageType::Pointer inputImage = reader->GetOutput(); ImageType::Pointer outputImage = ImageType::New(); RegionType inputRegion = inputImage->GetLargestPossibleRegion(); const unsigned int NumberOfProjectionImages = 45; ImageType::IndexType start; start[0] = inputRegion.GetIndex()[0]; start[1] = inputRegion.GetIndex()[1]; start[2] = inputRegion.GetIndex()[2]; RegionType::SizeType size; size[0] = inputRegion.GetSize()[0]; size[1] = inputRegion.GetSize()[1]; size[2] = NumberOfProjectionImages; RegionType region; region.SetSize(size); region.SetIndex(start); ImageType::SpacingType spacing; spacing[0] = inputImage->GetSpacing()[0]; spacing[1] = inputImage->GetSpacing()[1]; spacing[2] = inputImage->GetSpacing()[2]; ImageType::PointType origin; origin[0] = inputImage->GetOrigin()[0]; origin[1] = inputImage->GetOrigin()[1]; origin[2] = inputImage->GetOrigin()[2]; outputImage->SetRegions(region); outputImage->SetSpacing(spacing); outputImage->SetOrigin(origin); outputImage->Allocate(); outputImage->FillBuffer(size[0] * size[1] * size[2]); // Geometry typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(510., 510., i*8.); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->SetGeometry(geometry); forward->Update(); I?m not sure how I have to add projection for the geometry to get a result which I?m familiar with. Can you describe how do I have to interpret the result of the Joseph-Filter? I am familiar with sinograms and how they are computed, but one sinogram is created by the projections of one image slice as far as I understood it. What I want is to manipulate the image in the radon space and then perform a filtered back projection. Typically the articles describe techniques to reduce metal artifacts by using one 2D Slice. Is it possible to achieve something like that with the JosephFilter? I?m guessing since this filter won?t work well for 2D I have to use another filter. Can you give me a hint if I can do something like that with RTK or another ITK-based framework? Here a diagram which shows an example what I want to try. I tried also to use my code with one slice and added a zero padding like that: typedef itk::ConstantPadImageFilter ConstantPadImageFilterType; ConstantPadImageFilterType::Pointer padFilter = ConstantPadImageFilterType::New(); padFilter->SetInput(inputImage); ImageType::SizeType extendRegion; extendRegion[0] = 0; extendRegion[1] = 0; extendRegion[2] = 0; padFilter->SetPadLowerBound(extendRegion); padFilter->SetPadUpperBound(extendRegion); padFilter->SetConstant(1); padFilter->Update(); But the result of my png is a black square. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Freitag, 13. Mai 2016 18:15 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto: simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein < tstein at stud.hs-heilbronn.de> Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Sat May 14 06:17:18 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sat, 14 May 2016 12:17:18 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Message-ID: The output of the Joseph filter (of any forward projector) is a stack of projection images, i.e., a 3D image. If you slice this 3D image in the z direction, you get one projection images. If you slice this 3D image in the y direction, you get a sinogram, e.g., the 2D sinogram of the central slice (plane of the source trajectory) if y=0. The best way to have this sinogram is to set size[1]=1 and there is no better way to do it in RTK. For zero-padding, you need to set extendRegion[?]=1, with (for all dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that your image is a black square, something else must be going on. One thing to remember, the typical RTK rotation is around the y axis so your 3D slice must be 1 in the y direction. A simple way to change the orientation of one slice is to change its direction with ChangeImageFilter Simon On Sat, May 14, 2016 at 11:48 AM, Tobias Stein wrote: > Hello Simon, > > > > Thanks for your advice so far. I?m getting to know this filter better. At > least I can now use it and save the result into a file. > > > > I updated my code which now uses a volume. > > The values of the input and output volume are equal except of the > z-dimension of the output which I changed to the number of projection > images. > > const unsigned int Dimension = 3; > > ?Reading image? > > ImageType::Pointer inputImage = reader->GetOutput(); > > ImageType::Pointer outputImage = ImageType::New(); > > > > RegionType inputRegion = inputImage->GetLargestPossibleRegion(); > > > > const unsigned int NumberOfProjectionImages = 45; > > > > ImageType::IndexType start; > > start[0] = inputRegion.GetIndex()[0]; > > start[1] = inputRegion.GetIndex()[1]; > > start[2] = inputRegion.GetIndex()[2]; > > > > RegionType::SizeType size; > > size[0] = inputRegion.GetSize()[0]; > > size[1] = inputRegion.GetSize()[1]; > > size[2] = NumberOfProjectionImages; > > > > RegionType region; > > region.SetSize(size); > > region.SetIndex(start); > > > > ImageType::SpacingType spacing; > > spacing[0] = inputImage->GetSpacing()[0]; > > spacing[1] = inputImage->GetSpacing()[1]; > > spacing[2] = inputImage->GetSpacing()[2]; > > > > ImageType::PointType origin; > > origin[0] = inputImage->GetOrigin()[0]; > > origin[1] = inputImage->GetOrigin()[1]; > > origin[2] = inputImage->GetOrigin()[2]; > > > > outputImage->SetRegions(region); > > outputImage->SetSpacing(spacing); > > outputImage->SetOrigin(origin); > > outputImage->Allocate(); > > outputImage->FillBuffer(size[0] * size[1] * size[2]); > > > > // Geometry > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(510., 510., i*8.); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->SetGeometry(geometry); > > forward->Update(); > > > > I?m not sure how I have to add projection for the geometry to get a result > which I?m familiar with. > > > > Can you describe how do I have to interpret the result of the > Joseph-Filter? I am familiar with sinograms and how they are computed, but > one sinogram is created by the projections of one image slice as far as I > understood it. What I want is to manipulate the image in the radon space > and then perform a filtered back projection. Typically the articles > describe techniques to reduce metal artifacts by using one 2D Slice. Is it > possible to achieve something like that with the JosephFilter? I?m guessing > since this filter won?t work well for 2D I have to use another filter. Can > you give me a hint if I can do something like that with RTK or another > ITK-based framework? Here a diagram > which shows an example what I want to try. > > > > I tried also to use my code with one slice and added a zero padding like > that: > > typedef itk::ConstantPadImageFilter > ConstantPadImageFilterType; > > ConstantPadImageFilterType::Pointer padFilter = > ConstantPadImageFilterType::New(); > > padFilter->SetInput(inputImage); > > > > ImageType::SizeType extendRegion; > > extendRegion[0] = 0; > > extendRegion[1] = 0; > > extendRegion[2] = 0; > > > > padFilter->SetPadLowerBound(extendRegion); > > padFilter->SetPadUpperBound(extendRegion); > > padFilter->SetConstant(1); > > padFilter->Update(); > > But the result of my png is a black square. > > Tobias > > > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Freitag, 13. Mai 2016 18:15 > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > If you intialize the data of your itk::Image with FillBuffer with the > corresponding constant value, it is quite similar. The constant image value > allow us to stream the computation whereas you have to allocate the whole > image if you pass directly itk::Image. > > We only work in 3D and probably our projector don't work with 2D, that is > probably the problem here. You would have to correct the code for 2D but > that's a lot of work, we generally prefer pseudo 2D, see next point. > > I doubt that our forward projector will work well with one slice only if > you use 3D, we assume that the volume starts at the first pixel and ends at > the last pixel. You should probably add a zero border around with > itk::PadImage to see something. > > To avoid aliasing, you can cut frequencies in the ramp filter (look for > CutFrequency in the doxygen of rtk::FFTRampImageFilter). > > Simon > > > > On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: > > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Sat May 14 06:18:57 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sat, 14 May 2016 12:18:57 +0200 Subject: [Rtk-users] RTK training - June 17 2016 Message-ID: Dear all, The training on June 17 in Lyon is confirmed. Please register asap if you'd like to attend. Looking forward to meeting our users, Simon On Thu, Mar 10, 2016 at 11:02 AM, Simon Rit wrote: > Dear all, > The new date for the RTK training is Friday June 17. > I'm looking forward to meeting you there, > Simon > > On Sun, Mar 6, 2016 at 12:57 PM, Simon Rit > wrote: > >> Dear all, >> We have to fix another date for the RTK training due to a conflicting >> meeting. If you are interested, please fill in the foodle >> so that >> we fix a date that suits everyone. If none of these dates works for you, >> please let me know and we'll try to extend the foodle. >> Please answer before Tuesday, we'll fix the date on Tuesday evening. >> Thanks for your cooperation and apologies for the mess, >> Simon >> >> On Tue, Feb 9, 2016 at 11:49 AM, Simon Rit < >> simon.rit at creatis.insa-lyon.fr> wrote: >> >>> Dear RTK users, >>> We will organize a new training >>> session on June 22 2016 in >>> Lyon. Follow the instructions on the webpage >>> to register. The training is >>> for both users and developers. We are happy to answer any question that you >>> might have and we are looking forward to this new training session. >>> Simon >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Sun May 15 08:38:40 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Sun, 15 May 2016 14:38:40 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Message-ID: <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> If I understood you correct, the input of the Joseph-Filter needs to be oriented in the y-direction when I am dealing with axial oriented slices. Now I changed the direction of the 3D Slice by rotating it 90 degrees around the x-axis with the itk::ChangeInformationImageFilter to have my slice in the xz-layer in the y-direction: double rotationX = 90; itk::Versor< double > rotation; const double angleInRadians = rotationX * vnl_math::pi / 180.0; rotation.SetRotationAroundX(angleInRadians); const ImageType::DirectionType direction = inputImage->GetDirection(); const ImageType::DirectionType newDirection = direction * rotation.GetMatrix(); changeFilter->SetOutputDirection(newDirection); changeFilter->ChangeAll(); changeFilter->SetInput(inputImage); changeFilter->UpdateOutputInformation(); Then I added a zero-border as you told me (This changed the size of my region from [512, 512, 1] to [514, 514, 3]). While executing the Joseph Filter I got an error because a vector subscript was out of range. Maybe that?s because the index of the region is [-1,-1,-1] caused by the padding. I tried the padding after the Joseph Filter, and got a result which has a size [514, 3, 45], while 45 was the number of projection images but the image was still empty. I also tried the Jospeh Filter with a real 3D volume stack of slices, rotated it as described below and got a result. Now I am confused how I should create the geometry of the Joseph Filter to get a good result. typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(300., 500., i * 180 / NumberOfProjectionImages); I am trying to use a 180-degree rotation, but i don?t have the feeling for the distance values. I this code example I used an 3D Image with dimensions = [256, 256, 49] My idea was, since there is no way to get a result with a single 3D slice, I would use a stack of slices as input and slice the output volume in y-direction to get my sinogram as you said. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Samstag, 14. Mai 2016 12:17 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK The output of the Joseph filter (of any forward projector) is a stack of projection images, i.e., a 3D image. If you slice this 3D image in the z direction, you get one projection images. If you slice this 3D image in the y direction, you get a sinogram, e.g., the 2D sinogram of the central slice (plane of the source trajectory) if y=0. The best way to have this sinogram is to set size[1]=1 and there is no better way to do it in RTK. For zero-padding, you need to set extendRegion[?]=1, with (for all dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that your image is a black square, something else must be going on. One thing to remember, the typical RTK rotation is around the y axis so your 3D slice must be 1 in the y direction. A simple way to change the orientation of one slice is to change its direction with ChangeImageFilter Simon On Sat, May 14, 2016 at 11:48 AM, Tobias Stein > wrote: Hello Simon, Thanks for your advice so far. I?m getting to know this filter better. At least I can now use it and save the result into a file. I updated my code which now uses a volume. The values of the input and output volume are equal except of the z-dimension of the output which I changed to the number of projection images. const unsigned int Dimension = 3; ?Reading image? ImageType::Pointer inputImage = reader->GetOutput(); ImageType::Pointer outputImage = ImageType::New(); RegionType inputRegion = inputImage->GetLargestPossibleRegion(); const unsigned int NumberOfProjectionImages = 45; ImageType::IndexType start; start[0] = inputRegion.GetIndex()[0]; start[1] = inputRegion.GetIndex()[1]; start[2] = inputRegion.GetIndex()[2]; RegionType::SizeType size; size[0] = inputRegion.GetSize()[0]; size[1] = inputRegion.GetSize()[1]; size[2] = NumberOfProjectionImages; RegionType region; region.SetSize(size); region.SetIndex(start); ImageType::SpacingType spacing; spacing[0] = inputImage->GetSpacing()[0]; spacing[1] = inputImage->GetSpacing()[1]; spacing[2] = inputImage->GetSpacing()[2]; ImageType::PointType origin; origin[0] = inputImage->GetOrigin()[0]; origin[1] = inputImage->GetOrigin()[1]; origin[2] = inputImage->GetOrigin()[2]; outputImage->SetRegions(region); outputImage->SetSpacing(spacing); outputImage->SetOrigin(origin); outputImage->Allocate(); outputImage->FillBuffer(size[0] * size[1] * size[2]); // Geometry typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(510., 510., i*8.); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->SetGeometry(geometry); forward->Update(); I?m not sure how I have to add projection for the geometry to get a result which I?m familiar with. Can you describe how do I have to interpret the result of the Joseph-Filter? I am familiar with sinograms and how they are computed, but one sinogram is created by the projections of one image slice as far as I understood it. What I want is to manipulate the image in the radon space and then perform a filtered back projection. Typically the articles describe techniques to reduce metal artifacts by using one 2D Slice. Is it possible to achieve something like that with the JosephFilter? I?m guessing since this filter won?t work well for 2D I have to use another filter. Can you give me a hint if I can do something like that with RTK or another ITK-based framework? Here a diagram which shows an example what I want to try. I tried also to use my code with one slice and added a zero padding like that: typedef itk::ConstantPadImageFilter ConstantPadImageFilterType; ConstantPadImageFilterType::Pointer padFilter = ConstantPadImageFilterType::New(); padFilter->SetInput(inputImage); ImageType::SizeType extendRegion; extendRegion[0] = 0; extendRegion[1] = 0; extendRegion[2] = 0; padFilter->SetPadLowerBound(extendRegion); padFilter->SetPadUpperBound(extendRegion); padFilter->SetConstant(1); padFilter->Update(); But the result of my png is a black square. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com ] Im Auftrag von Simon Rit Gesendet: Freitag, 13. Mai 2016 18:15 An: Tobias Stein > Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto: simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein < tstein at stud.hs-heilbronn.de> Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 16 05:50:41 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 16 May 2016 11:50:41 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> Message-ID: Answers below. I think you need to understand better the coordinate system of an ITK image, maybe check ITK's doc. Simon On Sun, May 15, 2016 at 2:38 PM, Tobias Stein wrote: > If I understood you correct, the input of the Joseph-Filter needs to be > oriented in the y-direction when I am dealing with axial oriented slices. > Yes, or in other words, if you want to take projections around the axial axis, be aware that y is the default axis of rotation in RTK. > Now I changed the direction of the 3D Slice by rotating it 90 degrees > around the x-axis with the itk::ChangeInformationImageFilter to have my > slice in the xz-layer in the y-direction: > > double rotationX = 90; > > itk::Versor< double > rotation; > > const double angleInRadians = rotationX * vnl_math::pi / 180.0; > > rotation.SetRotationAroundX(angleInRadians); > > const ImageType::DirectionType direction = > inputImage->GetDirection(); > > const ImageType::DirectionType newDirection = direction * > rotation.GetMatrix(); > > changeFilter->SetOutputDirection(newDirection); > > changeFilter->ChangeAll(); > > changeFilter->SetInput(inputImage); > > changeFilter->UpdateOutputInformation(); > > > > Then I added a zero-border as you told me (This changed the size of my > region from [512, 512, 1] to [514, 514, 3]). > > While executing the Joseph Filter I got an error because a vector > subscript was out of range. Maybe that?s because the index of the region is > [-1,-1,-1] caused by the padding. > That should not have been a problem but that might be a bug... > I tried the padding after the Joseph Filter, and got a result which has a > size [514, 3, 45], while 45 was the number of projection images but the > image was still empty. > I guess you should check the origin of your projected volume and your projections. A simple test is to center your volume (check using ITK doc how you can define the origin so that (0,0,0) is at the center) and your projection (for the projection stack, only the first 2 coordinates count). > > > I also tried the Jospeh Filter with a real 3D volume stack of slices, > rotated it as described below and got a result. > > Now I am confused how I should create the geometry of the Joseph Filter to > get a good result. > > > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(300., 500., i * 180 / > NumberOfProjectionImages); > > > > I am trying to use a 180-degree rotation, but i don?t have the feeling for > the distance values. > > I this code example I used an 3D Image with dimensions = [256, 256, 49] > This doesn't tell you anything about the size of your volume, we also need the origin and the spacing. Look at the ITK doc to understand the ITK coordinate systems. > > > My idea was, since there is no way to get a result with a single 3D slice, > I would use a stack of slices as input and slice the output volume in > y-direction to get my sinogram as you said. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Samstag, 14. Mai 2016 12:17 > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > The output of the Joseph filter (of any forward projector) is a stack of > projection images, i.e., a 3D image. If you slice this 3D image in the z > direction, you get one projection images. If you slice this 3D image in the > y direction, you get a sinogram, e.g., the 2D sinogram of the central slice > (plane of the source trajectory) if y=0. The best way to have this sinogram > is to set size[1]=1 and there is no better way to do it in RTK. > > For zero-padding, you need to set extendRegion[?]=1, with (for all > dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that > your image is a black square, something else must be going on. One thing to > remember, the typical RTK rotation is around the y axis so your 3D slice > must be 1 in the y direction. A simple way to change the orientation of one > slice is to change its direction with ChangeImageFilter > > Simon > > > > > > On Sat, May 14, 2016 at 11:48 AM, Tobias Stein < > tstein at stud.hs-heilbronn.de> wrote: > > Hello Simon, > > > > Thanks for your advice so far. I?m getting to know this filter better. At > least I can now use it and save the result into a file. > > > > I updated my code which now uses a volume. > > The values of the input and output volume are equal except of the > z-dimension of the output which I changed to the number of projection > images. > > const unsigned int Dimension = 3; > > ?Reading image? > > ImageType::Pointer inputImage = reader->GetOutput(); > > ImageType::Pointer outputImage = ImageType::New(); > > > > RegionType inputRegion = inputImage->GetLargestPossibleRegion(); > > > > const unsigned int NumberOfProjectionImages = 45; > > > > ImageType::IndexType start; > > start[0] = inputRegion.GetIndex()[0]; > > start[1] = inputRegion.GetIndex()[1]; > > start[2] = inputRegion.GetIndex()[2]; > > > > RegionType::SizeType size; > > size[0] = inputRegion.GetSize()[0]; > > size[1] = inputRegion.GetSize()[1]; > > size[2] = NumberOfProjectionImages; > > > > RegionType region; > > region.SetSize(size); > > region.SetIndex(start); > > > > ImageType::SpacingType spacing; > > spacing[0] = inputImage->GetSpacing()[0]; > > spacing[1] = inputImage->GetSpacing()[1]; > > spacing[2] = inputImage->GetSpacing()[2]; > > > > ImageType::PointType origin; > > origin[0] = inputImage->GetOrigin()[0]; > > origin[1] = inputImage->GetOrigin()[1]; > > origin[2] = inputImage->GetOrigin()[2]; > > > > outputImage->SetRegions(region); > > outputImage->SetSpacing(spacing); > > outputImage->SetOrigin(origin); > > outputImage->Allocate(); > > outputImage->FillBuffer(size[0] * size[1] * size[2]); > > > > // Geometry > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(510., 510., i*8.); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->SetGeometry(geometry); > > forward->Update(); > > > > I?m not sure how I have to add projection for the geometry to get a result > which I?m familiar with. > > > > Can you describe how do I have to interpret the result of the > Joseph-Filter? I am familiar with sinograms and how they are computed, but > one sinogram is created by the projections of one image slice as far as I > understood it. What I want is to manipulate the image in the radon space > and then perform a filtered back projection. Typically the articles > describe techniques to reduce metal artifacts by using one 2D Slice. Is it > possible to achieve something like that with the JosephFilter? I?m guessing > since this filter won?t work well for 2D I have to use another filter. Can > you give me a hint if I can do something like that with RTK or another > ITK-based framework? Here a diagram > which shows an example what I want to try. > > > > I tried also to use my code with one slice and added a zero padding like > that: > > typedef itk::ConstantPadImageFilter > ConstantPadImageFilterType; > > ConstantPadImageFilterType::Pointer padFilter = > ConstantPadImageFilterType::New(); > > padFilter->SetInput(inputImage); > > > > ImageType::SizeType extendRegion; > > extendRegion[0] = 0; > > extendRegion[1] = 0; > > extendRegion[2] = 0; > > > > padFilter->SetPadLowerBound(extendRegion); > > padFilter->SetPadUpperBound(extendRegion); > > padFilter->SetConstant(1); > > padFilter->Update(); > > But the result of my png is a black square. > > Tobias > > > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Freitag, 13. Mai 2016 18:15 > > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > If you intialize the data of your itk::Image with FillBuffer with the > corresponding constant value, it is quite similar. The constant image value > allow us to stream the computation whereas you have to allocate the whole > image if you pass directly itk::Image. > > We only work in 3D and probably our projector don't work with 2D, that is > probably the problem here. You would have to correct the code for 2D but > that's a lot of work, we generally prefer pseudo 2D, see next point. > > I doubt that our forward projector will work well with one slice only if > you use 3D, we assume that the volume starts at the first pixel and ends at > the last pixel. You should probably add a zero border around with > itk::PadImage to see something. > > To avoid aliasing, you can cut frequencies in the ramp filter (look for > CutFrequency in the doxygen of rtk::FFTRampImageFilter). > > Simon > > > > On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: > > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Tue May 17 07:07:20 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Tue, 17 May 2016 16:37:20 +0530 Subject: [Rtk-users] Object isocenter shift Message-ID: Hello, As my previous thread caused some confusion, I am attaching an image showing the same in detail. As you can see my object center is not aligned with isocenter line. Besides it is offset by DX and DY values. In my case you can see the object center as red dot. Is there any method in RTK to nullify this offset effect? Will the rotation of turntable affect the reconstruction due to this offset? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: objectoffset.png Type: image/png Size: 12365 bytes Desc: not available URL: From cyril.mory at uclouvain.be Tue May 17 08:19:38 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Tue, 17 May 2016 14:19:38 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: <573B0C5A.4030001@uclouvain.be> Well, if it's just that, you should not worry about it : you cannot perfectly center your object, even if you try. And most objects (e.g. patients) do not even have a "center". So it does not make sense to struggle to have the center of the object perfectly match the isocenter of the acquisition device. You can either live with that (it is perfectly fine for most applications), or try one of these things: - If you can re-do the acquisition, you should try to have your object's center _roughly_ match the system's isocenter, because that's where you will have the least artifacts - Reconstruct your object as it is (it will work fine, unless there are other problems), but select the origin and size of your reconstructed volume carefully to have your object's center roughly at the center of your reconstructed volume. If you are not familiar with the exact definition of "origin", "spacing" and "size" of an itk::image, read section 4.1.4 of the ITK software guide (https://itk.org/ItkSoftwareGuide.pdf). This is both clear, short, and something extremely important to understand. I hope it helps, Cyril On 05/17/2016 01:07 PM, AMJAD N wrote: > Hello, > > As my previous thread caused some confusion, I am attaching an image > showing the same in detail. > > As you can see my object center is not aligned with isocenter line. > Besides it is offset by DX and DY values. In my case you can see the > object center as red dot. > > Is there any method in RTK to nullify this offset effect? > Will the rotation of turntable affect the reconstruction due to this > offset? > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From wuchao04 at gmail.com Tue May 17 09:24:58 2016 From: wuchao04 at gmail.com (Chao Wu) Date: Tue, 17 May 2016 15:24:58 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: There's nothing to correct or compensate for DURING reconstruction in your case. Where you put your object dose not change the geometry of the CT system at all. As long as the object is still inside FOV, a normal reconstruction will give you a correct result. In the resulting image, the origin is at the center of rotation, and the object is off-center by DX and DY, that's it. If you want the origin to be at the center of the object, you can shift it by DX/DY AFTER reconstruction. Regards, Chao 2016-05-17 13:07 GMT+02:00 AMJAD N : > Hello, > > As my previous thread caused some confusion, I am attaching an image > showing the same in detail. > > As you can see my object center is not aligned with isocenter line. > Besides it is offset by DX and DY values. In my case you can see the object > center as red dot. > > Is there any method in RTK to nullify this offset effect? > Will the rotation of turntable affect the reconstruction due to this > offset? > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shiraska at gmail.com Thu May 19 04:41:54 2016 From: shiraska at gmail.com (Shiras Abdurahman) Date: Thu, 19 May 2016 10:41:54 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction Message-ID: Dear all, I am trying to simulate Tomosynthesis reconstruction with stationary flat panel detector where source rotates around Y axis to acquire 21 projections (system geometry diagram is attached). Geometry file geometry.xml is generated with Reg23ProjectionGeometry. I generated projection images of a cube volume and then I tried to reconstruct with FDK algorithm. Even though I am able to generate projections, FDK reconstruction yields the volume with all voxel values zero. The commands I used for generating projections and reconstructing volume are rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 --dimension=256,256,256 --hardware=cuda I am also attaching geometry xml file, mhd header files of the original volume, projections and reconstructed volume. With regards, Shiras -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: geometry.xml Type: text/xml Size: 11889 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fdk.mhd Type: application/octet-stream Size: 322 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: projections.mhd Type: application/octet-stream Size: 335 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: volume.mhd Type: application/octet-stream Size: 355 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: system_geometry.PNG Type: image/png Size: 50006 bytes Desc: not available URL: From cyril.mory at uclouvain.be Fri May 20 04:38:22 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Fri, 20 May 2016 10:38:22 +0200 Subject: [Rtk-users] Compiler RTK In-Reply-To: <573E430F.5030704@uclouvain.be> References: <573E430F.5030704@uclouvain.be> Message-ID: <573ECCFE.3070500@uclouvain.be> Hi Kevin, I'm replying to the RTK users mailing list. Next time, please send your questions to this list instead of just me (except when it specifically involves reggui, for example). I have tried to reproduce the error but the compilation runs fine on my machine. Can you send information on your compiler ? Maybe someone else on the list can help ? Cyril On 05/20/2016 12:49 AM, Kevin Souris wrote: > Bonjour, > > Je viens de t?l?charger la derni?re version de RTK sur Github. > J'essaye maintenant de compiler sur une machine linux et j'obtiens > cette erreur: > > /home/pen/RTK/RTK-master/applications/rtkprojections/rtkprojections.cxx: > In function ?int main(int, char**)?: > /home/pen/RTK/RTK-master/applications/rtkprojections*/**rtkprojections.cxx:27: > error: invalid conversion from ?const char*? to ?char*?* > /home/pen/RTK/RTK-master/applications/rtkprojections/rtkprojections.cxx:27: > error: initializing argument 1 of ?int > cmdline_parser_rtkprojections_config_file(char*, > args_info_rtkprojections*, cmdline_parser_rtkprojections_params*)? > > Comment puis-je r?parer ?a ? > Merci > > Kevin > > > > > -- > Kevin Souris, PhD student > Universit? catholique de Louvain > Molecular Imagery, Radiotherapy and Oncology (MIRO) -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 25 15:45:57 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 25 May 2016 21:45:57 +0200 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Hi Solomon, I had still to look into this on my todo list. I did again but now I think I overlooked something in your email. You say that going through ChangeInformationImageFilter might be the problem. But now, I wonder if the problem is not that the origin that you set is wrong and then the volume or the projections are completely off (hence the projections). So, here is my question : what happens if you replace filter -> SetOutputOrigin(origin); with filter -> SetOutputOrigin(image->GetOutputOrigin()); Of course, it's not what you want to do but it might point to a wrong choice of origin... Simon On Fri, May 6, 2016 at 1:45 AM, Solomon Tang wrote: > Hi Simon, > > I added the line as you suggested and it does not change the output (still > blank). Sorry for the delayed response. > > Thanks for looking into it! > > On Wed, May 4, 2016 at 12:16 AM, Simon Rit > wrote: > >> Dear Solomon, >> Thanks for the report. It looks like a bug to me. I checked and >> itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in >> the itkGPUImage and the itkCudaImage, this function does not check >> consistency between CPU and GPU data. I'll work on a minimal example to >> check this but can you test that your problem is solved if you add >> m_DataManager->UpdateCPUBuffer(); >> before >> m_DataManager->SetGPUBufferDirty(); >> in itkCudaImage.h line 121? >> Thanks, >> Simon >> >> On Mon, May 2, 2016 at 10:42 PM, Solomon Tang >> wrote: >> >>> Thanks for the tip Simon, >>> >>> I think I may have figured it out. I initially read as a CUDA Image, and >>> then passed the CUDA image through ChangeInformationImageFilter to change >>> the offset of the image. >>> >>> template >>> typename itk::CudaImage::Pointer ShiftOffset( >>> const typename itk::CudaImage::Pointer image, >>> const typename itk::Image::PointType origin) >>> { >>> typedef itk::ChangeInformationImageFilter< itk::CudaImage > >>> FilterType; >>> FilterType::Pointer filter = FilterType::New(); >>> filter -> SetInput(image); >>> filter -> SetOutputOrigin(origin); >>> filter -> ChangeOriginOn(); >>> filter -> UpdateOutputInformation(); >>> filter -> Update(); >>> return filter->GetOutput(); >>> } >>> >>> If I pass the offset image pointer to ForwardProjection, it outputs a >>> blank image. >>> >>> However, when I write the offset image and then read it again as a CUDA >>> image, then the ForwardProjection works as intended. Perhaps using the CUDA >>> version of ITK would fix this. >>> >>> >>> On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < >>> simon.rit at creatis.insa-lyon.fr> wrote: >>> >>>> Hi Solomon, >>>> Hard to say without the full code. Maybe the cudaness of your output >>>> image is lost further in the code. Try accessing the CPU buffer at the end, >>>> after the update, to be sure that the GPU image is transferred to CPU, e.g. >>>> std::cout << forwardProjection->GetOutput()->GetPointer() <>>> Simon >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 26 12:04:47 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 26 May 2016 18:04:47 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Hi Shiras, I generated a volume to look at your problem: rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 --offset 0,0,1.7 Then I obtained the same issue as you. I think the problem is that rtkfdk is meant for circular CBCT and it includes pre-weighting for displaced detector and short scan. I'm not sure why you don't get a warning but these are probably responsible for the blank output. A simple solution is to do only the 3 FDK steps using in order the command tools: rtktwodweights rtkramp rtkbackprojections You can also try to shunt the preweighting by modifying rtkfdk.cxx. It's interesting that you try out tomosynthesis but you'll encounter some problem. When I ran the above commands, I get very weird results because the first and the last projections get a lot more weight than the others since it looks at the angular weight with the previous and the next projections. A simple solution is to blank out these two projections. Good luck and keep us posted if you get interesting results, Simon On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman wrote: > Dear all, > > I am trying to simulate Tomosynthesis reconstruction with stationary flat > panel detector where source rotates around Y axis to acquire 21 projections > (system geometry diagram is attached). Geometry file geometry.xml is > generated with Reg23ProjectionGeometry. I generated projection images of > a cube volume and then I tried to reconstruct with FDK algorithm. Even > though I am able to generate projections, FDK reconstruction yields the > volume with all voxel values zero. The commands I used for generating > projections and reconstructing volume are > > rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd > --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast > rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml > --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 > --dimension=256,256,256 --hardware=cuda > > I am also attaching geometry xml file, mhd header files of the original > volume, projections and reconstructed volume. > > With regards, > Shiras > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shiraska at gmail.com Fri May 27 11:31:52 2016 From: shiraska at gmail.com (Shiras Abdurahman) Date: Fri, 27 May 2016 17:31:52 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Dear Simon, Thank you very much for the reply. I tried to reconstruct with only ramp filtering and back projection and the results are looking good without any weighting of the projections. I also reconstructed the volume with rtksart with 10 iterations and the results are better than rtkfdk. With these experiments, I also confirmed that my geometry file is accurate. Thank you very much for your help. With regards, Shiras On Thu, May 26, 2016 at 6:04 PM, Simon Rit wrote: > Hi Shiras, > I generated a volume to look at your problem: > rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 > --offset 0,0,1.7 > Then I obtained the same issue as you. I think the problem is that rtkfdk > is meant for circular CBCT and it includes pre-weighting for displaced > detector and short scan. I'm not sure why you don't get a warning but these > are probably responsible for the blank output. A simple solution is to do > only the 3 FDK steps using in order the command tools: > rtktwodweights > rtkramp > rtkbackprojections > You can also try to shunt the preweighting by modifying rtkfdk.cxx. > > It's interesting that you try out tomosynthesis but you'll encounter some > problem. When I ran the above commands, I get very weird results because > the first and the last projections get a lot more weight than the others > since it looks at the angular weight with the previous and the next > projections. A simple solution is to blank out these two projections. > Good luck and keep us posted if you get interesting results, > Simon > > On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman > wrote: > >> Dear all, >> >> I am trying to simulate Tomosynthesis reconstruction with stationary flat >> panel detector where source rotates around Y axis to acquire 21 projections >> (system geometry diagram is attached). Geometry file geometry.xml is >> generated with Reg23ProjectionGeometry. I generated projection images of >> a cube volume and then I tried to reconstruct with FDK algorithm. Even >> though I am able to generate projections, FDK reconstruction yields the >> volume with all voxel values zero. The commands I used for generating >> projections and reconstructing volume are >> >> rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd >> --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast >> rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml >> --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 >> --dimension=256,256,256 --hardware=cuda >> >> I am also attaching geometry xml file, mhd header files of the original >> volume, projections and reconstructed volume. >> >> With regards, >> Shiras >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 27 12:00:56 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 27 May 2016 18:00:56 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Indeed, the angular weighting resulting from the discretization of the back projection occurs in rtkfdktwodweights so skipping this might help. Simon On 27 May 2016 5:32 p.m., "Shiras Abdurahman" wrote: Dear Simon, Thank you very much for the reply. I tried to reconstruct with only ramp filtering and back projection and the results are looking good without any weighting of the projections. I also reconstructed the volume with rtksart with 10 iterations and the results are better than rtkfdk. With these experiments, I also confirmed that my geometry file is accurate. Thank you very much for your help. With regards, Shiras On Thu, May 26, 2016 at 6:04 PM, Simon Rit wrote: > Hi Shiras, > I generated a volume to look at your problem: > rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 > --offset 0,0,1.7 > Then I obtained the same issue as you. I think the problem is that rtkfdk > is meant for circular CBCT and it includes pre-weighting for displaced > detector and short scan. I'm not sure why you don't get a warning but these > are probably responsible for the blank output. A simple solution is to do > only the 3 FDK steps using in order the command tools: > rtktwodweights > rtkramp > rtkbackprojections > You can also try to shunt the preweighting by modifying rtkfdk.cxx. > > It's interesting that you try out tomosynthesis but you'll encounter some > problem. When I ran the above commands, I get very weird results because > the first and the last projections get a lot more weight than the others > since it looks at the angular weight with the previous and the next > projections. A simple solution is to blank out these two projections. > Good luck and keep us posted if you get interesting results, > Simon > > On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman > wrote: > >> Dear all, >> >> I am trying to simulate Tomosynthesis reconstruction with stationary flat >> panel detector where source rotates around Y axis to acquire 21 projections >> (system geometry diagram is attached). Geometry file geometry.xml is >> generated with Reg23ProjectionGeometry. I generated projection images of >> a cube volume and then I tried to reconstruct with FDK algorithm. Even >> though I am able to generate projections, FDK reconstruction yields the >> volume with all voxel values zero. The commands I used for generating >> projections and reconstructing volume are >> >> rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd >> --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast >> rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml >> --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 >> --dimension=256,256,256 --hardware=cuda >> >> I am also attaching geometry xml file, mhd header files of the original >> volume, projections and reconstructed volume. >> >> With regards, >> Shiras >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 31 12:02:32 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 31 May 2016 18:02:32 +0200 Subject: [Rtk-users] Rooster In-Reply-To: References: Message-ID: Hi Guillaume, I'm adding RTK user list to this conversation, it's better to have these conversations on the mailing list IMO. Can you tell us what's the volume size and the GPU? Cyril is ROOSTER's dev, maybe he could comment on recon times. Simon On Tue, May 31, 2016 at 5:29 PM, wrote: > Hi Simon, > > I tried the rooster recon. I used the parameters from the example page. The results looks rather nice but it took several hours to run (5-6). Its a big dataset of about 2000 256x256 projections. > > Guillaume From G.Landry at physik.uni-muenchen.de Tue May 31 13:48:28 2016 From: G.Landry at physik.uni-muenchen.de (G.Landry at physik.uni-muenchen.de) Date: Tue, 31 May 2016 19:48:28 +0200 Subject: [Rtk-users] Rooster In-Reply-To: References: Message-ID: <20160531194828.Horde.Im1irUOnkCrL1p8oGSue_A5@webmail.physik.lmu.de> Hi Simon, Thanks for mailing list suggestion. My initial question was about typical reconstruction times for rtkfourdrooster. What I tried is summarized below: -Volume size was 410 410 264 and could be easily reduced by a good margin. -The GPU is quadro M4000 with 8GB -about 2300 256x256 projections with shifted elekta panel (so called M20) -10 phases -for the motion mask at the moment I just used the FOV mask for first try. --gamma_time 0.0001 --gamma_space 0.0001 - spacing 1 1 1 --niter 30 --cgiter 4 --tviter 10 Recon time was about 5-6 hours. I saw about 4 Gb used on the card. The image looked nice, albeit with the TV "feel/plastic-y". Thanks for your feedback Guillaume Quoting Simon Rit : > Hi Guillaume, > I'm adding RTK user list to this conversation, it's better to have > these conversations on the mailing list IMO. Can you tell us what's > the volume size and the GPU? > Cyril is ROOSTER's dev, maybe he could comment on recon times. > Simon > > On Tue, May 31, 2016 at 5:29 PM, wrote: >> Hi Simon, >> >> I tried the rooster recon. I used the parameters from the example >> page. The results looks rather nice but it took several hours to >> run (5-6). Its a big dataset of about 2000 256x256 projections. >> >> Guillaume -- Dr. Guillaume Landry Ludwig Maximilians University (LMU) Munich Medical Physics Am Coulombwall 1 85748 Garching Tel:+49 (0) 89 289-14077 Fax:+49 (0) 89 289-14072 From solomoncztang at gmail.com Mon May 2 16:42:44 2016 From: solomoncztang at gmail.com (Solomon Tang) Date: Mon, 2 May 2016 13:42:44 -0700 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Thanks for the tip Simon, I think I may have figured it out. I initially read as a CUDA Image, and then passed the CUDA image through ChangeInformationImageFilter to change the offset of the image. template typename itk::CudaImage::Pointer ShiftOffset( const typename itk::CudaImage::Pointer image, const typename itk::Image::PointType origin) { typedef itk::ChangeInformationImageFilter< itk::CudaImage > FilterType; FilterType::Pointer filter = FilterType::New(); filter -> SetInput(image); filter -> SetOutputOrigin(origin); filter -> ChangeOriginOn(); filter -> UpdateOutputInformation(); filter -> Update(); return filter->GetOutput(); } If I pass the offset image pointer to ForwardProjection, it outputs a blank image. However, when I write the offset image and then read it again as a CUDA image, then the ForwardProjection works as intended. Perhaps using the CUDA version of ITK would fix this. On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit wrote: > Hi Solomon, > Hard to say without the full code. Maybe the cudaness of your output image > is lost further in the code. Try accessing the CPU buffer at the end, after > the update, to be sure that the GPU image is transferred to CPU, e.g. > std::cout << forwardProjection->GetOutput()->GetPointer() < Simon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Tue May 3 18:59:03 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Wed, 4 May 2016 00:59:03 +0200 Subject: [Rtk-users] forward and back projection - MITK Message-ID: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I've seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I've also seen the test for this class but I don't get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I've got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 4 03:02:05 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 4 May 2016 09:02:05 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Message-ID: Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein wrote: > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 4 03:16:33 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 4 May 2016 09:16:33 +0200 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Dear Solomon, Thanks for the report. It looks like a bug to me. I checked and itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in the itkGPUImage and the itkCudaImage, this function does not check consistency between CPU and GPU data. I'll work on a minimal example to check this but can you test that your problem is solved if you add m_DataManager->UpdateCPUBuffer(); before m_DataManager->SetGPUBufferDirty(); in itkCudaImage.h line 121? Thanks, Simon On Mon, May 2, 2016 at 10:42 PM, Solomon Tang wrote: > Thanks for the tip Simon, > > I think I may have figured it out. I initially read as a CUDA Image, and > then passed the CUDA image through ChangeInformationImageFilter to change > the offset of the image. > > template > typename itk::CudaImage::Pointer ShiftOffset( > const typename itk::CudaImage::Pointer image, > const typename itk::Image::PointType origin) > { > typedef itk::ChangeInformationImageFilter< itk::CudaImage > > FilterType; > FilterType::Pointer filter = FilterType::New(); > filter -> SetInput(image); > filter -> SetOutputOrigin(origin); > filter -> ChangeOriginOn(); > filter -> UpdateOutputInformation(); > filter -> Update(); > return filter->GetOutput(); > } > > If I pass the offset image pointer to ForwardProjection, it outputs a > blank image. > > However, when I write the offset image and then read it again as a CUDA > image, then the ForwardProjection works as intended. Perhaps using the CUDA > version of ITK would fix this. > > > On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < > simon.rit at creatis.insa-lyon.fr> wrote: > >> Hi Solomon, >> Hard to say without the full code. Maybe the cudaness of your output >> image is lost further in the code. Try accessing the CPU buffer at the end, >> after the update, to be sure that the GPU image is transferred to CPU, e.g. >> std::cout << forwardProjection->GetOutput()->GetPointer() <> Simon >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Wed May 4 05:04:28 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Wed, 4 May 2016 14:34:28 +0530 Subject: [Rtk-users] Reconstructed Slice save as tiff Message-ID: Hi all, I have wrote code for saving output volume stack as *.tiff. Currently I am getting output of XY axis. What should I do in order to get the other axes. My code is shown below. typedef itk::StreamingImageFilter StreamerType; StreamerType::Pointer streamerBP = StreamerType::New(); streamerBP->SetInput(feldkampCUDA->GetOutput()); streamerBP->SetNumberOfStreamDivisions(8); typedef itk::Image< float, 2 > Image2DType; typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; WriterType::Pointer writer = WriterType::New(); writer->SetInput(streamerBP->GetOutput()); typedef itk::NumericSeriesFileNames NameGeneratorType; NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); nameGenerator->SetStartIndex(0); nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the Z-axis value of //reconstructed volume nameGenerator->SetIncrementIndex(1); writer->SetFileNames(nameGenerator->GetFileNames()); writer->SetUseCompression(true); writer->Update(); PS: My reconstruction works fine. Thanks and Regards AMJAD N -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyril.mory at uclouvain.be Wed May 4 07:27:24 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Wed, 4 May 2016 13:27:24 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: References: Message-ID: <5729DC9C.10105@uclouvain.be> Hi Amjad, You can use an ITK extract filter to extract a region that corresponds to one of your slices (along the axis you want). The output of the extract filter will be 3D, so you will need to cast it into a 2D images using an ITK cast filter. Cyril On 05/04/2016 11:04 AM, AMJAD N wrote: > Hi all, > > I have wrote code for saving output volume stack as *.tiff. Currently > I am getting output of XY axis. What should I do in order to get the > other axes. > My code is shown below. > > typedef itk::StreamingImageFilter FloatImageType> StreamerType; > StreamerType::Pointer streamerBP = StreamerType::New(); > streamerBP->SetInput(feldkampCUDA->GetOutput()); > streamerBP->SetNumberOfStreamDivisions(8); > > typedef itk::Image< float, 2 > Image2DType; > typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; > WriterType::Pointer writer = WriterType::New(); > writer->SetInput(streamerBP->GetOutput()); > > typedef itk::NumericSeriesFileNames NameGeneratorType; > NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); > nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); > nameGenerator->SetStartIndex(0); > nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the > Z-axis value of //reconstructed volume > nameGenerator->SetIncrementIndex(1); > writer->SetFileNames(nameGenerator->GetFileNames()); > writer->SetUseCompression(true); > writer->Update(); > > PS: My reconstruction works fine. > > Thanks and Regards > > AMJAD N > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From wuchao04 at gmail.com Wed May 4 08:44:37 2016 From: wuchao04 at gmail.com (Chao Wu) Date: Wed, 4 May 2016 14:44:37 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: <5729DC9C.10105@uclouvain.be> References: <5729DC9C.10105@uclouvain.be> Message-ID: A small add-on (copied from ITK document): ExtractImageFilter also collapses dimensions so that the input image may have more dimensions than the output image (i.e. 4-D input image to a 3-D output image). To specify what dimensions to collapse, the ExtractionRegion must be specified. For any dimension dim where ExtractionRegion.Size[dim] = 0, that dimension is collapsed. The index to collapse on is specified by ExtractionRegion.Index[dim]. For example, we have a image 4D = a 4x4x4x4 image, and we want to get a 3D image, 3D = a 4x4x4 image, specified as [x,y,z,2] from 4D (i.e. the 3rd "time" slice from 4D). The ExtractionRegion.Size = [4,4,4,0] and ExtractionRegion.Index = [0,0,0,2]. Regards, Chao 2016-05-04 13:27 GMT+02:00 Cyril Mory : > Hi Amjad, > > You can use an ITK extract filter to extract a region that corresponds to > one of your slices (along the axis you want). The output of the extract > filter will be 3D, so you will need to cast it into a 2D images using an > ITK cast filter. > > Cyril > > > On 05/04/2016 11:04 AM, AMJAD N wrote: > > Hi all, > > I have wrote code for saving output volume stack as *.tiff. Currently I am > getting output of XY axis. What should I do in order to get the other axes. > My code is shown below. > > typedef itk::StreamingImageFilter > StreamerType; > StreamerType::Pointer streamerBP = StreamerType::New(); > streamerBP->SetInput(feldkampCUDA->GetOutput()); > streamerBP->SetNumberOfStreamDivisions(8); > > typedef itk::Image< float, 2 > Image2DType; > typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; > WriterType::Pointer writer = WriterType::New(); > writer->SetInput(streamerBP->GetOutput()); > > typedef itk::NumericSeriesFileNames NameGeneratorType; > NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); > nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); > nameGenerator->SetStartIndex(0); > nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the > Z-axis value of //reconstructed volume > nameGenerator->SetIncrementIndex(1); > writer->SetFileNames(nameGenerator->GetFileNames()); > writer->SetUseCompression(true); > writer->Update(); > > PS: My reconstruction works fine. > > Thanks and Regards > > AMJAD N > > > > _______________________________________________ > Rtk-users mailing listRtk-users at public.kitware.comhttp://public.kitware.com/mailman/listinfo/rtk-users > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyril.mory at uclouvain.be Wed May 4 08:56:14 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Wed, 4 May 2016 14:56:14 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: References: <5729DC9C.10105@uclouvain.be> Message-ID: <5729F16E.5020402@uclouvain.be> Thanks Chao Wu, You're right, I was mistaken : the cast filter is not required in this case. It is needed, on the other hand, to increase the dimension of an image. So in this case, Amjad, you don't need it. Cyril On 05/04/2016 02:44 PM, Chao Wu wrote: > A small add-on (copied from ITK document): > > ExtractImageFilter also collapses dimensions so that the input image > may have more dimensions than the output image (i.e. 4-D input image > to a 3-D output image). To specify what dimensions to collapse, the > ExtractionRegion must be specified. For any dimension dim where > ExtractionRegion.Size[dim] = 0, that dimension is collapsed. The index > to collapse on is specified by ExtractionRegion.Index[dim]. For > example, we have a image 4D = a 4x4x4x4 image, and we want to get a 3D > image, 3D = a 4x4x4 image, specified as [x,y,z,2] from 4D (i.e. the > 3rd "time" slice from 4D). The ExtractionRegion.Size = [4,4,4,0] and > ExtractionRegion.Index = [0,0,0,2]. > > Regards, > Chao > > 2016-05-04 13:27 GMT+02:00 Cyril Mory >: > > Hi Amjad, > > You can use an ITK extract filter to extract a region that > corresponds to one of your slices (along the axis you want). The > output of the extract filter will be 3D, so you will need to cast > it into a 2D images using an ITK cast filter. > > Cyril > > > On 05/04/2016 11:04 AM, AMJAD N wrote: >> Hi all, >> >> I have wrote code for saving output volume stack as *.tiff. >> Currently I am getting output of XY axis. What should I do in >> order to get the other axes. >> My code is shown below. >> >> typedef itk::StreamingImageFilter> FloatImageType> StreamerType; >> StreamerType::Pointer streamerBP = StreamerType::New(); >> streamerBP->SetInput(feldkampCUDA->GetOutput()); >> streamerBP->SetNumberOfStreamDivisions(8); >> >> typedef itk::Image< float, 2 > Image2DType; >> typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > >> WriterType; >> WriterType::Pointer writer = WriterType::New(); >> writer->SetInput(streamerBP->GetOutput()); >> >> typedef itk::NumericSeriesFileNames NameGeneratorType; >> NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); >> nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); >> nameGenerator->SetStartIndex(0); >> nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] >> is the Z-axis value of //reconstructed volume >> nameGenerator->SetIncrementIndex(1); >> writer->SetFileNames(nameGenerator->GetFileNames()); >> writer->SetUseCompression(true); >> writer->Update(); >> >> PS: My reconstruction works fine. >> >> Thanks and Regards >> >> AMJAD N >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From solomoncztang at gmail.com Thu May 5 19:45:43 2016 From: solomoncztang at gmail.com (Solomon Tang) Date: Thu, 5 May 2016 16:45:43 -0700 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Hi Simon, I added the line as you suggested and it does not change the output (still blank). Sorry for the delayed response. Thanks for looking into it! On Wed, May 4, 2016 at 12:16 AM, Simon Rit wrote: > Dear Solomon, > Thanks for the report. It looks like a bug to me. I checked and > itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in > the itkGPUImage and the itkCudaImage, this function does not check > consistency between CPU and GPU data. I'll work on a minimal example to > check this but can you test that your problem is solved if you add > m_DataManager->UpdateCPUBuffer(); > before > m_DataManager->SetGPUBufferDirty(); > in itkCudaImage.h line 121? > Thanks, > Simon > > On Mon, May 2, 2016 at 10:42 PM, Solomon Tang > wrote: > >> Thanks for the tip Simon, >> >> I think I may have figured it out. I initially read as a CUDA Image, and >> then passed the CUDA image through ChangeInformationImageFilter to change >> the offset of the image. >> >> template >> typename itk::CudaImage::Pointer ShiftOffset( >> const typename itk::CudaImage::Pointer image, >> const typename itk::Image::PointType origin) >> { >> typedef itk::ChangeInformationImageFilter< itk::CudaImage > >> FilterType; >> FilterType::Pointer filter = FilterType::New(); >> filter -> SetInput(image); >> filter -> SetOutputOrigin(origin); >> filter -> ChangeOriginOn(); >> filter -> UpdateOutputInformation(); >> filter -> Update(); >> return filter->GetOutput(); >> } >> >> If I pass the offset image pointer to ForwardProjection, it outputs a >> blank image. >> >> However, when I write the offset image and then read it again as a CUDA >> image, then the ForwardProjection works as intended. Perhaps using the CUDA >> version of ITK would fix this. >> >> >> On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < >> simon.rit at creatis.insa-lyon.fr> wrote: >> >>> Hi Solomon, >>> Hard to say without the full code. Maybe the cudaness of your output >>> image is lost further in the code. Try accessing the CPU buffer at the end, >>> after the update, to be sure that the GPU image is transferred to CPU, e.g. >>> std::cout << forwardProjection->GetOutput()->GetPointer() <>> Simon >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 10 01:29:44 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 10 May 2016 07:29:44 +0200 Subject: [Rtk-users] Cmake build error help In-Reply-To: References: Message-ID: <573171C8.80400@creatis.insa-lyon.fr> Hi, Can you update GetGitRevisionDescription.cmake and GetGitRevisionDescription.cmake.in from https://github.com/rpavlik/cmake-modules and see if the new versions fix this issue? Thanks, Simon PS: plead keep using the mailing list On 10/05/2016 03:09, Solomon Tang wrote: > Hi Simon, > > I am rebuilding RTK after moving to Visual Studio 2015 with cmake > 3.5.2 and am running into the following error: > > CMake Error at build/applications/CMakeFiles/git-data/grabRef.cmake:36 > (file): > file failed to open for reading (No such file or directory): > > C:/Work/Tools/Current/RTK-1.2.0/build/applications/CMakeFiles/git-data/head-ref > Call Stack (most recent call first): > cmake/GetGitRevisionDescription.cmake:77 (include) > applications/CMakeLists.txt:5 (get_git_head_revision) > > I am using ITK 4.9.0 and fresh download of RTK 1.2.0. > > How do I resolve this issue? > > Thanks again, > > Solomon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Thu May 12 00:12:17 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Thu, 12 May 2016 09:42:17 +0530 Subject: [Rtk-users] Reconstruction Volume. Message-ID: Hello users, I have successfully implemented CBCT reconstruction using both CUDA and CPU method. For finding the reconstruction volume size, I measured the actual object size. divided by respective axis number of pixels to get spacing. eg: If my object is 10x15x20 cm. I measure that dimensions. If the required volume is 500x600x700 px, to get spacing i used 10/500,15/600,20/700. But this is not practically possible for every object. Is there any way to find the reconstruction volume spacing other than doing the above method. I have SDD(Source Detector Distance), SID(Source Isocenter Distance), Detector physical size,pixel density. Thanks and Regards AMJAD N -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 12 01:31:51 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 12 May 2016 07:31:51 +0200 Subject: [Rtk-users] Reconstruction Volume. In-Reply-To: References: Message-ID: Hi, The typical solution (e.g., in clincial scanners) is to reconstruct the field-of-view of the scanner (every point in space that is seen by all source positions) because you know this is the only area of space where your reconstruction is going to be accurate. rtkfieldofview generates this FOV. Simon On Thu, May 12, 2016 at 6:12 AM, AMJAD N wrote: > Hello users, > > I have successfully implemented CBCT reconstruction using both CUDA and > CPU method. For finding the reconstruction volume size, I measured the > actual object size. divided by respective axis number of pixels to get > spacing. > > eg: If my object is 10x15x20 cm. I measure that dimensions. If the > required volume is 500x600x700 px, to get spacing i used > 10/500,15/600,20/700. > > But this is not practically possible for every object. Is there any way to > find the reconstruction volume spacing other than doing the above method. > > I have SDD(Source Detector Distance), SID(Source Isocenter Distance), > Detector physical size,pixel density. > > Thanks and Regards > > AMJAD N > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Fri May 13 04:30:33 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Fri, 13 May 2016 14:00:33 +0530 Subject: [Rtk-users] Object isocenter shift Message-ID: Hello users, During acquisition it is found that my object isocenter is shifted from turntable isocenter by DX and DY values. Source , turntable isocenter and detector center is aligned perfectly. Is there any method in RTK we can make use of to nullify the effect due to this isocenter shift? Thanks and Regards AMJAD -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 13 08:36:48 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 13 May 2016 14:36:48 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: Hi, I don't understand the question. The isocenter is by definition the center of rotation in RTK and we assume it's at the origin of the reconstructed volume. There is no such thing as an "object isocenter". DX and DY values are the shift of the projection origin (which can be anywhere) with respect to the central ray (source to isocenter ray). It is not the turntable isocenter. If you want to have dx=0 and dy=0, the projection origin must be changed. But it has to be constant for the whole projection stack. I hope it helps, Simon On Fri, May 13, 2016 at 10:30 AM, AMJAD N wrote: > Hello users, > During acquisition it is found that my object isocenter is shifted from > turntable isocenter by DX and DY values. Source , turntable isocenter and > detector center is aligned perfectly. Is there any method in RTK we can > make use of to nullify the effect due to this isocenter shift? > > Thanks and Regards > AMJAD > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Fri May 13 11:35:57 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Fri, 13 May 2016 17:35:57 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Message-ID: <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 13 12:15:09 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 13 May 2016 18:15:09 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Message-ID: Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein wrote: > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Sat May 14 05:48:01 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Sat, 14 May 2016 11:48:01 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Message-ID: <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Hello Simon, Thanks for your advice so far. I?m getting to know this filter better. At least I can now use it and save the result into a file. I updated my code which now uses a volume. The values of the input and output volume are equal except of the z-dimension of the output which I changed to the number of projection images. const unsigned int Dimension = 3; ?Reading image? ImageType::Pointer inputImage = reader->GetOutput(); ImageType::Pointer outputImage = ImageType::New(); RegionType inputRegion = inputImage->GetLargestPossibleRegion(); const unsigned int NumberOfProjectionImages = 45; ImageType::IndexType start; start[0] = inputRegion.GetIndex()[0]; start[1] = inputRegion.GetIndex()[1]; start[2] = inputRegion.GetIndex()[2]; RegionType::SizeType size; size[0] = inputRegion.GetSize()[0]; size[1] = inputRegion.GetSize()[1]; size[2] = NumberOfProjectionImages; RegionType region; region.SetSize(size); region.SetIndex(start); ImageType::SpacingType spacing; spacing[0] = inputImage->GetSpacing()[0]; spacing[1] = inputImage->GetSpacing()[1]; spacing[2] = inputImage->GetSpacing()[2]; ImageType::PointType origin; origin[0] = inputImage->GetOrigin()[0]; origin[1] = inputImage->GetOrigin()[1]; origin[2] = inputImage->GetOrigin()[2]; outputImage->SetRegions(region); outputImage->SetSpacing(spacing); outputImage->SetOrigin(origin); outputImage->Allocate(); outputImage->FillBuffer(size[0] * size[1] * size[2]); // Geometry typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(510., 510., i*8.); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->SetGeometry(geometry); forward->Update(); I?m not sure how I have to add projection for the geometry to get a result which I?m familiar with. Can you describe how do I have to interpret the result of the Joseph-Filter? I am familiar with sinograms and how they are computed, but one sinogram is created by the projections of one image slice as far as I understood it. What I want is to manipulate the image in the radon space and then perform a filtered back projection. Typically the articles describe techniques to reduce metal artifacts by using one 2D Slice. Is it possible to achieve something like that with the JosephFilter? I?m guessing since this filter won?t work well for 2D I have to use another filter. Can you give me a hint if I can do something like that with RTK or another ITK-based framework? Here a diagram which shows an example what I want to try. I tried also to use my code with one slice and added a zero padding like that: typedef itk::ConstantPadImageFilter ConstantPadImageFilterType; ConstantPadImageFilterType::Pointer padFilter = ConstantPadImageFilterType::New(); padFilter->SetInput(inputImage); ImageType::SizeType extendRegion; extendRegion[0] = 0; extendRegion[1] = 0; extendRegion[2] = 0; padFilter->SetPadLowerBound(extendRegion); padFilter->SetPadUpperBound(extendRegion); padFilter->SetConstant(1); padFilter->Update(); But the result of my png is a black square. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Freitag, 13. Mai 2016 18:15 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto: simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein < tstein at stud.hs-heilbronn.de> Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Sat May 14 06:17:18 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sat, 14 May 2016 12:17:18 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Message-ID: The output of the Joseph filter (of any forward projector) is a stack of projection images, i.e., a 3D image. If you slice this 3D image in the z direction, you get one projection images. If you slice this 3D image in the y direction, you get a sinogram, e.g., the 2D sinogram of the central slice (plane of the source trajectory) if y=0. The best way to have this sinogram is to set size[1]=1 and there is no better way to do it in RTK. For zero-padding, you need to set extendRegion[?]=1, with (for all dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that your image is a black square, something else must be going on. One thing to remember, the typical RTK rotation is around the y axis so your 3D slice must be 1 in the y direction. A simple way to change the orientation of one slice is to change its direction with ChangeImageFilter Simon On Sat, May 14, 2016 at 11:48 AM, Tobias Stein wrote: > Hello Simon, > > > > Thanks for your advice so far. I?m getting to know this filter better. At > least I can now use it and save the result into a file. > > > > I updated my code which now uses a volume. > > The values of the input and output volume are equal except of the > z-dimension of the output which I changed to the number of projection > images. > > const unsigned int Dimension = 3; > > ?Reading image? > > ImageType::Pointer inputImage = reader->GetOutput(); > > ImageType::Pointer outputImage = ImageType::New(); > > > > RegionType inputRegion = inputImage->GetLargestPossibleRegion(); > > > > const unsigned int NumberOfProjectionImages = 45; > > > > ImageType::IndexType start; > > start[0] = inputRegion.GetIndex()[0]; > > start[1] = inputRegion.GetIndex()[1]; > > start[2] = inputRegion.GetIndex()[2]; > > > > RegionType::SizeType size; > > size[0] = inputRegion.GetSize()[0]; > > size[1] = inputRegion.GetSize()[1]; > > size[2] = NumberOfProjectionImages; > > > > RegionType region; > > region.SetSize(size); > > region.SetIndex(start); > > > > ImageType::SpacingType spacing; > > spacing[0] = inputImage->GetSpacing()[0]; > > spacing[1] = inputImage->GetSpacing()[1]; > > spacing[2] = inputImage->GetSpacing()[2]; > > > > ImageType::PointType origin; > > origin[0] = inputImage->GetOrigin()[0]; > > origin[1] = inputImage->GetOrigin()[1]; > > origin[2] = inputImage->GetOrigin()[2]; > > > > outputImage->SetRegions(region); > > outputImage->SetSpacing(spacing); > > outputImage->SetOrigin(origin); > > outputImage->Allocate(); > > outputImage->FillBuffer(size[0] * size[1] * size[2]); > > > > // Geometry > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(510., 510., i*8.); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->SetGeometry(geometry); > > forward->Update(); > > > > I?m not sure how I have to add projection for the geometry to get a result > which I?m familiar with. > > > > Can you describe how do I have to interpret the result of the > Joseph-Filter? I am familiar with sinograms and how they are computed, but > one sinogram is created by the projections of one image slice as far as I > understood it. What I want is to manipulate the image in the radon space > and then perform a filtered back projection. Typically the articles > describe techniques to reduce metal artifacts by using one 2D Slice. Is it > possible to achieve something like that with the JosephFilter? I?m guessing > since this filter won?t work well for 2D I have to use another filter. Can > you give me a hint if I can do something like that with RTK or another > ITK-based framework? Here a diagram > which shows an example what I want to try. > > > > I tried also to use my code with one slice and added a zero padding like > that: > > typedef itk::ConstantPadImageFilter > ConstantPadImageFilterType; > > ConstantPadImageFilterType::Pointer padFilter = > ConstantPadImageFilterType::New(); > > padFilter->SetInput(inputImage); > > > > ImageType::SizeType extendRegion; > > extendRegion[0] = 0; > > extendRegion[1] = 0; > > extendRegion[2] = 0; > > > > padFilter->SetPadLowerBound(extendRegion); > > padFilter->SetPadUpperBound(extendRegion); > > padFilter->SetConstant(1); > > padFilter->Update(); > > But the result of my png is a black square. > > Tobias > > > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Freitag, 13. Mai 2016 18:15 > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > If you intialize the data of your itk::Image with FillBuffer with the > corresponding constant value, it is quite similar. The constant image value > allow us to stream the computation whereas you have to allocate the whole > image if you pass directly itk::Image. > > We only work in 3D and probably our projector don't work with 2D, that is > probably the problem here. You would have to correct the code for 2D but > that's a lot of work, we generally prefer pseudo 2D, see next point. > > I doubt that our forward projector will work well with one slice only if > you use 3D, we assume that the volume starts at the first pixel and ends at > the last pixel. You should probably add a zero border around with > itk::PadImage to see something. > > To avoid aliasing, you can cut frequencies in the ramp filter (look for > CutFrequency in the doxygen of rtk::FFTRampImageFilter). > > Simon > > > > On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: > > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Sat May 14 06:18:57 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sat, 14 May 2016 12:18:57 +0200 Subject: [Rtk-users] RTK training - June 17 2016 Message-ID: Dear all, The training on June 17 in Lyon is confirmed. Please register asap if you'd like to attend. Looking forward to meeting our users, Simon On Thu, Mar 10, 2016 at 11:02 AM, Simon Rit wrote: > Dear all, > The new date for the RTK training is Friday June 17. > I'm looking forward to meeting you there, > Simon > > On Sun, Mar 6, 2016 at 12:57 PM, Simon Rit > wrote: > >> Dear all, >> We have to fix another date for the RTK training due to a conflicting >> meeting. If you are interested, please fill in the foodle >> so that >> we fix a date that suits everyone. If none of these dates works for you, >> please let me know and we'll try to extend the foodle. >> Please answer before Tuesday, we'll fix the date on Tuesday evening. >> Thanks for your cooperation and apologies for the mess, >> Simon >> >> On Tue, Feb 9, 2016 at 11:49 AM, Simon Rit < >> simon.rit at creatis.insa-lyon.fr> wrote: >> >>> Dear RTK users, >>> We will organize a new training >>> session on June 22 2016 in >>> Lyon. Follow the instructions on the webpage >>> to register. The training is >>> for both users and developers. We are happy to answer any question that you >>> might have and we are looking forward to this new training session. >>> Simon >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Sun May 15 08:38:40 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Sun, 15 May 2016 14:38:40 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Message-ID: <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> If I understood you correct, the input of the Joseph-Filter needs to be oriented in the y-direction when I am dealing with axial oriented slices. Now I changed the direction of the 3D Slice by rotating it 90 degrees around the x-axis with the itk::ChangeInformationImageFilter to have my slice in the xz-layer in the y-direction: double rotationX = 90; itk::Versor< double > rotation; const double angleInRadians = rotationX * vnl_math::pi / 180.0; rotation.SetRotationAroundX(angleInRadians); const ImageType::DirectionType direction = inputImage->GetDirection(); const ImageType::DirectionType newDirection = direction * rotation.GetMatrix(); changeFilter->SetOutputDirection(newDirection); changeFilter->ChangeAll(); changeFilter->SetInput(inputImage); changeFilter->UpdateOutputInformation(); Then I added a zero-border as you told me (This changed the size of my region from [512, 512, 1] to [514, 514, 3]). While executing the Joseph Filter I got an error because a vector subscript was out of range. Maybe that?s because the index of the region is [-1,-1,-1] caused by the padding. I tried the padding after the Joseph Filter, and got a result which has a size [514, 3, 45], while 45 was the number of projection images but the image was still empty. I also tried the Jospeh Filter with a real 3D volume stack of slices, rotated it as described below and got a result. Now I am confused how I should create the geometry of the Joseph Filter to get a good result. typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(300., 500., i * 180 / NumberOfProjectionImages); I am trying to use a 180-degree rotation, but i don?t have the feeling for the distance values. I this code example I used an 3D Image with dimensions = [256, 256, 49] My idea was, since there is no way to get a result with a single 3D slice, I would use a stack of slices as input and slice the output volume in y-direction to get my sinogram as you said. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Samstag, 14. Mai 2016 12:17 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK The output of the Joseph filter (of any forward projector) is a stack of projection images, i.e., a 3D image. If you slice this 3D image in the z direction, you get one projection images. If you slice this 3D image in the y direction, you get a sinogram, e.g., the 2D sinogram of the central slice (plane of the source trajectory) if y=0. The best way to have this sinogram is to set size[1]=1 and there is no better way to do it in RTK. For zero-padding, you need to set extendRegion[?]=1, with (for all dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that your image is a black square, something else must be going on. One thing to remember, the typical RTK rotation is around the y axis so your 3D slice must be 1 in the y direction. A simple way to change the orientation of one slice is to change its direction with ChangeImageFilter Simon On Sat, May 14, 2016 at 11:48 AM, Tobias Stein > wrote: Hello Simon, Thanks for your advice so far. I?m getting to know this filter better. At least I can now use it and save the result into a file. I updated my code which now uses a volume. The values of the input and output volume are equal except of the z-dimension of the output which I changed to the number of projection images. const unsigned int Dimension = 3; ?Reading image? ImageType::Pointer inputImage = reader->GetOutput(); ImageType::Pointer outputImage = ImageType::New(); RegionType inputRegion = inputImage->GetLargestPossibleRegion(); const unsigned int NumberOfProjectionImages = 45; ImageType::IndexType start; start[0] = inputRegion.GetIndex()[0]; start[1] = inputRegion.GetIndex()[1]; start[2] = inputRegion.GetIndex()[2]; RegionType::SizeType size; size[0] = inputRegion.GetSize()[0]; size[1] = inputRegion.GetSize()[1]; size[2] = NumberOfProjectionImages; RegionType region; region.SetSize(size); region.SetIndex(start); ImageType::SpacingType spacing; spacing[0] = inputImage->GetSpacing()[0]; spacing[1] = inputImage->GetSpacing()[1]; spacing[2] = inputImage->GetSpacing()[2]; ImageType::PointType origin; origin[0] = inputImage->GetOrigin()[0]; origin[1] = inputImage->GetOrigin()[1]; origin[2] = inputImage->GetOrigin()[2]; outputImage->SetRegions(region); outputImage->SetSpacing(spacing); outputImage->SetOrigin(origin); outputImage->Allocate(); outputImage->FillBuffer(size[0] * size[1] * size[2]); // Geometry typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(510., 510., i*8.); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->SetGeometry(geometry); forward->Update(); I?m not sure how I have to add projection for the geometry to get a result which I?m familiar with. Can you describe how do I have to interpret the result of the Joseph-Filter? I am familiar with sinograms and how they are computed, but one sinogram is created by the projections of one image slice as far as I understood it. What I want is to manipulate the image in the radon space and then perform a filtered back projection. Typically the articles describe techniques to reduce metal artifacts by using one 2D Slice. Is it possible to achieve something like that with the JosephFilter? I?m guessing since this filter won?t work well for 2D I have to use another filter. Can you give me a hint if I can do something like that with RTK or another ITK-based framework? Here a diagram which shows an example what I want to try. I tried also to use my code with one slice and added a zero padding like that: typedef itk::ConstantPadImageFilter ConstantPadImageFilterType; ConstantPadImageFilterType::Pointer padFilter = ConstantPadImageFilterType::New(); padFilter->SetInput(inputImage); ImageType::SizeType extendRegion; extendRegion[0] = 0; extendRegion[1] = 0; extendRegion[2] = 0; padFilter->SetPadLowerBound(extendRegion); padFilter->SetPadUpperBound(extendRegion); padFilter->SetConstant(1); padFilter->Update(); But the result of my png is a black square. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com ] Im Auftrag von Simon Rit Gesendet: Freitag, 13. Mai 2016 18:15 An: Tobias Stein > Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto: simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein < tstein at stud.hs-heilbronn.de> Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 16 05:50:41 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 16 May 2016 11:50:41 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> Message-ID: Answers below. I think you need to understand better the coordinate system of an ITK image, maybe check ITK's doc. Simon On Sun, May 15, 2016 at 2:38 PM, Tobias Stein wrote: > If I understood you correct, the input of the Joseph-Filter needs to be > oriented in the y-direction when I am dealing with axial oriented slices. > Yes, or in other words, if you want to take projections around the axial axis, be aware that y is the default axis of rotation in RTK. > Now I changed the direction of the 3D Slice by rotating it 90 degrees > around the x-axis with the itk::ChangeInformationImageFilter to have my > slice in the xz-layer in the y-direction: > > double rotationX = 90; > > itk::Versor< double > rotation; > > const double angleInRadians = rotationX * vnl_math::pi / 180.0; > > rotation.SetRotationAroundX(angleInRadians); > > const ImageType::DirectionType direction = > inputImage->GetDirection(); > > const ImageType::DirectionType newDirection = direction * > rotation.GetMatrix(); > > changeFilter->SetOutputDirection(newDirection); > > changeFilter->ChangeAll(); > > changeFilter->SetInput(inputImage); > > changeFilter->UpdateOutputInformation(); > > > > Then I added a zero-border as you told me (This changed the size of my > region from [512, 512, 1] to [514, 514, 3]). > > While executing the Joseph Filter I got an error because a vector > subscript was out of range. Maybe that?s because the index of the region is > [-1,-1,-1] caused by the padding. > That should not have been a problem but that might be a bug... > I tried the padding after the Joseph Filter, and got a result which has a > size [514, 3, 45], while 45 was the number of projection images but the > image was still empty. > I guess you should check the origin of your projected volume and your projections. A simple test is to center your volume (check using ITK doc how you can define the origin so that (0,0,0) is at the center) and your projection (for the projection stack, only the first 2 coordinates count). > > > I also tried the Jospeh Filter with a real 3D volume stack of slices, > rotated it as described below and got a result. > > Now I am confused how I should create the geometry of the Joseph Filter to > get a good result. > > > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(300., 500., i * 180 / > NumberOfProjectionImages); > > > > I am trying to use a 180-degree rotation, but i don?t have the feeling for > the distance values. > > I this code example I used an 3D Image with dimensions = [256, 256, 49] > This doesn't tell you anything about the size of your volume, we also need the origin and the spacing. Look at the ITK doc to understand the ITK coordinate systems. > > > My idea was, since there is no way to get a result with a single 3D slice, > I would use a stack of slices as input and slice the output volume in > y-direction to get my sinogram as you said. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Samstag, 14. Mai 2016 12:17 > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > The output of the Joseph filter (of any forward projector) is a stack of > projection images, i.e., a 3D image. If you slice this 3D image in the z > direction, you get one projection images. If you slice this 3D image in the > y direction, you get a sinogram, e.g., the 2D sinogram of the central slice > (plane of the source trajectory) if y=0. The best way to have this sinogram > is to set size[1]=1 and there is no better way to do it in RTK. > > For zero-padding, you need to set extendRegion[?]=1, with (for all > dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that > your image is a black square, something else must be going on. One thing to > remember, the typical RTK rotation is around the y axis so your 3D slice > must be 1 in the y direction. A simple way to change the orientation of one > slice is to change its direction with ChangeImageFilter > > Simon > > > > > > On Sat, May 14, 2016 at 11:48 AM, Tobias Stein < > tstein at stud.hs-heilbronn.de> wrote: > > Hello Simon, > > > > Thanks for your advice so far. I?m getting to know this filter better. At > least I can now use it and save the result into a file. > > > > I updated my code which now uses a volume. > > The values of the input and output volume are equal except of the > z-dimension of the output which I changed to the number of projection > images. > > const unsigned int Dimension = 3; > > ?Reading image? > > ImageType::Pointer inputImage = reader->GetOutput(); > > ImageType::Pointer outputImage = ImageType::New(); > > > > RegionType inputRegion = inputImage->GetLargestPossibleRegion(); > > > > const unsigned int NumberOfProjectionImages = 45; > > > > ImageType::IndexType start; > > start[0] = inputRegion.GetIndex()[0]; > > start[1] = inputRegion.GetIndex()[1]; > > start[2] = inputRegion.GetIndex()[2]; > > > > RegionType::SizeType size; > > size[0] = inputRegion.GetSize()[0]; > > size[1] = inputRegion.GetSize()[1]; > > size[2] = NumberOfProjectionImages; > > > > RegionType region; > > region.SetSize(size); > > region.SetIndex(start); > > > > ImageType::SpacingType spacing; > > spacing[0] = inputImage->GetSpacing()[0]; > > spacing[1] = inputImage->GetSpacing()[1]; > > spacing[2] = inputImage->GetSpacing()[2]; > > > > ImageType::PointType origin; > > origin[0] = inputImage->GetOrigin()[0]; > > origin[1] = inputImage->GetOrigin()[1]; > > origin[2] = inputImage->GetOrigin()[2]; > > > > outputImage->SetRegions(region); > > outputImage->SetSpacing(spacing); > > outputImage->SetOrigin(origin); > > outputImage->Allocate(); > > outputImage->FillBuffer(size[0] * size[1] * size[2]); > > > > // Geometry > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(510., 510., i*8.); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->SetGeometry(geometry); > > forward->Update(); > > > > I?m not sure how I have to add projection for the geometry to get a result > which I?m familiar with. > > > > Can you describe how do I have to interpret the result of the > Joseph-Filter? I am familiar with sinograms and how they are computed, but > one sinogram is created by the projections of one image slice as far as I > understood it. What I want is to manipulate the image in the radon space > and then perform a filtered back projection. Typically the articles > describe techniques to reduce metal artifacts by using one 2D Slice. Is it > possible to achieve something like that with the JosephFilter? I?m guessing > since this filter won?t work well for 2D I have to use another filter. Can > you give me a hint if I can do something like that with RTK or another > ITK-based framework? Here a diagram > which shows an example what I want to try. > > > > I tried also to use my code with one slice and added a zero padding like > that: > > typedef itk::ConstantPadImageFilter > ConstantPadImageFilterType; > > ConstantPadImageFilterType::Pointer padFilter = > ConstantPadImageFilterType::New(); > > padFilter->SetInput(inputImage); > > > > ImageType::SizeType extendRegion; > > extendRegion[0] = 0; > > extendRegion[1] = 0; > > extendRegion[2] = 0; > > > > padFilter->SetPadLowerBound(extendRegion); > > padFilter->SetPadUpperBound(extendRegion); > > padFilter->SetConstant(1); > > padFilter->Update(); > > But the result of my png is a black square. > > Tobias > > > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Freitag, 13. Mai 2016 18:15 > > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > If you intialize the data of your itk::Image with FillBuffer with the > corresponding constant value, it is quite similar. The constant image value > allow us to stream the computation whereas you have to allocate the whole > image if you pass directly itk::Image. > > We only work in 3D and probably our projector don't work with 2D, that is > probably the problem here. You would have to correct the code for 2D but > that's a lot of work, we generally prefer pseudo 2D, see next point. > > I doubt that our forward projector will work well with one slice only if > you use 3D, we assume that the volume starts at the first pixel and ends at > the last pixel. You should probably add a zero border around with > itk::PadImage to see something. > > To avoid aliasing, you can cut frequencies in the ramp filter (look for > CutFrequency in the doxygen of rtk::FFTRampImageFilter). > > Simon > > > > On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: > > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Tue May 17 07:07:20 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Tue, 17 May 2016 16:37:20 +0530 Subject: [Rtk-users] Object isocenter shift Message-ID: Hello, As my previous thread caused some confusion, I am attaching an image showing the same in detail. As you can see my object center is not aligned with isocenter line. Besides it is offset by DX and DY values. In my case you can see the object center as red dot. Is there any method in RTK to nullify this offset effect? Will the rotation of turntable affect the reconstruction due to this offset? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: objectoffset.png Type: image/png Size: 12365 bytes Desc: not available URL: From cyril.mory at uclouvain.be Tue May 17 08:19:38 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Tue, 17 May 2016 14:19:38 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: <573B0C5A.4030001@uclouvain.be> Well, if it's just that, you should not worry about it : you cannot perfectly center your object, even if you try. And most objects (e.g. patients) do not even have a "center". So it does not make sense to struggle to have the center of the object perfectly match the isocenter of the acquisition device. You can either live with that (it is perfectly fine for most applications), or try one of these things: - If you can re-do the acquisition, you should try to have your object's center _roughly_ match the system's isocenter, because that's where you will have the least artifacts - Reconstruct your object as it is (it will work fine, unless there are other problems), but select the origin and size of your reconstructed volume carefully to have your object's center roughly at the center of your reconstructed volume. If you are not familiar with the exact definition of "origin", "spacing" and "size" of an itk::image, read section 4.1.4 of the ITK software guide (https://itk.org/ItkSoftwareGuide.pdf). This is both clear, short, and something extremely important to understand. I hope it helps, Cyril On 05/17/2016 01:07 PM, AMJAD N wrote: > Hello, > > As my previous thread caused some confusion, I am attaching an image > showing the same in detail. > > As you can see my object center is not aligned with isocenter line. > Besides it is offset by DX and DY values. In my case you can see the > object center as red dot. > > Is there any method in RTK to nullify this offset effect? > Will the rotation of turntable affect the reconstruction due to this > offset? > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From wuchao04 at gmail.com Tue May 17 09:24:58 2016 From: wuchao04 at gmail.com (Chao Wu) Date: Tue, 17 May 2016 15:24:58 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: There's nothing to correct or compensate for DURING reconstruction in your case. Where you put your object dose not change the geometry of the CT system at all. As long as the object is still inside FOV, a normal reconstruction will give you a correct result. In the resulting image, the origin is at the center of rotation, and the object is off-center by DX and DY, that's it. If you want the origin to be at the center of the object, you can shift it by DX/DY AFTER reconstruction. Regards, Chao 2016-05-17 13:07 GMT+02:00 AMJAD N : > Hello, > > As my previous thread caused some confusion, I am attaching an image > showing the same in detail. > > As you can see my object center is not aligned with isocenter line. > Besides it is offset by DX and DY values. In my case you can see the object > center as red dot. > > Is there any method in RTK to nullify this offset effect? > Will the rotation of turntable affect the reconstruction due to this > offset? > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shiraska at gmail.com Thu May 19 04:41:54 2016 From: shiraska at gmail.com (Shiras Abdurahman) Date: Thu, 19 May 2016 10:41:54 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction Message-ID: Dear all, I am trying to simulate Tomosynthesis reconstruction with stationary flat panel detector where source rotates around Y axis to acquire 21 projections (system geometry diagram is attached). Geometry file geometry.xml is generated with Reg23ProjectionGeometry. I generated projection images of a cube volume and then I tried to reconstruct with FDK algorithm. Even though I am able to generate projections, FDK reconstruction yields the volume with all voxel values zero. The commands I used for generating projections and reconstructing volume are rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 --dimension=256,256,256 --hardware=cuda I am also attaching geometry xml file, mhd header files of the original volume, projections and reconstructed volume. With regards, Shiras -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: geometry.xml Type: text/xml Size: 11889 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fdk.mhd Type: application/octet-stream Size: 322 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: projections.mhd Type: application/octet-stream Size: 335 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: volume.mhd Type: application/octet-stream Size: 355 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: system_geometry.PNG Type: image/png Size: 50006 bytes Desc: not available URL: From cyril.mory at uclouvain.be Fri May 20 04:38:22 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Fri, 20 May 2016 10:38:22 +0200 Subject: [Rtk-users] Compiler RTK In-Reply-To: <573E430F.5030704@uclouvain.be> References: <573E430F.5030704@uclouvain.be> Message-ID: <573ECCFE.3070500@uclouvain.be> Hi Kevin, I'm replying to the RTK users mailing list. Next time, please send your questions to this list instead of just me (except when it specifically involves reggui, for example). I have tried to reproduce the error but the compilation runs fine on my machine. Can you send information on your compiler ? Maybe someone else on the list can help ? Cyril On 05/20/2016 12:49 AM, Kevin Souris wrote: > Bonjour, > > Je viens de t?l?charger la derni?re version de RTK sur Github. > J'essaye maintenant de compiler sur une machine linux et j'obtiens > cette erreur: > > /home/pen/RTK/RTK-master/applications/rtkprojections/rtkprojections.cxx: > In function ?int main(int, char**)?: > /home/pen/RTK/RTK-master/applications/rtkprojections*/**rtkprojections.cxx:27: > error: invalid conversion from ?const char*? to ?char*?* > /home/pen/RTK/RTK-master/applications/rtkprojections/rtkprojections.cxx:27: > error: initializing argument 1 of ?int > cmdline_parser_rtkprojections_config_file(char*, > args_info_rtkprojections*, cmdline_parser_rtkprojections_params*)? > > Comment puis-je r?parer ?a ? > Merci > > Kevin > > > > > -- > Kevin Souris, PhD student > Universit? catholique de Louvain > Molecular Imagery, Radiotherapy and Oncology (MIRO) -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 25 15:45:57 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 25 May 2016 21:45:57 +0200 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Hi Solomon, I had still to look into this on my todo list. I did again but now I think I overlooked something in your email. You say that going through ChangeInformationImageFilter might be the problem. But now, I wonder if the problem is not that the origin that you set is wrong and then the volume or the projections are completely off (hence the projections). So, here is my question : what happens if you replace filter -> SetOutputOrigin(origin); with filter -> SetOutputOrigin(image->GetOutputOrigin()); Of course, it's not what you want to do but it might point to a wrong choice of origin... Simon On Fri, May 6, 2016 at 1:45 AM, Solomon Tang wrote: > Hi Simon, > > I added the line as you suggested and it does not change the output (still > blank). Sorry for the delayed response. > > Thanks for looking into it! > > On Wed, May 4, 2016 at 12:16 AM, Simon Rit > wrote: > >> Dear Solomon, >> Thanks for the report. It looks like a bug to me. I checked and >> itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in >> the itkGPUImage and the itkCudaImage, this function does not check >> consistency between CPU and GPU data. I'll work on a minimal example to >> check this but can you test that your problem is solved if you add >> m_DataManager->UpdateCPUBuffer(); >> before >> m_DataManager->SetGPUBufferDirty(); >> in itkCudaImage.h line 121? >> Thanks, >> Simon >> >> On Mon, May 2, 2016 at 10:42 PM, Solomon Tang >> wrote: >> >>> Thanks for the tip Simon, >>> >>> I think I may have figured it out. I initially read as a CUDA Image, and >>> then passed the CUDA image through ChangeInformationImageFilter to change >>> the offset of the image. >>> >>> template >>> typename itk::CudaImage::Pointer ShiftOffset( >>> const typename itk::CudaImage::Pointer image, >>> const typename itk::Image::PointType origin) >>> { >>> typedef itk::ChangeInformationImageFilter< itk::CudaImage > >>> FilterType; >>> FilterType::Pointer filter = FilterType::New(); >>> filter -> SetInput(image); >>> filter -> SetOutputOrigin(origin); >>> filter -> ChangeOriginOn(); >>> filter -> UpdateOutputInformation(); >>> filter -> Update(); >>> return filter->GetOutput(); >>> } >>> >>> If I pass the offset image pointer to ForwardProjection, it outputs a >>> blank image. >>> >>> However, when I write the offset image and then read it again as a CUDA >>> image, then the ForwardProjection works as intended. Perhaps using the CUDA >>> version of ITK would fix this. >>> >>> >>> On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < >>> simon.rit at creatis.insa-lyon.fr> wrote: >>> >>>> Hi Solomon, >>>> Hard to say without the full code. Maybe the cudaness of your output >>>> image is lost further in the code. Try accessing the CPU buffer at the end, >>>> after the update, to be sure that the GPU image is transferred to CPU, e.g. >>>> std::cout << forwardProjection->GetOutput()->GetPointer() <>>> Simon >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 26 12:04:47 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 26 May 2016 18:04:47 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Hi Shiras, I generated a volume to look at your problem: rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 --offset 0,0,1.7 Then I obtained the same issue as you. I think the problem is that rtkfdk is meant for circular CBCT and it includes pre-weighting for displaced detector and short scan. I'm not sure why you don't get a warning but these are probably responsible for the blank output. A simple solution is to do only the 3 FDK steps using in order the command tools: rtktwodweights rtkramp rtkbackprojections You can also try to shunt the preweighting by modifying rtkfdk.cxx. It's interesting that you try out tomosynthesis but you'll encounter some problem. When I ran the above commands, I get very weird results because the first and the last projections get a lot more weight than the others since it looks at the angular weight with the previous and the next projections. A simple solution is to blank out these two projections. Good luck and keep us posted if you get interesting results, Simon On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman wrote: > Dear all, > > I am trying to simulate Tomosynthesis reconstruction with stationary flat > panel detector where source rotates around Y axis to acquire 21 projections > (system geometry diagram is attached). Geometry file geometry.xml is > generated with Reg23ProjectionGeometry. I generated projection images of > a cube volume and then I tried to reconstruct with FDK algorithm. Even > though I am able to generate projections, FDK reconstruction yields the > volume with all voxel values zero. The commands I used for generating > projections and reconstructing volume are > > rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd > --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast > rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml > --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 > --dimension=256,256,256 --hardware=cuda > > I am also attaching geometry xml file, mhd header files of the original > volume, projections and reconstructed volume. > > With regards, > Shiras > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shiraska at gmail.com Fri May 27 11:31:52 2016 From: shiraska at gmail.com (Shiras Abdurahman) Date: Fri, 27 May 2016 17:31:52 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Dear Simon, Thank you very much for the reply. I tried to reconstruct with only ramp filtering and back projection and the results are looking good without any weighting of the projections. I also reconstructed the volume with rtksart with 10 iterations and the results are better than rtkfdk. With these experiments, I also confirmed that my geometry file is accurate. Thank you very much for your help. With regards, Shiras On Thu, May 26, 2016 at 6:04 PM, Simon Rit wrote: > Hi Shiras, > I generated a volume to look at your problem: > rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 > --offset 0,0,1.7 > Then I obtained the same issue as you. I think the problem is that rtkfdk > is meant for circular CBCT and it includes pre-weighting for displaced > detector and short scan. I'm not sure why you don't get a warning but these > are probably responsible for the blank output. A simple solution is to do > only the 3 FDK steps using in order the command tools: > rtktwodweights > rtkramp > rtkbackprojections > You can also try to shunt the preweighting by modifying rtkfdk.cxx. > > It's interesting that you try out tomosynthesis but you'll encounter some > problem. When I ran the above commands, I get very weird results because > the first and the last projections get a lot more weight than the others > since it looks at the angular weight with the previous and the next > projections. A simple solution is to blank out these two projections. > Good luck and keep us posted if you get interesting results, > Simon > > On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman > wrote: > >> Dear all, >> >> I am trying to simulate Tomosynthesis reconstruction with stationary flat >> panel detector where source rotates around Y axis to acquire 21 projections >> (system geometry diagram is attached). Geometry file geometry.xml is >> generated with Reg23ProjectionGeometry. I generated projection images of >> a cube volume and then I tried to reconstruct with FDK algorithm. Even >> though I am able to generate projections, FDK reconstruction yields the >> volume with all voxel values zero. The commands I used for generating >> projections and reconstructing volume are >> >> rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd >> --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast >> rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml >> --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 >> --dimension=256,256,256 --hardware=cuda >> >> I am also attaching geometry xml file, mhd header files of the original >> volume, projections and reconstructed volume. >> >> With regards, >> Shiras >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 27 12:00:56 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 27 May 2016 18:00:56 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Indeed, the angular weighting resulting from the discretization of the back projection occurs in rtkfdktwodweights so skipping this might help. Simon On 27 May 2016 5:32 p.m., "Shiras Abdurahman" wrote: Dear Simon, Thank you very much for the reply. I tried to reconstruct with only ramp filtering and back projection and the results are looking good without any weighting of the projections. I also reconstructed the volume with rtksart with 10 iterations and the results are better than rtkfdk. With these experiments, I also confirmed that my geometry file is accurate. Thank you very much for your help. With regards, Shiras On Thu, May 26, 2016 at 6:04 PM, Simon Rit wrote: > Hi Shiras, > I generated a volume to look at your problem: > rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 > --offset 0,0,1.7 > Then I obtained the same issue as you. I think the problem is that rtkfdk > is meant for circular CBCT and it includes pre-weighting for displaced > detector and short scan. I'm not sure why you don't get a warning but these > are probably responsible for the blank output. A simple solution is to do > only the 3 FDK steps using in order the command tools: > rtktwodweights > rtkramp > rtkbackprojections > You can also try to shunt the preweighting by modifying rtkfdk.cxx. > > It's interesting that you try out tomosynthesis but you'll encounter some > problem. When I ran the above commands, I get very weird results because > the first and the last projections get a lot more weight than the others > since it looks at the angular weight with the previous and the next > projections. A simple solution is to blank out these two projections. > Good luck and keep us posted if you get interesting results, > Simon > > On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman > wrote: > >> Dear all, >> >> I am trying to simulate Tomosynthesis reconstruction with stationary flat >> panel detector where source rotates around Y axis to acquire 21 projections >> (system geometry diagram is attached). Geometry file geometry.xml is >> generated with Reg23ProjectionGeometry. I generated projection images of >> a cube volume and then I tried to reconstruct with FDK algorithm. Even >> though I am able to generate projections, FDK reconstruction yields the >> volume with all voxel values zero. The commands I used for generating >> projections and reconstructing volume are >> >> rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd >> --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast >> rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml >> --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 >> --dimension=256,256,256 --hardware=cuda >> >> I am also attaching geometry xml file, mhd header files of the original >> volume, projections and reconstructed volume. >> >> With regards, >> Shiras >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 31 12:02:32 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 31 May 2016 18:02:32 +0200 Subject: [Rtk-users] Rooster In-Reply-To: References: Message-ID: Hi Guillaume, I'm adding RTK user list to this conversation, it's better to have these conversations on the mailing list IMO. Can you tell us what's the volume size and the GPU? Cyril is ROOSTER's dev, maybe he could comment on recon times. Simon On Tue, May 31, 2016 at 5:29 PM, wrote: > Hi Simon, > > I tried the rooster recon. I used the parameters from the example page. The results looks rather nice but it took several hours to run (5-6). Its a big dataset of about 2000 256x256 projections. > > Guillaume From G.Landry at physik.uni-muenchen.de Tue May 31 13:48:28 2016 From: G.Landry at physik.uni-muenchen.de (G.Landry at physik.uni-muenchen.de) Date: Tue, 31 May 2016 19:48:28 +0200 Subject: [Rtk-users] Rooster In-Reply-To: References: Message-ID: <20160531194828.Horde.Im1irUOnkCrL1p8oGSue_A5@webmail.physik.lmu.de> Hi Simon, Thanks for mailing list suggestion. My initial question was about typical reconstruction times for rtkfourdrooster. What I tried is summarized below: -Volume size was 410 410 264 and could be easily reduced by a good margin. -The GPU is quadro M4000 with 8GB -about 2300 256x256 projections with shifted elekta panel (so called M20) -10 phases -for the motion mask at the moment I just used the FOV mask for first try. --gamma_time 0.0001 --gamma_space 0.0001 - spacing 1 1 1 --niter 30 --cgiter 4 --tviter 10 Recon time was about 5-6 hours. I saw about 4 Gb used on the card. The image looked nice, albeit with the TV "feel/plastic-y". Thanks for your feedback Guillaume Quoting Simon Rit : > Hi Guillaume, > I'm adding RTK user list to this conversation, it's better to have > these conversations on the mailing list IMO. Can you tell us what's > the volume size and the GPU? > Cyril is ROOSTER's dev, maybe he could comment on recon times. > Simon > > On Tue, May 31, 2016 at 5:29 PM, wrote: >> Hi Simon, >> >> I tried the rooster recon. I used the parameters from the example >> page. The results looks rather nice but it took several hours to >> run (5-6). Its a big dataset of about 2000 256x256 projections. >> >> Guillaume -- Dr. Guillaume Landry Ludwig Maximilians University (LMU) Munich Medical Physics Am Coulombwall 1 85748 Garching Tel:+49 (0) 89 289-14077 Fax:+49 (0) 89 289-14072 From solomoncztang at gmail.com Mon May 2 16:42:44 2016 From: solomoncztang at gmail.com (Solomon Tang) Date: Mon, 2 May 2016 13:42:44 -0700 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Thanks for the tip Simon, I think I may have figured it out. I initially read as a CUDA Image, and then passed the CUDA image through ChangeInformationImageFilter to change the offset of the image. template typename itk::CudaImage::Pointer ShiftOffset( const typename itk::CudaImage::Pointer image, const typename itk::Image::PointType origin) { typedef itk::ChangeInformationImageFilter< itk::CudaImage > FilterType; FilterType::Pointer filter = FilterType::New(); filter -> SetInput(image); filter -> SetOutputOrigin(origin); filter -> ChangeOriginOn(); filter -> UpdateOutputInformation(); filter -> Update(); return filter->GetOutput(); } If I pass the offset image pointer to ForwardProjection, it outputs a blank image. However, when I write the offset image and then read it again as a CUDA image, then the ForwardProjection works as intended. Perhaps using the CUDA version of ITK would fix this. On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit wrote: > Hi Solomon, > Hard to say without the full code. Maybe the cudaness of your output image > is lost further in the code. Try accessing the CPU buffer at the end, after > the update, to be sure that the GPU image is transferred to CPU, e.g. > std::cout << forwardProjection->GetOutput()->GetPointer() < Simon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Tue May 3 18:59:03 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Wed, 4 May 2016 00:59:03 +0200 Subject: [Rtk-users] forward and back projection - MITK Message-ID: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I've seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I've also seen the test for this class but I don't get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I've got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 4 03:02:05 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 4 May 2016 09:02:05 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Message-ID: Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein wrote: > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 4 03:16:33 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 4 May 2016 09:16:33 +0200 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Dear Solomon, Thanks for the report. It looks like a bug to me. I checked and itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in the itkGPUImage and the itkCudaImage, this function does not check consistency between CPU and GPU data. I'll work on a minimal example to check this but can you test that your problem is solved if you add m_DataManager->UpdateCPUBuffer(); before m_DataManager->SetGPUBufferDirty(); in itkCudaImage.h line 121? Thanks, Simon On Mon, May 2, 2016 at 10:42 PM, Solomon Tang wrote: > Thanks for the tip Simon, > > I think I may have figured it out. I initially read as a CUDA Image, and > then passed the CUDA image through ChangeInformationImageFilter to change > the offset of the image. > > template > typename itk::CudaImage::Pointer ShiftOffset( > const typename itk::CudaImage::Pointer image, > const typename itk::Image::PointType origin) > { > typedef itk::ChangeInformationImageFilter< itk::CudaImage > > FilterType; > FilterType::Pointer filter = FilterType::New(); > filter -> SetInput(image); > filter -> SetOutputOrigin(origin); > filter -> ChangeOriginOn(); > filter -> UpdateOutputInformation(); > filter -> Update(); > return filter->GetOutput(); > } > > If I pass the offset image pointer to ForwardProjection, it outputs a > blank image. > > However, when I write the offset image and then read it again as a CUDA > image, then the ForwardProjection works as intended. Perhaps using the CUDA > version of ITK would fix this. > > > On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < > simon.rit at creatis.insa-lyon.fr> wrote: > >> Hi Solomon, >> Hard to say without the full code. Maybe the cudaness of your output >> image is lost further in the code. Try accessing the CPU buffer at the end, >> after the update, to be sure that the GPU image is transferred to CPU, e.g. >> std::cout << forwardProjection->GetOutput()->GetPointer() <> Simon >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Wed May 4 05:04:28 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Wed, 4 May 2016 14:34:28 +0530 Subject: [Rtk-users] Reconstructed Slice save as tiff Message-ID: Hi all, I have wrote code for saving output volume stack as *.tiff. Currently I am getting output of XY axis. What should I do in order to get the other axes. My code is shown below. typedef itk::StreamingImageFilter StreamerType; StreamerType::Pointer streamerBP = StreamerType::New(); streamerBP->SetInput(feldkampCUDA->GetOutput()); streamerBP->SetNumberOfStreamDivisions(8); typedef itk::Image< float, 2 > Image2DType; typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; WriterType::Pointer writer = WriterType::New(); writer->SetInput(streamerBP->GetOutput()); typedef itk::NumericSeriesFileNames NameGeneratorType; NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); nameGenerator->SetStartIndex(0); nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the Z-axis value of //reconstructed volume nameGenerator->SetIncrementIndex(1); writer->SetFileNames(nameGenerator->GetFileNames()); writer->SetUseCompression(true); writer->Update(); PS: My reconstruction works fine. Thanks and Regards AMJAD N -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyril.mory at uclouvain.be Wed May 4 07:27:24 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Wed, 4 May 2016 13:27:24 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: References: Message-ID: <5729DC9C.10105@uclouvain.be> Hi Amjad, You can use an ITK extract filter to extract a region that corresponds to one of your slices (along the axis you want). The output of the extract filter will be 3D, so you will need to cast it into a 2D images using an ITK cast filter. Cyril On 05/04/2016 11:04 AM, AMJAD N wrote: > Hi all, > > I have wrote code for saving output volume stack as *.tiff. Currently > I am getting output of XY axis. What should I do in order to get the > other axes. > My code is shown below. > > typedef itk::StreamingImageFilter FloatImageType> StreamerType; > StreamerType::Pointer streamerBP = StreamerType::New(); > streamerBP->SetInput(feldkampCUDA->GetOutput()); > streamerBP->SetNumberOfStreamDivisions(8); > > typedef itk::Image< float, 2 > Image2DType; > typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; > WriterType::Pointer writer = WriterType::New(); > writer->SetInput(streamerBP->GetOutput()); > > typedef itk::NumericSeriesFileNames NameGeneratorType; > NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); > nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); > nameGenerator->SetStartIndex(0); > nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the > Z-axis value of //reconstructed volume > nameGenerator->SetIncrementIndex(1); > writer->SetFileNames(nameGenerator->GetFileNames()); > writer->SetUseCompression(true); > writer->Update(); > > PS: My reconstruction works fine. > > Thanks and Regards > > AMJAD N > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From wuchao04 at gmail.com Wed May 4 08:44:37 2016 From: wuchao04 at gmail.com (Chao Wu) Date: Wed, 4 May 2016 14:44:37 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: <5729DC9C.10105@uclouvain.be> References: <5729DC9C.10105@uclouvain.be> Message-ID: A small add-on (copied from ITK document): ExtractImageFilter also collapses dimensions so that the input image may have more dimensions than the output image (i.e. 4-D input image to a 3-D output image). To specify what dimensions to collapse, the ExtractionRegion must be specified. For any dimension dim where ExtractionRegion.Size[dim] = 0, that dimension is collapsed. The index to collapse on is specified by ExtractionRegion.Index[dim]. For example, we have a image 4D = a 4x4x4x4 image, and we want to get a 3D image, 3D = a 4x4x4 image, specified as [x,y,z,2] from 4D (i.e. the 3rd "time" slice from 4D). The ExtractionRegion.Size = [4,4,4,0] and ExtractionRegion.Index = [0,0,0,2]. Regards, Chao 2016-05-04 13:27 GMT+02:00 Cyril Mory : > Hi Amjad, > > You can use an ITK extract filter to extract a region that corresponds to > one of your slices (along the axis you want). The output of the extract > filter will be 3D, so you will need to cast it into a 2D images using an > ITK cast filter. > > Cyril > > > On 05/04/2016 11:04 AM, AMJAD N wrote: > > Hi all, > > I have wrote code for saving output volume stack as *.tiff. Currently I am > getting output of XY axis. What should I do in order to get the other axes. > My code is shown below. > > typedef itk::StreamingImageFilter > StreamerType; > StreamerType::Pointer streamerBP = StreamerType::New(); > streamerBP->SetInput(feldkampCUDA->GetOutput()); > streamerBP->SetNumberOfStreamDivisions(8); > > typedef itk::Image< float, 2 > Image2DType; > typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; > WriterType::Pointer writer = WriterType::New(); > writer->SetInput(streamerBP->GetOutput()); > > typedef itk::NumericSeriesFileNames NameGeneratorType; > NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); > nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); > nameGenerator->SetStartIndex(0); > nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the > Z-axis value of //reconstructed volume > nameGenerator->SetIncrementIndex(1); > writer->SetFileNames(nameGenerator->GetFileNames()); > writer->SetUseCompression(true); > writer->Update(); > > PS: My reconstruction works fine. > > Thanks and Regards > > AMJAD N > > > > _______________________________________________ > Rtk-users mailing listRtk-users at public.kitware.comhttp://public.kitware.com/mailman/listinfo/rtk-users > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyril.mory at uclouvain.be Wed May 4 08:56:14 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Wed, 4 May 2016 14:56:14 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: References: <5729DC9C.10105@uclouvain.be> Message-ID: <5729F16E.5020402@uclouvain.be> Thanks Chao Wu, You're right, I was mistaken : the cast filter is not required in this case. It is needed, on the other hand, to increase the dimension of an image. So in this case, Amjad, you don't need it. Cyril On 05/04/2016 02:44 PM, Chao Wu wrote: > A small add-on (copied from ITK document): > > ExtractImageFilter also collapses dimensions so that the input image > may have more dimensions than the output image (i.e. 4-D input image > to a 3-D output image). To specify what dimensions to collapse, the > ExtractionRegion must be specified. For any dimension dim where > ExtractionRegion.Size[dim] = 0, that dimension is collapsed. The index > to collapse on is specified by ExtractionRegion.Index[dim]. For > example, we have a image 4D = a 4x4x4x4 image, and we want to get a 3D > image, 3D = a 4x4x4 image, specified as [x,y,z,2] from 4D (i.e. the > 3rd "time" slice from 4D). The ExtractionRegion.Size = [4,4,4,0] and > ExtractionRegion.Index = [0,0,0,2]. > > Regards, > Chao > > 2016-05-04 13:27 GMT+02:00 Cyril Mory >: > > Hi Amjad, > > You can use an ITK extract filter to extract a region that > corresponds to one of your slices (along the axis you want). The > output of the extract filter will be 3D, so you will need to cast > it into a 2D images using an ITK cast filter. > > Cyril > > > On 05/04/2016 11:04 AM, AMJAD N wrote: >> Hi all, >> >> I have wrote code for saving output volume stack as *.tiff. >> Currently I am getting output of XY axis. What should I do in >> order to get the other axes. >> My code is shown below. >> >> typedef itk::StreamingImageFilter> FloatImageType> StreamerType; >> StreamerType::Pointer streamerBP = StreamerType::New(); >> streamerBP->SetInput(feldkampCUDA->GetOutput()); >> streamerBP->SetNumberOfStreamDivisions(8); >> >> typedef itk::Image< float, 2 > Image2DType; >> typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > >> WriterType; >> WriterType::Pointer writer = WriterType::New(); >> writer->SetInput(streamerBP->GetOutput()); >> >> typedef itk::NumericSeriesFileNames NameGeneratorType; >> NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); >> nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); >> nameGenerator->SetStartIndex(0); >> nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] >> is the Z-axis value of //reconstructed volume >> nameGenerator->SetIncrementIndex(1); >> writer->SetFileNames(nameGenerator->GetFileNames()); >> writer->SetUseCompression(true); >> writer->Update(); >> >> PS: My reconstruction works fine. >> >> Thanks and Regards >> >> AMJAD N >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From solomoncztang at gmail.com Thu May 5 19:45:43 2016 From: solomoncztang at gmail.com (Solomon Tang) Date: Thu, 5 May 2016 16:45:43 -0700 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Hi Simon, I added the line as you suggested and it does not change the output (still blank). Sorry for the delayed response. Thanks for looking into it! On Wed, May 4, 2016 at 12:16 AM, Simon Rit wrote: > Dear Solomon, > Thanks for the report. It looks like a bug to me. I checked and > itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in > the itkGPUImage and the itkCudaImage, this function does not check > consistency between CPU and GPU data. I'll work on a minimal example to > check this but can you test that your problem is solved if you add > m_DataManager->UpdateCPUBuffer(); > before > m_DataManager->SetGPUBufferDirty(); > in itkCudaImage.h line 121? > Thanks, > Simon > > On Mon, May 2, 2016 at 10:42 PM, Solomon Tang > wrote: > >> Thanks for the tip Simon, >> >> I think I may have figured it out. I initially read as a CUDA Image, and >> then passed the CUDA image through ChangeInformationImageFilter to change >> the offset of the image. >> >> template >> typename itk::CudaImage::Pointer ShiftOffset( >> const typename itk::CudaImage::Pointer image, >> const typename itk::Image::PointType origin) >> { >> typedef itk::ChangeInformationImageFilter< itk::CudaImage > >> FilterType; >> FilterType::Pointer filter = FilterType::New(); >> filter -> SetInput(image); >> filter -> SetOutputOrigin(origin); >> filter -> ChangeOriginOn(); >> filter -> UpdateOutputInformation(); >> filter -> Update(); >> return filter->GetOutput(); >> } >> >> If I pass the offset image pointer to ForwardProjection, it outputs a >> blank image. >> >> However, when I write the offset image and then read it again as a CUDA >> image, then the ForwardProjection works as intended. Perhaps using the CUDA >> version of ITK would fix this. >> >> >> On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < >> simon.rit at creatis.insa-lyon.fr> wrote: >> >>> Hi Solomon, >>> Hard to say without the full code. Maybe the cudaness of your output >>> image is lost further in the code. Try accessing the CPU buffer at the end, >>> after the update, to be sure that the GPU image is transferred to CPU, e.g. >>> std::cout << forwardProjection->GetOutput()->GetPointer() <>> Simon >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 10 01:29:44 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 10 May 2016 07:29:44 +0200 Subject: [Rtk-users] Cmake build error help In-Reply-To: References: Message-ID: <573171C8.80400@creatis.insa-lyon.fr> Hi, Can you update GetGitRevisionDescription.cmake and GetGitRevisionDescription.cmake.in from https://github.com/rpavlik/cmake-modules and see if the new versions fix this issue? Thanks, Simon PS: plead keep using the mailing list On 10/05/2016 03:09, Solomon Tang wrote: > Hi Simon, > > I am rebuilding RTK after moving to Visual Studio 2015 with cmake > 3.5.2 and am running into the following error: > > CMake Error at build/applications/CMakeFiles/git-data/grabRef.cmake:36 > (file): > file failed to open for reading (No such file or directory): > > C:/Work/Tools/Current/RTK-1.2.0/build/applications/CMakeFiles/git-data/head-ref > Call Stack (most recent call first): > cmake/GetGitRevisionDescription.cmake:77 (include) > applications/CMakeLists.txt:5 (get_git_head_revision) > > I am using ITK 4.9.0 and fresh download of RTK 1.2.0. > > How do I resolve this issue? > > Thanks again, > > Solomon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Thu May 12 00:12:17 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Thu, 12 May 2016 09:42:17 +0530 Subject: [Rtk-users] Reconstruction Volume. Message-ID: Hello users, I have successfully implemented CBCT reconstruction using both CUDA and CPU method. For finding the reconstruction volume size, I measured the actual object size. divided by respective axis number of pixels to get spacing. eg: If my object is 10x15x20 cm. I measure that dimensions. If the required volume is 500x600x700 px, to get spacing i used 10/500,15/600,20/700. But this is not practically possible for every object. Is there any way to find the reconstruction volume spacing other than doing the above method. I have SDD(Source Detector Distance), SID(Source Isocenter Distance), Detector physical size,pixel density. Thanks and Regards AMJAD N -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 12 01:31:51 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 12 May 2016 07:31:51 +0200 Subject: [Rtk-users] Reconstruction Volume. In-Reply-To: References: Message-ID: Hi, The typical solution (e.g., in clincial scanners) is to reconstruct the field-of-view of the scanner (every point in space that is seen by all source positions) because you know this is the only area of space where your reconstruction is going to be accurate. rtkfieldofview generates this FOV. Simon On Thu, May 12, 2016 at 6:12 AM, AMJAD N wrote: > Hello users, > > I have successfully implemented CBCT reconstruction using both CUDA and > CPU method. For finding the reconstruction volume size, I measured the > actual object size. divided by respective axis number of pixels to get > spacing. > > eg: If my object is 10x15x20 cm. I measure that dimensions. If the > required volume is 500x600x700 px, to get spacing i used > 10/500,15/600,20/700. > > But this is not practically possible for every object. Is there any way to > find the reconstruction volume spacing other than doing the above method. > > I have SDD(Source Detector Distance), SID(Source Isocenter Distance), > Detector physical size,pixel density. > > Thanks and Regards > > AMJAD N > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Fri May 13 04:30:33 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Fri, 13 May 2016 14:00:33 +0530 Subject: [Rtk-users] Object isocenter shift Message-ID: Hello users, During acquisition it is found that my object isocenter is shifted from turntable isocenter by DX and DY values. Source , turntable isocenter and detector center is aligned perfectly. Is there any method in RTK we can make use of to nullify the effect due to this isocenter shift? Thanks and Regards AMJAD -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 13 08:36:48 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 13 May 2016 14:36:48 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: Hi, I don't understand the question. The isocenter is by definition the center of rotation in RTK and we assume it's at the origin of the reconstructed volume. There is no such thing as an "object isocenter". DX and DY values are the shift of the projection origin (which can be anywhere) with respect to the central ray (source to isocenter ray). It is not the turntable isocenter. If you want to have dx=0 and dy=0, the projection origin must be changed. But it has to be constant for the whole projection stack. I hope it helps, Simon On Fri, May 13, 2016 at 10:30 AM, AMJAD N wrote: > Hello users, > During acquisition it is found that my object isocenter is shifted from > turntable isocenter by DX and DY values. Source , turntable isocenter and > detector center is aligned perfectly. Is there any method in RTK we can > make use of to nullify the effect due to this isocenter shift? > > Thanks and Regards > AMJAD > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Fri May 13 11:35:57 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Fri, 13 May 2016 17:35:57 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Message-ID: <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 13 12:15:09 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 13 May 2016 18:15:09 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Message-ID: Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein wrote: > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Sat May 14 05:48:01 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Sat, 14 May 2016 11:48:01 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Message-ID: <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Hello Simon, Thanks for your advice so far. I?m getting to know this filter better. At least I can now use it and save the result into a file. I updated my code which now uses a volume. The values of the input and output volume are equal except of the z-dimension of the output which I changed to the number of projection images. const unsigned int Dimension = 3; ?Reading image? ImageType::Pointer inputImage = reader->GetOutput(); ImageType::Pointer outputImage = ImageType::New(); RegionType inputRegion = inputImage->GetLargestPossibleRegion(); const unsigned int NumberOfProjectionImages = 45; ImageType::IndexType start; start[0] = inputRegion.GetIndex()[0]; start[1] = inputRegion.GetIndex()[1]; start[2] = inputRegion.GetIndex()[2]; RegionType::SizeType size; size[0] = inputRegion.GetSize()[0]; size[1] = inputRegion.GetSize()[1]; size[2] = NumberOfProjectionImages; RegionType region; region.SetSize(size); region.SetIndex(start); ImageType::SpacingType spacing; spacing[0] = inputImage->GetSpacing()[0]; spacing[1] = inputImage->GetSpacing()[1]; spacing[2] = inputImage->GetSpacing()[2]; ImageType::PointType origin; origin[0] = inputImage->GetOrigin()[0]; origin[1] = inputImage->GetOrigin()[1]; origin[2] = inputImage->GetOrigin()[2]; outputImage->SetRegions(region); outputImage->SetSpacing(spacing); outputImage->SetOrigin(origin); outputImage->Allocate(); outputImage->FillBuffer(size[0] * size[1] * size[2]); // Geometry typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(510., 510., i*8.); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->SetGeometry(geometry); forward->Update(); I?m not sure how I have to add projection for the geometry to get a result which I?m familiar with. Can you describe how do I have to interpret the result of the Joseph-Filter? I am familiar with sinograms and how they are computed, but one sinogram is created by the projections of one image slice as far as I understood it. What I want is to manipulate the image in the radon space and then perform a filtered back projection. Typically the articles describe techniques to reduce metal artifacts by using one 2D Slice. Is it possible to achieve something like that with the JosephFilter? I?m guessing since this filter won?t work well for 2D I have to use another filter. Can you give me a hint if I can do something like that with RTK or another ITK-based framework? Here a diagram which shows an example what I want to try. I tried also to use my code with one slice and added a zero padding like that: typedef itk::ConstantPadImageFilter ConstantPadImageFilterType; ConstantPadImageFilterType::Pointer padFilter = ConstantPadImageFilterType::New(); padFilter->SetInput(inputImage); ImageType::SizeType extendRegion; extendRegion[0] = 0; extendRegion[1] = 0; extendRegion[2] = 0; padFilter->SetPadLowerBound(extendRegion); padFilter->SetPadUpperBound(extendRegion); padFilter->SetConstant(1); padFilter->Update(); But the result of my png is a black square. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Freitag, 13. Mai 2016 18:15 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto: simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein < tstein at stud.hs-heilbronn.de> Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Sat May 14 06:17:18 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sat, 14 May 2016 12:17:18 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Message-ID: The output of the Joseph filter (of any forward projector) is a stack of projection images, i.e., a 3D image. If you slice this 3D image in the z direction, you get one projection images. If you slice this 3D image in the y direction, you get a sinogram, e.g., the 2D sinogram of the central slice (plane of the source trajectory) if y=0. The best way to have this sinogram is to set size[1]=1 and there is no better way to do it in RTK. For zero-padding, you need to set extendRegion[?]=1, with (for all dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that your image is a black square, something else must be going on. One thing to remember, the typical RTK rotation is around the y axis so your 3D slice must be 1 in the y direction. A simple way to change the orientation of one slice is to change its direction with ChangeImageFilter Simon On Sat, May 14, 2016 at 11:48 AM, Tobias Stein wrote: > Hello Simon, > > > > Thanks for your advice so far. I?m getting to know this filter better. At > least I can now use it and save the result into a file. > > > > I updated my code which now uses a volume. > > The values of the input and output volume are equal except of the > z-dimension of the output which I changed to the number of projection > images. > > const unsigned int Dimension = 3; > > ?Reading image? > > ImageType::Pointer inputImage = reader->GetOutput(); > > ImageType::Pointer outputImage = ImageType::New(); > > > > RegionType inputRegion = inputImage->GetLargestPossibleRegion(); > > > > const unsigned int NumberOfProjectionImages = 45; > > > > ImageType::IndexType start; > > start[0] = inputRegion.GetIndex()[0]; > > start[1] = inputRegion.GetIndex()[1]; > > start[2] = inputRegion.GetIndex()[2]; > > > > RegionType::SizeType size; > > size[0] = inputRegion.GetSize()[0]; > > size[1] = inputRegion.GetSize()[1]; > > size[2] = NumberOfProjectionImages; > > > > RegionType region; > > region.SetSize(size); > > region.SetIndex(start); > > > > ImageType::SpacingType spacing; > > spacing[0] = inputImage->GetSpacing()[0]; > > spacing[1] = inputImage->GetSpacing()[1]; > > spacing[2] = inputImage->GetSpacing()[2]; > > > > ImageType::PointType origin; > > origin[0] = inputImage->GetOrigin()[0]; > > origin[1] = inputImage->GetOrigin()[1]; > > origin[2] = inputImage->GetOrigin()[2]; > > > > outputImage->SetRegions(region); > > outputImage->SetSpacing(spacing); > > outputImage->SetOrigin(origin); > > outputImage->Allocate(); > > outputImage->FillBuffer(size[0] * size[1] * size[2]); > > > > // Geometry > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(510., 510., i*8.); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->SetGeometry(geometry); > > forward->Update(); > > > > I?m not sure how I have to add projection for the geometry to get a result > which I?m familiar with. > > > > Can you describe how do I have to interpret the result of the > Joseph-Filter? I am familiar with sinograms and how they are computed, but > one sinogram is created by the projections of one image slice as far as I > understood it. What I want is to manipulate the image in the radon space > and then perform a filtered back projection. Typically the articles > describe techniques to reduce metal artifacts by using one 2D Slice. Is it > possible to achieve something like that with the JosephFilter? I?m guessing > since this filter won?t work well for 2D I have to use another filter. Can > you give me a hint if I can do something like that with RTK or another > ITK-based framework? Here a diagram > which shows an example what I want to try. > > > > I tried also to use my code with one slice and added a zero padding like > that: > > typedef itk::ConstantPadImageFilter > ConstantPadImageFilterType; > > ConstantPadImageFilterType::Pointer padFilter = > ConstantPadImageFilterType::New(); > > padFilter->SetInput(inputImage); > > > > ImageType::SizeType extendRegion; > > extendRegion[0] = 0; > > extendRegion[1] = 0; > > extendRegion[2] = 0; > > > > padFilter->SetPadLowerBound(extendRegion); > > padFilter->SetPadUpperBound(extendRegion); > > padFilter->SetConstant(1); > > padFilter->Update(); > > But the result of my png is a black square. > > Tobias > > > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Freitag, 13. Mai 2016 18:15 > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > If you intialize the data of your itk::Image with FillBuffer with the > corresponding constant value, it is quite similar. The constant image value > allow us to stream the computation whereas you have to allocate the whole > image if you pass directly itk::Image. > > We only work in 3D and probably our projector don't work with 2D, that is > probably the problem here. You would have to correct the code for 2D but > that's a lot of work, we generally prefer pseudo 2D, see next point. > > I doubt that our forward projector will work well with one slice only if > you use 3D, we assume that the volume starts at the first pixel and ends at > the last pixel. You should probably add a zero border around with > itk::PadImage to see something. > > To avoid aliasing, you can cut frequencies in the ramp filter (look for > CutFrequency in the doxygen of rtk::FFTRampImageFilter). > > Simon > > > > On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: > > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Sat May 14 06:18:57 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sat, 14 May 2016 12:18:57 +0200 Subject: [Rtk-users] RTK training - June 17 2016 Message-ID: Dear all, The training on June 17 in Lyon is confirmed. Please register asap if you'd like to attend. Looking forward to meeting our users, Simon On Thu, Mar 10, 2016 at 11:02 AM, Simon Rit wrote: > Dear all, > The new date for the RTK training is Friday June 17. > I'm looking forward to meeting you there, > Simon > > On Sun, Mar 6, 2016 at 12:57 PM, Simon Rit > wrote: > >> Dear all, >> We have to fix another date for the RTK training due to a conflicting >> meeting. If you are interested, please fill in the foodle >> so that >> we fix a date that suits everyone. If none of these dates works for you, >> please let me know and we'll try to extend the foodle. >> Please answer before Tuesday, we'll fix the date on Tuesday evening. >> Thanks for your cooperation and apologies for the mess, >> Simon >> >> On Tue, Feb 9, 2016 at 11:49 AM, Simon Rit < >> simon.rit at creatis.insa-lyon.fr> wrote: >> >>> Dear RTK users, >>> We will organize a new training >>> session on June 22 2016 in >>> Lyon. Follow the instructions on the webpage >>> to register. The training is >>> for both users and developers. We are happy to answer any question that you >>> might have and we are looking forward to this new training session. >>> Simon >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Sun May 15 08:38:40 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Sun, 15 May 2016 14:38:40 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Message-ID: <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> If I understood you correct, the input of the Joseph-Filter needs to be oriented in the y-direction when I am dealing with axial oriented slices. Now I changed the direction of the 3D Slice by rotating it 90 degrees around the x-axis with the itk::ChangeInformationImageFilter to have my slice in the xz-layer in the y-direction: double rotationX = 90; itk::Versor< double > rotation; const double angleInRadians = rotationX * vnl_math::pi / 180.0; rotation.SetRotationAroundX(angleInRadians); const ImageType::DirectionType direction = inputImage->GetDirection(); const ImageType::DirectionType newDirection = direction * rotation.GetMatrix(); changeFilter->SetOutputDirection(newDirection); changeFilter->ChangeAll(); changeFilter->SetInput(inputImage); changeFilter->UpdateOutputInformation(); Then I added a zero-border as you told me (This changed the size of my region from [512, 512, 1] to [514, 514, 3]). While executing the Joseph Filter I got an error because a vector subscript was out of range. Maybe that?s because the index of the region is [-1,-1,-1] caused by the padding. I tried the padding after the Joseph Filter, and got a result which has a size [514, 3, 45], while 45 was the number of projection images but the image was still empty. I also tried the Jospeh Filter with a real 3D volume stack of slices, rotated it as described below and got a result. Now I am confused how I should create the geometry of the Joseph Filter to get a good result. typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(300., 500., i * 180 / NumberOfProjectionImages); I am trying to use a 180-degree rotation, but i don?t have the feeling for the distance values. I this code example I used an 3D Image with dimensions = [256, 256, 49] My idea was, since there is no way to get a result with a single 3D slice, I would use a stack of slices as input and slice the output volume in y-direction to get my sinogram as you said. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Samstag, 14. Mai 2016 12:17 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK The output of the Joseph filter (of any forward projector) is a stack of projection images, i.e., a 3D image. If you slice this 3D image in the z direction, you get one projection images. If you slice this 3D image in the y direction, you get a sinogram, e.g., the 2D sinogram of the central slice (plane of the source trajectory) if y=0. The best way to have this sinogram is to set size[1]=1 and there is no better way to do it in RTK. For zero-padding, you need to set extendRegion[?]=1, with (for all dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that your image is a black square, something else must be going on. One thing to remember, the typical RTK rotation is around the y axis so your 3D slice must be 1 in the y direction. A simple way to change the orientation of one slice is to change its direction with ChangeImageFilter Simon On Sat, May 14, 2016 at 11:48 AM, Tobias Stein > wrote: Hello Simon, Thanks for your advice so far. I?m getting to know this filter better. At least I can now use it and save the result into a file. I updated my code which now uses a volume. The values of the input and output volume are equal except of the z-dimension of the output which I changed to the number of projection images. const unsigned int Dimension = 3; ?Reading image? ImageType::Pointer inputImage = reader->GetOutput(); ImageType::Pointer outputImage = ImageType::New(); RegionType inputRegion = inputImage->GetLargestPossibleRegion(); const unsigned int NumberOfProjectionImages = 45; ImageType::IndexType start; start[0] = inputRegion.GetIndex()[0]; start[1] = inputRegion.GetIndex()[1]; start[2] = inputRegion.GetIndex()[2]; RegionType::SizeType size; size[0] = inputRegion.GetSize()[0]; size[1] = inputRegion.GetSize()[1]; size[2] = NumberOfProjectionImages; RegionType region; region.SetSize(size); region.SetIndex(start); ImageType::SpacingType spacing; spacing[0] = inputImage->GetSpacing()[0]; spacing[1] = inputImage->GetSpacing()[1]; spacing[2] = inputImage->GetSpacing()[2]; ImageType::PointType origin; origin[0] = inputImage->GetOrigin()[0]; origin[1] = inputImage->GetOrigin()[1]; origin[2] = inputImage->GetOrigin()[2]; outputImage->SetRegions(region); outputImage->SetSpacing(spacing); outputImage->SetOrigin(origin); outputImage->Allocate(); outputImage->FillBuffer(size[0] * size[1] * size[2]); // Geometry typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(510., 510., i*8.); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->SetGeometry(geometry); forward->Update(); I?m not sure how I have to add projection for the geometry to get a result which I?m familiar with. Can you describe how do I have to interpret the result of the Joseph-Filter? I am familiar with sinograms and how they are computed, but one sinogram is created by the projections of one image slice as far as I understood it. What I want is to manipulate the image in the radon space and then perform a filtered back projection. Typically the articles describe techniques to reduce metal artifacts by using one 2D Slice. Is it possible to achieve something like that with the JosephFilter? I?m guessing since this filter won?t work well for 2D I have to use another filter. Can you give me a hint if I can do something like that with RTK or another ITK-based framework? Here a diagram which shows an example what I want to try. I tried also to use my code with one slice and added a zero padding like that: typedef itk::ConstantPadImageFilter ConstantPadImageFilterType; ConstantPadImageFilterType::Pointer padFilter = ConstantPadImageFilterType::New(); padFilter->SetInput(inputImage); ImageType::SizeType extendRegion; extendRegion[0] = 0; extendRegion[1] = 0; extendRegion[2] = 0; padFilter->SetPadLowerBound(extendRegion); padFilter->SetPadUpperBound(extendRegion); padFilter->SetConstant(1); padFilter->Update(); But the result of my png is a black square. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com ] Im Auftrag von Simon Rit Gesendet: Freitag, 13. Mai 2016 18:15 An: Tobias Stein > Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto: simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein < tstein at stud.hs-heilbronn.de> Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 16 05:50:41 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 16 May 2016 11:50:41 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> Message-ID: Answers below. I think you need to understand better the coordinate system of an ITK image, maybe check ITK's doc. Simon On Sun, May 15, 2016 at 2:38 PM, Tobias Stein wrote: > If I understood you correct, the input of the Joseph-Filter needs to be > oriented in the y-direction when I am dealing with axial oriented slices. > Yes, or in other words, if you want to take projections around the axial axis, be aware that y is the default axis of rotation in RTK. > Now I changed the direction of the 3D Slice by rotating it 90 degrees > around the x-axis with the itk::ChangeInformationImageFilter to have my > slice in the xz-layer in the y-direction: > > double rotationX = 90; > > itk::Versor< double > rotation; > > const double angleInRadians = rotationX * vnl_math::pi / 180.0; > > rotation.SetRotationAroundX(angleInRadians); > > const ImageType::DirectionType direction = > inputImage->GetDirection(); > > const ImageType::DirectionType newDirection = direction * > rotation.GetMatrix(); > > changeFilter->SetOutputDirection(newDirection); > > changeFilter->ChangeAll(); > > changeFilter->SetInput(inputImage); > > changeFilter->UpdateOutputInformation(); > > > > Then I added a zero-border as you told me (This changed the size of my > region from [512, 512, 1] to [514, 514, 3]). > > While executing the Joseph Filter I got an error because a vector > subscript was out of range. Maybe that?s because the index of the region is > [-1,-1,-1] caused by the padding. > That should not have been a problem but that might be a bug... > I tried the padding after the Joseph Filter, and got a result which has a > size [514, 3, 45], while 45 was the number of projection images but the > image was still empty. > I guess you should check the origin of your projected volume and your projections. A simple test is to center your volume (check using ITK doc how you can define the origin so that (0,0,0) is at the center) and your projection (for the projection stack, only the first 2 coordinates count). > > > I also tried the Jospeh Filter with a real 3D volume stack of slices, > rotated it as described below and got a result. > > Now I am confused how I should create the geometry of the Joseph Filter to > get a good result. > > > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(300., 500., i * 180 / > NumberOfProjectionImages); > > > > I am trying to use a 180-degree rotation, but i don?t have the feeling for > the distance values. > > I this code example I used an 3D Image with dimensions = [256, 256, 49] > This doesn't tell you anything about the size of your volume, we also need the origin and the spacing. Look at the ITK doc to understand the ITK coordinate systems. > > > My idea was, since there is no way to get a result with a single 3D slice, > I would use a stack of slices as input and slice the output volume in > y-direction to get my sinogram as you said. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Samstag, 14. Mai 2016 12:17 > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > The output of the Joseph filter (of any forward projector) is a stack of > projection images, i.e., a 3D image. If you slice this 3D image in the z > direction, you get one projection images. If you slice this 3D image in the > y direction, you get a sinogram, e.g., the 2D sinogram of the central slice > (plane of the source trajectory) if y=0. The best way to have this sinogram > is to set size[1]=1 and there is no better way to do it in RTK. > > For zero-padding, you need to set extendRegion[?]=1, with (for all > dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that > your image is a black square, something else must be going on. One thing to > remember, the typical RTK rotation is around the y axis so your 3D slice > must be 1 in the y direction. A simple way to change the orientation of one > slice is to change its direction with ChangeImageFilter > > Simon > > > > > > On Sat, May 14, 2016 at 11:48 AM, Tobias Stein < > tstein at stud.hs-heilbronn.de> wrote: > > Hello Simon, > > > > Thanks for your advice so far. I?m getting to know this filter better. At > least I can now use it and save the result into a file. > > > > I updated my code which now uses a volume. > > The values of the input and output volume are equal except of the > z-dimension of the output which I changed to the number of projection > images. > > const unsigned int Dimension = 3; > > ?Reading image? > > ImageType::Pointer inputImage = reader->GetOutput(); > > ImageType::Pointer outputImage = ImageType::New(); > > > > RegionType inputRegion = inputImage->GetLargestPossibleRegion(); > > > > const unsigned int NumberOfProjectionImages = 45; > > > > ImageType::IndexType start; > > start[0] = inputRegion.GetIndex()[0]; > > start[1] = inputRegion.GetIndex()[1]; > > start[2] = inputRegion.GetIndex()[2]; > > > > RegionType::SizeType size; > > size[0] = inputRegion.GetSize()[0]; > > size[1] = inputRegion.GetSize()[1]; > > size[2] = NumberOfProjectionImages; > > > > RegionType region; > > region.SetSize(size); > > region.SetIndex(start); > > > > ImageType::SpacingType spacing; > > spacing[0] = inputImage->GetSpacing()[0]; > > spacing[1] = inputImage->GetSpacing()[1]; > > spacing[2] = inputImage->GetSpacing()[2]; > > > > ImageType::PointType origin; > > origin[0] = inputImage->GetOrigin()[0]; > > origin[1] = inputImage->GetOrigin()[1]; > > origin[2] = inputImage->GetOrigin()[2]; > > > > outputImage->SetRegions(region); > > outputImage->SetSpacing(spacing); > > outputImage->SetOrigin(origin); > > outputImage->Allocate(); > > outputImage->FillBuffer(size[0] * size[1] * size[2]); > > > > // Geometry > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(510., 510., i*8.); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->SetGeometry(geometry); > > forward->Update(); > > > > I?m not sure how I have to add projection for the geometry to get a result > which I?m familiar with. > > > > Can you describe how do I have to interpret the result of the > Joseph-Filter? I am familiar with sinograms and how they are computed, but > one sinogram is created by the projections of one image slice as far as I > understood it. What I want is to manipulate the image in the radon space > and then perform a filtered back projection. Typically the articles > describe techniques to reduce metal artifacts by using one 2D Slice. Is it > possible to achieve something like that with the JosephFilter? I?m guessing > since this filter won?t work well for 2D I have to use another filter. Can > you give me a hint if I can do something like that with RTK or another > ITK-based framework? Here a diagram > which shows an example what I want to try. > > > > I tried also to use my code with one slice and added a zero padding like > that: > > typedef itk::ConstantPadImageFilter > ConstantPadImageFilterType; > > ConstantPadImageFilterType::Pointer padFilter = > ConstantPadImageFilterType::New(); > > padFilter->SetInput(inputImage); > > > > ImageType::SizeType extendRegion; > > extendRegion[0] = 0; > > extendRegion[1] = 0; > > extendRegion[2] = 0; > > > > padFilter->SetPadLowerBound(extendRegion); > > padFilter->SetPadUpperBound(extendRegion); > > padFilter->SetConstant(1); > > padFilter->Update(); > > But the result of my png is a black square. > > Tobias > > > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Freitag, 13. Mai 2016 18:15 > > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > If you intialize the data of your itk::Image with FillBuffer with the > corresponding constant value, it is quite similar. The constant image value > allow us to stream the computation whereas you have to allocate the whole > image if you pass directly itk::Image. > > We only work in 3D and probably our projector don't work with 2D, that is > probably the problem here. You would have to correct the code for 2D but > that's a lot of work, we generally prefer pseudo 2D, see next point. > > I doubt that our forward projector will work well with one slice only if > you use 3D, we assume that the volume starts at the first pixel and ends at > the last pixel. You should probably add a zero border around with > itk::PadImage to see something. > > To avoid aliasing, you can cut frequencies in the ramp filter (look for > CutFrequency in the doxygen of rtk::FFTRampImageFilter). > > Simon > > > > On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: > > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Tue May 17 07:07:20 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Tue, 17 May 2016 16:37:20 +0530 Subject: [Rtk-users] Object isocenter shift Message-ID: Hello, As my previous thread caused some confusion, I am attaching an image showing the same in detail. As you can see my object center is not aligned with isocenter line. Besides it is offset by DX and DY values. In my case you can see the object center as red dot. Is there any method in RTK to nullify this offset effect? Will the rotation of turntable affect the reconstruction due to this offset? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: objectoffset.png Type: image/png Size: 12365 bytes Desc: not available URL: From cyril.mory at uclouvain.be Tue May 17 08:19:38 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Tue, 17 May 2016 14:19:38 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: <573B0C5A.4030001@uclouvain.be> Well, if it's just that, you should not worry about it : you cannot perfectly center your object, even if you try. And most objects (e.g. patients) do not even have a "center". So it does not make sense to struggle to have the center of the object perfectly match the isocenter of the acquisition device. You can either live with that (it is perfectly fine for most applications), or try one of these things: - If you can re-do the acquisition, you should try to have your object's center _roughly_ match the system's isocenter, because that's where you will have the least artifacts - Reconstruct your object as it is (it will work fine, unless there are other problems), but select the origin and size of your reconstructed volume carefully to have your object's center roughly at the center of your reconstructed volume. If you are not familiar with the exact definition of "origin", "spacing" and "size" of an itk::image, read section 4.1.4 of the ITK software guide (https://itk.org/ItkSoftwareGuide.pdf). This is both clear, short, and something extremely important to understand. I hope it helps, Cyril On 05/17/2016 01:07 PM, AMJAD N wrote: > Hello, > > As my previous thread caused some confusion, I am attaching an image > showing the same in detail. > > As you can see my object center is not aligned with isocenter line. > Besides it is offset by DX and DY values. In my case you can see the > object center as red dot. > > Is there any method in RTK to nullify this offset effect? > Will the rotation of turntable affect the reconstruction due to this > offset? > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From wuchao04 at gmail.com Tue May 17 09:24:58 2016 From: wuchao04 at gmail.com (Chao Wu) Date: Tue, 17 May 2016 15:24:58 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: There's nothing to correct or compensate for DURING reconstruction in your case. Where you put your object dose not change the geometry of the CT system at all. As long as the object is still inside FOV, a normal reconstruction will give you a correct result. In the resulting image, the origin is at the center of rotation, and the object is off-center by DX and DY, that's it. If you want the origin to be at the center of the object, you can shift it by DX/DY AFTER reconstruction. Regards, Chao 2016-05-17 13:07 GMT+02:00 AMJAD N : > Hello, > > As my previous thread caused some confusion, I am attaching an image > showing the same in detail. > > As you can see my object center is not aligned with isocenter line. > Besides it is offset by DX and DY values. In my case you can see the object > center as red dot. > > Is there any method in RTK to nullify this offset effect? > Will the rotation of turntable affect the reconstruction due to this > offset? > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shiraska at gmail.com Thu May 19 04:41:54 2016 From: shiraska at gmail.com (Shiras Abdurahman) Date: Thu, 19 May 2016 10:41:54 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction Message-ID: Dear all, I am trying to simulate Tomosynthesis reconstruction with stationary flat panel detector where source rotates around Y axis to acquire 21 projections (system geometry diagram is attached). Geometry file geometry.xml is generated with Reg23ProjectionGeometry. I generated projection images of a cube volume and then I tried to reconstruct with FDK algorithm. Even though I am able to generate projections, FDK reconstruction yields the volume with all voxel values zero. The commands I used for generating projections and reconstructing volume are rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 --dimension=256,256,256 --hardware=cuda I am also attaching geometry xml file, mhd header files of the original volume, projections and reconstructed volume. With regards, Shiras -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: geometry.xml Type: text/xml Size: 11889 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fdk.mhd Type: application/octet-stream Size: 322 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: projections.mhd Type: application/octet-stream Size: 335 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: volume.mhd Type: application/octet-stream Size: 355 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: system_geometry.PNG Type: image/png Size: 50006 bytes Desc: not available URL: From cyril.mory at uclouvain.be Fri May 20 04:38:22 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Fri, 20 May 2016 10:38:22 +0200 Subject: [Rtk-users] Compiler RTK In-Reply-To: <573E430F.5030704@uclouvain.be> References: <573E430F.5030704@uclouvain.be> Message-ID: <573ECCFE.3070500@uclouvain.be> Hi Kevin, I'm replying to the RTK users mailing list. Next time, please send your questions to this list instead of just me (except when it specifically involves reggui, for example). I have tried to reproduce the error but the compilation runs fine on my machine. Can you send information on your compiler ? Maybe someone else on the list can help ? Cyril On 05/20/2016 12:49 AM, Kevin Souris wrote: > Bonjour, > > Je viens de t?l?charger la derni?re version de RTK sur Github. > J'essaye maintenant de compiler sur une machine linux et j'obtiens > cette erreur: > > /home/pen/RTK/RTK-master/applications/rtkprojections/rtkprojections.cxx: > In function ?int main(int, char**)?: > /home/pen/RTK/RTK-master/applications/rtkprojections*/**rtkprojections.cxx:27: > error: invalid conversion from ?const char*? to ?char*?* > /home/pen/RTK/RTK-master/applications/rtkprojections/rtkprojections.cxx:27: > error: initializing argument 1 of ?int > cmdline_parser_rtkprojections_config_file(char*, > args_info_rtkprojections*, cmdline_parser_rtkprojections_params*)? > > Comment puis-je r?parer ?a ? > Merci > > Kevin > > > > > -- > Kevin Souris, PhD student > Universit? catholique de Louvain > Molecular Imagery, Radiotherapy and Oncology (MIRO) -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 25 15:45:57 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 25 May 2016 21:45:57 +0200 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Hi Solomon, I had still to look into this on my todo list. I did again but now I think I overlooked something in your email. You say that going through ChangeInformationImageFilter might be the problem. But now, I wonder if the problem is not that the origin that you set is wrong and then the volume or the projections are completely off (hence the projections). So, here is my question : what happens if you replace filter -> SetOutputOrigin(origin); with filter -> SetOutputOrigin(image->GetOutputOrigin()); Of course, it's not what you want to do but it might point to a wrong choice of origin... Simon On Fri, May 6, 2016 at 1:45 AM, Solomon Tang wrote: > Hi Simon, > > I added the line as you suggested and it does not change the output (still > blank). Sorry for the delayed response. > > Thanks for looking into it! > > On Wed, May 4, 2016 at 12:16 AM, Simon Rit > wrote: > >> Dear Solomon, >> Thanks for the report. It looks like a bug to me. I checked and >> itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in >> the itkGPUImage and the itkCudaImage, this function does not check >> consistency between CPU and GPU data. I'll work on a minimal example to >> check this but can you test that your problem is solved if you add >> m_DataManager->UpdateCPUBuffer(); >> before >> m_DataManager->SetGPUBufferDirty(); >> in itkCudaImage.h line 121? >> Thanks, >> Simon >> >> On Mon, May 2, 2016 at 10:42 PM, Solomon Tang >> wrote: >> >>> Thanks for the tip Simon, >>> >>> I think I may have figured it out. I initially read as a CUDA Image, and >>> then passed the CUDA image through ChangeInformationImageFilter to change >>> the offset of the image. >>> >>> template >>> typename itk::CudaImage::Pointer ShiftOffset( >>> const typename itk::CudaImage::Pointer image, >>> const typename itk::Image::PointType origin) >>> { >>> typedef itk::ChangeInformationImageFilter< itk::CudaImage > >>> FilterType; >>> FilterType::Pointer filter = FilterType::New(); >>> filter -> SetInput(image); >>> filter -> SetOutputOrigin(origin); >>> filter -> ChangeOriginOn(); >>> filter -> UpdateOutputInformation(); >>> filter -> Update(); >>> return filter->GetOutput(); >>> } >>> >>> If I pass the offset image pointer to ForwardProjection, it outputs a >>> blank image. >>> >>> However, when I write the offset image and then read it again as a CUDA >>> image, then the ForwardProjection works as intended. Perhaps using the CUDA >>> version of ITK would fix this. >>> >>> >>> On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < >>> simon.rit at creatis.insa-lyon.fr> wrote: >>> >>>> Hi Solomon, >>>> Hard to say without the full code. Maybe the cudaness of your output >>>> image is lost further in the code. Try accessing the CPU buffer at the end, >>>> after the update, to be sure that the GPU image is transferred to CPU, e.g. >>>> std::cout << forwardProjection->GetOutput()->GetPointer() <>>> Simon >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 26 12:04:47 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 26 May 2016 18:04:47 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Hi Shiras, I generated a volume to look at your problem: rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 --offset 0,0,1.7 Then I obtained the same issue as you. I think the problem is that rtkfdk is meant for circular CBCT and it includes pre-weighting for displaced detector and short scan. I'm not sure why you don't get a warning but these are probably responsible for the blank output. A simple solution is to do only the 3 FDK steps using in order the command tools: rtktwodweights rtkramp rtkbackprojections You can also try to shunt the preweighting by modifying rtkfdk.cxx. It's interesting that you try out tomosynthesis but you'll encounter some problem. When I ran the above commands, I get very weird results because the first and the last projections get a lot more weight than the others since it looks at the angular weight with the previous and the next projections. A simple solution is to blank out these two projections. Good luck and keep us posted if you get interesting results, Simon On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman wrote: > Dear all, > > I am trying to simulate Tomosynthesis reconstruction with stationary flat > panel detector where source rotates around Y axis to acquire 21 projections > (system geometry diagram is attached). Geometry file geometry.xml is > generated with Reg23ProjectionGeometry. I generated projection images of > a cube volume and then I tried to reconstruct with FDK algorithm. Even > though I am able to generate projections, FDK reconstruction yields the > volume with all voxel values zero. The commands I used for generating > projections and reconstructing volume are > > rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd > --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast > rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml > --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 > --dimension=256,256,256 --hardware=cuda > > I am also attaching geometry xml file, mhd header files of the original > volume, projections and reconstructed volume. > > With regards, > Shiras > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shiraska at gmail.com Fri May 27 11:31:52 2016 From: shiraska at gmail.com (Shiras Abdurahman) Date: Fri, 27 May 2016 17:31:52 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Dear Simon, Thank you very much for the reply. I tried to reconstruct with only ramp filtering and back projection and the results are looking good without any weighting of the projections. I also reconstructed the volume with rtksart with 10 iterations and the results are better than rtkfdk. With these experiments, I also confirmed that my geometry file is accurate. Thank you very much for your help. With regards, Shiras On Thu, May 26, 2016 at 6:04 PM, Simon Rit wrote: > Hi Shiras, > I generated a volume to look at your problem: > rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 > --offset 0,0,1.7 > Then I obtained the same issue as you. I think the problem is that rtkfdk > is meant for circular CBCT and it includes pre-weighting for displaced > detector and short scan. I'm not sure why you don't get a warning but these > are probably responsible for the blank output. A simple solution is to do > only the 3 FDK steps using in order the command tools: > rtktwodweights > rtkramp > rtkbackprojections > You can also try to shunt the preweighting by modifying rtkfdk.cxx. > > It's interesting that you try out tomosynthesis but you'll encounter some > problem. When I ran the above commands, I get very weird results because > the first and the last projections get a lot more weight than the others > since it looks at the angular weight with the previous and the next > projections. A simple solution is to blank out these two projections. > Good luck and keep us posted if you get interesting results, > Simon > > On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman > wrote: > >> Dear all, >> >> I am trying to simulate Tomosynthesis reconstruction with stationary flat >> panel detector where source rotates around Y axis to acquire 21 projections >> (system geometry diagram is attached). Geometry file geometry.xml is >> generated with Reg23ProjectionGeometry. I generated projection images of >> a cube volume and then I tried to reconstruct with FDK algorithm. Even >> though I am able to generate projections, FDK reconstruction yields the >> volume with all voxel values zero. The commands I used for generating >> projections and reconstructing volume are >> >> rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd >> --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast >> rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml >> --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 >> --dimension=256,256,256 --hardware=cuda >> >> I am also attaching geometry xml file, mhd header files of the original >> volume, projections and reconstructed volume. >> >> With regards, >> Shiras >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 27 12:00:56 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 27 May 2016 18:00:56 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Indeed, the angular weighting resulting from the discretization of the back projection occurs in rtkfdktwodweights so skipping this might help. Simon On 27 May 2016 5:32 p.m., "Shiras Abdurahman" wrote: Dear Simon, Thank you very much for the reply. I tried to reconstruct with only ramp filtering and back projection and the results are looking good without any weighting of the projections. I also reconstructed the volume with rtksart with 10 iterations and the results are better than rtkfdk. With these experiments, I also confirmed that my geometry file is accurate. Thank you very much for your help. With regards, Shiras On Thu, May 26, 2016 at 6:04 PM, Simon Rit wrote: > Hi Shiras, > I generated a volume to look at your problem: > rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 > --offset 0,0,1.7 > Then I obtained the same issue as you. I think the problem is that rtkfdk > is meant for circular CBCT and it includes pre-weighting for displaced > detector and short scan. I'm not sure why you don't get a warning but these > are probably responsible for the blank output. A simple solution is to do > only the 3 FDK steps using in order the command tools: > rtktwodweights > rtkramp > rtkbackprojections > You can also try to shunt the preweighting by modifying rtkfdk.cxx. > > It's interesting that you try out tomosynthesis but you'll encounter some > problem. When I ran the above commands, I get very weird results because > the first and the last projections get a lot more weight than the others > since it looks at the angular weight with the previous and the next > projections. A simple solution is to blank out these two projections. > Good luck and keep us posted if you get interesting results, > Simon > > On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman > wrote: > >> Dear all, >> >> I am trying to simulate Tomosynthesis reconstruction with stationary flat >> panel detector where source rotates around Y axis to acquire 21 projections >> (system geometry diagram is attached). Geometry file geometry.xml is >> generated with Reg23ProjectionGeometry. I generated projection images of >> a cube volume and then I tried to reconstruct with FDK algorithm. Even >> though I am able to generate projections, FDK reconstruction yields the >> volume with all voxel values zero. The commands I used for generating >> projections and reconstructing volume are >> >> rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd >> --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast >> rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml >> --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 >> --dimension=256,256,256 --hardware=cuda >> >> I am also attaching geometry xml file, mhd header files of the original >> volume, projections and reconstructed volume. >> >> With regards, >> Shiras >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 31 12:02:32 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 31 May 2016 18:02:32 +0200 Subject: [Rtk-users] Rooster In-Reply-To: References: Message-ID: Hi Guillaume, I'm adding RTK user list to this conversation, it's better to have these conversations on the mailing list IMO. Can you tell us what's the volume size and the GPU? Cyril is ROOSTER's dev, maybe he could comment on recon times. Simon On Tue, May 31, 2016 at 5:29 PM, wrote: > Hi Simon, > > I tried the rooster recon. I used the parameters from the example page. The results looks rather nice but it took several hours to run (5-6). Its a big dataset of about 2000 256x256 projections. > > Guillaume From G.Landry at physik.uni-muenchen.de Tue May 31 13:48:28 2016 From: G.Landry at physik.uni-muenchen.de (G.Landry at physik.uni-muenchen.de) Date: Tue, 31 May 2016 19:48:28 +0200 Subject: [Rtk-users] Rooster In-Reply-To: References: Message-ID: <20160531194828.Horde.Im1irUOnkCrL1p8oGSue_A5@webmail.physik.lmu.de> Hi Simon, Thanks for mailing list suggestion. My initial question was about typical reconstruction times for rtkfourdrooster. What I tried is summarized below: -Volume size was 410 410 264 and could be easily reduced by a good margin. -The GPU is quadro M4000 with 8GB -about 2300 256x256 projections with shifted elekta panel (so called M20) -10 phases -for the motion mask at the moment I just used the FOV mask for first try. --gamma_time 0.0001 --gamma_space 0.0001 - spacing 1 1 1 --niter 30 --cgiter 4 --tviter 10 Recon time was about 5-6 hours. I saw about 4 Gb used on the card. The image looked nice, albeit with the TV "feel/plastic-y". Thanks for your feedback Guillaume Quoting Simon Rit : > Hi Guillaume, > I'm adding RTK user list to this conversation, it's better to have > these conversations on the mailing list IMO. Can you tell us what's > the volume size and the GPU? > Cyril is ROOSTER's dev, maybe he could comment on recon times. > Simon > > On Tue, May 31, 2016 at 5:29 PM, wrote: >> Hi Simon, >> >> I tried the rooster recon. I used the parameters from the example >> page. The results looks rather nice but it took several hours to >> run (5-6). Its a big dataset of about 2000 256x256 projections. >> >> Guillaume -- Dr. Guillaume Landry Ludwig Maximilians University (LMU) Munich Medical Physics Am Coulombwall 1 85748 Garching Tel:+49 (0) 89 289-14077 Fax:+49 (0) 89 289-14072 From solomoncztang at gmail.com Mon May 2 16:42:44 2016 From: solomoncztang at gmail.com (Solomon Tang) Date: Mon, 2 May 2016 13:42:44 -0700 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Thanks for the tip Simon, I think I may have figured it out. I initially read as a CUDA Image, and then passed the CUDA image through ChangeInformationImageFilter to change the offset of the image. template typename itk::CudaImage::Pointer ShiftOffset( const typename itk::CudaImage::Pointer image, const typename itk::Image::PointType origin) { typedef itk::ChangeInformationImageFilter< itk::CudaImage > FilterType; FilterType::Pointer filter = FilterType::New(); filter -> SetInput(image); filter -> SetOutputOrigin(origin); filter -> ChangeOriginOn(); filter -> UpdateOutputInformation(); filter -> Update(); return filter->GetOutput(); } If I pass the offset image pointer to ForwardProjection, it outputs a blank image. However, when I write the offset image and then read it again as a CUDA image, then the ForwardProjection works as intended. Perhaps using the CUDA version of ITK would fix this. On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit wrote: > Hi Solomon, > Hard to say without the full code. Maybe the cudaness of your output image > is lost further in the code. Try accessing the CPU buffer at the end, after > the update, to be sure that the GPU image is transferred to CPU, e.g. > std::cout << forwardProjection->GetOutput()->GetPointer() < Simon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Tue May 3 18:59:03 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Wed, 4 May 2016 00:59:03 +0200 Subject: [Rtk-users] forward and back projection - MITK Message-ID: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I've seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I've also seen the test for this class but I don't get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I've got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 4 03:02:05 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 4 May 2016 09:02:05 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Message-ID: Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein wrote: > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 4 03:16:33 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 4 May 2016 09:16:33 +0200 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Dear Solomon, Thanks for the report. It looks like a bug to me. I checked and itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in the itkGPUImage and the itkCudaImage, this function does not check consistency between CPU and GPU data. I'll work on a minimal example to check this but can you test that your problem is solved if you add m_DataManager->UpdateCPUBuffer(); before m_DataManager->SetGPUBufferDirty(); in itkCudaImage.h line 121? Thanks, Simon On Mon, May 2, 2016 at 10:42 PM, Solomon Tang wrote: > Thanks for the tip Simon, > > I think I may have figured it out. I initially read as a CUDA Image, and > then passed the CUDA image through ChangeInformationImageFilter to change > the offset of the image. > > template > typename itk::CudaImage::Pointer ShiftOffset( > const typename itk::CudaImage::Pointer image, > const typename itk::Image::PointType origin) > { > typedef itk::ChangeInformationImageFilter< itk::CudaImage > > FilterType; > FilterType::Pointer filter = FilterType::New(); > filter -> SetInput(image); > filter -> SetOutputOrigin(origin); > filter -> ChangeOriginOn(); > filter -> UpdateOutputInformation(); > filter -> Update(); > return filter->GetOutput(); > } > > If I pass the offset image pointer to ForwardProjection, it outputs a > blank image. > > However, when I write the offset image and then read it again as a CUDA > image, then the ForwardProjection works as intended. Perhaps using the CUDA > version of ITK would fix this. > > > On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < > simon.rit at creatis.insa-lyon.fr> wrote: > >> Hi Solomon, >> Hard to say without the full code. Maybe the cudaness of your output >> image is lost further in the code. Try accessing the CPU buffer at the end, >> after the update, to be sure that the GPU image is transferred to CPU, e.g. >> std::cout << forwardProjection->GetOutput()->GetPointer() <> Simon >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Wed May 4 05:04:28 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Wed, 4 May 2016 14:34:28 +0530 Subject: [Rtk-users] Reconstructed Slice save as tiff Message-ID: Hi all, I have wrote code for saving output volume stack as *.tiff. Currently I am getting output of XY axis. What should I do in order to get the other axes. My code is shown below. typedef itk::StreamingImageFilter StreamerType; StreamerType::Pointer streamerBP = StreamerType::New(); streamerBP->SetInput(feldkampCUDA->GetOutput()); streamerBP->SetNumberOfStreamDivisions(8); typedef itk::Image< float, 2 > Image2DType; typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; WriterType::Pointer writer = WriterType::New(); writer->SetInput(streamerBP->GetOutput()); typedef itk::NumericSeriesFileNames NameGeneratorType; NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); nameGenerator->SetStartIndex(0); nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the Z-axis value of //reconstructed volume nameGenerator->SetIncrementIndex(1); writer->SetFileNames(nameGenerator->GetFileNames()); writer->SetUseCompression(true); writer->Update(); PS: My reconstruction works fine. Thanks and Regards AMJAD N -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyril.mory at uclouvain.be Wed May 4 07:27:24 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Wed, 4 May 2016 13:27:24 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: References: Message-ID: <5729DC9C.10105@uclouvain.be> Hi Amjad, You can use an ITK extract filter to extract a region that corresponds to one of your slices (along the axis you want). The output of the extract filter will be 3D, so you will need to cast it into a 2D images using an ITK cast filter. Cyril On 05/04/2016 11:04 AM, AMJAD N wrote: > Hi all, > > I have wrote code for saving output volume stack as *.tiff. Currently > I am getting output of XY axis. What should I do in order to get the > other axes. > My code is shown below. > > typedef itk::StreamingImageFilter FloatImageType> StreamerType; > StreamerType::Pointer streamerBP = StreamerType::New(); > streamerBP->SetInput(feldkampCUDA->GetOutput()); > streamerBP->SetNumberOfStreamDivisions(8); > > typedef itk::Image< float, 2 > Image2DType; > typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; > WriterType::Pointer writer = WriterType::New(); > writer->SetInput(streamerBP->GetOutput()); > > typedef itk::NumericSeriesFileNames NameGeneratorType; > NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); > nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); > nameGenerator->SetStartIndex(0); > nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the > Z-axis value of //reconstructed volume > nameGenerator->SetIncrementIndex(1); > writer->SetFileNames(nameGenerator->GetFileNames()); > writer->SetUseCompression(true); > writer->Update(); > > PS: My reconstruction works fine. > > Thanks and Regards > > AMJAD N > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From wuchao04 at gmail.com Wed May 4 08:44:37 2016 From: wuchao04 at gmail.com (Chao Wu) Date: Wed, 4 May 2016 14:44:37 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: <5729DC9C.10105@uclouvain.be> References: <5729DC9C.10105@uclouvain.be> Message-ID: A small add-on (copied from ITK document): ExtractImageFilter also collapses dimensions so that the input image may have more dimensions than the output image (i.e. 4-D input image to a 3-D output image). To specify what dimensions to collapse, the ExtractionRegion must be specified. For any dimension dim where ExtractionRegion.Size[dim] = 0, that dimension is collapsed. The index to collapse on is specified by ExtractionRegion.Index[dim]. For example, we have a image 4D = a 4x4x4x4 image, and we want to get a 3D image, 3D = a 4x4x4 image, specified as [x,y,z,2] from 4D (i.e. the 3rd "time" slice from 4D). The ExtractionRegion.Size = [4,4,4,0] and ExtractionRegion.Index = [0,0,0,2]. Regards, Chao 2016-05-04 13:27 GMT+02:00 Cyril Mory : > Hi Amjad, > > You can use an ITK extract filter to extract a region that corresponds to > one of your slices (along the axis you want). The output of the extract > filter will be 3D, so you will need to cast it into a 2D images using an > ITK cast filter. > > Cyril > > > On 05/04/2016 11:04 AM, AMJAD N wrote: > > Hi all, > > I have wrote code for saving output volume stack as *.tiff. Currently I am > getting output of XY axis. What should I do in order to get the other axes. > My code is shown below. > > typedef itk::StreamingImageFilter > StreamerType; > StreamerType::Pointer streamerBP = StreamerType::New(); > streamerBP->SetInput(feldkampCUDA->GetOutput()); > streamerBP->SetNumberOfStreamDivisions(8); > > typedef itk::Image< float, 2 > Image2DType; > typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; > WriterType::Pointer writer = WriterType::New(); > writer->SetInput(streamerBP->GetOutput()); > > typedef itk::NumericSeriesFileNames NameGeneratorType; > NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); > nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); > nameGenerator->SetStartIndex(0); > nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the > Z-axis value of //reconstructed volume > nameGenerator->SetIncrementIndex(1); > writer->SetFileNames(nameGenerator->GetFileNames()); > writer->SetUseCompression(true); > writer->Update(); > > PS: My reconstruction works fine. > > Thanks and Regards > > AMJAD N > > > > _______________________________________________ > Rtk-users mailing listRtk-users at public.kitware.comhttp://public.kitware.com/mailman/listinfo/rtk-users > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyril.mory at uclouvain.be Wed May 4 08:56:14 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Wed, 4 May 2016 14:56:14 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: References: <5729DC9C.10105@uclouvain.be> Message-ID: <5729F16E.5020402@uclouvain.be> Thanks Chao Wu, You're right, I was mistaken : the cast filter is not required in this case. It is needed, on the other hand, to increase the dimension of an image. So in this case, Amjad, you don't need it. Cyril On 05/04/2016 02:44 PM, Chao Wu wrote: > A small add-on (copied from ITK document): > > ExtractImageFilter also collapses dimensions so that the input image > may have more dimensions than the output image (i.e. 4-D input image > to a 3-D output image). To specify what dimensions to collapse, the > ExtractionRegion must be specified. For any dimension dim where > ExtractionRegion.Size[dim] = 0, that dimension is collapsed. The index > to collapse on is specified by ExtractionRegion.Index[dim]. For > example, we have a image 4D = a 4x4x4x4 image, and we want to get a 3D > image, 3D = a 4x4x4 image, specified as [x,y,z,2] from 4D (i.e. the > 3rd "time" slice from 4D). The ExtractionRegion.Size = [4,4,4,0] and > ExtractionRegion.Index = [0,0,0,2]. > > Regards, > Chao > > 2016-05-04 13:27 GMT+02:00 Cyril Mory >: > > Hi Amjad, > > You can use an ITK extract filter to extract a region that > corresponds to one of your slices (along the axis you want). The > output of the extract filter will be 3D, so you will need to cast > it into a 2D images using an ITK cast filter. > > Cyril > > > On 05/04/2016 11:04 AM, AMJAD N wrote: >> Hi all, >> >> I have wrote code for saving output volume stack as *.tiff. >> Currently I am getting output of XY axis. What should I do in >> order to get the other axes. >> My code is shown below. >> >> typedef itk::StreamingImageFilter> FloatImageType> StreamerType; >> StreamerType::Pointer streamerBP = StreamerType::New(); >> streamerBP->SetInput(feldkampCUDA->GetOutput()); >> streamerBP->SetNumberOfStreamDivisions(8); >> >> typedef itk::Image< float, 2 > Image2DType; >> typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > >> WriterType; >> WriterType::Pointer writer = WriterType::New(); >> writer->SetInput(streamerBP->GetOutput()); >> >> typedef itk::NumericSeriesFileNames NameGeneratorType; >> NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); >> nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); >> nameGenerator->SetStartIndex(0); >> nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] >> is the Z-axis value of //reconstructed volume >> nameGenerator->SetIncrementIndex(1); >> writer->SetFileNames(nameGenerator->GetFileNames()); >> writer->SetUseCompression(true); >> writer->Update(); >> >> PS: My reconstruction works fine. >> >> Thanks and Regards >> >> AMJAD N >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From solomoncztang at gmail.com Thu May 5 19:45:43 2016 From: solomoncztang at gmail.com (Solomon Tang) Date: Thu, 5 May 2016 16:45:43 -0700 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Hi Simon, I added the line as you suggested and it does not change the output (still blank). Sorry for the delayed response. Thanks for looking into it! On Wed, May 4, 2016 at 12:16 AM, Simon Rit wrote: > Dear Solomon, > Thanks for the report. It looks like a bug to me. I checked and > itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in > the itkGPUImage and the itkCudaImage, this function does not check > consistency between CPU and GPU data. I'll work on a minimal example to > check this but can you test that your problem is solved if you add > m_DataManager->UpdateCPUBuffer(); > before > m_DataManager->SetGPUBufferDirty(); > in itkCudaImage.h line 121? > Thanks, > Simon > > On Mon, May 2, 2016 at 10:42 PM, Solomon Tang > wrote: > >> Thanks for the tip Simon, >> >> I think I may have figured it out. I initially read as a CUDA Image, and >> then passed the CUDA image through ChangeInformationImageFilter to change >> the offset of the image. >> >> template >> typename itk::CudaImage::Pointer ShiftOffset( >> const typename itk::CudaImage::Pointer image, >> const typename itk::Image::PointType origin) >> { >> typedef itk::ChangeInformationImageFilter< itk::CudaImage > >> FilterType; >> FilterType::Pointer filter = FilterType::New(); >> filter -> SetInput(image); >> filter -> SetOutputOrigin(origin); >> filter -> ChangeOriginOn(); >> filter -> UpdateOutputInformation(); >> filter -> Update(); >> return filter->GetOutput(); >> } >> >> If I pass the offset image pointer to ForwardProjection, it outputs a >> blank image. >> >> However, when I write the offset image and then read it again as a CUDA >> image, then the ForwardProjection works as intended. Perhaps using the CUDA >> version of ITK would fix this. >> >> >> On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < >> simon.rit at creatis.insa-lyon.fr> wrote: >> >>> Hi Solomon, >>> Hard to say without the full code. Maybe the cudaness of your output >>> image is lost further in the code. Try accessing the CPU buffer at the end, >>> after the update, to be sure that the GPU image is transferred to CPU, e.g. >>> std::cout << forwardProjection->GetOutput()->GetPointer() <>> Simon >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 10 01:29:44 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 10 May 2016 07:29:44 +0200 Subject: [Rtk-users] Cmake build error help In-Reply-To: References: Message-ID: <573171C8.80400@creatis.insa-lyon.fr> Hi, Can you update GetGitRevisionDescription.cmake and GetGitRevisionDescription.cmake.in from https://github.com/rpavlik/cmake-modules and see if the new versions fix this issue? Thanks, Simon PS: plead keep using the mailing list On 10/05/2016 03:09, Solomon Tang wrote: > Hi Simon, > > I am rebuilding RTK after moving to Visual Studio 2015 with cmake > 3.5.2 and am running into the following error: > > CMake Error at build/applications/CMakeFiles/git-data/grabRef.cmake:36 > (file): > file failed to open for reading (No such file or directory): > > C:/Work/Tools/Current/RTK-1.2.0/build/applications/CMakeFiles/git-data/head-ref > Call Stack (most recent call first): > cmake/GetGitRevisionDescription.cmake:77 (include) > applications/CMakeLists.txt:5 (get_git_head_revision) > > I am using ITK 4.9.0 and fresh download of RTK 1.2.0. > > How do I resolve this issue? > > Thanks again, > > Solomon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Thu May 12 00:12:17 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Thu, 12 May 2016 09:42:17 +0530 Subject: [Rtk-users] Reconstruction Volume. Message-ID: Hello users, I have successfully implemented CBCT reconstruction using both CUDA and CPU method. For finding the reconstruction volume size, I measured the actual object size. divided by respective axis number of pixels to get spacing. eg: If my object is 10x15x20 cm. I measure that dimensions. If the required volume is 500x600x700 px, to get spacing i used 10/500,15/600,20/700. But this is not practically possible for every object. Is there any way to find the reconstruction volume spacing other than doing the above method. I have SDD(Source Detector Distance), SID(Source Isocenter Distance), Detector physical size,pixel density. Thanks and Regards AMJAD N -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 12 01:31:51 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 12 May 2016 07:31:51 +0200 Subject: [Rtk-users] Reconstruction Volume. In-Reply-To: References: Message-ID: Hi, The typical solution (e.g., in clincial scanners) is to reconstruct the field-of-view of the scanner (every point in space that is seen by all source positions) because you know this is the only area of space where your reconstruction is going to be accurate. rtkfieldofview generates this FOV. Simon On Thu, May 12, 2016 at 6:12 AM, AMJAD N wrote: > Hello users, > > I have successfully implemented CBCT reconstruction using both CUDA and > CPU method. For finding the reconstruction volume size, I measured the > actual object size. divided by respective axis number of pixels to get > spacing. > > eg: If my object is 10x15x20 cm. I measure that dimensions. If the > required volume is 500x600x700 px, to get spacing i used > 10/500,15/600,20/700. > > But this is not practically possible for every object. Is there any way to > find the reconstruction volume spacing other than doing the above method. > > I have SDD(Source Detector Distance), SID(Source Isocenter Distance), > Detector physical size,pixel density. > > Thanks and Regards > > AMJAD N > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Fri May 13 04:30:33 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Fri, 13 May 2016 14:00:33 +0530 Subject: [Rtk-users] Object isocenter shift Message-ID: Hello users, During acquisition it is found that my object isocenter is shifted from turntable isocenter by DX and DY values. Source , turntable isocenter and detector center is aligned perfectly. Is there any method in RTK we can make use of to nullify the effect due to this isocenter shift? Thanks and Regards AMJAD -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 13 08:36:48 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 13 May 2016 14:36:48 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: Hi, I don't understand the question. The isocenter is by definition the center of rotation in RTK and we assume it's at the origin of the reconstructed volume. There is no such thing as an "object isocenter". DX and DY values are the shift of the projection origin (which can be anywhere) with respect to the central ray (source to isocenter ray). It is not the turntable isocenter. If you want to have dx=0 and dy=0, the projection origin must be changed. But it has to be constant for the whole projection stack. I hope it helps, Simon On Fri, May 13, 2016 at 10:30 AM, AMJAD N wrote: > Hello users, > During acquisition it is found that my object isocenter is shifted from > turntable isocenter by DX and DY values. Source , turntable isocenter and > detector center is aligned perfectly. Is there any method in RTK we can > make use of to nullify the effect due to this isocenter shift? > > Thanks and Regards > AMJAD > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Fri May 13 11:35:57 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Fri, 13 May 2016 17:35:57 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Message-ID: <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 13 12:15:09 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 13 May 2016 18:15:09 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Message-ID: Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein wrote: > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Sat May 14 05:48:01 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Sat, 14 May 2016 11:48:01 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Message-ID: <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Hello Simon, Thanks for your advice so far. I?m getting to know this filter better. At least I can now use it and save the result into a file. I updated my code which now uses a volume. The values of the input and output volume are equal except of the z-dimension of the output which I changed to the number of projection images. const unsigned int Dimension = 3; ?Reading image? ImageType::Pointer inputImage = reader->GetOutput(); ImageType::Pointer outputImage = ImageType::New(); RegionType inputRegion = inputImage->GetLargestPossibleRegion(); const unsigned int NumberOfProjectionImages = 45; ImageType::IndexType start; start[0] = inputRegion.GetIndex()[0]; start[1] = inputRegion.GetIndex()[1]; start[2] = inputRegion.GetIndex()[2]; RegionType::SizeType size; size[0] = inputRegion.GetSize()[0]; size[1] = inputRegion.GetSize()[1]; size[2] = NumberOfProjectionImages; RegionType region; region.SetSize(size); region.SetIndex(start); ImageType::SpacingType spacing; spacing[0] = inputImage->GetSpacing()[0]; spacing[1] = inputImage->GetSpacing()[1]; spacing[2] = inputImage->GetSpacing()[2]; ImageType::PointType origin; origin[0] = inputImage->GetOrigin()[0]; origin[1] = inputImage->GetOrigin()[1]; origin[2] = inputImage->GetOrigin()[2]; outputImage->SetRegions(region); outputImage->SetSpacing(spacing); outputImage->SetOrigin(origin); outputImage->Allocate(); outputImage->FillBuffer(size[0] * size[1] * size[2]); // Geometry typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(510., 510., i*8.); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->SetGeometry(geometry); forward->Update(); I?m not sure how I have to add projection for the geometry to get a result which I?m familiar with. Can you describe how do I have to interpret the result of the Joseph-Filter? I am familiar with sinograms and how they are computed, but one sinogram is created by the projections of one image slice as far as I understood it. What I want is to manipulate the image in the radon space and then perform a filtered back projection. Typically the articles describe techniques to reduce metal artifacts by using one 2D Slice. Is it possible to achieve something like that with the JosephFilter? I?m guessing since this filter won?t work well for 2D I have to use another filter. Can you give me a hint if I can do something like that with RTK or another ITK-based framework? Here a diagram which shows an example what I want to try. I tried also to use my code with one slice and added a zero padding like that: typedef itk::ConstantPadImageFilter ConstantPadImageFilterType; ConstantPadImageFilterType::Pointer padFilter = ConstantPadImageFilterType::New(); padFilter->SetInput(inputImage); ImageType::SizeType extendRegion; extendRegion[0] = 0; extendRegion[1] = 0; extendRegion[2] = 0; padFilter->SetPadLowerBound(extendRegion); padFilter->SetPadUpperBound(extendRegion); padFilter->SetConstant(1); padFilter->Update(); But the result of my png is a black square. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Freitag, 13. Mai 2016 18:15 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto: simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein < tstein at stud.hs-heilbronn.de> Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Sat May 14 06:17:18 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sat, 14 May 2016 12:17:18 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Message-ID: The output of the Joseph filter (of any forward projector) is a stack of projection images, i.e., a 3D image. If you slice this 3D image in the z direction, you get one projection images. If you slice this 3D image in the y direction, you get a sinogram, e.g., the 2D sinogram of the central slice (plane of the source trajectory) if y=0. The best way to have this sinogram is to set size[1]=1 and there is no better way to do it in RTK. For zero-padding, you need to set extendRegion[?]=1, with (for all dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that your image is a black square, something else must be going on. One thing to remember, the typical RTK rotation is around the y axis so your 3D slice must be 1 in the y direction. A simple way to change the orientation of one slice is to change its direction with ChangeImageFilter Simon On Sat, May 14, 2016 at 11:48 AM, Tobias Stein wrote: > Hello Simon, > > > > Thanks for your advice so far. I?m getting to know this filter better. At > least I can now use it and save the result into a file. > > > > I updated my code which now uses a volume. > > The values of the input and output volume are equal except of the > z-dimension of the output which I changed to the number of projection > images. > > const unsigned int Dimension = 3; > > ?Reading image? > > ImageType::Pointer inputImage = reader->GetOutput(); > > ImageType::Pointer outputImage = ImageType::New(); > > > > RegionType inputRegion = inputImage->GetLargestPossibleRegion(); > > > > const unsigned int NumberOfProjectionImages = 45; > > > > ImageType::IndexType start; > > start[0] = inputRegion.GetIndex()[0]; > > start[1] = inputRegion.GetIndex()[1]; > > start[2] = inputRegion.GetIndex()[2]; > > > > RegionType::SizeType size; > > size[0] = inputRegion.GetSize()[0]; > > size[1] = inputRegion.GetSize()[1]; > > size[2] = NumberOfProjectionImages; > > > > RegionType region; > > region.SetSize(size); > > region.SetIndex(start); > > > > ImageType::SpacingType spacing; > > spacing[0] = inputImage->GetSpacing()[0]; > > spacing[1] = inputImage->GetSpacing()[1]; > > spacing[2] = inputImage->GetSpacing()[2]; > > > > ImageType::PointType origin; > > origin[0] = inputImage->GetOrigin()[0]; > > origin[1] = inputImage->GetOrigin()[1]; > > origin[2] = inputImage->GetOrigin()[2]; > > > > outputImage->SetRegions(region); > > outputImage->SetSpacing(spacing); > > outputImage->SetOrigin(origin); > > outputImage->Allocate(); > > outputImage->FillBuffer(size[0] * size[1] * size[2]); > > > > // Geometry > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(510., 510., i*8.); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->SetGeometry(geometry); > > forward->Update(); > > > > I?m not sure how I have to add projection for the geometry to get a result > which I?m familiar with. > > > > Can you describe how do I have to interpret the result of the > Joseph-Filter? I am familiar with sinograms and how they are computed, but > one sinogram is created by the projections of one image slice as far as I > understood it. What I want is to manipulate the image in the radon space > and then perform a filtered back projection. Typically the articles > describe techniques to reduce metal artifacts by using one 2D Slice. Is it > possible to achieve something like that with the JosephFilter? I?m guessing > since this filter won?t work well for 2D I have to use another filter. Can > you give me a hint if I can do something like that with RTK or another > ITK-based framework? Here a diagram > which shows an example what I want to try. > > > > I tried also to use my code with one slice and added a zero padding like > that: > > typedef itk::ConstantPadImageFilter > ConstantPadImageFilterType; > > ConstantPadImageFilterType::Pointer padFilter = > ConstantPadImageFilterType::New(); > > padFilter->SetInput(inputImage); > > > > ImageType::SizeType extendRegion; > > extendRegion[0] = 0; > > extendRegion[1] = 0; > > extendRegion[2] = 0; > > > > padFilter->SetPadLowerBound(extendRegion); > > padFilter->SetPadUpperBound(extendRegion); > > padFilter->SetConstant(1); > > padFilter->Update(); > > But the result of my png is a black square. > > Tobias > > > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Freitag, 13. Mai 2016 18:15 > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > If you intialize the data of your itk::Image with FillBuffer with the > corresponding constant value, it is quite similar. The constant image value > allow us to stream the computation whereas you have to allocate the whole > image if you pass directly itk::Image. > > We only work in 3D and probably our projector don't work with 2D, that is > probably the problem here. You would have to correct the code for 2D but > that's a lot of work, we generally prefer pseudo 2D, see next point. > > I doubt that our forward projector will work well with one slice only if > you use 3D, we assume that the volume starts at the first pixel and ends at > the last pixel. You should probably add a zero border around with > itk::PadImage to see something. > > To avoid aliasing, you can cut frequencies in the ramp filter (look for > CutFrequency in the doxygen of rtk::FFTRampImageFilter). > > Simon > > > > On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: > > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Sat May 14 06:18:57 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sat, 14 May 2016 12:18:57 +0200 Subject: [Rtk-users] RTK training - June 17 2016 Message-ID: Dear all, The training on June 17 in Lyon is confirmed. Please register asap if you'd like to attend. Looking forward to meeting our users, Simon On Thu, Mar 10, 2016 at 11:02 AM, Simon Rit wrote: > Dear all, > The new date for the RTK training is Friday June 17. > I'm looking forward to meeting you there, > Simon > > On Sun, Mar 6, 2016 at 12:57 PM, Simon Rit > wrote: > >> Dear all, >> We have to fix another date for the RTK training due to a conflicting >> meeting. If you are interested, please fill in the foodle >> so that >> we fix a date that suits everyone. If none of these dates works for you, >> please let me know and we'll try to extend the foodle. >> Please answer before Tuesday, we'll fix the date on Tuesday evening. >> Thanks for your cooperation and apologies for the mess, >> Simon >> >> On Tue, Feb 9, 2016 at 11:49 AM, Simon Rit < >> simon.rit at creatis.insa-lyon.fr> wrote: >> >>> Dear RTK users, >>> We will organize a new training >>> session on June 22 2016 in >>> Lyon. Follow the instructions on the webpage >>> to register. The training is >>> for both users and developers. We are happy to answer any question that you >>> might have and we are looking forward to this new training session. >>> Simon >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Sun May 15 08:38:40 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Sun, 15 May 2016 14:38:40 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Message-ID: <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> If I understood you correct, the input of the Joseph-Filter needs to be oriented in the y-direction when I am dealing with axial oriented slices. Now I changed the direction of the 3D Slice by rotating it 90 degrees around the x-axis with the itk::ChangeInformationImageFilter to have my slice in the xz-layer in the y-direction: double rotationX = 90; itk::Versor< double > rotation; const double angleInRadians = rotationX * vnl_math::pi / 180.0; rotation.SetRotationAroundX(angleInRadians); const ImageType::DirectionType direction = inputImage->GetDirection(); const ImageType::DirectionType newDirection = direction * rotation.GetMatrix(); changeFilter->SetOutputDirection(newDirection); changeFilter->ChangeAll(); changeFilter->SetInput(inputImage); changeFilter->UpdateOutputInformation(); Then I added a zero-border as you told me (This changed the size of my region from [512, 512, 1] to [514, 514, 3]). While executing the Joseph Filter I got an error because a vector subscript was out of range. Maybe that?s because the index of the region is [-1,-1,-1] caused by the padding. I tried the padding after the Joseph Filter, and got a result which has a size [514, 3, 45], while 45 was the number of projection images but the image was still empty. I also tried the Jospeh Filter with a real 3D volume stack of slices, rotated it as described below and got a result. Now I am confused how I should create the geometry of the Joseph Filter to get a good result. typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(300., 500., i * 180 / NumberOfProjectionImages); I am trying to use a 180-degree rotation, but i don?t have the feeling for the distance values. I this code example I used an 3D Image with dimensions = [256, 256, 49] My idea was, since there is no way to get a result with a single 3D slice, I would use a stack of slices as input and slice the output volume in y-direction to get my sinogram as you said. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Samstag, 14. Mai 2016 12:17 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK The output of the Joseph filter (of any forward projector) is a stack of projection images, i.e., a 3D image. If you slice this 3D image in the z direction, you get one projection images. If you slice this 3D image in the y direction, you get a sinogram, e.g., the 2D sinogram of the central slice (plane of the source trajectory) if y=0. The best way to have this sinogram is to set size[1]=1 and there is no better way to do it in RTK. For zero-padding, you need to set extendRegion[?]=1, with (for all dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that your image is a black square, something else must be going on. One thing to remember, the typical RTK rotation is around the y axis so your 3D slice must be 1 in the y direction. A simple way to change the orientation of one slice is to change its direction with ChangeImageFilter Simon On Sat, May 14, 2016 at 11:48 AM, Tobias Stein > wrote: Hello Simon, Thanks for your advice so far. I?m getting to know this filter better. At least I can now use it and save the result into a file. I updated my code which now uses a volume. The values of the input and output volume are equal except of the z-dimension of the output which I changed to the number of projection images. const unsigned int Dimension = 3; ?Reading image? ImageType::Pointer inputImage = reader->GetOutput(); ImageType::Pointer outputImage = ImageType::New(); RegionType inputRegion = inputImage->GetLargestPossibleRegion(); const unsigned int NumberOfProjectionImages = 45; ImageType::IndexType start; start[0] = inputRegion.GetIndex()[0]; start[1] = inputRegion.GetIndex()[1]; start[2] = inputRegion.GetIndex()[2]; RegionType::SizeType size; size[0] = inputRegion.GetSize()[0]; size[1] = inputRegion.GetSize()[1]; size[2] = NumberOfProjectionImages; RegionType region; region.SetSize(size); region.SetIndex(start); ImageType::SpacingType spacing; spacing[0] = inputImage->GetSpacing()[0]; spacing[1] = inputImage->GetSpacing()[1]; spacing[2] = inputImage->GetSpacing()[2]; ImageType::PointType origin; origin[0] = inputImage->GetOrigin()[0]; origin[1] = inputImage->GetOrigin()[1]; origin[2] = inputImage->GetOrigin()[2]; outputImage->SetRegions(region); outputImage->SetSpacing(spacing); outputImage->SetOrigin(origin); outputImage->Allocate(); outputImage->FillBuffer(size[0] * size[1] * size[2]); // Geometry typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(510., 510., i*8.); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->SetGeometry(geometry); forward->Update(); I?m not sure how I have to add projection for the geometry to get a result which I?m familiar with. Can you describe how do I have to interpret the result of the Joseph-Filter? I am familiar with sinograms and how they are computed, but one sinogram is created by the projections of one image slice as far as I understood it. What I want is to manipulate the image in the radon space and then perform a filtered back projection. Typically the articles describe techniques to reduce metal artifacts by using one 2D Slice. Is it possible to achieve something like that with the JosephFilter? I?m guessing since this filter won?t work well for 2D I have to use another filter. Can you give me a hint if I can do something like that with RTK or another ITK-based framework? Here a diagram which shows an example what I want to try. I tried also to use my code with one slice and added a zero padding like that: typedef itk::ConstantPadImageFilter ConstantPadImageFilterType; ConstantPadImageFilterType::Pointer padFilter = ConstantPadImageFilterType::New(); padFilter->SetInput(inputImage); ImageType::SizeType extendRegion; extendRegion[0] = 0; extendRegion[1] = 0; extendRegion[2] = 0; padFilter->SetPadLowerBound(extendRegion); padFilter->SetPadUpperBound(extendRegion); padFilter->SetConstant(1); padFilter->Update(); But the result of my png is a black square. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com ] Im Auftrag von Simon Rit Gesendet: Freitag, 13. Mai 2016 18:15 An: Tobias Stein > Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto: simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein < tstein at stud.hs-heilbronn.de> Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 16 05:50:41 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 16 May 2016 11:50:41 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> Message-ID: Answers below. I think you need to understand better the coordinate system of an ITK image, maybe check ITK's doc. Simon On Sun, May 15, 2016 at 2:38 PM, Tobias Stein wrote: > If I understood you correct, the input of the Joseph-Filter needs to be > oriented in the y-direction when I am dealing with axial oriented slices. > Yes, or in other words, if you want to take projections around the axial axis, be aware that y is the default axis of rotation in RTK. > Now I changed the direction of the 3D Slice by rotating it 90 degrees > around the x-axis with the itk::ChangeInformationImageFilter to have my > slice in the xz-layer in the y-direction: > > double rotationX = 90; > > itk::Versor< double > rotation; > > const double angleInRadians = rotationX * vnl_math::pi / 180.0; > > rotation.SetRotationAroundX(angleInRadians); > > const ImageType::DirectionType direction = > inputImage->GetDirection(); > > const ImageType::DirectionType newDirection = direction * > rotation.GetMatrix(); > > changeFilter->SetOutputDirection(newDirection); > > changeFilter->ChangeAll(); > > changeFilter->SetInput(inputImage); > > changeFilter->UpdateOutputInformation(); > > > > Then I added a zero-border as you told me (This changed the size of my > region from [512, 512, 1] to [514, 514, 3]). > > While executing the Joseph Filter I got an error because a vector > subscript was out of range. Maybe that?s because the index of the region is > [-1,-1,-1] caused by the padding. > That should not have been a problem but that might be a bug... > I tried the padding after the Joseph Filter, and got a result which has a > size [514, 3, 45], while 45 was the number of projection images but the > image was still empty. > I guess you should check the origin of your projected volume and your projections. A simple test is to center your volume (check using ITK doc how you can define the origin so that (0,0,0) is at the center) and your projection (for the projection stack, only the first 2 coordinates count). > > > I also tried the Jospeh Filter with a real 3D volume stack of slices, > rotated it as described below and got a result. > > Now I am confused how I should create the geometry of the Joseph Filter to > get a good result. > > > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(300., 500., i * 180 / > NumberOfProjectionImages); > > > > I am trying to use a 180-degree rotation, but i don?t have the feeling for > the distance values. > > I this code example I used an 3D Image with dimensions = [256, 256, 49] > This doesn't tell you anything about the size of your volume, we also need the origin and the spacing. Look at the ITK doc to understand the ITK coordinate systems. > > > My idea was, since there is no way to get a result with a single 3D slice, > I would use a stack of slices as input and slice the output volume in > y-direction to get my sinogram as you said. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Samstag, 14. Mai 2016 12:17 > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > The output of the Joseph filter (of any forward projector) is a stack of > projection images, i.e., a 3D image. If you slice this 3D image in the z > direction, you get one projection images. If you slice this 3D image in the > y direction, you get a sinogram, e.g., the 2D sinogram of the central slice > (plane of the source trajectory) if y=0. The best way to have this sinogram > is to set size[1]=1 and there is no better way to do it in RTK. > > For zero-padding, you need to set extendRegion[?]=1, with (for all > dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that > your image is a black square, something else must be going on. One thing to > remember, the typical RTK rotation is around the y axis so your 3D slice > must be 1 in the y direction. A simple way to change the orientation of one > slice is to change its direction with ChangeImageFilter > > Simon > > > > > > On Sat, May 14, 2016 at 11:48 AM, Tobias Stein < > tstein at stud.hs-heilbronn.de> wrote: > > Hello Simon, > > > > Thanks for your advice so far. I?m getting to know this filter better. At > least I can now use it and save the result into a file. > > > > I updated my code which now uses a volume. > > The values of the input and output volume are equal except of the > z-dimension of the output which I changed to the number of projection > images. > > const unsigned int Dimension = 3; > > ?Reading image? > > ImageType::Pointer inputImage = reader->GetOutput(); > > ImageType::Pointer outputImage = ImageType::New(); > > > > RegionType inputRegion = inputImage->GetLargestPossibleRegion(); > > > > const unsigned int NumberOfProjectionImages = 45; > > > > ImageType::IndexType start; > > start[0] = inputRegion.GetIndex()[0]; > > start[1] = inputRegion.GetIndex()[1]; > > start[2] = inputRegion.GetIndex()[2]; > > > > RegionType::SizeType size; > > size[0] = inputRegion.GetSize()[0]; > > size[1] = inputRegion.GetSize()[1]; > > size[2] = NumberOfProjectionImages; > > > > RegionType region; > > region.SetSize(size); > > region.SetIndex(start); > > > > ImageType::SpacingType spacing; > > spacing[0] = inputImage->GetSpacing()[0]; > > spacing[1] = inputImage->GetSpacing()[1]; > > spacing[2] = inputImage->GetSpacing()[2]; > > > > ImageType::PointType origin; > > origin[0] = inputImage->GetOrigin()[0]; > > origin[1] = inputImage->GetOrigin()[1]; > > origin[2] = inputImage->GetOrigin()[2]; > > > > outputImage->SetRegions(region); > > outputImage->SetSpacing(spacing); > > outputImage->SetOrigin(origin); > > outputImage->Allocate(); > > outputImage->FillBuffer(size[0] * size[1] * size[2]); > > > > // Geometry > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(510., 510., i*8.); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->SetGeometry(geometry); > > forward->Update(); > > > > I?m not sure how I have to add projection for the geometry to get a result > which I?m familiar with. > > > > Can you describe how do I have to interpret the result of the > Joseph-Filter? I am familiar with sinograms and how they are computed, but > one sinogram is created by the projections of one image slice as far as I > understood it. What I want is to manipulate the image in the radon space > and then perform a filtered back projection. Typically the articles > describe techniques to reduce metal artifacts by using one 2D Slice. Is it > possible to achieve something like that with the JosephFilter? I?m guessing > since this filter won?t work well for 2D I have to use another filter. Can > you give me a hint if I can do something like that with RTK or another > ITK-based framework? Here a diagram > which shows an example what I want to try. > > > > I tried also to use my code with one slice and added a zero padding like > that: > > typedef itk::ConstantPadImageFilter > ConstantPadImageFilterType; > > ConstantPadImageFilterType::Pointer padFilter = > ConstantPadImageFilterType::New(); > > padFilter->SetInput(inputImage); > > > > ImageType::SizeType extendRegion; > > extendRegion[0] = 0; > > extendRegion[1] = 0; > > extendRegion[2] = 0; > > > > padFilter->SetPadLowerBound(extendRegion); > > padFilter->SetPadUpperBound(extendRegion); > > padFilter->SetConstant(1); > > padFilter->Update(); > > But the result of my png is a black square. > > Tobias > > > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Freitag, 13. Mai 2016 18:15 > > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > If you intialize the data of your itk::Image with FillBuffer with the > corresponding constant value, it is quite similar. The constant image value > allow us to stream the computation whereas you have to allocate the whole > image if you pass directly itk::Image. > > We only work in 3D and probably our projector don't work with 2D, that is > probably the problem here. You would have to correct the code for 2D but > that's a lot of work, we generally prefer pseudo 2D, see next point. > > I doubt that our forward projector will work well with one slice only if > you use 3D, we assume that the volume starts at the first pixel and ends at > the last pixel. You should probably add a zero border around with > itk::PadImage to see something. > > To avoid aliasing, you can cut frequencies in the ramp filter (look for > CutFrequency in the doxygen of rtk::FFTRampImageFilter). > > Simon > > > > On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: > > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Tue May 17 07:07:20 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Tue, 17 May 2016 16:37:20 +0530 Subject: [Rtk-users] Object isocenter shift Message-ID: Hello, As my previous thread caused some confusion, I am attaching an image showing the same in detail. As you can see my object center is not aligned with isocenter line. Besides it is offset by DX and DY values. In my case you can see the object center as red dot. Is there any method in RTK to nullify this offset effect? Will the rotation of turntable affect the reconstruction due to this offset? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: objectoffset.png Type: image/png Size: 12365 bytes Desc: not available URL: From cyril.mory at uclouvain.be Tue May 17 08:19:38 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Tue, 17 May 2016 14:19:38 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: <573B0C5A.4030001@uclouvain.be> Well, if it's just that, you should not worry about it : you cannot perfectly center your object, even if you try. And most objects (e.g. patients) do not even have a "center". So it does not make sense to struggle to have the center of the object perfectly match the isocenter of the acquisition device. You can either live with that (it is perfectly fine for most applications), or try one of these things: - If you can re-do the acquisition, you should try to have your object's center _roughly_ match the system's isocenter, because that's where you will have the least artifacts - Reconstruct your object as it is (it will work fine, unless there are other problems), but select the origin and size of your reconstructed volume carefully to have your object's center roughly at the center of your reconstructed volume. If you are not familiar with the exact definition of "origin", "spacing" and "size" of an itk::image, read section 4.1.4 of the ITK software guide (https://itk.org/ItkSoftwareGuide.pdf). This is both clear, short, and something extremely important to understand. I hope it helps, Cyril On 05/17/2016 01:07 PM, AMJAD N wrote: > Hello, > > As my previous thread caused some confusion, I am attaching an image > showing the same in detail. > > As you can see my object center is not aligned with isocenter line. > Besides it is offset by DX and DY values. In my case you can see the > object center as red dot. > > Is there any method in RTK to nullify this offset effect? > Will the rotation of turntable affect the reconstruction due to this > offset? > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From wuchao04 at gmail.com Tue May 17 09:24:58 2016 From: wuchao04 at gmail.com (Chao Wu) Date: Tue, 17 May 2016 15:24:58 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: There's nothing to correct or compensate for DURING reconstruction in your case. Where you put your object dose not change the geometry of the CT system at all. As long as the object is still inside FOV, a normal reconstruction will give you a correct result. In the resulting image, the origin is at the center of rotation, and the object is off-center by DX and DY, that's it. If you want the origin to be at the center of the object, you can shift it by DX/DY AFTER reconstruction. Regards, Chao 2016-05-17 13:07 GMT+02:00 AMJAD N : > Hello, > > As my previous thread caused some confusion, I am attaching an image > showing the same in detail. > > As you can see my object center is not aligned with isocenter line. > Besides it is offset by DX and DY values. In my case you can see the object > center as red dot. > > Is there any method in RTK to nullify this offset effect? > Will the rotation of turntable affect the reconstruction due to this > offset? > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shiraska at gmail.com Thu May 19 04:41:54 2016 From: shiraska at gmail.com (Shiras Abdurahman) Date: Thu, 19 May 2016 10:41:54 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction Message-ID: Dear all, I am trying to simulate Tomosynthesis reconstruction with stationary flat panel detector where source rotates around Y axis to acquire 21 projections (system geometry diagram is attached). Geometry file geometry.xml is generated with Reg23ProjectionGeometry. I generated projection images of a cube volume and then I tried to reconstruct with FDK algorithm. Even though I am able to generate projections, FDK reconstruction yields the volume with all voxel values zero. The commands I used for generating projections and reconstructing volume are rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 --dimension=256,256,256 --hardware=cuda I am also attaching geometry xml file, mhd header files of the original volume, projections and reconstructed volume. With regards, Shiras -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: geometry.xml Type: text/xml Size: 11889 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fdk.mhd Type: application/octet-stream Size: 322 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: projections.mhd Type: application/octet-stream Size: 335 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: volume.mhd Type: application/octet-stream Size: 355 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: system_geometry.PNG Type: image/png Size: 50006 bytes Desc: not available URL: From cyril.mory at uclouvain.be Fri May 20 04:38:22 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Fri, 20 May 2016 10:38:22 +0200 Subject: [Rtk-users] Compiler RTK In-Reply-To: <573E430F.5030704@uclouvain.be> References: <573E430F.5030704@uclouvain.be> Message-ID: <573ECCFE.3070500@uclouvain.be> Hi Kevin, I'm replying to the RTK users mailing list. Next time, please send your questions to this list instead of just me (except when it specifically involves reggui, for example). I have tried to reproduce the error but the compilation runs fine on my machine. Can you send information on your compiler ? Maybe someone else on the list can help ? Cyril On 05/20/2016 12:49 AM, Kevin Souris wrote: > Bonjour, > > Je viens de t?l?charger la derni?re version de RTK sur Github. > J'essaye maintenant de compiler sur une machine linux et j'obtiens > cette erreur: > > /home/pen/RTK/RTK-master/applications/rtkprojections/rtkprojections.cxx: > In function ?int main(int, char**)?: > /home/pen/RTK/RTK-master/applications/rtkprojections*/**rtkprojections.cxx:27: > error: invalid conversion from ?const char*? to ?char*?* > /home/pen/RTK/RTK-master/applications/rtkprojections/rtkprojections.cxx:27: > error: initializing argument 1 of ?int > cmdline_parser_rtkprojections_config_file(char*, > args_info_rtkprojections*, cmdline_parser_rtkprojections_params*)? > > Comment puis-je r?parer ?a ? > Merci > > Kevin > > > > > -- > Kevin Souris, PhD student > Universit? catholique de Louvain > Molecular Imagery, Radiotherapy and Oncology (MIRO) -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 25 15:45:57 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 25 May 2016 21:45:57 +0200 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Hi Solomon, I had still to look into this on my todo list. I did again but now I think I overlooked something in your email. You say that going through ChangeInformationImageFilter might be the problem. But now, I wonder if the problem is not that the origin that you set is wrong and then the volume or the projections are completely off (hence the projections). So, here is my question : what happens if you replace filter -> SetOutputOrigin(origin); with filter -> SetOutputOrigin(image->GetOutputOrigin()); Of course, it's not what you want to do but it might point to a wrong choice of origin... Simon On Fri, May 6, 2016 at 1:45 AM, Solomon Tang wrote: > Hi Simon, > > I added the line as you suggested and it does not change the output (still > blank). Sorry for the delayed response. > > Thanks for looking into it! > > On Wed, May 4, 2016 at 12:16 AM, Simon Rit > wrote: > >> Dear Solomon, >> Thanks for the report. It looks like a bug to me. I checked and >> itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in >> the itkGPUImage and the itkCudaImage, this function does not check >> consistency between CPU and GPU data. I'll work on a minimal example to >> check this but can you test that your problem is solved if you add >> m_DataManager->UpdateCPUBuffer(); >> before >> m_DataManager->SetGPUBufferDirty(); >> in itkCudaImage.h line 121? >> Thanks, >> Simon >> >> On Mon, May 2, 2016 at 10:42 PM, Solomon Tang >> wrote: >> >>> Thanks for the tip Simon, >>> >>> I think I may have figured it out. I initially read as a CUDA Image, and >>> then passed the CUDA image through ChangeInformationImageFilter to change >>> the offset of the image. >>> >>> template >>> typename itk::CudaImage::Pointer ShiftOffset( >>> const typename itk::CudaImage::Pointer image, >>> const typename itk::Image::PointType origin) >>> { >>> typedef itk::ChangeInformationImageFilter< itk::CudaImage > >>> FilterType; >>> FilterType::Pointer filter = FilterType::New(); >>> filter -> SetInput(image); >>> filter -> SetOutputOrigin(origin); >>> filter -> ChangeOriginOn(); >>> filter -> UpdateOutputInformation(); >>> filter -> Update(); >>> return filter->GetOutput(); >>> } >>> >>> If I pass the offset image pointer to ForwardProjection, it outputs a >>> blank image. >>> >>> However, when I write the offset image and then read it again as a CUDA >>> image, then the ForwardProjection works as intended. Perhaps using the CUDA >>> version of ITK would fix this. >>> >>> >>> On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < >>> simon.rit at creatis.insa-lyon.fr> wrote: >>> >>>> Hi Solomon, >>>> Hard to say without the full code. Maybe the cudaness of your output >>>> image is lost further in the code. Try accessing the CPU buffer at the end, >>>> after the update, to be sure that the GPU image is transferred to CPU, e.g. >>>> std::cout << forwardProjection->GetOutput()->GetPointer() <>>> Simon >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 26 12:04:47 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 26 May 2016 18:04:47 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Hi Shiras, I generated a volume to look at your problem: rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 --offset 0,0,1.7 Then I obtained the same issue as you. I think the problem is that rtkfdk is meant for circular CBCT and it includes pre-weighting for displaced detector and short scan. I'm not sure why you don't get a warning but these are probably responsible for the blank output. A simple solution is to do only the 3 FDK steps using in order the command tools: rtktwodweights rtkramp rtkbackprojections You can also try to shunt the preweighting by modifying rtkfdk.cxx. It's interesting that you try out tomosynthesis but you'll encounter some problem. When I ran the above commands, I get very weird results because the first and the last projections get a lot more weight than the others since it looks at the angular weight with the previous and the next projections. A simple solution is to blank out these two projections. Good luck and keep us posted if you get interesting results, Simon On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman wrote: > Dear all, > > I am trying to simulate Tomosynthesis reconstruction with stationary flat > panel detector where source rotates around Y axis to acquire 21 projections > (system geometry diagram is attached). Geometry file geometry.xml is > generated with Reg23ProjectionGeometry. I generated projection images of > a cube volume and then I tried to reconstruct with FDK algorithm. Even > though I am able to generate projections, FDK reconstruction yields the > volume with all voxel values zero. The commands I used for generating > projections and reconstructing volume are > > rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd > --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast > rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml > --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 > --dimension=256,256,256 --hardware=cuda > > I am also attaching geometry xml file, mhd header files of the original > volume, projections and reconstructed volume. > > With regards, > Shiras > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shiraska at gmail.com Fri May 27 11:31:52 2016 From: shiraska at gmail.com (Shiras Abdurahman) Date: Fri, 27 May 2016 17:31:52 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Dear Simon, Thank you very much for the reply. I tried to reconstruct with only ramp filtering and back projection and the results are looking good without any weighting of the projections. I also reconstructed the volume with rtksart with 10 iterations and the results are better than rtkfdk. With these experiments, I also confirmed that my geometry file is accurate. Thank you very much for your help. With regards, Shiras On Thu, May 26, 2016 at 6:04 PM, Simon Rit wrote: > Hi Shiras, > I generated a volume to look at your problem: > rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 > --offset 0,0,1.7 > Then I obtained the same issue as you. I think the problem is that rtkfdk > is meant for circular CBCT and it includes pre-weighting for displaced > detector and short scan. I'm not sure why you don't get a warning but these > are probably responsible for the blank output. A simple solution is to do > only the 3 FDK steps using in order the command tools: > rtktwodweights > rtkramp > rtkbackprojections > You can also try to shunt the preweighting by modifying rtkfdk.cxx. > > It's interesting that you try out tomosynthesis but you'll encounter some > problem. When I ran the above commands, I get very weird results because > the first and the last projections get a lot more weight than the others > since it looks at the angular weight with the previous and the next > projections. A simple solution is to blank out these two projections. > Good luck and keep us posted if you get interesting results, > Simon > > On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman > wrote: > >> Dear all, >> >> I am trying to simulate Tomosynthesis reconstruction with stationary flat >> panel detector where source rotates around Y axis to acquire 21 projections >> (system geometry diagram is attached). Geometry file geometry.xml is >> generated with Reg23ProjectionGeometry. I generated projection images of >> a cube volume and then I tried to reconstruct with FDK algorithm. Even >> though I am able to generate projections, FDK reconstruction yields the >> volume with all voxel values zero. The commands I used for generating >> projections and reconstructing volume are >> >> rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd >> --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast >> rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml >> --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 >> --dimension=256,256,256 --hardware=cuda >> >> I am also attaching geometry xml file, mhd header files of the original >> volume, projections and reconstructed volume. >> >> With regards, >> Shiras >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 27 12:00:56 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 27 May 2016 18:00:56 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Indeed, the angular weighting resulting from the discretization of the back projection occurs in rtkfdktwodweights so skipping this might help. Simon On 27 May 2016 5:32 p.m., "Shiras Abdurahman" wrote: Dear Simon, Thank you very much for the reply. I tried to reconstruct with only ramp filtering and back projection and the results are looking good without any weighting of the projections. I also reconstructed the volume with rtksart with 10 iterations and the results are better than rtkfdk. With these experiments, I also confirmed that my geometry file is accurate. Thank you very much for your help. With regards, Shiras On Thu, May 26, 2016 at 6:04 PM, Simon Rit wrote: > Hi Shiras, > I generated a volume to look at your problem: > rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 > --offset 0,0,1.7 > Then I obtained the same issue as you. I think the problem is that rtkfdk > is meant for circular CBCT and it includes pre-weighting for displaced > detector and short scan. I'm not sure why you don't get a warning but these > are probably responsible for the blank output. A simple solution is to do > only the 3 FDK steps using in order the command tools: > rtktwodweights > rtkramp > rtkbackprojections > You can also try to shunt the preweighting by modifying rtkfdk.cxx. > > It's interesting that you try out tomosynthesis but you'll encounter some > problem. When I ran the above commands, I get very weird results because > the first and the last projections get a lot more weight than the others > since it looks at the angular weight with the previous and the next > projections. A simple solution is to blank out these two projections. > Good luck and keep us posted if you get interesting results, > Simon > > On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman > wrote: > >> Dear all, >> >> I am trying to simulate Tomosynthesis reconstruction with stationary flat >> panel detector where source rotates around Y axis to acquire 21 projections >> (system geometry diagram is attached). Geometry file geometry.xml is >> generated with Reg23ProjectionGeometry. I generated projection images of >> a cube volume and then I tried to reconstruct with FDK algorithm. Even >> though I am able to generate projections, FDK reconstruction yields the >> volume with all voxel values zero. The commands I used for generating >> projections and reconstructing volume are >> >> rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd >> --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast >> rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml >> --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 >> --dimension=256,256,256 --hardware=cuda >> >> I am also attaching geometry xml file, mhd header files of the original >> volume, projections and reconstructed volume. >> >> With regards, >> Shiras >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 31 12:02:32 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 31 May 2016 18:02:32 +0200 Subject: [Rtk-users] Rooster In-Reply-To: References: Message-ID: Hi Guillaume, I'm adding RTK user list to this conversation, it's better to have these conversations on the mailing list IMO. Can you tell us what's the volume size and the GPU? Cyril is ROOSTER's dev, maybe he could comment on recon times. Simon On Tue, May 31, 2016 at 5:29 PM, wrote: > Hi Simon, > > I tried the rooster recon. I used the parameters from the example page. The results looks rather nice but it took several hours to run (5-6). Its a big dataset of about 2000 256x256 projections. > > Guillaume From G.Landry at physik.uni-muenchen.de Tue May 31 13:48:28 2016 From: G.Landry at physik.uni-muenchen.de (G.Landry at physik.uni-muenchen.de) Date: Tue, 31 May 2016 19:48:28 +0200 Subject: [Rtk-users] Rooster In-Reply-To: References: Message-ID: <20160531194828.Horde.Im1irUOnkCrL1p8oGSue_A5@webmail.physik.lmu.de> Hi Simon, Thanks for mailing list suggestion. My initial question was about typical reconstruction times for rtkfourdrooster. What I tried is summarized below: -Volume size was 410 410 264 and could be easily reduced by a good margin. -The GPU is quadro M4000 with 8GB -about 2300 256x256 projections with shifted elekta panel (so called M20) -10 phases -for the motion mask at the moment I just used the FOV mask for first try. --gamma_time 0.0001 --gamma_space 0.0001 - spacing 1 1 1 --niter 30 --cgiter 4 --tviter 10 Recon time was about 5-6 hours. I saw about 4 Gb used on the card. The image looked nice, albeit with the TV "feel/plastic-y". Thanks for your feedback Guillaume Quoting Simon Rit : > Hi Guillaume, > I'm adding RTK user list to this conversation, it's better to have > these conversations on the mailing list IMO. Can you tell us what's > the volume size and the GPU? > Cyril is ROOSTER's dev, maybe he could comment on recon times. > Simon > > On Tue, May 31, 2016 at 5:29 PM, wrote: >> Hi Simon, >> >> I tried the rooster recon. I used the parameters from the example >> page. The results looks rather nice but it took several hours to >> run (5-6). Its a big dataset of about 2000 256x256 projections. >> >> Guillaume -- Dr. Guillaume Landry Ludwig Maximilians University (LMU) Munich Medical Physics Am Coulombwall 1 85748 Garching Tel:+49 (0) 89 289-14077 Fax:+49 (0) 89 289-14072 From solomoncztang at gmail.com Mon May 2 16:42:44 2016 From: solomoncztang at gmail.com (Solomon Tang) Date: Mon, 2 May 2016 13:42:44 -0700 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Thanks for the tip Simon, I think I may have figured it out. I initially read as a CUDA Image, and then passed the CUDA image through ChangeInformationImageFilter to change the offset of the image. template typename itk::CudaImage::Pointer ShiftOffset( const typename itk::CudaImage::Pointer image, const typename itk::Image::PointType origin) { typedef itk::ChangeInformationImageFilter< itk::CudaImage > FilterType; FilterType::Pointer filter = FilterType::New(); filter -> SetInput(image); filter -> SetOutputOrigin(origin); filter -> ChangeOriginOn(); filter -> UpdateOutputInformation(); filter -> Update(); return filter->GetOutput(); } If I pass the offset image pointer to ForwardProjection, it outputs a blank image. However, when I write the offset image and then read it again as a CUDA image, then the ForwardProjection works as intended. Perhaps using the CUDA version of ITK would fix this. On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit wrote: > Hi Solomon, > Hard to say without the full code. Maybe the cudaness of your output image > is lost further in the code. Try accessing the CPU buffer at the end, after > the update, to be sure that the GPU image is transferred to CPU, e.g. > std::cout << forwardProjection->GetOutput()->GetPointer() < Simon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Tue May 3 18:59:03 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Wed, 4 May 2016 00:59:03 +0200 Subject: [Rtk-users] forward and back projection - MITK Message-ID: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I've seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I've also seen the test for this class but I don't get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I've got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 4 03:02:05 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 4 May 2016 09:02:05 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Message-ID: Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein wrote: > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 4 03:16:33 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 4 May 2016 09:16:33 +0200 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Dear Solomon, Thanks for the report. It looks like a bug to me. I checked and itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in the itkGPUImage and the itkCudaImage, this function does not check consistency between CPU and GPU data. I'll work on a minimal example to check this but can you test that your problem is solved if you add m_DataManager->UpdateCPUBuffer(); before m_DataManager->SetGPUBufferDirty(); in itkCudaImage.h line 121? Thanks, Simon On Mon, May 2, 2016 at 10:42 PM, Solomon Tang wrote: > Thanks for the tip Simon, > > I think I may have figured it out. I initially read as a CUDA Image, and > then passed the CUDA image through ChangeInformationImageFilter to change > the offset of the image. > > template > typename itk::CudaImage::Pointer ShiftOffset( > const typename itk::CudaImage::Pointer image, > const typename itk::Image::PointType origin) > { > typedef itk::ChangeInformationImageFilter< itk::CudaImage > > FilterType; > FilterType::Pointer filter = FilterType::New(); > filter -> SetInput(image); > filter -> SetOutputOrigin(origin); > filter -> ChangeOriginOn(); > filter -> UpdateOutputInformation(); > filter -> Update(); > return filter->GetOutput(); > } > > If I pass the offset image pointer to ForwardProjection, it outputs a > blank image. > > However, when I write the offset image and then read it again as a CUDA > image, then the ForwardProjection works as intended. Perhaps using the CUDA > version of ITK would fix this. > > > On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < > simon.rit at creatis.insa-lyon.fr> wrote: > >> Hi Solomon, >> Hard to say without the full code. Maybe the cudaness of your output >> image is lost further in the code. Try accessing the CPU buffer at the end, >> after the update, to be sure that the GPU image is transferred to CPU, e.g. >> std::cout << forwardProjection->GetOutput()->GetPointer() <> Simon >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Wed May 4 05:04:28 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Wed, 4 May 2016 14:34:28 +0530 Subject: [Rtk-users] Reconstructed Slice save as tiff Message-ID: Hi all, I have wrote code for saving output volume stack as *.tiff. Currently I am getting output of XY axis. What should I do in order to get the other axes. My code is shown below. typedef itk::StreamingImageFilter StreamerType; StreamerType::Pointer streamerBP = StreamerType::New(); streamerBP->SetInput(feldkampCUDA->GetOutput()); streamerBP->SetNumberOfStreamDivisions(8); typedef itk::Image< float, 2 > Image2DType; typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; WriterType::Pointer writer = WriterType::New(); writer->SetInput(streamerBP->GetOutput()); typedef itk::NumericSeriesFileNames NameGeneratorType; NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); nameGenerator->SetStartIndex(0); nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the Z-axis value of //reconstructed volume nameGenerator->SetIncrementIndex(1); writer->SetFileNames(nameGenerator->GetFileNames()); writer->SetUseCompression(true); writer->Update(); PS: My reconstruction works fine. Thanks and Regards AMJAD N -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyril.mory at uclouvain.be Wed May 4 07:27:24 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Wed, 4 May 2016 13:27:24 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: References: Message-ID: <5729DC9C.10105@uclouvain.be> Hi Amjad, You can use an ITK extract filter to extract a region that corresponds to one of your slices (along the axis you want). The output of the extract filter will be 3D, so you will need to cast it into a 2D images using an ITK cast filter. Cyril On 05/04/2016 11:04 AM, AMJAD N wrote: > Hi all, > > I have wrote code for saving output volume stack as *.tiff. Currently > I am getting output of XY axis. What should I do in order to get the > other axes. > My code is shown below. > > typedef itk::StreamingImageFilter FloatImageType> StreamerType; > StreamerType::Pointer streamerBP = StreamerType::New(); > streamerBP->SetInput(feldkampCUDA->GetOutput()); > streamerBP->SetNumberOfStreamDivisions(8); > > typedef itk::Image< float, 2 > Image2DType; > typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; > WriterType::Pointer writer = WriterType::New(); > writer->SetInput(streamerBP->GetOutput()); > > typedef itk::NumericSeriesFileNames NameGeneratorType; > NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); > nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); > nameGenerator->SetStartIndex(0); > nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the > Z-axis value of //reconstructed volume > nameGenerator->SetIncrementIndex(1); > writer->SetFileNames(nameGenerator->GetFileNames()); > writer->SetUseCompression(true); > writer->Update(); > > PS: My reconstruction works fine. > > Thanks and Regards > > AMJAD N > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From wuchao04 at gmail.com Wed May 4 08:44:37 2016 From: wuchao04 at gmail.com (Chao Wu) Date: Wed, 4 May 2016 14:44:37 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: <5729DC9C.10105@uclouvain.be> References: <5729DC9C.10105@uclouvain.be> Message-ID: A small add-on (copied from ITK document): ExtractImageFilter also collapses dimensions so that the input image may have more dimensions than the output image (i.e. 4-D input image to a 3-D output image). To specify what dimensions to collapse, the ExtractionRegion must be specified. For any dimension dim where ExtractionRegion.Size[dim] = 0, that dimension is collapsed. The index to collapse on is specified by ExtractionRegion.Index[dim]. For example, we have a image 4D = a 4x4x4x4 image, and we want to get a 3D image, 3D = a 4x4x4 image, specified as [x,y,z,2] from 4D (i.e. the 3rd "time" slice from 4D). The ExtractionRegion.Size = [4,4,4,0] and ExtractionRegion.Index = [0,0,0,2]. Regards, Chao 2016-05-04 13:27 GMT+02:00 Cyril Mory : > Hi Amjad, > > You can use an ITK extract filter to extract a region that corresponds to > one of your slices (along the axis you want). The output of the extract > filter will be 3D, so you will need to cast it into a 2D images using an > ITK cast filter. > > Cyril > > > On 05/04/2016 11:04 AM, AMJAD N wrote: > > Hi all, > > I have wrote code for saving output volume stack as *.tiff. Currently I am > getting output of XY axis. What should I do in order to get the other axes. > My code is shown below. > > typedef itk::StreamingImageFilter > StreamerType; > StreamerType::Pointer streamerBP = StreamerType::New(); > streamerBP->SetInput(feldkampCUDA->GetOutput()); > streamerBP->SetNumberOfStreamDivisions(8); > > typedef itk::Image< float, 2 > Image2DType; > typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > WriterType; > WriterType::Pointer writer = WriterType::New(); > writer->SetInput(streamerBP->GetOutput()); > > typedef itk::NumericSeriesFileNames NameGeneratorType; > NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); > nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); > nameGenerator->SetStartIndex(0); > nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] is the > Z-axis value of //reconstructed volume > nameGenerator->SetIncrementIndex(1); > writer->SetFileNames(nameGenerator->GetFileNames()); > writer->SetUseCompression(true); > writer->Update(); > > PS: My reconstruction works fine. > > Thanks and Regards > > AMJAD N > > > > _______________________________________________ > Rtk-users mailing listRtk-users at public.kitware.comhttp://public.kitware.com/mailman/listinfo/rtk-users > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyril.mory at uclouvain.be Wed May 4 08:56:14 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Wed, 4 May 2016 14:56:14 +0200 Subject: [Rtk-users] Reconstructed Slice save as tiff In-Reply-To: References: <5729DC9C.10105@uclouvain.be> Message-ID: <5729F16E.5020402@uclouvain.be> Thanks Chao Wu, You're right, I was mistaken : the cast filter is not required in this case. It is needed, on the other hand, to increase the dimension of an image. So in this case, Amjad, you don't need it. Cyril On 05/04/2016 02:44 PM, Chao Wu wrote: > A small add-on (copied from ITK document): > > ExtractImageFilter also collapses dimensions so that the input image > may have more dimensions than the output image (i.e. 4-D input image > to a 3-D output image). To specify what dimensions to collapse, the > ExtractionRegion must be specified. For any dimension dim where > ExtractionRegion.Size[dim] = 0, that dimension is collapsed. The index > to collapse on is specified by ExtractionRegion.Index[dim]. For > example, we have a image 4D = a 4x4x4x4 image, and we want to get a 3D > image, 3D = a 4x4x4 image, specified as [x,y,z,2] from 4D (i.e. the > 3rd "time" slice from 4D). The ExtractionRegion.Size = [4,4,4,0] and > ExtractionRegion.Index = [0,0,0,2]. > > Regards, > Chao > > 2016-05-04 13:27 GMT+02:00 Cyril Mory >: > > Hi Amjad, > > You can use an ITK extract filter to extract a region that > corresponds to one of your slices (along the axis you want). The > output of the extract filter will be 3D, so you will need to cast > it into a 2D images using an ITK cast filter. > > Cyril > > > On 05/04/2016 11:04 AM, AMJAD N wrote: >> Hi all, >> >> I have wrote code for saving output volume stack as *.tiff. >> Currently I am getting output of XY axis. What should I do in >> order to get the other axes. >> My code is shown below. >> >> typedef itk::StreamingImageFilter> FloatImageType> StreamerType; >> StreamerType::Pointer streamerBP = StreamerType::New(); >> streamerBP->SetInput(feldkampCUDA->GetOutput()); >> streamerBP->SetNumberOfStreamDivisions(8); >> >> typedef itk::Image< float, 2 > Image2DType; >> typedef itk::ImageSeriesWriter< FloatImageType, Image2DType > >> WriterType; >> WriterType::Pointer writer = WriterType::New(); >> writer->SetInput(streamerBP->GetOutput()); >> >> typedef itk::NumericSeriesFileNames NameGeneratorType; >> NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New(); >> nameGenerator->SetSeriesFormat("Reconstructed_%06d.tif"); >> nameGenerator->SetStartIndex(0); >> nameGenerator->SetEndIndex(sizeOutput[2] - 1); // sizeOutput[2] >> is the Z-axis value of //reconstructed volume >> nameGenerator->SetIncrementIndex(1); >> writer->SetFileNames(nameGenerator->GetFileNames()); >> writer->SetUseCompression(true); >> writer->Update(); >> >> PS: My reconstruction works fine. >> >> Thanks and Regards >> >> AMJAD N >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From solomoncztang at gmail.com Thu May 5 19:45:43 2016 From: solomoncztang at gmail.com (Solomon Tang) Date: Thu, 5 May 2016 16:45:43 -0700 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Hi Simon, I added the line as you suggested and it does not change the output (still blank). Sorry for the delayed response. Thanks for looking into it! On Wed, May 4, 2016 at 12:16 AM, Simon Rit wrote: > Dear Solomon, > Thanks for the report. It looks like a bug to me. I checked and > itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in > the itkGPUImage and the itkCudaImage, this function does not check > consistency between CPU and GPU data. I'll work on a minimal example to > check this but can you test that your problem is solved if you add > m_DataManager->UpdateCPUBuffer(); > before > m_DataManager->SetGPUBufferDirty(); > in itkCudaImage.h line 121? > Thanks, > Simon > > On Mon, May 2, 2016 at 10:42 PM, Solomon Tang > wrote: > >> Thanks for the tip Simon, >> >> I think I may have figured it out. I initially read as a CUDA Image, and >> then passed the CUDA image through ChangeInformationImageFilter to change >> the offset of the image. >> >> template >> typename itk::CudaImage::Pointer ShiftOffset( >> const typename itk::CudaImage::Pointer image, >> const typename itk::Image::PointType origin) >> { >> typedef itk::ChangeInformationImageFilter< itk::CudaImage > >> FilterType; >> FilterType::Pointer filter = FilterType::New(); >> filter -> SetInput(image); >> filter -> SetOutputOrigin(origin); >> filter -> ChangeOriginOn(); >> filter -> UpdateOutputInformation(); >> filter -> Update(); >> return filter->GetOutput(); >> } >> >> If I pass the offset image pointer to ForwardProjection, it outputs a >> blank image. >> >> However, when I write the offset image and then read it again as a CUDA >> image, then the ForwardProjection works as intended. Perhaps using the CUDA >> version of ITK would fix this. >> >> >> On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < >> simon.rit at creatis.insa-lyon.fr> wrote: >> >>> Hi Solomon, >>> Hard to say without the full code. Maybe the cudaness of your output >>> image is lost further in the code. Try accessing the CPU buffer at the end, >>> after the update, to be sure that the GPU image is transferred to CPU, e.g. >>> std::cout << forwardProjection->GetOutput()->GetPointer() <>> Simon >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 10 01:29:44 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 10 May 2016 07:29:44 +0200 Subject: [Rtk-users] Cmake build error help In-Reply-To: References: Message-ID: <573171C8.80400@creatis.insa-lyon.fr> Hi, Can you update GetGitRevisionDescription.cmake and GetGitRevisionDescription.cmake.in from https://github.com/rpavlik/cmake-modules and see if the new versions fix this issue? Thanks, Simon PS: plead keep using the mailing list On 10/05/2016 03:09, Solomon Tang wrote: > Hi Simon, > > I am rebuilding RTK after moving to Visual Studio 2015 with cmake > 3.5.2 and am running into the following error: > > CMake Error at build/applications/CMakeFiles/git-data/grabRef.cmake:36 > (file): > file failed to open for reading (No such file or directory): > > C:/Work/Tools/Current/RTK-1.2.0/build/applications/CMakeFiles/git-data/head-ref > Call Stack (most recent call first): > cmake/GetGitRevisionDescription.cmake:77 (include) > applications/CMakeLists.txt:5 (get_git_head_revision) > > I am using ITK 4.9.0 and fresh download of RTK 1.2.0. > > How do I resolve this issue? > > Thanks again, > > Solomon > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Thu May 12 00:12:17 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Thu, 12 May 2016 09:42:17 +0530 Subject: [Rtk-users] Reconstruction Volume. Message-ID: Hello users, I have successfully implemented CBCT reconstruction using both CUDA and CPU method. For finding the reconstruction volume size, I measured the actual object size. divided by respective axis number of pixels to get spacing. eg: If my object is 10x15x20 cm. I measure that dimensions. If the required volume is 500x600x700 px, to get spacing i used 10/500,15/600,20/700. But this is not practically possible for every object. Is there any way to find the reconstruction volume spacing other than doing the above method. I have SDD(Source Detector Distance), SID(Source Isocenter Distance), Detector physical size,pixel density. Thanks and Regards AMJAD N -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 12 01:31:51 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 12 May 2016 07:31:51 +0200 Subject: [Rtk-users] Reconstruction Volume. In-Reply-To: References: Message-ID: Hi, The typical solution (e.g., in clincial scanners) is to reconstruct the field-of-view of the scanner (every point in space that is seen by all source positions) because you know this is the only area of space where your reconstruction is going to be accurate. rtkfieldofview generates this FOV. Simon On Thu, May 12, 2016 at 6:12 AM, AMJAD N wrote: > Hello users, > > I have successfully implemented CBCT reconstruction using both CUDA and > CPU method. For finding the reconstruction volume size, I measured the > actual object size. divided by respective axis number of pixels to get > spacing. > > eg: If my object is 10x15x20 cm. I measure that dimensions. If the > required volume is 500x600x700 px, to get spacing i used > 10/500,15/600,20/700. > > But this is not practically possible for every object. Is there any way to > find the reconstruction volume spacing other than doing the above method. > > I have SDD(Source Detector Distance), SID(Source Isocenter Distance), > Detector physical size,pixel density. > > Thanks and Regards > > AMJAD N > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Fri May 13 04:30:33 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Fri, 13 May 2016 14:00:33 +0530 Subject: [Rtk-users] Object isocenter shift Message-ID: Hello users, During acquisition it is found that my object isocenter is shifted from turntable isocenter by DX and DY values. Source , turntable isocenter and detector center is aligned perfectly. Is there any method in RTK we can make use of to nullify the effect due to this isocenter shift? Thanks and Regards AMJAD -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 13 08:36:48 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 13 May 2016 14:36:48 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: Hi, I don't understand the question. The isocenter is by definition the center of rotation in RTK and we assume it's at the origin of the reconstructed volume. There is no such thing as an "object isocenter". DX and DY values are the shift of the projection origin (which can be anywhere) with respect to the central ray (source to isocenter ray). It is not the turntable isocenter. If you want to have dx=0 and dy=0, the projection origin must be changed. But it has to be constant for the whole projection stack. I hope it helps, Simon On Fri, May 13, 2016 at 10:30 AM, AMJAD N wrote: > Hello users, > During acquisition it is found that my object isocenter is shifted from > turntable isocenter by DX and DY values. Source , turntable isocenter and > detector center is aligned perfectly. Is there any method in RTK we can > make use of to nullify the effect due to this isocenter shift? > > Thanks and Regards > AMJAD > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Fri May 13 11:35:57 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Fri, 13 May 2016 17:35:57 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> Message-ID: <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 13 12:15:09 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 13 May 2016 18:15:09 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Message-ID: Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein wrote: > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Sat May 14 05:48:01 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Sat, 14 May 2016 11:48:01 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> Message-ID: <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Hello Simon, Thanks for your advice so far. I?m getting to know this filter better. At least I can now use it and save the result into a file. I updated my code which now uses a volume. The values of the input and output volume are equal except of the z-dimension of the output which I changed to the number of projection images. const unsigned int Dimension = 3; ?Reading image? ImageType::Pointer inputImage = reader->GetOutput(); ImageType::Pointer outputImage = ImageType::New(); RegionType inputRegion = inputImage->GetLargestPossibleRegion(); const unsigned int NumberOfProjectionImages = 45; ImageType::IndexType start; start[0] = inputRegion.GetIndex()[0]; start[1] = inputRegion.GetIndex()[1]; start[2] = inputRegion.GetIndex()[2]; RegionType::SizeType size; size[0] = inputRegion.GetSize()[0]; size[1] = inputRegion.GetSize()[1]; size[2] = NumberOfProjectionImages; RegionType region; region.SetSize(size); region.SetIndex(start); ImageType::SpacingType spacing; spacing[0] = inputImage->GetSpacing()[0]; spacing[1] = inputImage->GetSpacing()[1]; spacing[2] = inputImage->GetSpacing()[2]; ImageType::PointType origin; origin[0] = inputImage->GetOrigin()[0]; origin[1] = inputImage->GetOrigin()[1]; origin[2] = inputImage->GetOrigin()[2]; outputImage->SetRegions(region); outputImage->SetSpacing(spacing); outputImage->SetOrigin(origin); outputImage->Allocate(); outputImage->FillBuffer(size[0] * size[1] * size[2]); // Geometry typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(510., 510., i*8.); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->SetGeometry(geometry); forward->Update(); I?m not sure how I have to add projection for the geometry to get a result which I?m familiar with. Can you describe how do I have to interpret the result of the Joseph-Filter? I am familiar with sinograms and how they are computed, but one sinogram is created by the projections of one image slice as far as I understood it. What I want is to manipulate the image in the radon space and then perform a filtered back projection. Typically the articles describe techniques to reduce metal artifacts by using one 2D Slice. Is it possible to achieve something like that with the JosephFilter? I?m guessing since this filter won?t work well for 2D I have to use another filter. Can you give me a hint if I can do something like that with RTK or another ITK-based framework? Here a diagram which shows an example what I want to try. I tried also to use my code with one slice and added a zero padding like that: typedef itk::ConstantPadImageFilter ConstantPadImageFilterType; ConstantPadImageFilterType::Pointer padFilter = ConstantPadImageFilterType::New(); padFilter->SetInput(inputImage); ImageType::SizeType extendRegion; extendRegion[0] = 0; extendRegion[1] = 0; extendRegion[2] = 0; padFilter->SetPadLowerBound(extendRegion); padFilter->SetPadUpperBound(extendRegion); padFilter->SetConstant(1); padFilter->Update(); But the result of my png is a black square. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Freitag, 13. Mai 2016 18:15 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto: simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein < tstein at stud.hs-heilbronn.de> Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Sat May 14 06:17:18 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sat, 14 May 2016 12:17:18 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Message-ID: The output of the Joseph filter (of any forward projector) is a stack of projection images, i.e., a 3D image. If you slice this 3D image in the z direction, you get one projection images. If you slice this 3D image in the y direction, you get a sinogram, e.g., the 2D sinogram of the central slice (plane of the source trajectory) if y=0. The best way to have this sinogram is to set size[1]=1 and there is no better way to do it in RTK. For zero-padding, you need to set extendRegion[?]=1, with (for all dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that your image is a black square, something else must be going on. One thing to remember, the typical RTK rotation is around the y axis so your 3D slice must be 1 in the y direction. A simple way to change the orientation of one slice is to change its direction with ChangeImageFilter Simon On Sat, May 14, 2016 at 11:48 AM, Tobias Stein wrote: > Hello Simon, > > > > Thanks for your advice so far. I?m getting to know this filter better. At > least I can now use it and save the result into a file. > > > > I updated my code which now uses a volume. > > The values of the input and output volume are equal except of the > z-dimension of the output which I changed to the number of projection > images. > > const unsigned int Dimension = 3; > > ?Reading image? > > ImageType::Pointer inputImage = reader->GetOutput(); > > ImageType::Pointer outputImage = ImageType::New(); > > > > RegionType inputRegion = inputImage->GetLargestPossibleRegion(); > > > > const unsigned int NumberOfProjectionImages = 45; > > > > ImageType::IndexType start; > > start[0] = inputRegion.GetIndex()[0]; > > start[1] = inputRegion.GetIndex()[1]; > > start[2] = inputRegion.GetIndex()[2]; > > > > RegionType::SizeType size; > > size[0] = inputRegion.GetSize()[0]; > > size[1] = inputRegion.GetSize()[1]; > > size[2] = NumberOfProjectionImages; > > > > RegionType region; > > region.SetSize(size); > > region.SetIndex(start); > > > > ImageType::SpacingType spacing; > > spacing[0] = inputImage->GetSpacing()[0]; > > spacing[1] = inputImage->GetSpacing()[1]; > > spacing[2] = inputImage->GetSpacing()[2]; > > > > ImageType::PointType origin; > > origin[0] = inputImage->GetOrigin()[0]; > > origin[1] = inputImage->GetOrigin()[1]; > > origin[2] = inputImage->GetOrigin()[2]; > > > > outputImage->SetRegions(region); > > outputImage->SetSpacing(spacing); > > outputImage->SetOrigin(origin); > > outputImage->Allocate(); > > outputImage->FillBuffer(size[0] * size[1] * size[2]); > > > > // Geometry > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(510., 510., i*8.); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->SetGeometry(geometry); > > forward->Update(); > > > > I?m not sure how I have to add projection for the geometry to get a result > which I?m familiar with. > > > > Can you describe how do I have to interpret the result of the > Joseph-Filter? I am familiar with sinograms and how they are computed, but > one sinogram is created by the projections of one image slice as far as I > understood it. What I want is to manipulate the image in the radon space > and then perform a filtered back projection. Typically the articles > describe techniques to reduce metal artifacts by using one 2D Slice. Is it > possible to achieve something like that with the JosephFilter? I?m guessing > since this filter won?t work well for 2D I have to use another filter. Can > you give me a hint if I can do something like that with RTK or another > ITK-based framework? Here a diagram > which shows an example what I want to try. > > > > I tried also to use my code with one slice and added a zero padding like > that: > > typedef itk::ConstantPadImageFilter > ConstantPadImageFilterType; > > ConstantPadImageFilterType::Pointer padFilter = > ConstantPadImageFilterType::New(); > > padFilter->SetInput(inputImage); > > > > ImageType::SizeType extendRegion; > > extendRegion[0] = 0; > > extendRegion[1] = 0; > > extendRegion[2] = 0; > > > > padFilter->SetPadLowerBound(extendRegion); > > padFilter->SetPadUpperBound(extendRegion); > > padFilter->SetConstant(1); > > padFilter->Update(); > > But the result of my png is a black square. > > Tobias > > > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Freitag, 13. Mai 2016 18:15 > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > If you intialize the data of your itk::Image with FillBuffer with the > corresponding constant value, it is quite similar. The constant image value > allow us to stream the computation whereas you have to allocate the whole > image if you pass directly itk::Image. > > We only work in 3D and probably our projector don't work with 2D, that is > probably the problem here. You would have to correct the code for 2D but > that's a lot of work, we generally prefer pseudo 2D, see next point. > > I doubt that our forward projector will work well with one slice only if > you use 3D, we assume that the volume starts at the first pixel and ends at > the last pixel. You should probably add a zero border around with > itk::PadImage to see something. > > To avoid aliasing, you can cut frequencies in the ramp filter (look for > CutFrequency in the doxygen of rtk::FFTRampImageFilter). > > Simon > > > > On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: > > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Sat May 14 06:18:57 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sat, 14 May 2016 12:18:57 +0200 Subject: [Rtk-users] RTK training - June 17 2016 Message-ID: Dear all, The training on June 17 in Lyon is confirmed. Please register asap if you'd like to attend. Looking forward to meeting our users, Simon On Thu, Mar 10, 2016 at 11:02 AM, Simon Rit wrote: > Dear all, > The new date for the RTK training is Friday June 17. > I'm looking forward to meeting you there, > Simon > > On Sun, Mar 6, 2016 at 12:57 PM, Simon Rit > wrote: > >> Dear all, >> We have to fix another date for the RTK training due to a conflicting >> meeting. If you are interested, please fill in the foodle >> so that >> we fix a date that suits everyone. If none of these dates works for you, >> please let me know and we'll try to extend the foodle. >> Please answer before Tuesday, we'll fix the date on Tuesday evening. >> Thanks for your cooperation and apologies for the mess, >> Simon >> >> On Tue, Feb 9, 2016 at 11:49 AM, Simon Rit < >> simon.rit at creatis.insa-lyon.fr> wrote: >> >>> Dear RTK users, >>> We will organize a new training >>> session on June 22 2016 in >>> Lyon. Follow the instructions on the webpage >>> to register. The training is >>> for both users and developers. We are happy to answer any question that you >>> might have and we are looking forward to this new training session. >>> Simon >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tstein at stud.hs-heilbronn.de Sun May 15 08:38:40 2016 From: tstein at stud.hs-heilbronn.de (Tobias Stein) Date: Sun, 15 May 2016 14:38:40 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> Message-ID: <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> If I understood you correct, the input of the Joseph-Filter needs to be oriented in the y-direction when I am dealing with axial oriented slices. Now I changed the direction of the 3D Slice by rotating it 90 degrees around the x-axis with the itk::ChangeInformationImageFilter to have my slice in the xz-layer in the y-direction: double rotationX = 90; itk::Versor< double > rotation; const double angleInRadians = rotationX * vnl_math::pi / 180.0; rotation.SetRotationAroundX(angleInRadians); const ImageType::DirectionType direction = inputImage->GetDirection(); const ImageType::DirectionType newDirection = direction * rotation.GetMatrix(); changeFilter->SetOutputDirection(newDirection); changeFilter->ChangeAll(); changeFilter->SetInput(inputImage); changeFilter->UpdateOutputInformation(); Then I added a zero-border as you told me (This changed the size of my region from [512, 512, 1] to [514, 514, 3]). While executing the Joseph Filter I got an error because a vector subscript was out of range. Maybe that?s because the index of the region is [-1,-1,-1] caused by the padding. I tried the padding after the Joseph Filter, and got a result which has a size [514, 3, 45], while 45 was the number of projection images but the image was still empty. I also tried the Jospeh Filter with a real 3D volume stack of slices, rotated it as described below and got a result. Now I am confused how I should create the geometry of the Joseph Filter to get a good result. typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(300., 500., i * 180 / NumberOfProjectionImages); I am trying to use a 180-degree rotation, but i don?t have the feeling for the distance values. I this code example I used an 3D Image with dimensions = [256, 256, 49] My idea was, since there is no way to get a result with a single 3D slice, I would use a stack of slices as input and slice the output volume in y-direction to get my sinogram as you said. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Samstag, 14. Mai 2016 12:17 An: Tobias Stein Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK The output of the Joseph filter (of any forward projector) is a stack of projection images, i.e., a 3D image. If you slice this 3D image in the z direction, you get one projection images. If you slice this 3D image in the y direction, you get a sinogram, e.g., the 2D sinogram of the central slice (plane of the source trajectory) if y=0. The best way to have this sinogram is to set size[1]=1 and there is no better way to do it in RTK. For zero-padding, you need to set extendRegion[?]=1, with (for all dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that your image is a black square, something else must be going on. One thing to remember, the typical RTK rotation is around the y axis so your 3D slice must be 1 in the y direction. A simple way to change the orientation of one slice is to change its direction with ChangeImageFilter Simon On Sat, May 14, 2016 at 11:48 AM, Tobias Stein > wrote: Hello Simon, Thanks for your advice so far. I?m getting to know this filter better. At least I can now use it and save the result into a file. I updated my code which now uses a volume. The values of the input and output volume are equal except of the z-dimension of the output which I changed to the number of projection images. const unsigned int Dimension = 3; ?Reading image? ImageType::Pointer inputImage = reader->GetOutput(); ImageType::Pointer outputImage = ImageType::New(); RegionType inputRegion = inputImage->GetLargestPossibleRegion(); const unsigned int NumberOfProjectionImages = 45; ImageType::IndexType start; start[0] = inputRegion.GetIndex()[0]; start[1] = inputRegion.GetIndex()[1]; start[2] = inputRegion.GetIndex()[2]; RegionType::SizeType size; size[0] = inputRegion.GetSize()[0]; size[1] = inputRegion.GetSize()[1]; size[2] = NumberOfProjectionImages; RegionType region; region.SetSize(size); region.SetIndex(start); ImageType::SpacingType spacing; spacing[0] = inputImage->GetSpacing()[0]; spacing[1] = inputImage->GetSpacing()[1]; spacing[2] = inputImage->GetSpacing()[2]; ImageType::PointType origin; origin[0] = inputImage->GetOrigin()[0]; origin[1] = inputImage->GetOrigin()[1]; origin[2] = inputImage->GetOrigin()[2]; outputImage->SetRegions(region); outputImage->SetSpacing(spacing); outputImage->SetOrigin(origin); outputImage->Allocate(); outputImage->FillBuffer(size[0] * size[1] * size[2]); // Geometry typedef rtk::ThreeDCircularProjectionGeometry GeometryType; GeometryType::Pointer geometry = GeometryType::New(); for (unsigned int i = 0; i < NumberOfProjectionImages; i++) geometry->AddProjection(510., 510., i*8.); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->SetGeometry(geometry); forward->Update(); I?m not sure how I have to add projection for the geometry to get a result which I?m familiar with. Can you describe how do I have to interpret the result of the Joseph-Filter? I am familiar with sinograms and how they are computed, but one sinogram is created by the projections of one image slice as far as I understood it. What I want is to manipulate the image in the radon space and then perform a filtered back projection. Typically the articles describe techniques to reduce metal artifacts by using one 2D Slice. Is it possible to achieve something like that with the JosephFilter? I?m guessing since this filter won?t work well for 2D I have to use another filter. Can you give me a hint if I can do something like that with RTK or another ITK-based framework? Here a diagram which shows an example what I want to try. I tried also to use my code with one slice and added a zero padding like that: typedef itk::ConstantPadImageFilter ConstantPadImageFilterType; ConstantPadImageFilterType::Pointer padFilter = ConstantPadImageFilterType::New(); padFilter->SetInput(inputImage); ImageType::SizeType extendRegion; extendRegion[0] = 0; extendRegion[1] = 0; extendRegion[2] = 0; padFilter->SetPadLowerBound(extendRegion); padFilter->SetPadUpperBound(extendRegion); padFilter->SetConstant(1); padFilter->Update(); But the result of my png is a black square. Tobias Von: simon.rit at gmail.com [mailto:simon.rit at gmail.com ] Im Auftrag von Simon Rit Gesendet: Freitag, 13. Mai 2016 18:15 An: Tobias Stein > Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, If you intialize the data of your itk::Image with FillBuffer with the corresponding constant value, it is quite similar. The constant image value allow us to stream the computation whereas you have to allocate the whole image if you pass directly itk::Image. We only work in 3D and probably our projector don't work with 2D, that is probably the problem here. You would have to correct the code for 2D but that's a lot of work, we generally prefer pseudo 2D, see next point. I doubt that our forward projector will work well with one slice only if you use 3D, we assume that the volume starts at the first pixel and ends at the last pixel. You should probably add a zero border around with itk::PadImage to see something. To avoid aliasing, you can cut frequencies in the ramp filter (look for CutFrequency in the doxygen of rtk::FFTRampImageFilter). Simon On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: Thanks for the information. To keep it simple I want to project forward a single slice which I load as a DICOM file. Now I want to compute the sinogram of that slice and write it in a new file. I got a little confused about the ConstantImageSource which is used in the test class. Do I need it to compute a sinogram or is just a replacement of a itk::Image? Here is my code so far: const unsigned int Dimension = 2; typedef float PixelType; typedef itk::Image< PixelType, Dimension > ImageType; ? (reading image by itk::ImageFileReader which works) ? ImageType::Pointer inputImage = reader->GetOutput(); const unsigned int NumberOfProjectionImages = 1; ImageType::Pointer outputImage = ImageType::New(); typedef rtk::JosephForwardProjectionImageFilter ForwardType; ForwardType::Pointer forward = ForwardType::New(); forward->SetInput(1, inputImage); forward->SetInput(0, outputImage); forward->Update(); ? (writing output image into a file) ? The problem is that I get some errors when I instantiate the forward-Filter. The errors are like that one: error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" konnte nicht von "vnl_matrix_fixed" hergeleitet werden. Maybe there is something wrong with the PixelType that i used? If the forward projection works, which filter should i use to achieve a filtered back projection without aliasing? Many thanks in advance. Tobias Von: simon.rit at gmail.com [mailto: simon.rit at gmail.com] Im Auftrag von Simon Rit Gesendet: Mittwoch, 4. Mai 2016 09:02 An: Tobias Stein < tstein at stud.hs-heilbronn.de> Cc: rtk-users at public.kitware.com Betreff: Re: [Rtk-users] forward and back projection - MITK Dear Tobias, The forward projection has 2 inputs: - input 0: the stack of projections in which you wish to forward project, - input 1: the volume you wish to forward project. For the backprojection, it's exactly the same: - input 0: the volume in which you wish to backproject, - input 1: the stack of projections you wish to backproject. Be aware that JosephBackProjectionImageFilter is the transpose of the forward projection and will have some aliasing (see, e.g., De Man and Basu to see what I mean). I have personally never used MITK but don't hesitate to share your experience on the mailing list. Simon On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: Hi all, i want to use the forward and backward projection to reduce metal artefacts in ct images. I?ve seen so far that I may use the JosephForwardProjectionImageFilter to perform the forward projection. I?ve also seen the test for this class but I don?t get it, where should i put my 2D slice as input to execute the transformation. About the back transformation with the JosephBackProjectionImageFilter I also need more information how I can use it to transform a sinogram back to a ct slice. There is a test at the documentation, but the link is missing there. I?ve got another independent question. Are some of you familiar with MITK and know how to get the superbuild up and running with RTK? I am writing a MITK-Plugin and want to reduce the metal artifacts before a segmentation. So if some of you have experience with the combination of RTK and MITK it would be nice if you will share it ;) Best regards, Tobias _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 16 05:50:41 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 16 May 2016 11:50:41 +0200 Subject: [Rtk-users] forward and back projection - MITK In-Reply-To: <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> References: <006201d1a58f$63c18bb0$2b44a310$@stud.hs-heilbronn.de> <002c01d1ad2d$2612b9b0$72382d10$@stud.hs-heilbronn.de> <001801d1adc5$b504d390$1f0e7ab0$@stud.hs-heilbronn.de> <009001d1aea6$b5bfdff0$213f9fd0$@stud.hs-heilbronn.de> Message-ID: Answers below. I think you need to understand better the coordinate system of an ITK image, maybe check ITK's doc. Simon On Sun, May 15, 2016 at 2:38 PM, Tobias Stein wrote: > If I understood you correct, the input of the Joseph-Filter needs to be > oriented in the y-direction when I am dealing with axial oriented slices. > Yes, or in other words, if you want to take projections around the axial axis, be aware that y is the default axis of rotation in RTK. > Now I changed the direction of the 3D Slice by rotating it 90 degrees > around the x-axis with the itk::ChangeInformationImageFilter to have my > slice in the xz-layer in the y-direction: > > double rotationX = 90; > > itk::Versor< double > rotation; > > const double angleInRadians = rotationX * vnl_math::pi / 180.0; > > rotation.SetRotationAroundX(angleInRadians); > > const ImageType::DirectionType direction = > inputImage->GetDirection(); > > const ImageType::DirectionType newDirection = direction * > rotation.GetMatrix(); > > changeFilter->SetOutputDirection(newDirection); > > changeFilter->ChangeAll(); > > changeFilter->SetInput(inputImage); > > changeFilter->UpdateOutputInformation(); > > > > Then I added a zero-border as you told me (This changed the size of my > region from [512, 512, 1] to [514, 514, 3]). > > While executing the Joseph Filter I got an error because a vector > subscript was out of range. Maybe that?s because the index of the region is > [-1,-1,-1] caused by the padding. > That should not have been a problem but that might be a bug... > I tried the padding after the Joseph Filter, and got a result which has a > size [514, 3, 45], while 45 was the number of projection images but the > image was still empty. > I guess you should check the origin of your projected volume and your projections. A simple test is to center your volume (check using ITK doc how you can define the origin so that (0,0,0) is at the center) and your projection (for the projection stack, only the first 2 coordinates count). > > > I also tried the Jospeh Filter with a real 3D volume stack of slices, > rotated it as described below and got a result. > > Now I am confused how I should create the geometry of the Joseph Filter to > get a good result. > > > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(300., 500., i * 180 / > NumberOfProjectionImages); > > > > I am trying to use a 180-degree rotation, but i don?t have the feeling for > the distance values. > > I this code example I used an 3D Image with dimensions = [256, 256, 49] > This doesn't tell you anything about the size of your volume, we also need the origin and the spacing. Look at the ITK doc to understand the ITK coordinate systems. > > > My idea was, since there is no way to get a result with a single 3D slice, > I would use a stack of slices as input and slice the output volume in > y-direction to get my sinogram as you said. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Samstag, 14. Mai 2016 12:17 > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > The output of the Joseph filter (of any forward projector) is a stack of > projection images, i.e., a 3D image. If you slice this 3D image in the z > direction, you get one projection images. If you slice this 3D image in the > y direction, you get a sinogram, e.g., the 2D sinogram of the central slice > (plane of the source trajectory) if y=0. The best way to have this sinogram > is to set size[1]=1 and there is no better way to do it in RTK. > > For zero-padding, you need to set extendRegion[?]=1, with (for all > dimensions, i.e., ?=0,1,2) and SetConstant(0). I'm surprised though that > your image is a black square, something else must be going on. One thing to > remember, the typical RTK rotation is around the y axis so your 3D slice > must be 1 in the y direction. A simple way to change the orientation of one > slice is to change its direction with ChangeImageFilter > > Simon > > > > > > On Sat, May 14, 2016 at 11:48 AM, Tobias Stein < > tstein at stud.hs-heilbronn.de> wrote: > > Hello Simon, > > > > Thanks for your advice so far. I?m getting to know this filter better. At > least I can now use it and save the result into a file. > > > > I updated my code which now uses a volume. > > The values of the input and output volume are equal except of the > z-dimension of the output which I changed to the number of projection > images. > > const unsigned int Dimension = 3; > > ?Reading image? > > ImageType::Pointer inputImage = reader->GetOutput(); > > ImageType::Pointer outputImage = ImageType::New(); > > > > RegionType inputRegion = inputImage->GetLargestPossibleRegion(); > > > > const unsigned int NumberOfProjectionImages = 45; > > > > ImageType::IndexType start; > > start[0] = inputRegion.GetIndex()[0]; > > start[1] = inputRegion.GetIndex()[1]; > > start[2] = inputRegion.GetIndex()[2]; > > > > RegionType::SizeType size; > > size[0] = inputRegion.GetSize()[0]; > > size[1] = inputRegion.GetSize()[1]; > > size[2] = NumberOfProjectionImages; > > > > RegionType region; > > region.SetSize(size); > > region.SetIndex(start); > > > > ImageType::SpacingType spacing; > > spacing[0] = inputImage->GetSpacing()[0]; > > spacing[1] = inputImage->GetSpacing()[1]; > > spacing[2] = inputImage->GetSpacing()[2]; > > > > ImageType::PointType origin; > > origin[0] = inputImage->GetOrigin()[0]; > > origin[1] = inputImage->GetOrigin()[1]; > > origin[2] = inputImage->GetOrigin()[2]; > > > > outputImage->SetRegions(region); > > outputImage->SetSpacing(spacing); > > outputImage->SetOrigin(origin); > > outputImage->Allocate(); > > outputImage->FillBuffer(size[0] * size[1] * size[2]); > > > > // Geometry > > typedef rtk::ThreeDCircularProjectionGeometry GeometryType; > > GeometryType::Pointer geometry = GeometryType::New(); > > for (unsigned int i = 0; i < NumberOfProjectionImages; i++) > > geometry->AddProjection(510., 510., i*8.); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->SetGeometry(geometry); > > forward->Update(); > > > > I?m not sure how I have to add projection for the geometry to get a result > which I?m familiar with. > > > > Can you describe how do I have to interpret the result of the > Joseph-Filter? I am familiar with sinograms and how they are computed, but > one sinogram is created by the projections of one image slice as far as I > understood it. What I want is to manipulate the image in the radon space > and then perform a filtered back projection. Typically the articles > describe techniques to reduce metal artifacts by using one 2D Slice. Is it > possible to achieve something like that with the JosephFilter? I?m guessing > since this filter won?t work well for 2D I have to use another filter. Can > you give me a hint if I can do something like that with RTK or another > ITK-based framework? Here a diagram > which shows an example what I want to try. > > > > I tried also to use my code with one slice and added a zero padding like > that: > > typedef itk::ConstantPadImageFilter > ConstantPadImageFilterType; > > ConstantPadImageFilterType::Pointer padFilter = > ConstantPadImageFilterType::New(); > > padFilter->SetInput(inputImage); > > > > ImageType::SizeType extendRegion; > > extendRegion[0] = 0; > > extendRegion[1] = 0; > > extendRegion[2] = 0; > > > > padFilter->SetPadLowerBound(extendRegion); > > padFilter->SetPadUpperBound(extendRegion); > > padFilter->SetConstant(1); > > padFilter->Update(); > > But the result of my png is a black square. > > Tobias > > > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Freitag, 13. Mai 2016 18:15 > > > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > If you intialize the data of your itk::Image with FillBuffer with the > corresponding constant value, it is quite similar. The constant image value > allow us to stream the computation whereas you have to allocate the whole > image if you pass directly itk::Image. > > We only work in 3D and probably our projector don't work with 2D, that is > probably the problem here. You would have to correct the code for 2D but > that's a lot of work, we generally prefer pseudo 2D, see next point. > > I doubt that our forward projector will work well with one slice only if > you use 3D, we assume that the volume starts at the first pixel and ends at > the last pixel. You should probably add a zero border around with > itk::PadImage to see something. > > To avoid aliasing, you can cut frequencies in the ramp filter (look for > CutFrequency in the doxygen of rtk::FFTRampImageFilter). > > Simon > > > > On Fri, May 13, 2016 at 5:35 PM, Tobias Stein > wrote: > > Thanks for the information. > > > > To keep it simple I want to project forward a single slice which I load as > a DICOM file. > > Now I want to compute the sinogram of that slice and write it in a new > file. > > I got a little confused about the ConstantImageSource which is used in the > test class. Do I need it to compute a sinogram or is just a replacement of > a itk::Image? > > > > Here is my code so far: > > > > const unsigned int Dimension = 2; > > typedef float PixelType; > > typedef itk::Image< PixelType, Dimension > ImageType; > > ? > > (reading image by itk::ImageFileReader which works) > > ? > > ImageType::Pointer inputImage = reader->GetOutput(); > > > > const unsigned int NumberOfProjectionImages = 1; > > > > ImageType::Pointer outputImage = ImageType::New(); > > > > typedef rtk::JosephForwardProjectionImageFilter ImageType> ForwardType; > > ForwardType::Pointer forward = ForwardType::New(); > > forward->SetInput(1, inputImage); > > forward->SetInput(0, outputImage); > > forward->Update(); > > > > ? > > (writing output image into a file) > > ? > > > > The problem is that I get some errors when I instantiate the > forward-Filter. > > The errors are like that one: > > error C2784: "vnl_matrix operator *(const vnl_diag_matrix &,const > vnl_matrix &)": template-Argument f?r "const vnl_diag_matrix &" > konnte nicht von "vnl_matrix_fixed" hergeleitet werden. > > > > Maybe there is something wrong with the PixelType that i used? > > > > If the forward projection works, which filter should i use to achieve a > filtered back projection without aliasing? > > > > Many thanks in advance. > > Tobias > > > > *Von:* simon.rit at gmail.com [mailto:simon.rit at gmail.com] *Im Auftrag von *Simon > Rit > *Gesendet:* Mittwoch, 4. Mai 2016 09:02 > *An:* Tobias Stein > *Cc:* rtk-users at public.kitware.com > *Betreff:* Re: [Rtk-users] forward and back projection - MITK > > > > Dear Tobias, > > The forward projection has 2 inputs: > > - input 0: the stack of projections in which you wish to forward project, > > - input 1: the volume you wish to forward project. > > For the backprojection, it's exactly the same: > > - input 0: the volume in which you wish to backproject, > > - input 1: the stack of projections you wish to backproject. > > Be aware that JosephBackProjectionImageFilter is the transpose of the > forward projection and will have some aliasing (see, e.g., De Man and Basu > > to see what I mean). > > I have personally never used MITK but don't hesitate to share your > experience on the mailing list. > > Simon > > > > On Wed, May 4, 2016 at 12:59 AM, Tobias Stein > wrote: > > Hi all, > > > > i want to use the forward and backward projection to reduce metal > artefacts in ct images. I?ve seen so far that I may use the > JosephForwardProjectionImageFilter to perform the forward projection. I?ve > also seen the test for this class but I don?t get it, where should i put my > 2D slice as input to execute the transformation. About the back > transformation with the JosephBackProjectionImageFilter I also need more > information how I can use it to transform a sinogram back to a ct slice. > There is a test at the documentation, but the link is missing there. > > > > I?ve got another independent question. > > Are some of you familiar with MITK and know how to get the superbuild up > and running with RTK? I am writing a MITK-Plugin and want to reduce the > metal artifacts before a segmentation. So if some of you have experience > with the combination of RTK and MITK it would be nice if you will share it > ;) > > > > Best regards, > > Tobias > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amjad.n.cet at gmail.com Tue May 17 07:07:20 2016 From: amjad.n.cet at gmail.com (AMJAD N) Date: Tue, 17 May 2016 16:37:20 +0530 Subject: [Rtk-users] Object isocenter shift Message-ID: Hello, As my previous thread caused some confusion, I am attaching an image showing the same in detail. As you can see my object center is not aligned with isocenter line. Besides it is offset by DX and DY values. In my case you can see the object center as red dot. Is there any method in RTK to nullify this offset effect? Will the rotation of turntable affect the reconstruction due to this offset? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: objectoffset.png Type: image/png Size: 12365 bytes Desc: not available URL: From cyril.mory at uclouvain.be Tue May 17 08:19:38 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Tue, 17 May 2016 14:19:38 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: <573B0C5A.4030001@uclouvain.be> Well, if it's just that, you should not worry about it : you cannot perfectly center your object, even if you try. And most objects (e.g. patients) do not even have a "center". So it does not make sense to struggle to have the center of the object perfectly match the isocenter of the acquisition device. You can either live with that (it is perfectly fine for most applications), or try one of these things: - If you can re-do the acquisition, you should try to have your object's center _roughly_ match the system's isocenter, because that's where you will have the least artifacts - Reconstruct your object as it is (it will work fine, unless there are other problems), but select the origin and size of your reconstructed volume carefully to have your object's center roughly at the center of your reconstructed volume. If you are not familiar with the exact definition of "origin", "spacing" and "size" of an itk::image, read section 4.1.4 of the ITK software guide (https://itk.org/ItkSoftwareGuide.pdf). This is both clear, short, and something extremely important to understand. I hope it helps, Cyril On 05/17/2016 01:07 PM, AMJAD N wrote: > Hello, > > As my previous thread caused some confusion, I am attaching an image > showing the same in detail. > > As you can see my object center is not aligned with isocenter line. > Besides it is offset by DX and DY values. In my case you can see the > object center as red dot. > > Is there any method in RTK to nullify this offset effect? > Will the rotation of turntable affect the reconstruction due to this > offset? > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From wuchao04 at gmail.com Tue May 17 09:24:58 2016 From: wuchao04 at gmail.com (Chao Wu) Date: Tue, 17 May 2016 15:24:58 +0200 Subject: [Rtk-users] Object isocenter shift In-Reply-To: References: Message-ID: There's nothing to correct or compensate for DURING reconstruction in your case. Where you put your object dose not change the geometry of the CT system at all. As long as the object is still inside FOV, a normal reconstruction will give you a correct result. In the resulting image, the origin is at the center of rotation, and the object is off-center by DX and DY, that's it. If you want the origin to be at the center of the object, you can shift it by DX/DY AFTER reconstruction. Regards, Chao 2016-05-17 13:07 GMT+02:00 AMJAD N : > Hello, > > As my previous thread caused some confusion, I am attaching an image > showing the same in detail. > > As you can see my object center is not aligned with isocenter line. > Besides it is offset by DX and DY values. In my case you can see the object > center as red dot. > > Is there any method in RTK to nullify this offset effect? > Will the rotation of turntable affect the reconstruction due to this > offset? > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shiraska at gmail.com Thu May 19 04:41:54 2016 From: shiraska at gmail.com (Shiras Abdurahman) Date: Thu, 19 May 2016 10:41:54 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction Message-ID: Dear all, I am trying to simulate Tomosynthesis reconstruction with stationary flat panel detector where source rotates around Y axis to acquire 21 projections (system geometry diagram is attached). Geometry file geometry.xml is generated with Reg23ProjectionGeometry. I generated projection images of a cube volume and then I tried to reconstruct with FDK algorithm. Even though I am able to generate projections, FDK reconstruction yields the volume with all voxel values zero. The commands I used for generating projections and reconstructing volume are rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 --dimension=256,256,256 --hardware=cuda I am also attaching geometry xml file, mhd header files of the original volume, projections and reconstructed volume. With regards, Shiras -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: geometry.xml Type: text/xml Size: 11889 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fdk.mhd Type: application/octet-stream Size: 322 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: projections.mhd Type: application/octet-stream Size: 335 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: volume.mhd Type: application/octet-stream Size: 355 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: system_geometry.PNG Type: image/png Size: 50006 bytes Desc: not available URL: From cyril.mory at uclouvain.be Fri May 20 04:38:22 2016 From: cyril.mory at uclouvain.be (Cyril Mory) Date: Fri, 20 May 2016 10:38:22 +0200 Subject: [Rtk-users] Compiler RTK In-Reply-To: <573E430F.5030704@uclouvain.be> References: <573E430F.5030704@uclouvain.be> Message-ID: <573ECCFE.3070500@uclouvain.be> Hi Kevin, I'm replying to the RTK users mailing list. Next time, please send your questions to this list instead of just me (except when it specifically involves reggui, for example). I have tried to reproduce the error but the compilation runs fine on my machine. Can you send information on your compiler ? Maybe someone else on the list can help ? Cyril On 05/20/2016 12:49 AM, Kevin Souris wrote: > Bonjour, > > Je viens de t?l?charger la derni?re version de RTK sur Github. > J'essaye maintenant de compiler sur une machine linux et j'obtiens > cette erreur: > > /home/pen/RTK/RTK-master/applications/rtkprojections/rtkprojections.cxx: > In function ?int main(int, char**)?: > /home/pen/RTK/RTK-master/applications/rtkprojections*/**rtkprojections.cxx:27: > error: invalid conversion from ?const char*? to ?char*?* > /home/pen/RTK/RTK-master/applications/rtkprojections/rtkprojections.cxx:27: > error: initializing argument 1 of ?int > cmdline_parser_rtkprojections_config_file(char*, > args_info_rtkprojections*, cmdline_parser_rtkprojections_params*)? > > Comment puis-je r?parer ?a ? > Merci > > Kevin > > > > > -- > Kevin Souris, PhD student > Universit? catholique de Louvain > Molecular Imagery, Radiotherapy and Oncology (MIRO) -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 25 15:45:57 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 25 May 2016 21:45:57 +0200 Subject: [Rtk-users] CUDA projections are blank In-Reply-To: References: Message-ID: Hi Solomon, I had still to look into this on my todo list. I did again but now I think I overlooked something in your email. You say that going through ChangeInformationImageFilter might be the problem. But now, I wonder if the problem is not that the origin that you set is wrong and then the volume or the projections are completely off (hence the projections). So, here is my question : what happens if you replace filter -> SetOutputOrigin(origin); with filter -> SetOutputOrigin(image->GetOutputOrigin()); Of course, it's not what you want to do but it might point to a wrong choice of origin... Simon On Fri, May 6, 2016 at 1:45 AM, Solomon Tang wrote: > Hi Simon, > > I added the line as you suggested and it does not change the output (still > blank). Sorry for the delayed response. > > Thanks for looking into it! > > On Wed, May 4, 2016 at 12:16 AM, Simon Rit > wrote: > >> Dear Solomon, >> Thanks for the report. It looks like a bug to me. I checked and >> itk::ChangeInformationImageFilter calls GetPixelContainer and, indeed, in >> the itkGPUImage and the itkCudaImage, this function does not check >> consistency between CPU and GPU data. I'll work on a minimal example to >> check this but can you test that your problem is solved if you add >> m_DataManager->UpdateCPUBuffer(); >> before >> m_DataManager->SetGPUBufferDirty(); >> in itkCudaImage.h line 121? >> Thanks, >> Simon >> >> On Mon, May 2, 2016 at 10:42 PM, Solomon Tang >> wrote: >> >>> Thanks for the tip Simon, >>> >>> I think I may have figured it out. I initially read as a CUDA Image, and >>> then passed the CUDA image through ChangeInformationImageFilter to change >>> the offset of the image. >>> >>> template >>> typename itk::CudaImage::Pointer ShiftOffset( >>> const typename itk::CudaImage::Pointer image, >>> const typename itk::Image::PointType origin) >>> { >>> typedef itk::ChangeInformationImageFilter< itk::CudaImage > >>> FilterType; >>> FilterType::Pointer filter = FilterType::New(); >>> filter -> SetInput(image); >>> filter -> SetOutputOrigin(origin); >>> filter -> ChangeOriginOn(); >>> filter -> UpdateOutputInformation(); >>> filter -> Update(); >>> return filter->GetOutput(); >>> } >>> >>> If I pass the offset image pointer to ForwardProjection, it outputs a >>> blank image. >>> >>> However, when I write the offset image and then read it again as a CUDA >>> image, then the ForwardProjection works as intended. Perhaps using the CUDA >>> version of ITK would fix this. >>> >>> >>> On Sat, Apr 30, 2016 at 12:08 AM, Simon Rit < >>> simon.rit at creatis.insa-lyon.fr> wrote: >>> >>>> Hi Solomon, >>>> Hard to say without the full code. Maybe the cudaness of your output >>>> image is lost further in the code. Try accessing the CPU buffer at the end, >>>> after the update, to be sure that the GPU image is transferred to CPU, e.g. >>>> std::cout << forwardProjection->GetOutput()->GetPointer() <>>> Simon >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 26 12:04:47 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 26 May 2016 18:04:47 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Hi Shiras, I generated a volume to look at your problem: rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 --offset 0,0,1.7 Then I obtained the same issue as you. I think the problem is that rtkfdk is meant for circular CBCT and it includes pre-weighting for displaced detector and short scan. I'm not sure why you don't get a warning but these are probably responsible for the blank output. A simple solution is to do only the 3 FDK steps using in order the command tools: rtktwodweights rtkramp rtkbackprojections You can also try to shunt the preweighting by modifying rtkfdk.cxx. It's interesting that you try out tomosynthesis but you'll encounter some problem. When I ran the above commands, I get very weird results because the first and the last projections get a lot more weight than the others since it looks at the angular weight with the previous and the next projections. A simple solution is to blank out these two projections. Good luck and keep us posted if you get interesting results, Simon On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman wrote: > Dear all, > > I am trying to simulate Tomosynthesis reconstruction with stationary flat > panel detector where source rotates around Y axis to acquire 21 projections > (system geometry diagram is attached). Geometry file geometry.xml is > generated with Reg23ProjectionGeometry. I generated projection images of > a cube volume and then I tried to reconstruct with FDK algorithm. Even > though I am able to generate projections, FDK reconstruction yields the > volume with all voxel values zero. The commands I used for generating > projections and reconstructing volume are > > rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd > --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast > rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml > --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 > --dimension=256,256,256 --hardware=cuda > > I am also attaching geometry xml file, mhd header files of the original > volume, projections and reconstructed volume. > > With regards, > Shiras > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > http://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shiraska at gmail.com Fri May 27 11:31:52 2016 From: shiraska at gmail.com (Shiras Abdurahman) Date: Fri, 27 May 2016 17:31:52 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Dear Simon, Thank you very much for the reply. I tried to reconstruct with only ramp filtering and back projection and the results are looking good without any weighting of the projections. I also reconstructed the volume with rtksart with 10 iterations and the results are better than rtkfdk. With these experiments, I also confirmed that my geometry file is accurate. Thank you very much for your help. With regards, Shiras On Thu, May 26, 2016 at 6:04 PM, Simon Rit wrote: > Hi Shiras, > I generated a volume to look at your problem: > rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 > --offset 0,0,1.7 > Then I obtained the same issue as you. I think the problem is that rtkfdk > is meant for circular CBCT and it includes pre-weighting for displaced > detector and short scan. I'm not sure why you don't get a warning but these > are probably responsible for the blank output. A simple solution is to do > only the 3 FDK steps using in order the command tools: > rtktwodweights > rtkramp > rtkbackprojections > You can also try to shunt the preweighting by modifying rtkfdk.cxx. > > It's interesting that you try out tomosynthesis but you'll encounter some > problem. When I ran the above commands, I get very weird results because > the first and the last projections get a lot more weight than the others > since it looks at the angular weight with the previous and the next > projections. A simple solution is to blank out these two projections. > Good luck and keep us posted if you get interesting results, > Simon > > On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman > wrote: > >> Dear all, >> >> I am trying to simulate Tomosynthesis reconstruction with stationary flat >> panel detector where source rotates around Y axis to acquire 21 projections >> (system geometry diagram is attached). Geometry file geometry.xml is >> generated with Reg23ProjectionGeometry. I generated projection images of >> a cube volume and then I tried to reconstruct with FDK algorithm. Even >> though I am able to generate projections, FDK reconstruction yields the >> volume with all voxel values zero. The commands I used for generating >> projections and reconstructing volume are >> >> rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd >> --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast >> rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml >> --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 >> --dimension=256,256,256 --hardware=cuda >> >> I am also attaching geometry xml file, mhd header files of the original >> volume, projections and reconstructed volume. >> >> With regards, >> Shiras >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 27 12:00:56 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 27 May 2016 18:00:56 +0200 Subject: [Rtk-users] Tomosynthesis reconstruction In-Reply-To: References: Message-ID: Indeed, the angular weighting resulting from the discretization of the back projection occurs in rtkfdktwodweights so skipping this might help. Simon On 27 May 2016 5:32 p.m., "Shiras Abdurahman" wrote: Dear Simon, Thank you very much for the reply. I tried to reconstruct with only ramp filtering and back projection and the results are looking good without any weighting of the projections. I also reconstructed the volume with rtksart with 10 iterations and the results are better than rtkfdk. With these experiments, I also confirmed that my geometry file is accurate. Thank you very much for your help. With regards, Shiras On Thu, May 26, 2016 at 6:04 PM, Simon Rit wrote: > Hi Shiras, > I generated a volume to look at your problem: > rtkdrawshepploganphantom --like volume.mhd -o volume.mhd --phantomscale 32 > --offset 0,0,1.7 > Then I obtained the same issue as you. I think the problem is that rtkfdk > is meant for circular CBCT and it includes pre-weighting for displaced > detector and short scan. I'm not sure why you don't get a warning but these > are probably responsible for the blank output. A simple solution is to do > only the 3 FDK steps using in order the command tools: > rtktwodweights > rtkramp > rtkbackprojections > You can also try to shunt the preweighting by modifying rtkfdk.cxx. > > It's interesting that you try out tomosynthesis but you'll encounter some > problem. When I ran the above commands, I get very weird results because > the first and the last projections get a lot more weight than the others > since it looks at the angular weight with the previous and the next > projections. A simple solution is to blank out these two projections. > Good luck and keep us posted if you get interesting results, > Simon > > On Thu, May 19, 2016 at 10:41 AM, Shiras Abdurahman > wrote: > >> Dear all, >> >> I am trying to simulate Tomosynthesis reconstruction with stationary flat >> panel detector where source rotates around Y axis to acquire 21 projections >> (system geometry diagram is attached). Geometry file geometry.xml is >> generated with Reg23ProjectionGeometry. I generated projection images of >> a cube volume and then I tried to reconstruct with FDK algorithm. Even >> though I am able to generate projections, FDK reconstruction yields the >> volume with all voxel values zero. The commands I used for generating >> projections and reconstructing volume are >> >> rtkforwardprojections -g geometry.xml -o projections.mhd -i volume.mhd >> --spacing 0.1518,0.1518,1 --dimension 1420,1416,21 --fp=CudaRayCast >> rtkfdk -p . -r projections.mhd -o fdk.mhd -g geometry.xml >> --spacing=0.25,0.25,0.25 --origin=-31.875,-31.875,25 >> --dimension=256,256,256 --hardware=cuda >> >> I am also attaching geometry xml file, mhd header files of the original >> volume, projections and reconstructed volume. >> >> With regards, >> Shiras >> >> >> >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> http://public.kitware.com/mailman/listinfo/rtk-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 31 12:02:32 2016 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 31 May 2016 18:02:32 +0200 Subject: [Rtk-users] Rooster In-Reply-To: References: Message-ID: Hi Guillaume, I'm adding RTK user list to this conversation, it's better to have these conversations on the mailing list IMO. Can you tell us what's the volume size and the GPU? Cyril is ROOSTER's dev, maybe he could comment on recon times. Simon On Tue, May 31, 2016 at 5:29 PM, wrote: > Hi Simon, > > I tried the rooster recon. I used the parameters from the example page. The results looks rather nice but it took several hours to run (5-6). Its a big dataset of about 2000 256x256 projections. > > Guillaume From G.Landry at physik.uni-muenchen.de Tue May 31 13:48:28 2016 From: G.Landry at physik.uni-muenchen.de (G.Landry at physik.uni-muenchen.de) Date: Tue, 31 May 2016 19:48:28 +0200 Subject: [Rtk-users] Rooster In-Reply-To: References: Message-ID: <20160531194828.Horde.Im1irUOnkCrL1p8oGSue_A5@webmail.physik.lmu.de> Hi Simon, Thanks for mailing list suggestion. My initial question was about typical reconstruction times for rtkfourdrooster. What I tried is summarized below: -Volume size was 410 410 264 and could be easily reduced by a good margin. -The GPU is quadro M4000 with 8GB -about 2300 256x256 projections with shifted elekta panel (so called M20) -10 phases -for the motion mask at the moment I just used the FOV mask for first try. --gamma_time 0.0001 --gamma_space 0.0001 - spacing 1 1 1 --niter 30 --cgiter 4 --tviter 10 Recon time was about 5-6 hours. I saw about 4 Gb used on the card. The image looked nice, albeit with the TV "feel/plastic-y". Thanks for your feedback Guillaume Quoting Simon Rit : > Hi Guillaume, > I'm adding RTK user list to this conversation, it's better to have > these conversations on the mailing list IMO. Can you tell us what's > the volume size and the GPU? > Cyril is ROOSTER's dev, maybe he could comment on recon times. > Simon > > On Tue, May 31, 2016 at 5:29 PM, wrote: >> Hi Simon, >> >> I tried the rooster recon. I used the parameters from the example >> page. The results looks rather nice but it took several hours to >> run (5-6). Its a big dataset of about 2000 256x256 projections. >> >> Guillaume -- Dr. Guillaume Landry Ludwig Maximilians University (LMU) Munich Medical Physics Am Coulombwall 1 85748 Garching Tel:+49 (0) 89 289-14077 Fax:+49 (0) 89 289-14072