Dear Zahid,
The --divisions is an option of the command-line application rtkfdk. It
is not directly an option of the FDKConeBeamReconstructionFilter :
rather, it is passed to a streaming filter at the end of the pipeline.
Look for the following bit of code in rtkfdk.cxx :
// Streaming depending on streaming capability of writer
typedef itk::StreamingImageFilter<CPUOutputImageType,
CPUOutputImageType> StreamerType;
StreamerType::Pointer streamerBP = StreamerType::New();
streamerBP->SetInput( pfeldkamp );
streamerBP->SetNumberOfStreamDivisions( args_info.divisions_arg );
You can find information on how a streaming filter works on this page:
https://itk.org/Doxygen/html/classitk_1_1StreamingImageFilter.html
I hope it helps,
Cyril
On 11/02/2016 09:01 AM, Zahid Hasan Ansari wrote:
Dear Cyril Mory,
I have tried but I am not getting where to give
--division 4 in my code.
Please find my code given below and please let me know
where I need to change in my code to make it work.
int _tmain(int argc, _TCHAR* argv[])
{
#pragma region "Variable declaration"
const double PI = 3.14159265358979323846;
float *angles;
int nProj = 349;
typedef unsigned short pixelType;
typedef float OutpixelType;
const int dimension = 3;
typedef itk::Image<pixelType, dimension> imageType;
typedef itk::ImageRegionConstIterator<imageType > ImageIteratorType;
imageType::Pointer Projections = imageType::New();
#pragma endregion "Variable declaration"
Projections =
ReadRawImages("D:\\CBCT\\CIRS_1204020_25022016153227\\Proj_%d.raw", nProj);
imageType::SpacingType pSpacing;
pSpacing[0] = 0.2960;
pSpacing[1] = 0.2960;
pSpacing[2] = 0.2960;
Projections->SetSpacing(pSpacing);
imageType::PointType pOrigin;
pOrigin[0] = -212.972;
pOrigin[1] = -212.972;
pOrigin[2] = -212.972; //-158.50;
Projections->SetOrigin(pOrigin);
Projections->Update();
//Read angles.
char *angles_file = "D:/CBCT/CIRS_1204020_25022016153227/angle.txt";
angles = new float[nProj];
angles = readAngles(angles_file, angles);
#pragma region"Geometry"
// Geometry object
typedef rtk::ThreeDCircularProjectionGeometry GeometryType;
GeometryType::Pointer geometry = GeometryType::New();
for (unsigned int noProj = 0; noProj < nProj; noProj++)
{
geometry->AddProjection(1000.0, 1500.0, angles[noProj], 15.0,
10, 0, 0);
// 136 half fan //2.07 Kidwai //
}
typedef rtk::ThreeDCircularProjectionGeometryXMLFileWriter
GeometryWriterType;
GeometryWriterType::Pointer geometryWriter = GeometryWriterType::New();
geometryWriter->SetFilename("D:\\geo.xml");
geometryWriter->SetObject(geometry);
geometryWriter->WriteFile();
geometry->Update();
#pragma endregion "Geometry"
//Define output image type
#ifdef USE_CUDA
typedef itk::CudaImage< OutpixelType, dimension >
OutPutImageType;
typedef rtk::ParkerShortScanImageFilter< OutPutImageType >
PSSFType;
typedef rtk::CudaFDKConeBeamReconstructionFilter FDKType;
#else
typedef itk::Image<OutpixelType, dimension> OutPutImageType;
typedef rtk::ParkerShortScanImageFilter<OutPutImageType >
PSSFType;
typedef rtk::FDKConeBeamReconstructionFilter<OutPutImageType>
FDKType;
#endif
//ScatterCorrection
typedef rtk::BoellaardScatterCorrectionImageFilter<imageType, imageType
>
BoellaardScatterCorrectionImageFilterType;
BoellaardScatterCorrectionImageFilterType::Pointer ScatterCorrection =
BoellaardScatterCorrectionImageFilterType::New();
ScatterCorrection->SetInput(Projections);
//VarianObiRawImageFilter
typedef rtk::VarianObiRawImageFilter< imageType, OutPutImageType >
RawImageFilterType;
RawImageFilterType::Pointer AttenuationFilter =
RawImageFilterType::New();
AttenuationFilter->SetInput(ScatterCorrection->GetOutput());
//Create the output image
typedef rtk::ConstantImageSource< OutPutImageType >
ConstantImageSourceType;
ConstantImageSourceType::PointType origin_p;
ConstantImageSourceType::SizeType size_p;
ConstantImageSourceType::SpacingType spacing_p;
ConstantImageSourceType::Pointer projectionsSource =
ConstantImageSourceType::New();
origin_p[0] = -127.5;
origin_p[1] = -127.5;
origin_p[2] = -127.5;
size_p[0] = 512;
size_p[1] = 512;
size_p[2] = 512;
spacing_p[0] = (origin_p[0] / size_p[0]) * 2 * (-1);
spacing_p[1] = (origin_p[1] / size_p[1]) * 2 * (-1);
spacing_p[2] = (origin_p[2] / size_p[2]) * 2 * (-1);
projectionsSource->SetOrigin(origin_p);
projectionsSource->SetSpacing(spacing_p);
projectionsSource->SetSize(size_p);
projectionsSource->SetConstant(0);
// Short scan image filter
PSSFType::Pointer pssf = PSSFType::New();
pssf->SetInput(AttenuationFilter->GetOutput());
pssf->SetGeometry(geometry);
pssf->InPlaceOff();
std::cout << "short scan image filter success" << std::endl;
FDKType::Pointer feldkamp = FDKType::New();
feldkamp->SetInput(0, projectionsSource->GetOutput());
feldkamp->SetInput(1, pssf->GetOutput());
feldkamp->SetGeometry(geometry);
feldkamp->GetRampFilter()->SetTruncationCorrection(1.0);
feldkamp->GetRampFilter()->SetHannCutFrequency(5.0);
feldkamp->GetRampFilter()->SetHannCutFrequencyY(5.0);
feldkamp->GetRampFilter()->SetCosineCutFrequency(5.0);
feldkamp->GetRampFilter()->SetHammingFrequency(5.0);
feldkamp->GetRampFilter()->SetRamLakCutFrequency(5.0);
feldkamp->SetGPUEnabled(1);
feldkamp->SetNumberOfThreads(10000);
#pragma region "Write volume"
//Create a raw io for writing
itk::RawImageIO<float, dimension>::Pointer io;
io = itk::RawImageIO<float, dimension>::New();
for (unsigned int i = 0; i < dimension; i++)
{
io->SetDimensions(i, size_p[i]);
io->SetSpacing(i, spacing_p[i]);
io->SetOrigin(i, origin_p[i]);
}
io->SetHeaderSize(0);
io->SetByteOrderToLittleEndian();
io->SetPixelType(itk::ImageIOBase::SCALAR);
io->SetNumberOfComponents(1);
io->SetNumberOfDimensions(3);
//create a writer and write reconstructed file
itk::ImageFileWriter<OutPutImageType>::Pointer writer;
writer = itk::ImageFileWriter<OutPutImageType>::New();
writer->SetFileName("D:\\Output.raw");
writer->SetImageIO(io);
writer->SetInput(feldkamp->GetOutput());
try
{
writer->Update();
}
catch (itk::ExceptionObject & excp)
{
std::cerr << "Error while writing the image " << std::endl;
std::cerr << excp << std::endl;
getchar();
}
#pragma endregion "WriteVolume"
delete[] angles;
return 0;
}
Thanks & Regards
Zahid Hasan Ansari
Senior Design Engineer
Mobile No. +91-9738379729
Panacea Medical Technologies Pvt. Ltd.
Head Office: Plot #119, GF, Envision Technology Center, EPIP Area Phase 1,
Whitefield, Bangalore - 560 066, Karnataka, INDIA
Manufacturing Unit: Plot #87 A, Phase -II, Malur KIADB Industrial Area,
Malur - 563130. Kolar District. INDIA.
Tel : +91 80 4242 8700 / 2845 4785 | Fax : + 91 42428710 | Url :
http://www.panaceamedical.com
Bangalore - India.
----- Original Message -----
From: Cyril Mory [mailto:[email protected]]
To: Zahid Hasan Ansari [mailto:[email protected]], Simon Rit
[mailto:[email protected]]
Cc: [email protected], [email protected]
Subject: Re: [Rtk-users] Reg: CBCT 1k reconstruction error
Dear Zahid,
I was able to perform a reconstruction from your header and geometry
file, using the following command lines:
rtkprojectshepploganphantom -o simulatedprojections.mha -g geo.xml
--phantomscale "128,128,128" --like Output.mhd
rtkfdk -p . -r simulatedprojections.mha -g geo.xml -o fdk.mha --hardware
cuda --dimension 1024 --spacing 0.25 --lowmem --divisions 4
The first computes projections through a Shepp & Logan phantom, with the
same size, spacing, origin, etc... as your projections, using your
geometry file geo.xml.
The second line performs the FDK reconstruction. I had to use both the
"--lowmem" and the "--divisions 4" since I have little GPU memory (3GB,
on a Geforce GTX 780). "--lowmem" loads the projections into memory by
subsets of 16. "--divisions 4" cuts the reconstructed volume into 4
parts, reconstructs them one by one, then assembles the results. Can you
run the same commands and let us know whether you still encounter the
crash you mentioned ? If it works, you can use your own projection data
in the second command line instead of "simulatedprojections.mha".
Best,
Cyril
On 10/25/2016 01:13 PM, Zahid Hasan Ansari wrote:
Dear Sir,
Please find the Header file in the attachment.
Thanks & Regards
Zahid Hasan Ansari
----- Original Message -----
From: Cyril Mory [mailto:[email protected]]
To: Zahid Hasan Ansari [mailto:[email protected]], Simon
Rit
[mailto:[email protected]]
Cc: [email protected], [email protected]
Subject: Re: [Rtk-users] Reg: CBCT 1k reconstruction error
Dear Zahid,
We do not need the projections file, at least not for a first stage of
error tracking. We only need the header.
Try the following command line:
rtkprojections -p . -r yourProjectionsFileName -o proj.mhd
It should write a "proj.mhd" and a "proj.raw". The "proj.mhd" file is
what we need, and it is a very light text file. The "proj.raw" contains
the pixel values, but at the moment we do not need them. We will create
our own proj.raw file, filled with zeros, which should be enough to
track down the error you encounter.
Looking forward to receiving your file,
Cyril
On 10/25/2016 09:22 AM, Zahid Hasan Ansari wrote:
Dear Sir,
The single raw file of the projections is 1.4 GB and we
are
not
able to send this big file to you. Can you please suggest other
alternatives
for this?
Or can you provide us the PC configuration to solve the
issue?
Let me know if any other clarification is required.
Thanks & Regards
Zahid Hasan Ansari
----- Original Message -----
From: Cyril Mory [mailto:[email protected]]
To: Zahid Hasan Ansari [mailto:[email protected]], Simon
Rit
[mailto:[email protected]]
Cc: [email protected], [email protected]
Subject: Re: [Rtk-users] Reg: CBCT 1k reconstruction error
Hello Zahid,
We will need the header of your projections file, too (It is best if
you
have all your projections as a single .mhd and a single .raw file, so
it
should be 3-D image, and you send only the .mhd file).
Regards,
Cyril
On 10/19/2016 03:18 PM, Zahid Hasan Ansari wrote:
Dear Cyril Mory,
I have only used RTK version 1.3.0. but in the
error
message it is showing RTK version 1.2.0.
Please find the attachment of the geometry file
of
our
projections.
Thanks & Regards
Zahid Hasan Ansari
----- Original Message -----
From: Cyril Mory [mailto:[email protected]]
To: Zahid Hasan Ansari [mailto:[email protected]],
Simon
Rit
[mailto:[email protected]]
Cc: [email protected], [email protected]
Subject: Re: [Rtk-users] Reg: CBCT 1k reconstruction error
Dear Zahid,
Without some more information, it's unlikely that we find the
source
of
the problem. Here are a few things you can do to help us (and
therefore
yourself):
- try version 1.3.0 of RTK: there have been considerable changes in
the
Cuda forward and back projection filters since v1.2.0, so your
problem
might disappear just by upgrading to the new version
- create a small example that reproduces your problem. You can, for
example, simulate a geometry, simulate projections of a shepp logan
phantom, and reconstruct from these projections (take a look at
http://wiki.openrtk.org/index.php/RTK/Scripts/FDK if you need an
example). And send us the script
- OR send us your geometry file and the header of your projections
file
(no need to send the projection data itself, we'll create a
zero-filled
stack of projections), and the command line that crashes
Best regards,
Cyril
On 10/17/2016 02:27 PM, Zahid Hasan Ansari wrote:
Dear Simon Rit,
Please find the screen shot in the attachment.
Thanks & Regards
Zahid Hasan Ansari
Senior Design Engineer
Mobile No. +91-9738379729
Panacea Medical Technologies Pvt. Ltd.
Head Office: Plot #119, GF, Envision Technology Center, EPIP Area
Phase
1,
Whitefield, Bangalore - 560 066, Karnataka, INDIA
Manufacturing Unit: Plot #87 A, Phase -II, Malur KIADB Industrial
Area,
Malur - 563130. Kolar District. INDIA.
Tel : +91 80 4242 8700 / 2845 4785 | Fax : + 91 42428710 | Url :
http://www.panaceamedical.com
Bangalore - India.
----- Original Message -----
From: Simon Rit [mailto:[email protected]]
To: Zahid Hasan Ansari [mailto:[email protected]]
Cc: [email protected]
[mailto:[email protected]],
[email protected]
Subject: Re: [Rtk-users] Reg: CBCT 1k reconstruction error
Dear Zahid,
There is no screenshot so I'm guessing that the problem is a CUDA
memory
error. If you use the command line tool rtkfdk, you should first
make
sure
that you use the --lowmem option to stream the projection images.
If
it
is
no sufficient, you can split your volume using the --divisions.
The
corresponding C++ code can be found in rtkfdk.cxx.
Is Panacea Medical using RTK? We are happy to advertise the use
of
RTK
on
our case studies webpage
<http://openrtk.org/RTK/project/casestudies.html>.
Simon
On Sat, Oct 15, 2016 at 11:12 AM, Zahid Hasan Ansari <
[email protected]> wrote:
Dear Sir\Madam,
I am unable to do 1024x1024x1024
reconstruction
using
RTK
CudaFDKConeBeamReconstructionFilter. Please check the screen
shoot
of
the
same.
I am using the following items given below.
1. RTK - RTK version 1.3
2. ITK - ITK version 4.7
3. Visual Studio 2013 win 64-bit console
application
4. GeForce GTX TITAN X GPU.
5. CUDA 7.
6. CMake version 3.4.3.
7. Windows 7 64-bit OS.
Please provide the solution of this and let
me
know
if
any
other clarification is required.
Thanks & Regards
Zahid Hasan Ansari
Senior Design Engineer
Mobile No. +91-9738379729
Panacea Medical Technologies Pvt. Ltd.
Head Office: Plot #119, GF, Envision Technology Center, EPIP
Area
Phase
1,
Whitefield, Bangalore - 560 066, Karnataka, INDIA
Manufacturing Unit: Plot #87 A, Phase -II, Malur KIADB
Industrial
Area,
Malur - 563130. Kolar District. INDIA.
Tel : +91 80 4242 8700 / 2845 4785 | Fax : + 91 42428710 | Url
:
http://www.panaceamedical.com
Bangalore - India.
________________________________________
PANACEA MEDICAL TECHNOLOGIES PVT. LTD.
Head Office: Plot #119, GF, Envision Technology Center, EPIP
Area
Phase
1, Whitefield, Bangalore - 560 066, Karnataka, INDIA
Manufacturing Unit: Plot #87 A, Phase -II, Malur KIADB
Industrial
Area,
Malur - 563130. Kolar District. INDIA.
Tel : +91 80 4242 8700 / 2845 4785
Fax : + 91 80 42428710
Url : http://www.panaceamedical.com
____________________________________________________________
________________
PMT EMAIL DISCLAIMER:
This email and any files transmitted with it are confidential
and
intended
solely for the use of the individual or entity to whom they are
addressed.
If you have received this email in error please notify the
system
manager.
Please note that any views or opinions presented in this email
are
solely
those of the author and do not necessarily represent those of
the
company.
Finally, the recipient should check this email and any
attachments
for
the
presence of viruses. The company accepts no liability for any
damage
caused by any virus transmitted by this email.
_______________________________________________
Rtk-users mailing list
[email protected]
http://public.kitware.com/mailman/listinfo/rtk-users
________________________________________
PANACEA MEDICAL TECHNOLOGIES PVT. LTD.
Head Office: Plot #119, GF, Envision Technology Center, EPIP Area
Phase
1,
Whitefield, Bangalore - 560 066, Karnataka, INDIA
Manufacturing Unit: Plot #87 A, Phase -II, Malur KIADB Industrial
Area,
Malur - 563130. Kolar District. INDIA.
Tel : +91 80 4242 8700 / 2845 4785
Fax : + 91 80 42428710
Url : http://www.panaceamedical.com
____________________________________________________________________________
PMT EMAIL DISCLAIMER:
This email and any files transmitted with it are confidential and
intended
solely for the use of the individual or entity to whom they are
addressed.
If you have received this email in error please notify the system
manager.
Please note that any views or opinions presented in this email are
solely
those of the author and do not necessarily represent those of the
company.
Finally, the recipient should check this email and any attachments
for
the
presence of viruses. The company accepts no liability for any
damage
caused by any virus transmitted by this email.
_______________________________________________
Rtk-users mailing list
[email protected]
http://public.kitware.com/mailman/listinfo/rtk-users
________________________________________
PANACEA MEDICAL TECHNOLOGIES PVT. LTD.
Head Office: Plot #119, GF, Envision Technology Center, EPIP Area
Phase
1,
Whitefield, Bangalore - 560 066, Karnataka, INDIA
Manufacturing Unit: Plot #87 A, Phase -II, Malur KIADB Industrial
Area,
Malur - 563130. Kolar District. INDIA.
Tel : +91 80 4242 8700 / 2845 4785
Fax : + 91 80 42428710
Url : http://www.panaceamedical.com
____________________________________________________________________________
PMT EMAIL DISCLAIMER:
This email and any files transmitted with it are confidential and
intended
solely for the use of the individual or entity to whom they are
addressed.
If you have received this email in error please notify the system
manager.
Please note that any views or opinions presented in this email are
solely
those of the author and do not necessarily represent those of the
company.
Finally, the recipient should check this email and any attachments
for
the
presence of viruses. The company accepts no liability for any damage
caused by any virus transmitted by this email.
________________________________________
PANACEA MEDICAL TECHNOLOGIES PVT. LTD.
Head Office: Plot #119, GF, Envision Technology Center, EPIP Area
Phase
1,
Whitefield, Bangalore - 560 066, Karnataka, INDIA
Manufacturing Unit: Plot #87 A, Phase -II, Malur KIADB Industrial
Area,
Malur - 563130. Kolar District. INDIA.
Tel : +91 80 4242 8700 / 2845 4785
Fax : + 91 80 42428710
Url : http://www.panaceamedical.com
____________________________________________________________________________
PMT EMAIL DISCLAIMER:
This email and any files transmitted with it are confidential and
intended
solely for the use of the individual or entity to whom they are
addressed.
If you have received this email in error please notify the system
manager.
Please note that any views or opinions presented in this email are
solely
those of the author and do not necessarily represent those of the
company.
Finally, the recipient should check this email and any attachments for
the
presence of viruses. The company accepts no liability for any damage
caused by any virus transmitted by this email.
________________________________________
PANACEA MEDICAL TECHNOLOGIES PVT. LTD.
Head Office: Plot #119, GF, Envision Technology Center, EPIP Area Phase
1,
Whitefield, Bangalore - 560 066, Karnataka, INDIA
Manufacturing Unit: Plot #87 A, Phase -II, Malur KIADB Industrial Area,
Malur - 563130. Kolar District. INDIA.
Tel : +91 80 4242 8700 / 2845 4785
Fax : + 91 80 42428710
Url : http://www.panaceamedical.com
____________________________________________________________________________
PMT EMAIL DISCLAIMER:
This email and any files transmitted with it are confidential and
intended
solely for the use of the individual or entity to whom they are
addressed.
If you have received this email in error please notify the system
manager.
Please note that any views or opinions presented in this email are
solely
those of the author and do not necessarily represent those of the
company.
Finally, the recipient should check this email and any attachments for
the
presence of viruses. The company accepts no liability for any damage
caused by any virus transmitted by this email.
________________________________________
PANACEA MEDICAL TECHNOLOGIES PVT. LTD.
Head Office: Plot #119, GF, Envision Technology Center, EPIP Area Phase 1,
Whitefield, Bangalore - 560 066, Karnataka, INDIA
Manufacturing Unit: Plot #87 A, Phase -II, Malur KIADB Industrial Area,
Malur - 563130. Kolar District. INDIA.
Tel : +91 80 4242 8700 / 2845 4785
Fax : + 91 80 42428710
Url : http://www.panaceamedical.com
____________________________________________________________________________
PMT EMAIL DISCLAIMER:
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the system manager.
Please note that any views or opinions presented in this email are solely
those of the author and do not necessarily represent those of the company.
Finally, the recipient should check this email and any attachments for the
presence of viruses. The company accepts no liability for any damage
caused by any virus transmitted by this email.