From simon.rit at creatis.insa-lyon.fr Tue Jan 5 04:21:57 2021 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 5 Jan 2021 10:21:57 +0100 Subject: [Rtk-users] FirstReconstruction questions In-Reply-To: References: Message-ID: Hi, I think the issue is that your projection images are given in the TIFF file format which does not contain important meta information such as the origin and the spacing of the projections. You should use ChangeInformationFilter to set these. I'm guessing that the origin is currently (0,0) and since you do not set any offsets when using AddProjection, it comes down to having the corner of your projection aligned with the central ray (line defined by the source and the center of rotation). You can share projections or a subset of them if you'd like us to give it a try with your code. Good luck! Simon On Mon, Jan 4, 2021 at 4:35 PM Lai Yao Hao wrote: > Hi, > > The code is as attached. Just for further reference, I am given images as > attached, and there are 800 of them, with 0.45 degrees separating each > frame. The naming of the screenshots depicts the frame that it is in. > > Thanks in advance for the advice and help!! I really appreciate this > community ? > > Regards > lyh > ------------------------------ > *From:* Simon Rit > *Sent:* Wednesday, December 30, 2020 9:35 PM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi, > RTK cone beam reconstruction filters expect line integrals but the > projection that you are showing seems to have the highest value in air. RTK > automatically processes such projections with log and normalization if the > pixels are unsigned short. Otherwise, you need to do it yourself. > It is not clear if the geometry is correct from the reconstruction screen > shot. The best would be to share your code if you want us to have a look. > Simon > > On Mon, Dec 28, 2020 at 8:34 AM Lai Yao Hao > wrote: > > Dear Simon and the RTK community > > Really thank you for the answer, and really sorry for the late reply. I am > trying to reconstruct a 3d model using 800 images, rotating an object 360 > degrees using rtk::ThreeDCircularProjectionGeometry, > rtk::ConstantImageSource and rtk:: FDKConeBeamReconstructionFilter from the > FirstReconstruction example as well as itk::ImageSeriesReader. > > However, the reconstruction created is shown above in the screenshot and > after checking all the parameters, I have no idea on how to move forward > from here. From reading the forums, I think that I should do one more image > filter before applying the cone beam reconstruction? However, I am not too > sure. Please advise on the next steps that can enable me to get the 3d > reconstruction. > > Thanks so much in advance and look forward to everyone's reply!! > > PS: the tif file is just 1 of the 800 images I am given to reconstruct the > object > > Regards > lyh > > ------------------------------ > *From:* Simon Rit > *Sent:* Wednesday, December 9, 2020 4:23 PM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi, > constantImageSource creates a constant volume. In the example, one is used > as input of the simulation of projections of an ellipsoid (rei) and one as > input of the reconstruction algorithm (feldkamp). fieldofview masks out > (i.e., set to 0) voxels which are not in the field of view. > I don't understand your screenshot either but if you use the tiff format, > make sure you use a viewer capable of dealing with 3D tiff images (e.g., > vv or ImageJ). > Simon > > On Wed, Dec 9, 2020 at 8:59 AM Lai Yao Hao wrote: > > Hi to all the rtk-users > > I am a new user of rtk, and I have some questions regarding the > FirstReconstruction example given in github. I have generated an image as > attached, with 4 tiny ball-like drawing hanging from the top. Can anyone > explain to me why do I get such image and what are the implications of > constantImageSource, rei, constantImageSource2, feldkamp and fieldofview? > > Your explanation will be much appreciated. Thanks in advance! > > Regards > lyh > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yao_hao777 at hotmail.com Tue Jan 5 11:34:50 2021 From: yao_hao777 at hotmail.com (Lai Yao Hao) Date: Tue, 5 Jan 2021 16:34:50 +0000 Subject: [Rtk-users] FirstReconstruction questions In-Reply-To: References: , Message-ID: Hi, I cannot send the projections via email as the projections are too big in size. Instead, I am sharing the files on Drive, with the hyperlink as below. In the folder, there is a subset of 100 projections out of the 800 projections, with the angle between each projection being 3.6 degrees. There are other details on the projects as listed in report.txt file in the folder. Google drive share link: https://drive.google.com/drive/folders/1wMRo3Rmr6HszUVil0vEsLPtLSLftFyfQ?usp=sharing Regards lyh ________________________________ From: Simon Rit Sent: Tuesday, January 5, 2021 5:21 PM To: Lai Yao Hao Cc: rtk-users at public.kitware.com Subject: Re: [Rtk-users] FirstReconstruction questions Hi, I think the issue is that your projection images are given in the TIFF file format which does not contain important meta information such as the origin and the spacing of the projections. You should use ChangeInformationFilter to set these. I'm guessing that the origin is currently (0,0) and since you do not set any offsets when using AddProjection, it comes down to having the corner of your projection aligned with the central ray (line defined by the source and the center of rotation). You can share projections or a subset of them if you'd like us to give it a try with your code. Good luck! Simon On Mon, Jan 4, 2021 at 4:35 PM Lai Yao Hao > wrote: Hi, The code is as attached. Just for further reference, I am given images as attached, and there are 800 of them, with 0.45 degrees separating each frame. The naming of the screenshots depicts the frame that it is in. Thanks in advance for the advice and help!! I really appreciate this community ? Regards lyh ________________________________ From: Simon Rit > Sent: Wednesday, December 30, 2020 9:35 PM To: Lai Yao Hao > Cc: rtk-users at public.kitware.com > Subject: Re: [Rtk-users] FirstReconstruction questions Hi, RTK cone beam reconstruction filters expect line integrals but the projection that you are showing seems to have the highest value in air. RTK automatically processes such projections with log and normalization if the pixels are unsigned short. Otherwise, you need to do it yourself. It is not clear if the geometry is correct from the reconstruction screen shot. The best would be to share your code if you want us to have a look. Simon On Mon, Dec 28, 2020 at 8:34 AM Lai Yao Hao > wrote: Dear Simon and the RTK community Really thank you for the answer, and really sorry for the late reply. I am trying to reconstruct a 3d model using 800 images, rotating an object 360 degrees using rtk::ThreeDCircularProjectionGeometry, rtk::ConstantImageSource and rtk:: FDKConeBeamReconstructionFilter from the FirstReconstruction example as well as itk::ImageSeriesReader. However, the reconstruction created is shown above in the screenshot and after checking all the parameters, I have no idea on how to move forward from here. From reading the forums, I think that I should do one more image filter before applying the cone beam reconstruction? However, I am not too sure. Please advise on the next steps that can enable me to get the 3d reconstruction. Thanks so much in advance and look forward to everyone's reply!! PS: the tif file is just 1 of the 800 images I am given to reconstruct the object Regards lyh ________________________________ From: Simon Rit > Sent: Wednesday, December 9, 2020 4:23 PM To: Lai Yao Hao > Cc: rtk-users at public.kitware.com > Subject: Re: [Rtk-users] FirstReconstruction questions Hi, constantImageSource creates a constant volume. In the example, one is used as input of the simulation of projections of an ellipsoid (rei) and one as input of the reconstruction algorithm (feldkamp). fieldofview masks out (i.e., set to 0) voxels which are not in the field of view. I don't understand your screenshot either but if you use the tiff format, make sure you use a viewer capable of dealing with 3D tiff images (e.g., vv or ImageJ). Simon On Wed, Dec 9, 2020 at 8:59 AM Lai Yao Hao > wrote: Hi to all the rtk-users I am a new user of rtk, and I have some questions regarding the FirstReconstruction example given in github. I have generated an image as attached, with 4 tiny ball-like drawing hanging from the top. Can anyone explain to me why do I get such image and what are the implications of constantImageSource, rei, constantImageSource2, feldkamp and fieldofview? Your explanation will be much appreciated. Thanks in advance! Regards lyh _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com https://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon Jan 11 15:22:57 2021 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 11 Jan 2021 21:22:57 +0100 Subject: [Rtk-users] FirstReconstruction questions In-Reply-To: References: Message-ID: Hi lyh, I had a look at what you've sent. I obtain a first result with the following command lines: rtksimulatedgeometry -n 100 -o g --sid 278.044 --sdd $(echo 278.044+372.528 | bc -l) -f 6.3 rtkfdk -p images -r p_[0-9]*.tif -o fdk.mha -g g --newspacing 0.2 --neworigin $(echo -0.5*1951*0.2 | bc -l) --spacing 0.25 --dimension 512 The newspacing and neworigin options set the projections spacing and origin with the ChangeInformationImageFilter. The result is not perfect, I believe the geometry is not right yet. Maybe there is a detector offset you're not aware of? But your text file indicate no offset so I don't know what's wrong. Attached is a snapshot. There are also some dead pixels which you could try to prefilter. I hope this helps. Cheers, Simon On Tue, Jan 5, 2021 at 5:35 PM Lai Yao Hao wrote: > Hi, > I cannot send the projections via email as the projections are too big in > size. Instead, I am sharing the files on Drive, with the hyperlink as > below. In the folder, there is a subset of 100 projections out of the 800 > projections, with the angle between each projection being 3.6 degrees. > There are other details on the projects as listed in report.txt file in the > folder. > > Google drive share link: > > https://drive.google.com/drive/folders/1wMRo3Rmr6HszUVil0vEsLPtLSLftFyfQ?usp=sharing > > Regards > lyh > ------------------------------ > *From:* Simon Rit > *Sent:* Tuesday, January 5, 2021 5:21 PM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi, > I think the issue is that your projection images are given in the TIFF > file format which does not contain important meta information such as the > origin and the spacing of the projections. You should use > ChangeInformationFilter > > to set these. I'm guessing that the origin is currently (0,0) and since you > do not set any offsets when using AddProjection, it comes down to having > the corner of your projection aligned with the central ray (line defined by > the source and the center of rotation). > You can share projections or a subset of them if you'd like us to give it > a try with your code. > Good luck! > Simon > > On Mon, Jan 4, 2021 at 4:35 PM Lai Yao Hao wrote: > > Hi, > > The code is as attached. Just for further reference, I am given images as > attached, and there are 800 of them, with 0.45 degrees separating each > frame. The naming of the screenshots depicts the frame that it is in. > > Thanks in advance for the advice and help!! I really appreciate this > community ? > > Regards > lyh > ------------------------------ > *From:* Simon Rit > *Sent:* Wednesday, December 30, 2020 9:35 PM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi, > RTK cone beam reconstruction filters expect line integrals but the > projection that you are showing seems to have the highest value in air. RTK > automatically processes such projections with log and normalization if the > pixels are unsigned short. Otherwise, you need to do it yourself. > It is not clear if the geometry is correct from the reconstruction screen > shot. The best would be to share your code if you want us to have a look. > Simon > > On Mon, Dec 28, 2020 at 8:34 AM Lai Yao Hao > wrote: > > Dear Simon and the RTK community > > Really thank you for the answer, and really sorry for the late reply. I am > trying to reconstruct a 3d model using 800 images, rotating an object 360 > degrees using rtk::ThreeDCircularProjectionGeometry, > rtk::ConstantImageSource and rtk:: FDKConeBeamReconstructionFilter from the > FirstReconstruction example as well as itk::ImageSeriesReader. > > However, the reconstruction created is shown above in the screenshot and > after checking all the parameters, I have no idea on how to move forward > from here. From reading the forums, I think that I should do one more image > filter before applying the cone beam reconstruction? However, I am not too > sure. Please advise on the next steps that can enable me to get the 3d > reconstruction. > > Thanks so much in advance and look forward to everyone's reply!! > > PS: the tif file is just 1 of the 800 images I am given to reconstruct the > object > > Regards > lyh > > ------------------------------ > *From:* Simon Rit > *Sent:* Wednesday, December 9, 2020 4:23 PM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi, > constantImageSource creates a constant volume. In the example, one is used > as input of the simulation of projections of an ellipsoid (rei) and one as > input of the reconstruction algorithm (feldkamp). fieldofview masks out > (i.e., set to 0) voxels which are not in the field of view. > I don't understand your screenshot either but if you use the tiff format, > make sure you use a viewer capable of dealing with 3D tiff images (e.g., > vv or ImageJ). > Simon > > On Wed, Dec 9, 2020 at 8:59 AM Lai Yao Hao wrote: > > Hi to all the rtk-users > > I am a new user of rtk, and I have some questions regarding the > FirstReconstruction example given in github. I have generated an image as > attached, with 4 tiny ball-like drawing hanging from the top. Can anyone > explain to me why do I get such image and what are the implications of > constantImageSource, rei, constantImageSource2, feldkamp and fieldofview? > > Your explanation will be much appreciated. Thanks in advance! > > Regards > lyh > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: axial.png Type: image/png Size: 256355 bytes Desc: not available URL: From simon.rit at creatis.insa-lyon.fr Wed Jan 13 04:07:55 2021 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 13 Jan 2021 10:07:55 +0100 Subject: [Rtk-users] FirstReconstruction questions In-Reply-To: References: Message-ID: Hi, For the first line (rtksimulatedgeometry), it's already there I believe. For the second line, as I said, you need to use itkChangeInformationImageFilter and set the origin and spacing of the projections equal to those given by newspacing and neworigin. Simon On Wed, Jan 13, 2021 at 9:51 AM Lai Yao Hao wrote: > Hi Simon > > Thank you so much for your help; the reconstructed image is almost similar > to the image you sent (see attached file). In the previous email, for the > command lines > rtksimulatedgeometry -n 100 -o g --sid 278.044 --sdd $(echo > 278.044+372.528 | bc -l) -f 6.3 > rtkfdk -p images -r p_[0-9]*.tif -o fdk.mha -g g --newspacing 0.2 > --neworigin $(echo -0.5*1951*0.2 | bc -l) --spacing 0.25 --dimension 512 > how do I get this line into the test.cxx file? If there is no way to get > these lines into the test.cxx file, then do I run these lines in the > terminal? > > Look forward for your favourable reply. > > With thanks > lyh > > > ------------------------------ > *From:* Simon Rit > *Sent:* Tuesday, January 12, 2021 4:22 AM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi lyh, > I had a look at what you've sent. I obtain a first result with the > following command lines: > rtksimulatedgeometry -n 100 -o g --sid 278.044 --sdd $(echo > 278.044+372.528 | bc -l) -f 6.3 > rtkfdk -p images -r p_[0-9]*.tif -o fdk.mha -g g --newspacing 0.2 > --neworigin $(echo -0.5*1951*0.2 | bc -l) --spacing 0.25 --dimension 512 > The newspacing and neworigin options set the projections spacing and > origin with the ChangeInformationImageFilter. The result is not perfect, I > believe the geometry is not right yet. Maybe there is a detector offset > you're not aware of? But your text file indicate no offset so I don't know > what's wrong. Attached is a snapshot. There are also some dead pixels which > you could try to prefilter. > I hope this helps. Cheers, > Simon > > On Tue, Jan 5, 2021 at 5:35 PM Lai Yao Hao wrote: > > Hi, > I cannot send the projections via email as the projections are too big in > size. Instead, I am sharing the files on Drive, with the hyperlink as > below. In the folder, there is a subset of 100 projections out of the 800 > projections, with the angle between each projection being 3.6 degrees. > There are other details on the projects as listed in report.txt file in the > folder. > > Google drive share link: > > https://drive.google.com/drive/folders/1wMRo3Rmr6HszUVil0vEsLPtLSLftFyfQ?usp=sharing > > Regards > lyh > ------------------------------ > *From:* Simon Rit > *Sent:* Tuesday, January 5, 2021 5:21 PM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi, > I think the issue is that your projection images are given in the TIFF > file format which does not contain important meta information such as the > origin and the spacing of the projections. You should use > ChangeInformationFilter > > to set these. I'm guessing that the origin is currently (0,0) and since you > do not set any offsets when using AddProjection, it comes down to having > the corner of your projection aligned with the central ray (line defined by > the source and the center of rotation). > You can share projections or a subset of them if you'd like us to give it > a try with your code. > Good luck! > Simon > > On Mon, Jan 4, 2021 at 4:35 PM Lai Yao Hao wrote: > > Hi, > > The code is as attached. Just for further reference, I am given images as > attached, and there are 800 of them, with 0.45 degrees separating each > frame. The naming of the screenshots depicts the frame that it is in. > > Thanks in advance for the advice and help!! I really appreciate this > community ? > > Regards > lyh > ------------------------------ > *From:* Simon Rit > *Sent:* Wednesday, December 30, 2020 9:35 PM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi, > RTK cone beam reconstruction filters expect line integrals but the > projection that you are showing seems to have the highest value in air. RTK > automatically processes such projections with log and normalization if the > pixels are unsigned short. Otherwise, you need to do it yourself. > It is not clear if the geometry is correct from the reconstruction screen > shot. The best would be to share your code if you want us to have a look. > Simon > > On Mon, Dec 28, 2020 at 8:34 AM Lai Yao Hao > wrote: > > Dear Simon and the RTK community > > Really thank you for the answer, and really sorry for the late reply. I am > trying to reconstruct a 3d model using 800 images, rotating an object 360 > degrees using rtk::ThreeDCircularProjectionGeometry, > rtk::ConstantImageSource and rtk:: FDKConeBeamReconstructionFilter from the > FirstReconstruction example as well as itk::ImageSeriesReader. > > However, the reconstruction created is shown above in the screenshot and > after checking all the parameters, I have no idea on how to move forward > from here. From reading the forums, I think that I should do one more image > filter before applying the cone beam reconstruction? However, I am not too > sure. Please advise on the next steps that can enable me to get the 3d > reconstruction. > > Thanks so much in advance and look forward to everyone's reply!! > > PS: the tif file is just 1 of the 800 images I am given to reconstruct the > object > > Regards > lyh > > ------------------------------ > *From:* Simon Rit > *Sent:* Wednesday, December 9, 2020 4:23 PM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi, > constantImageSource creates a constant volume. In the example, one is used > as input of the simulation of projections of an ellipsoid (rei) and one as > input of the reconstruction algorithm (feldkamp). fieldofview masks out > (i.e., set to 0) voxels which are not in the field of view. > I don't understand your screenshot either but if you use the tiff format, > make sure you use a viewer capable of dealing with 3D tiff images (e.g., > vv or ImageJ). > Simon > > On Wed, Dec 9, 2020 at 8:59 AM Lai Yao Hao wrote: > > Hi to all the rtk-users > > I am a new user of rtk, and I have some questions regarding the > FirstReconstruction example given in github. I have generated an image as > attached, with 4 tiny ball-like drawing hanging from the top. Can anyone > explain to me why do I get such image and what are the implications of > constantImageSource, rei, constantImageSource2, feldkamp and fieldofview? > > Your explanation will be much appreciated. Thanks in advance! > > Regards > lyh > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhehao.zhang at wustl.edu Thu Jan 14 00:36:40 2021 From: zhehao.zhang at wustl.edu (Zhang, Zhehao) Date: Thu, 14 Jan 2021 05:36:40 +0000 Subject: [Rtk-users] Iterative reconstruction methods Message-ID: Dear all, I am using the SARTConeBeamReconstructionFilter recently and it works well. Thanks for providing this helpful toolkits. I got one question when using this filter that there is one parameter called ?m_NumberOfProjectionsPerSubset?. On your website(http://www.openrtk.org/Doxygen/classrtk_1_1SARTConeBeamReconstructionFilter.html), the description for it is Number of projections processed before the volume is updated (1 for SART, several for OS-SART, all for SIRT). According to my knowledge, if we update the volume each time when one projection was processed, shouldn?t it be ART algorithm? And all projections represents SART, several represents OS-SART. So I got confused about the description and how SIRT was introduced here. Could anyone please give me some hints on how should I understand this? Thanks in advance. Best regards, Zhehao -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu Jan 14 02:47:05 2021 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 14 Jan 2021 08:47:05 +0100 Subject: [Rtk-users] Iterative reconstruction methods In-Reply-To: References: Message-ID: Hi, The ART algorithm uses one ray (one pixel of the projection) to update the volume. When all the pixels of one projection are used to update the volume, it's SART. Check Kak & Slaney for more details: http://engineering.purdue.edu/~malcolm/pct/CTI_Ch07.pdf Simon On Thu, Jan 14, 2021 at 6:37 AM Zhang, Zhehao wrote: > Dear all, > > > > I am using the SARTConeBeamReconstructionFilter recently and it works > well. Thanks for providing this helpful toolkits. I got one question when > using this filter that there is one parameter called > ?m_NumberOfProjectionsPerSubset?. On your website( > http://www.openrtk.org/Doxygen/classrtk_1_1SARTConeBeamReconstructionFilter.html), > the description for it is Number of projections processed before the volume > is updated (1 for SART, several for OS-SART, all for SIRT). > > > > According to my knowledge, if we update the volume each time when one > projection was processed, shouldn?t it be ART algorithm? And all > projections represents SART, several represents OS-SART. So I got confused > about the description and how SIRT was introduced here. Could anyone please > give me some hints on how should I understand this? Thanks in advance. > > > > Best regards, > > Zhehao > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yao_hao777 at hotmail.com Mon Jan 18 22:58:58 2021 From: yao_hao777 at hotmail.com (Lai Yao Hao) Date: Tue, 19 Jan 2021 03:58:58 +0000 Subject: [Rtk-users] FirstReconstruction questions In-Reply-To: References: , Message-ID: Hi Simon, Sorry to bother you again. Just want to check if I have used itkChangeInformationImageFilter correctly in the snippet of code below: using FilterType = itk::ChangeInformationImageFilter; FilterType::Pointer filter = FilterType::New(); ImageType::ConstPointer inputImage = reader->GetOutput(); ImageType::PointType firstOrigin = inputImage->GetOrigin(); ImageType::SpacingType firstSpacing = inputImage->GetSpacing(); for (unsigned int i= 0; i < Dimension;i++) { firstSpacing[i]*=0.2; } filter->SetOutputSpacing(firstSpacing); filter->ChangeSpacingOn(); ImageType::PointType::VectorType translation; translation[0] = -0.5*1951*0.2; translation[1] = -0.5*1951*0.2; translation[2] = -0.5*1951*0.2; firstOrigin += translation; filter->SetOutputOrigin(firstOrigin); filter->ChangeOriginOn(); filter->SetInput(reader->GetOutput()); ... feldkamp->SetInput(0, constantImageSource->GetOutput()); feldkamp->SetInput(1, filter->GetOutput()); ?Also, I would like to ask if there are any difference to the ?PixelType ?being unsigned short or unsigned char?? This is because the source code fail to compile when I used unsigned short on one computer but it works on the other computer. Looking forward to your reply and answers! Much thanks in advance! Regards, lyh ________________________________ From: Simon Rit Sent: Wednesday, January 13, 2021 5:07 PM To: Lai Yao Hao Cc: rtk-users at public.kitware.com Subject: Re: [Rtk-users] FirstReconstruction questions Hi, For the first line (rtksimulatedgeometry), it's already there I believe. For the second line, as I said, you need to use itkChangeInformationImageFilter and set the origin and spacing of the projections equal to those given by newspacing and neworigin. Simon On Wed, Jan 13, 2021 at 9:51 AM Lai Yao Hao > wrote: Hi Simon Thank you so much for your help; the reconstructed image is almost similar to the image you sent (see attached file). In the previous email, for the command lines rtksimulatedgeometry -n 100 -o g --sid 278.044 --sdd $(echo 278.044+372.528 | bc -l) -f 6.3 rtkfdk -p images -r p_[0-9]*.tif -o fdk.mha -g g --newspacing 0.2 --neworigin $(echo -0.5*1951*0.2 | bc -l) --spacing 0.25 --dimension 512 how do I get this line into the test.cxx file? If there is no way to get these lines into the test.cxx file, then do I run these lines in the terminal? Look forward for your favourable reply. With thanks lyh ________________________________ From: Simon Rit > Sent: Tuesday, January 12, 2021 4:22 AM To: Lai Yao Hao > Cc: rtk-users at public.kitware.com > Subject: Re: [Rtk-users] FirstReconstruction questions Hi lyh, I had a look at what you've sent. I obtain a first result with the following command lines: rtksimulatedgeometry -n 100 -o g --sid 278.044 --sdd $(echo 278.044+372.528 | bc -l) -f 6.3 rtkfdk -p images -r p_[0-9]*.tif -o fdk.mha -g g --newspacing 0.2 --neworigin $(echo -0.5*1951*0.2 | bc -l) --spacing 0.25 --dimension 512 The newspacing and neworigin options set the projections spacing and origin with the ChangeInformationImageFilter. The result is not perfect, I believe the geometry is not right yet. Maybe there is a detector offset you're not aware of? But your text file indicate no offset so I don't know what's wrong. Attached is a snapshot. There are also some dead pixels which you could try to prefilter. I hope this helps. Cheers, Simon On Tue, Jan 5, 2021 at 5:35 PM Lai Yao Hao > wrote: Hi, I cannot send the projections via email as the projections are too big in size. Instead, I am sharing the files on Drive, with the hyperlink as below. In the folder, there is a subset of 100 projections out of the 800 projections, with the angle between each projection being 3.6 degrees. There are other details on the projects as listed in report.txt file in the folder. Google drive share link: https://drive.google.com/drive/folders/1wMRo3Rmr6HszUVil0vEsLPtLSLftFyfQ?usp=sharing Regards lyh ________________________________ From: Simon Rit > Sent: Tuesday, January 5, 2021 5:21 PM To: Lai Yao Hao > Cc: rtk-users at public.kitware.com > Subject: Re: [Rtk-users] FirstReconstruction questions Hi, I think the issue is that your projection images are given in the TIFF file format which does not contain important meta information such as the origin and the spacing of the projections. You should use ChangeInformationFilter to set these. I'm guessing that the origin is currently (0,0) and since you do not set any offsets when using AddProjection, it comes down to having the corner of your projection aligned with the central ray (line defined by the source and the center of rotation). You can share projections or a subset of them if you'd like us to give it a try with your code. Good luck! Simon On Mon, Jan 4, 2021 at 4:35 PM Lai Yao Hao > wrote: Hi, The code is as attached. Just for further reference, I am given images as attached, and there are 800 of them, with 0.45 degrees separating each frame. The naming of the screenshots depicts the frame that it is in. Thanks in advance for the advice and help!! I really appreciate this community ? Regards lyh ________________________________ From: Simon Rit > Sent: Wednesday, December 30, 2020 9:35 PM To: Lai Yao Hao > Cc: rtk-users at public.kitware.com > Subject: Re: [Rtk-users] FirstReconstruction questions Hi, RTK cone beam reconstruction filters expect line integrals but the projection that you are showing seems to have the highest value in air. RTK automatically processes such projections with log and normalization if the pixels are unsigned short. Otherwise, you need to do it yourself. It is not clear if the geometry is correct from the reconstruction screen shot. The best would be to share your code if you want us to have a look. Simon On Mon, Dec 28, 2020 at 8:34 AM Lai Yao Hao > wrote: Dear Simon and the RTK community Really thank you for the answer, and really sorry for the late reply. I am trying to reconstruct a 3d model using 800 images, rotating an object 360 degrees using rtk::ThreeDCircularProjectionGeometry, rtk::ConstantImageSource and rtk:: FDKConeBeamReconstructionFilter from the FirstReconstruction example as well as itk::ImageSeriesReader. However, the reconstruction created is shown above in the screenshot and after checking all the parameters, I have no idea on how to move forward from here. From reading the forums, I think that I should do one more image filter before applying the cone beam reconstruction? However, I am not too sure. Please advise on the next steps that can enable me to get the 3d reconstruction. Thanks so much in advance and look forward to everyone's reply!! PS: the tif file is just 1 of the 800 images I am given to reconstruct the object Regards lyh ________________________________ From: Simon Rit > Sent: Wednesday, December 9, 2020 4:23 PM To: Lai Yao Hao > Cc: rtk-users at public.kitware.com > Subject: Re: [Rtk-users] FirstReconstruction questions Hi, constantImageSource creates a constant volume. In the example, one is used as input of the simulation of projections of an ellipsoid (rei) and one as input of the reconstruction algorithm (feldkamp). fieldofview masks out (i.e., set to 0) voxels which are not in the field of view. I don't understand your screenshot either but if you use the tiff format, make sure you use a viewer capable of dealing with 3D tiff images (e.g., vv or ImageJ). Simon On Wed, Dec 9, 2020 at 8:59 AM Lai Yao Hao > wrote: Hi to all the rtk-users I am a new user of rtk, and I have some questions regarding the FirstReconstruction example given in github. I have generated an image as attached, with 4 tiny ball-like drawing hanging from the top. Can anyone explain to me why do I get such image and what are the implications of constantImageSource, rei, constantImageSource2, feldkamp and fieldofview? Your explanation will be much appreciated. Thanks in advance! Regards lyh _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com https://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu Jan 21 09:52:53 2021 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 21 Jan 2021 15:52:53 +0100 Subject: [Rtk-users] FirstReconstruction questions In-Reply-To: References: Message-ID: Hi, Instead of firstSpacing[i]*=0.2; I would have written firstSpacing[i]=0.2; Sorry I did not look closely at the original code but you should modify it. The input images should be read with rtk::ProjectionsReader for being converted to line integrals (using the Beer-Lambert law). The output pixel type should be float or double, it won't work with integer values. I suggest to follow rtkfdk.cxx for implementing this. Simon On Tue, Jan 19, 2021 at 4:59 AM Lai Yao Hao wrote: > Hi Simon, > > Sorry to bother you again. Just want to check if I have used > itkChangeInformationImageFilter correctly in the snippet of code below: > > using FilterType = itk::ChangeInformationImageFilter; > FilterType::Pointer filter = FilterType::New(); > ImageType::ConstPointer inputImage = reader->GetOutput(); > ImageType::PointType firstOrigin = inputImage->GetOrigin(); > ImageType::SpacingType firstSpacing = inputImage->GetSpacing(); > for (unsigned int i= 0; i < Dimension;i++) { > firstSpacing[i]*=0.2; > } > filter->SetOutputSpacing(firstSpacing); > filter->ChangeSpacingOn(); > ImageType::PointType::VectorType translation; > > translation[0] = -0.5*1951*0.2; > translation[1] = -0.5*1951*0.2; > translation[2] = -0.5*1951*0.2; > > firstOrigin += translation; > filter->SetOutputOrigin(firstOrigin); > filter->ChangeOriginOn(); > > filter->SetInput(reader->GetOutput()); > ... > feldkamp->SetInput(0, constantImageSource->GetOutput()); > feldkamp->SetInput(1, filter->GetOutput()); > > ?Also, I would like to ask if there are any difference to the ?PixelType > ?being unsigned short or unsigned char?? This is because the source code > fail to compile when I used unsigned short on one computer but it works on > the other computer. > > Looking forward to your reply and answers! Much thanks in advance! > > Regards, > lyh > ------------------------------ > *From:* Simon Rit > *Sent:* Wednesday, January 13, 2021 5:07 PM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi, > For the first line (rtksimulatedgeometry), it's already there I believe. > For the second line, as I said, you need to use > itkChangeInformationImageFilter and set the origin and spacing of the > projections equal to those given by newspacing and neworigin. > Simon > > On Wed, Jan 13, 2021 at 9:51 AM Lai Yao Hao > wrote: > > Hi Simon > > Thank you so much for your help; the reconstructed image is almost similar > to the image you sent (see attached file). In the previous email, for the > command lines > rtksimulatedgeometry -n 100 -o g --sid 278.044 --sdd $(echo > 278.044+372.528 | bc -l) -f 6.3 > rtkfdk -p images -r p_[0-9]*.tif -o fdk.mha -g g --newspacing 0.2 > --neworigin $(echo -0.5*1951*0.2 | bc -l) --spacing 0.25 --dimension 512 > how do I get this line into the test.cxx file? If there is no way to get > these lines into the test.cxx file, then do I run these lines in the > terminal? > > Look forward for your favourable reply. > > With thanks > lyh > > > ------------------------------ > *From:* Simon Rit > *Sent:* Tuesday, January 12, 2021 4:22 AM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi lyh, > I had a look at what you've sent. I obtain a first result with the > following command lines: > rtksimulatedgeometry -n 100 -o g --sid 278.044 --sdd $(echo > 278.044+372.528 | bc -l) -f 6.3 > rtkfdk -p images -r p_[0-9]*.tif -o fdk.mha -g g --newspacing 0.2 > --neworigin $(echo -0.5*1951*0.2 | bc -l) --spacing 0.25 --dimension 512 > The newspacing and neworigin options set the projections spacing and > origin with the ChangeInformationImageFilter. The result is not perfect, I > believe the geometry is not right yet. Maybe there is a detector offset > you're not aware of? But your text file indicate no offset so I don't know > what's wrong. Attached is a snapshot. There are also some dead pixels which > you could try to prefilter. > I hope this helps. Cheers, > Simon > > On Tue, Jan 5, 2021 at 5:35 PM Lai Yao Hao wrote: > > Hi, > I cannot send the projections via email as the projections are too big in > size. Instead, I am sharing the files on Drive, with the hyperlink as > below. In the folder, there is a subset of 100 projections out of the 800 > projections, with the angle between each projection being 3.6 degrees. > There are other details on the projects as listed in report.txt file in the > folder. > > Google drive share link: > > https://drive.google.com/drive/folders/1wMRo3Rmr6HszUVil0vEsLPtLSLftFyfQ?usp=sharing > > Regards > lyh > ------------------------------ > *From:* Simon Rit > *Sent:* Tuesday, January 5, 2021 5:21 PM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi, > I think the issue is that your projection images are given in the TIFF > file format which does not contain important meta information such as the > origin and the spacing of the projections. You should use > ChangeInformationFilter > > to set these. I'm guessing that the origin is currently (0,0) and since you > do not set any offsets when using AddProjection, it comes down to having > the corner of your projection aligned with the central ray (line defined by > the source and the center of rotation). > You can share projections or a subset of them if you'd like us to give it > a try with your code. > Good luck! > Simon > > On Mon, Jan 4, 2021 at 4:35 PM Lai Yao Hao wrote: > > Hi, > > The code is as attached. Just for further reference, I am given images as > attached, and there are 800 of them, with 0.45 degrees separating each > frame. The naming of the screenshots depicts the frame that it is in. > > Thanks in advance for the advice and help!! I really appreciate this > community ? > > Regards > lyh > ------------------------------ > *From:* Simon Rit > *Sent:* Wednesday, December 30, 2020 9:35 PM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi, > RTK cone beam reconstruction filters expect line integrals but the > projection that you are showing seems to have the highest value in air. RTK > automatically processes such projections with log and normalization if the > pixels are unsigned short. Otherwise, you need to do it yourself. > It is not clear if the geometry is correct from the reconstruction screen > shot. The best would be to share your code if you want us to have a look. > Simon > > On Mon, Dec 28, 2020 at 8:34 AM Lai Yao Hao > wrote: > > Dear Simon and the RTK community > > Really thank you for the answer, and really sorry for the late reply. I am > trying to reconstruct a 3d model using 800 images, rotating an object 360 > degrees using rtk::ThreeDCircularProjectionGeometry, > rtk::ConstantImageSource and rtk:: FDKConeBeamReconstructionFilter from the > FirstReconstruction example as well as itk::ImageSeriesReader. > > However, the reconstruction created is shown above in the screenshot and > after checking all the parameters, I have no idea on how to move forward > from here. From reading the forums, I think that I should do one more image > filter before applying the cone beam reconstruction? However, I am not too > sure. Please advise on the next steps that can enable me to get the 3d > reconstruction. > > Thanks so much in advance and look forward to everyone's reply!! > > PS: the tif file is just 1 of the 800 images I am given to reconstruct the > object > > Regards > lyh > > ------------------------------ > *From:* Simon Rit > *Sent:* Wednesday, December 9, 2020 4:23 PM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi, > constantImageSource creates a constant volume. In the example, one is used > as input of the simulation of projections of an ellipsoid (rei) and one as > input of the reconstruction algorithm (feldkamp). fieldofview masks out > (i.e., set to 0) voxels which are not in the field of view. > I don't understand your screenshot either but if you use the tiff format, > make sure you use a viewer capable of dealing with 3D tiff images (e.g., > vv or ImageJ). > Simon > > On Wed, Dec 9, 2020 at 8:59 AM Lai Yao Hao wrote: > > Hi to all the rtk-users > > I am a new user of rtk, and I have some questions regarding the > FirstReconstruction example given in github. I have generated an image as > attached, with 4 tiny ball-like drawing hanging from the top. Can anyone > explain to me why do I get such image and what are the implications of > constantImageSource, rei, constantImageSource2, feldkamp and fieldofview? > > Your explanation will be much appreciated. Thanks in advance! > > Regards > lyh > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yao_hao777 at hotmail.com Wed Jan 27 02:27:47 2021 From: yao_hao777 at hotmail.com (Lai Yao Hao) Date: Wed, 27 Jan 2021 07:27:47 +0000 Subject: [Rtk-users] FirstReconstruction questions In-Reply-To: References: , Message-ID: Hi I am confused when following rtkfdk.cxx for the implementation, because in that file, there is no usage of itk::ChangeInformationFilter. Can I confirm if the usage of itkChangeInformationFilter should be according to one of the following steps? (1) Read in the projections using itk::ImageSeriesReader and itk::NumericSeriesFileNames -> use itk::ChangeInformationFilter to change spacing and origin -> use rtk::ProjectionsReader to read the images with new spacing and origin (2) Read in the projections using rtk::ProjectionsReader and itk::NumericSeriesFileNames -> use itk::ChangeInformationFilter to change spacing and origin (3) Read in the projections using rtk::ProjectionsReader and itk::NumericSeriesFileNames and change the spacing and origin using rtk::ProjectionsReader::SetSpacing and rtk::ProjectionsReader::SetOrigin. If (3) is the correct method, what input should be in the rtk::ProjectionsReader::SetSpacing and SetOrigin method and how do I get these inputs? If the above steps for reading the input projections are not correct, is it possible to suggest steps which I can read the projections correctly with the correct spacing and origin? Thanks in advance for the advice and I look forward towards your reply! Regards lyh ________________________________ From: Simon Rit Sent: Thursday, January 21, 2021 10:52 PM To: Lai Yao Hao Cc: rtk-users at public.kitware.com Subject: Re: [Rtk-users] FirstReconstruction questions Hi, Instead of firstSpacing[i]*=0.2; I would have written firstSpacing[i]=0.2; Sorry I did not look closely at the original code but you should modify it. The input images should be read with rtk::ProjectionsReader for being converted to line integrals (using the Beer-Lambert law). The output pixel type should be float or double, it won't work with integer values. I suggest to follow rtkfdk.cxx for implementing this. Simon On Tue, Jan 19, 2021 at 4:59 AM Lai Yao Hao > wrote: Hi Simon, Sorry to bother you again. Just want to check if I have used itkChangeInformationImageFilter correctly in the snippet of code below: using FilterType = itk::ChangeInformationImageFilter; FilterType::Pointer filter = FilterType::New(); ImageType::ConstPointer inputImage = reader->GetOutput(); ImageType::PointType firstOrigin = inputImage->GetOrigin(); ImageType::SpacingType firstSpacing = inputImage->GetSpacing(); for (unsigned int i= 0; i < Dimension;i++) { firstSpacing[i]*=0.2; } filter->SetOutputSpacing(firstSpacing); filter->ChangeSpacingOn(); ImageType::PointType::VectorType translation; translation[0] = -0.5*1951*0.2; translation[1] = -0.5*1951*0.2; translation[2] = -0.5*1951*0.2; firstOrigin += translation; filter->SetOutputOrigin(firstOrigin); filter->ChangeOriginOn(); filter->SetInput(reader->GetOutput()); ... feldkamp->SetInput(0, constantImageSource->GetOutput()); feldkamp->SetInput(1, filter->GetOutput()); ?Also, I would like to ask if there are any difference to the ?PixelType ?being unsigned short or unsigned char?? This is because the source code fail to compile when I used unsigned short on one computer but it works on the other computer. Looking forward to your reply and answers! Much thanks in advance! Regards, lyh ________________________________ From: Simon Rit > Sent: Wednesday, January 13, 2021 5:07 PM To: Lai Yao Hao > Cc: rtk-users at public.kitware.com > Subject: Re: [Rtk-users] FirstReconstruction questions Hi, For the first line (rtksimulatedgeometry), it's already there I believe. For the second line, as I said, you need to use itkChangeInformationImageFilter and set the origin and spacing of the projections equal to those given by newspacing and neworigin. Simon On Wed, Jan 13, 2021 at 9:51 AM Lai Yao Hao > wrote: Hi Simon Thank you so much for your help; the reconstructed image is almost similar to the image you sent (see attached file). In the previous email, for the command lines rtksimulatedgeometry -n 100 -o g --sid 278.044 --sdd $(echo 278.044+372.528 | bc -l) -f 6.3 rtkfdk -p images -r p_[0-9]*.tif -o fdk.mha -g g --newspacing 0.2 --neworigin $(echo -0.5*1951*0.2 | bc -l) --spacing 0.25 --dimension 512 how do I get this line into the test.cxx file? If there is no way to get these lines into the test.cxx file, then do I run these lines in the terminal? Look forward for your favourable reply. With thanks lyh ________________________________ From: Simon Rit > Sent: Tuesday, January 12, 2021 4:22 AM To: Lai Yao Hao > Cc: rtk-users at public.kitware.com > Subject: Re: [Rtk-users] FirstReconstruction questions Hi lyh, I had a look at what you've sent. I obtain a first result with the following command lines: rtksimulatedgeometry -n 100 -o g --sid 278.044 --sdd $(echo 278.044+372.528 | bc -l) -f 6.3 rtkfdk -p images -r p_[0-9]*.tif -o fdk.mha -g g --newspacing 0.2 --neworigin $(echo -0.5*1951*0.2 | bc -l) --spacing 0.25 --dimension 512 The newspacing and neworigin options set the projections spacing and origin with the ChangeInformationImageFilter. The result is not perfect, I believe the geometry is not right yet. Maybe there is a detector offset you're not aware of? But your text file indicate no offset so I don't know what's wrong. Attached is a snapshot. There are also some dead pixels which you could try to prefilter. I hope this helps. Cheers, Simon On Tue, Jan 5, 2021 at 5:35 PM Lai Yao Hao > wrote: Hi, I cannot send the projections via email as the projections are too big in size. Instead, I am sharing the files on Drive, with the hyperlink as below. In the folder, there is a subset of 100 projections out of the 800 projections, with the angle between each projection being 3.6 degrees. There are other details on the projects as listed in report.txt file in the folder. Google drive share link: https://drive.google.com/drive/folders/1wMRo3Rmr6HszUVil0vEsLPtLSLftFyfQ?usp=sharing Regards lyh ________________________________ From: Simon Rit > Sent: Tuesday, January 5, 2021 5:21 PM To: Lai Yao Hao > Cc: rtk-users at public.kitware.com > Subject: Re: [Rtk-users] FirstReconstruction questions Hi, I think the issue is that your projection images are given in the TIFF file format which does not contain important meta information such as the origin and the spacing of the projections. You should use ChangeInformationFilter to set these. I'm guessing that the origin is currently (0,0) and since you do not set any offsets when using AddProjection, it comes down to having the corner of your projection aligned with the central ray (line defined by the source and the center of rotation). You can share projections or a subset of them if you'd like us to give it a try with your code. Good luck! Simon On Mon, Jan 4, 2021 at 4:35 PM Lai Yao Hao > wrote: Hi, The code is as attached. Just for further reference, I am given images as attached, and there are 800 of them, with 0.45 degrees separating each frame. The naming of the screenshots depicts the frame that it is in. Thanks in advance for the advice and help!! I really appreciate this community ? Regards lyh ________________________________ From: Simon Rit > Sent: Wednesday, December 30, 2020 9:35 PM To: Lai Yao Hao > Cc: rtk-users at public.kitware.com > Subject: Re: [Rtk-users] FirstReconstruction questions Hi, RTK cone beam reconstruction filters expect line integrals but the projection that you are showing seems to have the highest value in air. RTK automatically processes such projections with log and normalization if the pixels are unsigned short. Otherwise, you need to do it yourself. It is not clear if the geometry is correct from the reconstruction screen shot. The best would be to share your code if you want us to have a look. Simon On Mon, Dec 28, 2020 at 8:34 AM Lai Yao Hao > wrote: Dear Simon and the RTK community Really thank you for the answer, and really sorry for the late reply. I am trying to reconstruct a 3d model using 800 images, rotating an object 360 degrees using rtk::ThreeDCircularProjectionGeometry, rtk::ConstantImageSource and rtk:: FDKConeBeamReconstructionFilter from the FirstReconstruction example as well as itk::ImageSeriesReader. However, the reconstruction created is shown above in the screenshot and after checking all the parameters, I have no idea on how to move forward from here. From reading the forums, I think that I should do one more image filter before applying the cone beam reconstruction? However, I am not too sure. Please advise on the next steps that can enable me to get the 3d reconstruction. Thanks so much in advance and look forward to everyone's reply!! PS: the tif file is just 1 of the 800 images I am given to reconstruct the object Regards lyh ________________________________ From: Simon Rit > Sent: Wednesday, December 9, 2020 4:23 PM To: Lai Yao Hao > Cc: rtk-users at public.kitware.com > Subject: Re: [Rtk-users] FirstReconstruction questions Hi, constantImageSource creates a constant volume. In the example, one is used as input of the simulation of projections of an ellipsoid (rei) and one as input of the reconstruction algorithm (feldkamp). fieldofview masks out (i.e., set to 0) voxels which are not in the field of view. I don't understand your screenshot either but if you use the tiff format, make sure you use a viewer capable of dealing with 3D tiff images (e.g., vv or ImageJ). Simon On Wed, Dec 9, 2020 at 8:59 AM Lai Yao Hao > wrote: Hi to all the rtk-users I am a new user of rtk, and I have some questions regarding the FirstReconstruction example given in github. I have generated an image as attached, with 4 tiny ball-like drawing hanging from the top. Can anyone explain to me why do I get such image and what are the implications of constantImageSource, rei, constantImageSource2, feldkamp and fieldofview? Your explanation will be much appreciated. Thanks in advance! Regards lyh _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com https://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed Jan 27 04:01:12 2021 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 27 Jan 2021 10:01:12 +0100 Subject: [Rtk-users] Release of RTK v2.2.0 Message-ID: Dear RTK users, RTK v2.2.0 has just been released, about fourteen months after RTK v2.1.0. This release is intended to produce python packages compatible with ITK v5.1.1 and v5.1.2 (current release on pypi.org). I will soon prepare another release for ITK v5.2. Release notes: * New projectors with PSF correction for SPECT reconstruction * New quadratic regularization in OSEM * Progress reporters for FDK and iterative reconstruction algorithms * New continuous integration using Github actions, following ITKModuleTemplate * Alignment with ITK developments * Enhanced Python wrappings * Many compilation, bug and style fixes Many thanks to all contributors for this release, in alphabetical order: Sebastien Brousmiche, Aur?lien Coussat, Julien Finet, Lucas Gandel, Hans Johnson, Matt McCormick, Antoine Robert, MrTzschr, Simon Rit, Pierre-Antoine Rodesch and Vincent Libertiaux. As usual, be aware that we do not focus on releases since we have a public github repository that we aim at keeping stable. I still recommend the use of the master HEAD over releases to enjoy the new RTK developments before their release. Corresponding python packages can now be downloaded from the Github action. We still have a few on-going projects for which we will use and enhance RTK. Simon (for the RTK consortium) -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed Jan 27 05:21:09 2021 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 27 Jan 2021 11:21:09 +0100 Subject: [Rtk-users] FirstReconstruction questions In-Reply-To: References: Message-ID: Hi, itk::ChangeInformationImageFilter is encapsulated in rtk::ProjectionsReader, see https://github.com/SimonRit/RTK/blob/master/include/rtkProjectionsReader.hxx#L481-L510. Option (3) is the correct one below. SetSpacing should be set according to your knowledge of the pixel spacing on the projections (the third dimension is ignored). SetOrigin should be set such that coordinate (0,0) on the detector corresponds to the line defined by the source and the center of rotation. If you have centered your detector, that should be -0.5*spacing*(size-1). Simon On Wed, Jan 27, 2021 at 8:28 AM Lai Yao Hao wrote: > Hi > > I am confused when following rtkfdk.cxx for the implementation, because in > that file, there is no usage of itk::ChangeInformationFilter. Can I confirm > if the usage of itkChangeInformationFilter should be according to one of > the following steps? > > (1) Read in the projections using itk::ImageSeriesReader and > itk::NumericSeriesFileNames -> use itk::ChangeInformationFilter to change > spacing and origin -> use rtk::ProjectionsReader to read the images with > new spacing and origin > > (2) Read in the projections using rtk::ProjectionsReader and > itk::NumericSeriesFileNames -> use itk::ChangeInformationFilter to change > spacing and origin > > (3) Read in the projections using rtk::ProjectionsReader and > itk::NumericSeriesFileNames and change the spacing and origin using > rtk::ProjectionsReader::SetSpacing and rtk::ProjectionsReader::SetOrigin. > > If (3) is the correct method, what input should be in the > rtk::ProjectionsReader::SetSpacing and SetOrigin method and how do I get > these inputs? > > If the above steps for reading the input projections are not correct, is > it possible to suggest steps which I can read the projections correctly > with the correct spacing and origin? > > Thanks in advance for the advice and I look forward towards your reply! > > Regards > lyh > ------------------------------ > *From:* Simon Rit > *Sent:* Thursday, January 21, 2021 10:52 PM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi, > Instead of > firstSpacing[i]*=0.2; > I would have written > firstSpacing[i]=0.2; > Sorry I did not look closely at the original code but you should modify > it. The input images should be read with rtk::ProjectionsReader for being > converted to line integrals (using the Beer-Lambert law). The output pixel > type should be float or double, it won't work with integer values. I > suggest to follow rtkfdk.cxx for implementing this. > Simon > > On Tue, Jan 19, 2021 at 4:59 AM Lai Yao Hao > wrote: > > Hi Simon, > > Sorry to bother you again. Just want to check if I have used > itkChangeInformationImageFilter correctly in the snippet of code below: > > using FilterType = itk::ChangeInformationImageFilter; > FilterType::Pointer filter = FilterType::New(); > ImageType::ConstPointer inputImage = reader->GetOutput(); > ImageType::PointType firstOrigin = inputImage->GetOrigin(); > ImageType::SpacingType firstSpacing = inputImage->GetSpacing(); > for (unsigned int i= 0; i < Dimension;i++) { > firstSpacing[i]*=0.2; > } > filter->SetOutputSpacing(firstSpacing); > filter->ChangeSpacingOn(); > ImageType::PointType::VectorType translation; > > translation[0] = -0.5*1951*0.2; > translation[1] = -0.5*1951*0.2; > translation[2] = -0.5*1951*0.2; > > firstOrigin += translation; > filter->SetOutputOrigin(firstOrigin); > filter->ChangeOriginOn(); > > filter->SetInput(reader->GetOutput()); > ... > feldkamp->SetInput(0, constantImageSource->GetOutput()); > feldkamp->SetInput(1, filter->GetOutput()); > > Also, I would like to ask if there are any difference to the PixelType > being unsigned short or unsigned char? This is because the source code > fail to compile when I used unsigned short on one computer but it works on > the other computer. > > Looking forward to your reply and answers! Much thanks in advance! > > Regards, > lyh > ------------------------------ > *From:* Simon Rit > *Sent:* Wednesday, January 13, 2021 5:07 PM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi, > For the first line (rtksimulatedgeometry), it's already there I believe. > For the second line, as I said, you need to use > itkChangeInformationImageFilter and set the origin and spacing of the > projections equal to those given by newspacing and neworigin. > Simon > > On Wed, Jan 13, 2021 at 9:51 AM Lai Yao Hao > wrote: > > Hi Simon > > Thank you so much for your help; the reconstructed image is almost similar > to the image you sent (see attached file). In the previous email, for the > command lines > rtksimulatedgeometry -n 100 -o g --sid 278.044 --sdd $(echo > 278.044+372.528 | bc -l) -f 6.3 > rtkfdk -p images -r p_[0-9]*.tif -o fdk.mha -g g --newspacing 0.2 > --neworigin $(echo -0.5*1951*0.2 | bc -l) --spacing 0.25 --dimension 512 > how do I get this line into the test.cxx file? If there is no way to get > these lines into the test.cxx file, then do I run these lines in the > terminal? > > Look forward for your favourable reply. > > With thanks > lyh > > > ------------------------------ > *From:* Simon Rit > *Sent:* Tuesday, January 12, 2021 4:22 AM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi lyh, > I had a look at what you've sent. I obtain a first result with the > following command lines: > rtksimulatedgeometry -n 100 -o g --sid 278.044 --sdd $(echo > 278.044+372.528 | bc -l) -f 6.3 > rtkfdk -p images -r p_[0-9]*.tif -o fdk.mha -g g --newspacing 0.2 > --neworigin $(echo -0.5*1951*0.2 | bc -l) --spacing 0.25 --dimension 512 > The newspacing and neworigin options set the projections spacing and > origin with the ChangeInformationImageFilter. The result is not perfect, I > believe the geometry is not right yet. Maybe there is a detector offset > you're not aware of? But your text file indicate no offset so I don't know > what's wrong. Attached is a snapshot. There are also some dead pixels which > you could try to prefilter. > I hope this helps. Cheers, > Simon > > On Tue, Jan 5, 2021 at 5:35 PM Lai Yao Hao wrote: > > Hi, > I cannot send the projections via email as the projections are too big in > size. Instead, I am sharing the files on Drive, with the hyperlink as > below. In the folder, there is a subset of 100 projections out of the 800 > projections, with the angle between each projection being 3.6 degrees. > There are other details on the projects as listed in report.txt file in the > folder. > > Google drive share link: > > https://drive.google.com/drive/folders/1wMRo3Rmr6HszUVil0vEsLPtLSLftFyfQ?usp=sharing > > Regards > lyh > ------------------------------ > *From:* Simon Rit > *Sent:* Tuesday, January 5, 2021 5:21 PM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi, > I think the issue is that your projection images are given in the TIFF > file format which does not contain important meta information such as the > origin and the spacing of the projections. You should use > ChangeInformationFilter > > to set these. I'm guessing that the origin is currently (0,0) and since you > do not set any offsets when using AddProjection, it comes down to having > the corner of your projection aligned with the central ray (line defined by > the source and the center of rotation). > You can share projections or a subset of them if you'd like us to give it > a try with your code. > Good luck! > Simon > > On Mon, Jan 4, 2021 at 4:35 PM Lai Yao Hao wrote: > > Hi, > > The code is as attached. Just for further reference, I am given images as > attached, and there are 800 of them, with 0.45 degrees separating each > frame. The naming of the screenshots depicts the frame that it is in. > > Thanks in advance for the advice and help!! I really appreciate this > community ? > > Regards > lyh > ------------------------------ > *From:* Simon Rit > *Sent:* Wednesday, December 30, 2020 9:35 PM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi, > RTK cone beam reconstruction filters expect line integrals but the > projection that you are showing seems to have the highest value in air. RTK > automatically processes such projections with log and normalization if the > pixels are unsigned short. Otherwise, you need to do it yourself. > It is not clear if the geometry is correct from the reconstruction screen > shot. The best would be to share your code if you want us to have a look. > Simon > > On Mon, Dec 28, 2020 at 8:34 AM Lai Yao Hao > wrote: > > Dear Simon and the RTK community > > Really thank you for the answer, and really sorry for the late reply. I am > trying to reconstruct a 3d model using 800 images, rotating an object 360 > degrees using rtk::ThreeDCircularProjectionGeometry, > rtk::ConstantImageSource and rtk:: FDKConeBeamReconstructionFilter from the > FirstReconstruction example as well as itk::ImageSeriesReader. > > However, the reconstruction created is shown above in the screenshot and > after checking all the parameters, I have no idea on how to move forward > from here. From reading the forums, I think that I should do one more image > filter before applying the cone beam reconstruction? However, I am not too > sure. Please advise on the next steps that can enable me to get the 3d > reconstruction. > > Thanks so much in advance and look forward to everyone's reply!! > > PS: the tif file is just 1 of the 800 images I am given to reconstruct the > object > > Regards > lyh > > ------------------------------ > *From:* Simon Rit > *Sent:* Wednesday, December 9, 2020 4:23 PM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi, > constantImageSource creates a constant volume. In the example, one is used > as input of the simulation of projections of an ellipsoid (rei) and one as > input of the reconstruction algorithm (feldkamp). fieldofview masks out > (i.e., set to 0) voxels which are not in the field of view. > I don't understand your screenshot either but if you use the tiff format, > make sure you use a viewer capable of dealing with 3D tiff images (e.g., > vv or ImageJ). > Simon > > On Wed, Dec 9, 2020 at 8:59 AM Lai Yao Hao wrote: > > Hi to all the rtk-users > > I am a new user of rtk, and I have some questions regarding the > FirstReconstruction example given in github. I have generated an image as > attached, with 4 tiny ball-like drawing hanging from the top. Can anyone > explain to me why do I get such image and what are the implications of > constantImageSource, rei, constantImageSource2, feldkamp and fieldofview? > > Your explanation will be much appreciated. Thanks in advance! > > Regards > lyh > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yao_hao777 at hotmail.com Thu Jan 28 05:17:35 2021 From: yao_hao777 at hotmail.com (Lai Yao Hao) Date: Thu, 28 Jan 2021 10:17:35 +0000 Subject: [Rtk-users] FirstReconstruction questions In-Reply-To: References: , Message-ID: Hi Simon Thanks for the clarification. In the rtkfdk.cxx file, there are these following lines: using DDFCPUType = rtk::DisplacedDetectorImageFilter; ... ddf->SetDisable(args_info.nodisplaced_flag); ... using PSSFCPUType = rtk::ParkerShortScanImageFilter; PSSFCPUType::Pointer pssf; ... pssf->SetAngularGapThreshold(args_info.short_arg * itk::Math::pi / 180.); ... using StreamerType = itk::StreamingImageFilter; ... streamerBP->SetNumberOfStreamDivisions(args_info.divisions_arg); ... Can I ask what are purpose do these 3 sections serve and do you think I need to include these 3 sections in my code? If so, what values should I include in the highlighted inputs? Appreciate your advice and look forward for your reply! Regards lyh ________________________________ From: Simon Rit Sent: Wednesday, January 27, 2021 6:21 PM To: Lai Yao Hao Cc: rtk-users at public.kitware.com Subject: Re: [Rtk-users] FirstReconstruction questions Hi, itk::ChangeInformationImageFilter is encapsulated in rtk::ProjectionsReader, see https://github.com/SimonRit/RTK/blob/master/include/rtkProjectionsReader.hxx#L481-L510. Option (3) is the correct one below. SetSpacing should be set according to your knowledge of the pixel spacing on the projections (the third dimension is ignored). SetOrigin should be set such that coordinate (0,0) on the detector corresponds to the line defined by the source and the center of rotation. If you have centered your detector, that should be -0.5*spacing*(size-1). Simon On Wed, Jan 27, 2021 at 8:28 AM Lai Yao Hao > wrote: Hi I am confused when following rtkfdk.cxx for the implementation, because in that file, there is no usage of itk::ChangeInformationFilter. Can I confirm if the usage of itkChangeInformationFilter should be according to one of the following steps? (1) Read in the projections using itk::ImageSeriesReader and itk::NumericSeriesFileNames -> use itk::ChangeInformationFilter to change spacing and origin -> use rtk::ProjectionsReader to read the images with new spacing and origin (2) Read in the projections using rtk::ProjectionsReader and itk::NumericSeriesFileNames -> use itk::ChangeInformationFilter to change spacing and origin (3) Read in the projections using rtk::ProjectionsReader and itk::NumericSeriesFileNames and change the spacing and origin using rtk::ProjectionsReader::SetSpacing and rtk::ProjectionsReader::SetOrigin. If (3) is the correct method, what input should be in the rtk::ProjectionsReader::SetSpacing and SetOrigin method and how do I get these inputs? If the above steps for reading the input projections are not correct, is it possible to suggest steps which I can read the projections correctly with the correct spacing and origin? Thanks in advance for the advice and I look forward towards your reply! Regards lyh ________________________________ From: Simon Rit > Sent: Thursday, January 21, 2021 10:52 PM To: Lai Yao Hao > Cc: rtk-users at public.kitware.com > Subject: Re: [Rtk-users] FirstReconstruction questions Hi, Instead of firstSpacing[i]*=0.2; I would have written firstSpacing[i]=0.2; Sorry I did not look closely at the original code but you should modify it. The input images should be read with rtk::ProjectionsReader for being converted to line integrals (using the Beer-Lambert law). The output pixel type should be float or double, it won't work with integer values. I suggest to follow rtkfdk.cxx for implementing this. Simon On Tue, Jan 19, 2021 at 4:59 AM Lai Yao Hao > wrote: Hi Simon, Sorry to bother you again. Just want to check if I have used itkChangeInformationImageFilter correctly in the snippet of code below: using FilterType = itk::ChangeInformationImageFilter; FilterType::Pointer filter = FilterType::New(); ImageType::ConstPointer inputImage = reader->GetOutput(); ImageType::PointType firstOrigin = inputImage->GetOrigin(); ImageType::SpacingType firstSpacing = inputImage->GetSpacing(); for (unsigned int i= 0; i < Dimension;i++) { firstSpacing[i]*=0.2; } filter->SetOutputSpacing(firstSpacing); filter->ChangeSpacingOn(); ImageType::PointType::VectorType translation; translation[0] = -0.5*1951*0.2; translation[1] = -0.5*1951*0.2; translation[2] = -0.5*1951*0.2; firstOrigin += translation; filter->SetOutputOrigin(firstOrigin); filter->ChangeOriginOn(); filter->SetInput(reader->GetOutput()); ... feldkamp->SetInput(0, constantImageSource->GetOutput()); feldkamp->SetInput(1, filter->GetOutput()); Also, I would like to ask if there are any difference to the PixelType being unsigned short or unsigned char? This is because the source code fail to compile when I used unsigned short on one computer but it works on the other computer. Looking forward to your reply and answers! Much thanks in advance! Regards, lyh ________________________________ From: Simon Rit > Sent: Wednesday, January 13, 2021 5:07 PM To: Lai Yao Hao > Cc: rtk-users at public.kitware.com > Subject: Re: [Rtk-users] FirstReconstruction questions Hi, For the first line (rtksimulatedgeometry), it's already there I believe. For the second line, as I said, you need to use itkChangeInformationImageFilter and set the origin and spacing of the projections equal to those given by newspacing and neworigin. Simon On Wed, Jan 13, 2021 at 9:51 AM Lai Yao Hao > wrote: Hi Simon Thank you so much for your help; the reconstructed image is almost similar to the image you sent (see attached file). In the previous email, for the command lines rtksimulatedgeometry -n 100 -o g --sid 278.044 --sdd $(echo 278.044+372.528 | bc -l) -f 6.3 rtkfdk -p images -r p_[0-9]*.tif -o fdk.mha -g g --newspacing 0.2 --neworigin $(echo -0.5*1951*0.2 | bc -l) --spacing 0.25 --dimension 512 how do I get this line into the test.cxx file? If there is no way to get these lines into the test.cxx file, then do I run these lines in the terminal? Look forward for your favourable reply. With thanks lyh ________________________________ From: Simon Rit > Sent: Tuesday, January 12, 2021 4:22 AM To: Lai Yao Hao > Cc: rtk-users at public.kitware.com > Subject: Re: [Rtk-users] FirstReconstruction questions Hi lyh, I had a look at what you've sent. I obtain a first result with the following command lines: rtksimulatedgeometry -n 100 -o g --sid 278.044 --sdd $(echo 278.044+372.528 | bc -l) -f 6.3 rtkfdk -p images -r p_[0-9]*.tif -o fdk.mha -g g --newspacing 0.2 --neworigin $(echo -0.5*1951*0.2 | bc -l) --spacing 0.25 --dimension 512 The newspacing and neworigin options set the projections spacing and origin with the ChangeInformationImageFilter. The result is not perfect, I believe the geometry is not right yet. Maybe there is a detector offset you're not aware of? But your text file indicate no offset so I don't know what's wrong. Attached is a snapshot. There are also some dead pixels which you could try to prefilter. I hope this helps. Cheers, Simon On Tue, Jan 5, 2021 at 5:35 PM Lai Yao Hao > wrote: Hi, I cannot send the projections via email as the projections are too big in size. Instead, I am sharing the files on Drive, with the hyperlink as below. In the folder, there is a subset of 100 projections out of the 800 projections, with the angle between each projection being 3.6 degrees. There are other details on the projects as listed in report.txt file in the folder. Google drive share link: https://drive.google.com/drive/folders/1wMRo3Rmr6HszUVil0vEsLPtLSLftFyfQ?usp=sharing Regards lyh ________________________________ From: Simon Rit > Sent: Tuesday, January 5, 2021 5:21 PM To: Lai Yao Hao > Cc: rtk-users at public.kitware.com > Subject: Re: [Rtk-users] FirstReconstruction questions Hi, I think the issue is that your projection images are given in the TIFF file format which does not contain important meta information such as the origin and the spacing of the projections. You should use ChangeInformationFilter to set these. I'm guessing that the origin is currently (0,0) and since you do not set any offsets when using AddProjection, it comes down to having the corner of your projection aligned with the central ray (line defined by the source and the center of rotation). You can share projections or a subset of them if you'd like us to give it a try with your code. Good luck! Simon On Mon, Jan 4, 2021 at 4:35 PM Lai Yao Hao > wrote: Hi, The code is as attached. Just for further reference, I am given images as attached, and there are 800 of them, with 0.45 degrees separating each frame. The naming of the screenshots depicts the frame that it is in. Thanks in advance for the advice and help!! I really appreciate this community ? Regards lyh ________________________________ From: Simon Rit > Sent: Wednesday, December 30, 2020 9:35 PM To: Lai Yao Hao > Cc: rtk-users at public.kitware.com > Subject: Re: [Rtk-users] FirstReconstruction questions Hi, RTK cone beam reconstruction filters expect line integrals but the projection that you are showing seems to have the highest value in air. RTK automatically processes such projections with log and normalization if the pixels are unsigned short. Otherwise, you need to do it yourself. It is not clear if the geometry is correct from the reconstruction screen shot. The best would be to share your code if you want us to have a look. Simon On Mon, Dec 28, 2020 at 8:34 AM Lai Yao Hao > wrote: Dear Simon and the RTK community Really thank you for the answer, and really sorry for the late reply. I am trying to reconstruct a 3d model using 800 images, rotating an object 360 degrees using rtk::ThreeDCircularProjectionGeometry, rtk::ConstantImageSource and rtk:: FDKConeBeamReconstructionFilter from the FirstReconstruction example as well as itk::ImageSeriesReader. However, the reconstruction created is shown above in the screenshot and after checking all the parameters, I have no idea on how to move forward from here. From reading the forums, I think that I should do one more image filter before applying the cone beam reconstruction? However, I am not too sure. Please advise on the next steps that can enable me to get the 3d reconstruction. Thanks so much in advance and look forward to everyone's reply!! PS: the tif file is just 1 of the 800 images I am given to reconstruct the object Regards lyh ________________________________ From: Simon Rit > Sent: Wednesday, December 9, 2020 4:23 PM To: Lai Yao Hao > Cc: rtk-users at public.kitware.com > Subject: Re: [Rtk-users] FirstReconstruction questions Hi, constantImageSource creates a constant volume. In the example, one is used as input of the simulation of projections of an ellipsoid (rei) and one as input of the reconstruction algorithm (feldkamp). fieldofview masks out (i.e., set to 0) voxels which are not in the field of view. I don't understand your screenshot either but if you use the tiff format, make sure you use a viewer capable of dealing with 3D tiff images (e.g., vv or ImageJ). Simon On Wed, Dec 9, 2020 at 8:59 AM Lai Yao Hao > wrote: Hi to all the rtk-users I am a new user of rtk, and I have some questions regarding the FirstReconstruction example given in github. I have generated an image as attached, with 4 tiny ball-like drawing hanging from the top. Can anyone explain to me why do I get such image and what are the implications of constantImageSource, rei, constantImageSource2, feldkamp and fieldofview? Your explanation will be much appreciated. Thanks in advance! Regards lyh _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com https://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu Jan 28 16:50:57 2021 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 28 Jan 2021 22:50:57 +0100 Subject: [Rtk-users] FirstReconstruction questions In-Reply-To: References: Message-ID: Hi, rtkfdk is a full pipeline which also allows to do short scans ( https://doi.org/10.1118/1.595078) or displaced detector ( https://doi.org/10.1118/1.1489043). The first yellow mark disables or enables the displaced detector filter depending on a parameter on the command line. The second yellow park sets how large should the gap be to be a short scan (in the Parker algorithm). The last mark uses streaming to compute the final image by parts. args_info.divisions_arg is the number of parts. If you have a regular full revolution with a centered detector and a computer with enough RAM, you won't need any of this, no. Simon On Thu, Jan 28, 2021 at 11:18 AM Lai Yao Hao wrote: > Hi Simon > > Thanks for the clarification. In the rtkfdk.cxx file, there are these > following lines: > using DDFCPUType = rtk::DisplacedDetectorImageFilter; > ... > ddf->SetDisable(args_info.nodisplaced_flag); > > ... > > using PSSFCPUType = rtk::ParkerShortScanImageFilter; > PSSFCPUType::Pointer pssf; > ... > pssf->SetAngularGapThreshold(args_info.short_arg * itk::Math::pi / 180.); > > ... > > using StreamerType = itk::StreamingImageFilter CPUOutputImageType>; > ... > streamerBP->SetNumberOfStreamDivisions(args_info.divisions_arg); > ... > > > Can I ask what are purpose do these 3 sections serve and do you think I > need to include these 3 sections in my code? If so, what values should I > include in the highlighted inputs? > > Appreciate your advice and look forward for your reply! > > Regards > lyh > ------------------------------ > *From:* Simon Rit > *Sent:* Wednesday, January 27, 2021 6:21 PM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi, > itk::ChangeInformationImageFilter is encapsulated in > rtk::ProjectionsReader, see > https://github.com/SimonRit/RTK/blob/master/include/rtkProjectionsReader.hxx#L481-L510. > Option (3) is the correct one below. SetSpacing should be set according to > your knowledge of the pixel spacing on the projections (the third dimension > is ignored). SetOrigin should be set such that coordinate (0,0) on the > detector corresponds to the line defined by the source and the center of > rotation. If you have centered your detector, that should be > -0.5*spacing*(size-1). > Simon > > On Wed, Jan 27, 2021 at 8:28 AM Lai Yao Hao > wrote: > > Hi > > I am confused when following rtkfdk.cxx for the implementation, because in > that file, there is no usage of itk::ChangeInformationFilter. Can I confirm > if the usage of itkChangeInformationFilter should be according to one of > the following steps? > > (1) Read in the projections using itk::ImageSeriesReader and > itk::NumericSeriesFileNames -> use itk::ChangeInformationFilter to change > spacing and origin -> use rtk::ProjectionsReader to read the images with > new spacing and origin > > > (2) Read in the projections using rtk::ProjectionsReader and > itk::NumericSeriesFileNames -> use itk::ChangeInformationFilter to change > spacing and origin > > (3) Read in the projections using rtk::ProjectionsReader and > itk::NumericSeriesFileNames and change the spacing and origin using > rtk::ProjectionsReader::SetSpacing and rtk::ProjectionsReader::SetOrigin. > > If (3) is the correct method, what input should be in the > rtk::ProjectionsReader::SetSpacing and SetOrigin method and how do I get > these inputs? > > If the above steps for reading the input projections are not correct, is > it possible to suggest steps which I can read the projections correctly > with the correct spacing and origin? > > Thanks in advance for the advice and I look forward towards your reply! > > Regards > lyh > ------------------------------ > *From:* Simon Rit > *Sent:* Thursday, January 21, 2021 10:52 PM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi, > Instead of > firstSpacing[i]*=0.2; > I would have written > firstSpacing[i]=0.2; > Sorry I did not look closely at the original code but you should modify > it. The input images should be read with rtk::ProjectionsReader for being > converted to line integrals (using the Beer-Lambert law). The output pixel > type should be float or double, it won't work with integer values. I > suggest to follow rtkfdk.cxx for implementing this. > Simon > > On Tue, Jan 19, 2021 at 4:59 AM Lai Yao Hao > wrote: > > Hi Simon, > > Sorry to bother you again. Just want to check if I have used > itkChangeInformationImageFilter correctly in the snippet of code below: > > using FilterType = itk::ChangeInformationImageFilter; > FilterType::Pointer filter = FilterType::New(); > ImageType::ConstPointer inputImage = reader->GetOutput(); > ImageType::PointType firstOrigin = inputImage->GetOrigin(); > ImageType::SpacingType firstSpacing = inputImage->GetSpacing(); > for (unsigned int i= 0; i < Dimension;i++) { > firstSpacing[i]*=0.2; > } > filter->SetOutputSpacing(firstSpacing); > filter->ChangeSpacingOn(); > ImageType::PointType::VectorType translation; > > translation[0] = -0.5*1951*0.2; > translation[1] = -0.5*1951*0.2; > translation[2] = -0.5*1951*0.2; > > firstOrigin += translation; > filter->SetOutputOrigin(firstOrigin); > filter->ChangeOriginOn(); > > filter->SetInput(reader->GetOutput()); > ... > feldkamp->SetInput(0, constantImageSource->GetOutput()); > feldkamp->SetInput(1, filter->GetOutput()); > > Also, I would like to ask if there are any difference to the PixelType > being unsigned short or unsigned char? This is because the source code > fail to compile when I used unsigned short on one computer but it works on > the other computer. > > Looking forward to your reply and answers! Much thanks in advance! > > Regards, > lyh > ------------------------------ > *From:* Simon Rit > *Sent:* Wednesday, January 13, 2021 5:07 PM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi, > For the first line (rtksimulatedgeometry), it's already there I believe. > For the second line, as I said, you need to use > itkChangeInformationImageFilter and set the origin and spacing of the > projections equal to those given by newspacing and neworigin. > Simon > > On Wed, Jan 13, 2021 at 9:51 AM Lai Yao Hao > wrote: > > Hi Simon > > Thank you so much for your help; the reconstructed image is almost similar > to the image you sent (see attached file). In the previous email, for the > command lines > rtksimulatedgeometry -n 100 -o g --sid 278.044 --sdd $(echo > 278.044+372.528 | bc -l) -f 6.3 > rtkfdk -p images -r p_[0-9]*.tif -o fdk.mha -g g --newspacing 0.2 > --neworigin $(echo -0.5*1951*0.2 | bc -l) --spacing 0.25 --dimension 512 > how do I get this line into the test.cxx file? If there is no way to get > these lines into the test.cxx file, then do I run these lines in the > terminal? > > Look forward for your favourable reply. > > With thanks > lyh > > > ------------------------------ > *From:* Simon Rit > *Sent:* Tuesday, January 12, 2021 4:22 AM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi lyh, > I had a look at what you've sent. I obtain a first result with the > following command lines: > rtksimulatedgeometry -n 100 -o g --sid 278.044 --sdd $(echo > 278.044+372.528 | bc -l) -f 6.3 > rtkfdk -p images -r p_[0-9]*.tif -o fdk.mha -g g --newspacing 0.2 > --neworigin $(echo -0.5*1951*0.2 | bc -l) --spacing 0.25 --dimension 512 > The newspacing and neworigin options set the projections spacing and > origin with the ChangeInformationImageFilter. The result is not perfect, I > believe the geometry is not right yet. Maybe there is a detector offset > you're not aware of? But your text file indicate no offset so I don't know > what's wrong. Attached is a snapshot. There are also some dead pixels which > you could try to prefilter. > I hope this helps. Cheers, > Simon > > On Tue, Jan 5, 2021 at 5:35 PM Lai Yao Hao wrote: > > Hi, > I cannot send the projections via email as the projections are too big in > size. Instead, I am sharing the files on Drive, with the hyperlink as > below. In the folder, there is a subset of 100 projections out of the 800 > projections, with the angle between each projection being 3.6 degrees. > There are other details on the projects as listed in report.txt file in the > folder. > > Google drive share link: > > https://drive.google.com/drive/folders/1wMRo3Rmr6HszUVil0vEsLPtLSLftFyfQ?usp=sharing > > Regards > lyh > ------------------------------ > *From:* Simon Rit > *Sent:* Tuesday, January 5, 2021 5:21 PM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi, > I think the issue is that your projection images are given in the TIFF > file format which does not contain important meta information such as the > origin and the spacing of the projections. You should use > ChangeInformationFilter > > to set these. I'm guessing that the origin is currently (0,0) and since you > do not set any offsets when using AddProjection, it comes down to having > the corner of your projection aligned with the central ray (line defined by > the source and the center of rotation). > You can share projections or a subset of them if you'd like us to give it > a try with your code. > Good luck! > Simon > > On Mon, Jan 4, 2021 at 4:35 PM Lai Yao Hao wrote: > > Hi, > > The code is as attached. Just for further reference, I am given images as > attached, and there are 800 of them, with 0.45 degrees separating each > frame. The naming of the screenshots depicts the frame that it is in. > > Thanks in advance for the advice and help!! I really appreciate this > community ? > > Regards > lyh > ------------------------------ > *From:* Simon Rit > *Sent:* Wednesday, December 30, 2020 9:35 PM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi, > RTK cone beam reconstruction filters expect line integrals but the > projection that you are showing seems to have the highest value in air. RTK > automatically processes such projections with log and normalization if the > pixels are unsigned short. Otherwise, you need to do it yourself. > It is not clear if the geometry is correct from the reconstruction screen > shot. The best would be to share your code if you want us to have a look. > Simon > > On Mon, Dec 28, 2020 at 8:34 AM Lai Yao Hao > wrote: > > Dear Simon and the RTK community > > Really thank you for the answer, and really sorry for the late reply. I am > trying to reconstruct a 3d model using 800 images, rotating an object 360 > degrees using rtk::ThreeDCircularProjectionGeometry, > rtk::ConstantImageSource and rtk:: FDKConeBeamReconstructionFilter from the > FirstReconstruction example as well as itk::ImageSeriesReader. > > However, the reconstruction created is shown above in the screenshot and > after checking all the parameters, I have no idea on how to move forward > from here. From reading the forums, I think that I should do one more image > filter before applying the cone beam reconstruction? However, I am not too > sure. Please advise on the next steps that can enable me to get the 3d > reconstruction. > > Thanks so much in advance and look forward to everyone's reply!! > > PS: the tif file is just 1 of the 800 images I am given to reconstruct the > object > > Regards > lyh > > ------------------------------ > *From:* Simon Rit > *Sent:* Wednesday, December 9, 2020 4:23 PM > *To:* Lai Yao Hao > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] FirstReconstruction questions > > Hi, > constantImageSource creates a constant volume. In the example, one is used > as input of the simulation of projections of an ellipsoid (rei) and one as > input of the reconstruction algorithm (feldkamp). fieldofview masks out > (i.e., set to 0) voxels which are not in the field of view. > I don't understand your screenshot either but if you use the tiff format, > make sure you use a viewer capable of dealing with 3D tiff images (e.g., > vv or ImageJ). > Simon > > On Wed, Dec 9, 2020 at 8:59 AM Lai Yao Hao wrote: > > Hi to all the rtk-users > > I am a new user of rtk, and I have some questions regarding the > FirstReconstruction example given in github. I have generated an image as > attached, with 4 tiny ball-like drawing hanging from the top. Can anyone > explain to me why do I get such image and what are the implications of > constantImageSource, rei, constantImageSource2, feldkamp and fieldofview? > > Your explanation will be much appreciated. Thanks in advance! > > Regards > lyh > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: