Hi Simon

Thanks for the clarification. In the rtkfdk.cxx file, there are these following 
lines:
using DDFCPUType = rtk::DisplacedDetectorImageFilter<OutputImageType>;
...
ddf->SetDisable(args_info.nodisplaced_flag);

...

using PSSFCPUType = rtk::ParkerShortScanImageFilter<OutputImageType>;
PSSFCPUType::Pointer pssf;
...
pssf->SetAngularGapThreshold(args_info.short_arg * itk::Math::pi / 180.);

...

using StreamerType = itk::StreamingImageFilter<CPUOutputImageType, 
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 <simon....@creatis.insa-lyon.fr>
Sent: Wednesday, January 27, 2021 6:21 PM
To: Lai Yao Hao <yao_hao...@hotmail.com>
Cc: rtk-users@public.kitware.com <rtk-users@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 
<yao_hao...@hotmail.com<mailto:yao_hao...@hotmail.com>> 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 
<simon....@creatis.insa-lyon.fr<mailto:simon....@creatis.insa-lyon.fr>>
Sent: Thursday, January 21, 2021 10:52 PM
To: Lai Yao Hao <yao_hao...@hotmail.com<mailto:yao_hao...@hotmail.com>>
Cc: rtk-users@public.kitware.com<mailto:rtk-users@public.kitware.com> 
<rtk-users@public.kitware.com<mailto:rtk-users@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 
<yao_hao...@hotmail.com<mailto:yao_hao...@hotmail.com>> 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<ImageType>;
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 
<simon....@creatis.insa-lyon.fr<mailto:simon....@creatis.insa-lyon.fr>>
Sent: Wednesday, January 13, 2021 5:07 PM
To: Lai Yao Hao <yao_hao...@hotmail.com<mailto:yao_hao...@hotmail.com>>
Cc: rtk-users@public.kitware.com<mailto:rtk-users@public.kitware.com> 
<rtk-users@public.kitware.com<mailto:rtk-users@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 
<yao_hao...@hotmail.com<mailto:yao_hao...@hotmail.com>> 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 
<simon....@creatis.insa-lyon.fr<mailto:simon....@creatis.insa-lyon.fr>>
Sent: Tuesday, January 12, 2021 4:22 AM
To: Lai Yao Hao <yao_hao...@hotmail.com<mailto:yao_hao...@hotmail.com>>
Cc: rtk-users@public.kitware.com<mailto:rtk-users@public.kitware.com> 
<rtk-users@public.kitware.com<mailto:rtk-users@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 
<yao_hao...@hotmail.com<mailto:yao_hao...@hotmail.com>> 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 
<simon....@creatis.insa-lyon.fr<mailto:simon....@creatis.insa-lyon.fr>>
Sent: Tuesday, January 5, 2021 5:21 PM
To: Lai Yao Hao <yao_hao...@hotmail.com<mailto:yao_hao...@hotmail.com>>
Cc: rtk-users@public.kitware.com<mailto:rtk-users@public.kitware.com> 
<rtk-users@public.kitware.com<mailto:rtk-users@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<https://itk.org/Doxygen/html/classitk_1_1ChangeInformationImageFilter.html>
 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 
<yao_hao...@hotmail.com<mailto:yao_hao...@hotmail.com>> 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 
<simon....@creatis.insa-lyon.fr<mailto:simon....@creatis.insa-lyon.fr>>
Sent: Wednesday, December 30, 2020 9:35 PM
To: Lai Yao Hao <yao_hao...@hotmail.com<mailto:yao_hao...@hotmail.com>>
Cc: rtk-users@public.kitware.com<mailto:rtk-users@public.kitware.com> 
<rtk-users@public.kitware.com<mailto:rtk-users@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 
<yao_hao...@hotmail.com<mailto:yao_hao...@hotmail.com>> 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 
<simon....@creatis.insa-lyon.fr<mailto:simon....@creatis.insa-lyon.fr>>
Sent: Wednesday, December 9, 2020 4:23 PM
To: Lai Yao Hao <yao_hao...@hotmail.com<mailto:yao_hao...@hotmail.com>>
Cc: rtk-users@public.kitware.com<mailto:rtk-users@public.kitware.com> 
<rtk-users@public.kitware.com<mailto:rtk-users@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<http://vv.creatis.insa-lyon.fr> or ImageJ).
Simon

On Wed, Dec 9, 2020 at 8:59 AM Lai Yao Hao 
<yao_hao...@hotmail.com<mailto:yao_hao...@hotmail.com>> 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@public.kitware.com<mailto:Rtk-users@public.kitware.com>
https://public.kitware.com/mailman/listinfo/rtk-users
_______________________________________________
Rtk-users mailing list
Rtk-users@public.kitware.com
https://public.kitware.com/mailman/listinfo/rtk-users

Reply via email to