[Insight-users] Problems about 3D construction with tetrahedral mesh from DICOM series
Andriy Fedorov
fedorov at bwh.harvard.edu
Fri Aug 5 12:25:31 EDT 2011
> From: smallping <smallping at fe.up.pt>
> Subject: [Insight-users] Problems about 3D construction with
> tetrahedral mesh from DICOM series
> To: insight-users at itk.org
> Message-ID: <1312477605636-6653520.post at n2.nabble.com>
> Content-Type: text/plain; charset=us-ascii
>
> I want to read the DICOM series, and then create tetrahedral mesh for volume
> modeling.
>
smallping,
You might want to look at this page that discusses this problem and
provides free tools for solving it: http://iso2mesh.sourceforge.net/
AF
> I do like this:
> 1) Read the 3D image data from a series of DICOM files
> 2) Use CurvatureFlowImageFilter to smooth the image
> 3) Run an image segmentation method
> 4) Use the vtkContour filter to generate the surface mesh
> 5) Save the surface mesh data to a .vtk file
> 6) Using TetGen, to generate the tetrahedral mesh from the surface mesh, and
> save into .vtk file
>
> But I have problems at step 6, when I try to use TetGen to generate the
> tetrahedral mesh from the surface mesh, it failed.
> Then I use ParaView to visualize my surface mesh, I find maybe there are
> some problems with the surface mesh.
> Because in the surface mesh, there are many holes, and a surface circle
> around the object, I do not know what is this.
> The surface mesh is shown as the following picture.
>
> http://itk-insight-users.2283740.n2.nabble.com/file/n6653520/Surface_mesh.jpg
>
> Can somebody know how to fix this ?
> Or give me an example to do this ?
> I need help from you.
> Thanks
>
> The following is my codes for step 2 to step 6 to generate the surface mesh
> /*=========================================================================
> #include "itkCommand.h"
> #include "itkImage.h"
> #include "itkVTKImageExport.h"
> #include "itkVTKImageImport.h"
> #include "itkConfidenceConnectedImageFilter.h"
> #include "itkCastImageFilter.h"
> #include "itkRGBPixel.h"
> #include "itkImageFileReader.h"
> #include "itkImageFileWriter.h"
>
> #include "vtkImageImport.h"
> #include "vtkImageExport.h"
> #include "vtkRenderer.h"
> #include "vtkRenderWindow.h"
> #include "vtkRenderWindowInteractor.h"
> #include "vtkActor.h"
> #include "vtkPolyData.h"
> #include "vtkPolyDataMapper.h"
> #include "vtkContourFilter.h"
> #include "vtkImageData.h"
> #include "vtkDataSet.h"
> #include "vtkProperty.h"
> #include "vtkImagePlaneWidget.h"
> #include "vtkCellPicker.h"
> #include "vtkPolyDataWriter.h"
>
> #include "itkCurvatureFlowImageFilter.h"
> #include "vtkSmartPointer.h"
> #include "vtkSTLWriter.h"
>
>
> template <typename ITK_Exporter, typename VTK_Importer>
> void ConnectPipelines(ITK_Exporter exporter, VTK_Importer* importer)
> {
>
> importer->SetUpdateInformationCallback(exporter->GetUpdateInformationCallback());
>
> importer->SetPipelineModifiedCallback(exporter->GetPipelineModifiedCallback());
> importer->SetWholeExtentCallback(exporter->GetWholeExtentCallback());
> importer->SetSpacingCallback(exporter->GetSpacingCallback());
> importer->SetOriginCallback(exporter->GetOriginCallback());
> importer->SetScalarTypeCallback(exporter->GetScalarTypeCallback());
>
> importer->SetNumberOfComponentsCallback(exporter->GetNumberOfComponentsCallback());
>
> importer->SetPropagateUpdateExtentCallback(exporter->GetPropagateUpdateExtentCallback());
> importer->SetUpdateDataCallback(exporter->GetUpdateDataCallback());
> importer->SetDataExtentCallback(exporter->GetDataExtentCallback());
> importer->SetBufferPointerCallback(exporter->GetBufferPointerCallback());
> importer->SetCallbackUserData(exporter->GetCallbackUserData());
> }
>
> template <typename VTK_Exporter, typename ITK_Importer>
> void ConnectPipelines(VTK_Exporter* exporter, ITK_Importer importer)
> {
>
> importer->SetUpdateInformationCallback(exporter->GetUpdateInformationCallback());
>
> importer->SetPipelineModifiedCallback(exporter->GetPipelineModifiedCallback());
> importer->SetWholeExtentCallback(exporter->GetWholeExtentCallback());
> importer->SetSpacingCallback(exporter->GetSpacingCallback());
> importer->SetOriginCallback(exporter->GetOriginCallback());
> importer->SetScalarTypeCallback(exporter->GetScalarTypeCallback());
>
> importer->SetNumberOfComponentsCallback(exporter->GetNumberOfComponentsCallback());
>
> importer->SetPropagateUpdateExtentCallback(exporter->GetPropagateUpdateExtentCallback());
> importer->SetUpdateDataCallback(exporter->GetUpdateDataCallback());
> importer->SetDataExtentCallback(exporter->GetDataExtentCallback());
> importer->SetBufferPointerCallback(exporter->GetBufferPointerCallback());
> importer->SetCallbackUserData(exporter->GetCallbackUserData());
> }
>
>
> int main(int argc, char * argv [] )
> {
> //DICOM-IMG.vtk is read from DICOM series
> argv[1]="/home/smallping/Codes/ITK/Test/MeshSurface/DICOM-IMG.vtk";
>
> try
> {
> typedef float InputPixelType;
> typedef unsigned char MaskPixelType;
>
> const unsigned int Dimension = 3;
> typedef itk::Image< InputPixelType, Dimension > InputImageType;
> typedef itk::Image< MaskPixelType, Dimension > MaskImageType ;
>
> typedef itk::ImageFileReader< InputImageType > ReaderType ;
>
> ReaderType::Pointer reader = ReaderType::New();
> reader->SetFileName( argv[1] );
> reader->Update();
>
> ////////////////////////////////////////////////////////////// Smooth
> typedef itk::CurvatureFlowImageFilter< InputImageType, InputImageType >
> CurvatureFlowImageFilterType;
> CurvatureFlowImageFilterType::Pointer smoothing =
> CurvatureFlowImageFilterType::New();
>
> smoothing->SetInput( reader->GetOutput() );
> smoothing->SetNumberOfIterations( 10 );
> smoothing->SetTimeStep( 0.0625 );
>
>
> //////////////////////////////////////////////////////////////Segmentation
> typedef itk::ConfidenceConnectedImageFilter<InputImageType,
> MaskImageType> ConnectedFilterType;
> ConnectedFilterType::Pointer filter = ConnectedFilterType::New();
>
> filter->SetInput( smoothing->GetOutput() );
>
> filter->SetNumberOfIterations(2);
> filter->SetReplaceValue(255);
> filter->SetMultiplier(2.5);
>
> InputImageType::Pointer inputImage = reader->GetOutput();
> InputImageType::SizeType size =
> inputImage->GetBufferedRegion().GetSize();
> InputImageType::IndexType start =
> inputImage->GetBufferedRegion().GetIndex();
>
> InputImageType::IndexType seed;
> seed[0] = start[0] + size[0] / 2;
> seed[1] = start[1] + size[1] / 2;
> seed[2] = start[2] + size[2] / 2;
>
> filter->SetSeed( seed );
>
> //////////////////////////////////////////////////////////////
> typedef itk::VTKImageExport< InputImageType > ExportFilter1Type;
> typedef itk::VTKImageExport< MaskImageType > ExportFilter2Type;
>
> ExportFilter1Type::Pointer itkExporter1 = ExportFilter1Type::New();
> ExportFilter2Type::Pointer itkExporter2 = ExportFilter2Type::New();
>
> itkExporter1->SetInput( reader->GetOutput() );
> itkExporter2->SetInput( filter->GetOutput() );
>
> vtkImageImport* vtkImporter1 = vtkImageImport::New();
> ConnectPipelines(itkExporter1, vtkImporter1);
> vtkImageImport* vtkImporter2 = vtkImageImport::New();
> ConnectPipelines(itkExporter2, vtkImporter2);
>
> vtkImporter1->Update();
>
> //////////////////////////////////////////////////////////////Surface
> vtkContourFilter * contour = vtkContourFilter::New();
> contour->SetInput( vtkImporter2->GetOutput() );
> contour->SetValue(0, 128);
>
> //////////////////////////////////////////////////////////////
> vtkPolyDataWriter * vtkWriter = vtkPolyDataWriter::New();
>
> vtkWriter->SetFileName("/home/smallping/Codes/ITK/Test/MeshSurface/DICOM-SURF.vtk");
> //save as vtk
> vtkWriter->SetInput( contour->GetOutput() );
> vtkWriter->Write();
>
> vtkSmartPointer< vtkSTLWriter > stlWriter = vtkSmartPointer<
> vtkSTLWriter >::New(); //save as stl
> stlWriter->SetInput( contour->GetOutput() );
> stlWriter->SetFileName(
> "/home/smallping/Codes/ITK/Test/MeshSurface/DICOM-SURF.stl" );
> stlWriter->Update();
>
> //////////////////////////////////////////////////////////////
> vtkImporter1->Delete();
> vtkImporter2->Delete();
> contour->Delete();
> }
> catch( itk::ExceptionObject & e )
> {
> std::cerr << "Exception catched !! " << e << std::endl;
> }
>
> return 0;
> }
>
> --
> View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Problems-about-3D-construction-with-tetrahedral-mesh-from-DICOM-series-tp6653520p6653520.html
> Sent from the ITK Insight Users mailing list archive at Nabble.com.
>
>
> ------------------------------
>
> Message: 2
> Date: Thu, 4 Aug 2011 14:18:29 -0400
> From: qi yang <tinaqiyang at gmail.com>
> Subject: [Insight-users] Question about
> itkReconstructionByDilationImageFilter
> To: insight-users <insight-users at itk.org>
> Message-ID:
> <CAOA0kRquff=Cus_vudGC+9mLyStR_b4qp_iWGCArarbKCGJJww at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi there,
>
> I am new to ITK. I have a question about
> using itkReconstructionByDilationImageFilter. Can anyone help me out?
> I have implemented a portion of simple code to input marker and mask images
> to itkReconstructionByDilationImageFilter and get output.
> But the output image I got is always the same as the mask image.
> At the same time, I used MeVisLab itkReconstructionByDilationImageFilter
> module to find out what's the ouput image using the same marker and mask
> images.
> I got the different output which I expected.
> So I think there must be something wrong with my code. The following is the
> code:
>
> #include "itkImage.h"
> #include "itkImageFileReader.h"
> #include "itkImageFileWriter.h"
> #include "itkReconstructionByDilationImageFilter.h"
> int main()
> {
> typedef unsigned char PixelType;
> const unsigned int Dimension = 2;
> typedef itk::Image< PixelType, Dimension > ImageType;
> typedef itk::ImageFileReader< ImageType > ReaderType;
> typedef itk::ImageFileWriter< ImageType > WriterType;
>
> const char *inputFilenameMarker = "C:\\marker.tif";
> const char *inputFilenameMask = "C:\\mask.tif";
> const char *outputFilename = "C:\\ITKresult.tif";
>
> // Get marker image
> ReaderType::Pointer reader = ReaderType::New();
> reader->SetFileName( inputFilenameMarker );
> reader->Update();
> ImageType::Pointer markerImage = ImageType::New();
> markerImage = reader->GetOutput();
>
> // Get mask image
> reader->SetFileName( inputFilenameMask );
> reader->Update();
> ImageType::Pointer maskImage = ImageType::New();
> maskImage = reader->GetOutput();
>
> // dilation
> typedef itk::ReconstructionByDilationImageFilter<ImageType, ImageType>
> FilterType;
> FilterType::Pointer filter = FilterType::New();
> filter->SetMarkerImage(markerImage);
> filter->SetMaskImage(maskImage);
> filter->Update();
>
> // write results
> WriterType::Pointer writer = WriterType::New();
> writer->SetFileName( outputFilename );
> writer->SetInput( filter->GetOutput());
> try
> {
> writer->Update();
> }
> catch( itk::ExceptionObject & err )
> {
> std::cerr << "ExceptionObject caught !" << std::endl;
> std::cerr << err << std::endl;
> return EXIT_FAILURE;
> }
> }
>
>
> Thank you very much!
>
> Thanks,
> Tina
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.itk.org/pipermail/insight-users/attachments/20110804/1eb4565e/attachment-0001.htm>
>
> ------------------------------
>
> Message: 3
> Date: Thu, 4 Aug 2011 14:35:57 -0400
> From: robert tamburo <robert.tamburo at gmail.com>
> Subject: Re: [Insight-users] Question about
> itkReconstructionByDilationImageFilter
> To: qi yang <tinaqiyang at gmail.com>
> Cc: insight-users <insight-users at itk.org>
> Message-ID:
> <CA+a19pYsiqTxF2Xov3Dv2+JEjbkaosmH5K9g=kRZqaf_uA0roQ at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> markerImage is being set to maskImage on the second Update() call. Try
> removing markerImage from the filter pipeline by calling
> markerImage->DisconnectPipeline() after setting it to the reader output.
> Since you are reusing the reader, you should also use
> UpdateLargestPossibleRegion() instead of Update(). This updates the size
> information.
>
> // Get marker image
> ReaderType::Pointer reader = ReaderType::New();
> reader->SetFileName( inputFilenameMarker );
> reader->Update();
> ImageType::Pointer markerImage = ImageType::New();
> markerImage = reader->GetOutput();
>
> // Get mask image
> reader->SetFileName( inputFilenameMask );
> reader->Update();
> ImageType::Pointer maskImage = ImageType::New();
> maskImage = reader->GetOutput();
>
> On Thu, Aug 4, 2011 at 2:18 PM, qi yang <tinaqiyang at gmail.com> wrote:
>
>> Hi there,
>>
>> I am new to ITK. I have a question about
>> using itkReconstructionByDilationImageFilter. Can anyone help me out?
>> I have implemented a portion of simple code to input marker and mask images
>> to itkReconstructionByDilationImageFilter and get output.
>> But the output image I got is always the same as the mask image.
>> At the same time, I used MeVisLab itkReconstructionByDilationImageFilter
>> module to find out what's the ouput image using the same marker and mask
>> images.
>> I got the different output which I expected.
>> So I think there must be something wrong with my code. The following is the
>> code:
>>
>> #include "itkImage.h"
>> #include "itkImageFileReader.h"
>> #include "itkImageFileWriter.h"
>> #include "itkReconstructionByDilationImageFilter.h"
>> int main()
>> {
>> typedef unsigned char PixelType;
>> const unsigned int Dimension = 2;
>> typedef itk::Image< PixelType, Dimension > ImageType;
>> typedef itk::ImageFileReader< ImageType > ReaderType;
>> typedef itk::ImageFileWriter< ImageType > WriterType;
>>
>> const char *inputFilenameMarker = "C:\\marker.tif";
>> const char *inputFilenameMask = "C:\\mask.tif";
>> const char *outputFilename = "C:\\ITKresult.tif";
>>
>> // Get marker image
>> ReaderType::Pointer reader = ReaderType::New();
>> reader->SetFileName( inputFilenameMarker );
>> reader->Update();
>> ImageType::Pointer markerImage = ImageType::New();
>> markerImage = reader->GetOutput();
>>
>> // Get mask image
>> reader->SetFileName( inputFilenameMask );
>> reader->Update();
>> ImageType::Pointer maskImage = ImageType::New();
>> maskImage = reader->GetOutput();
>>
>> // dilation
>> typedef itk::ReconstructionByDilationImageFilter<ImageType, ImageType>
>> FilterType;
>> FilterType::Pointer filter = FilterType::New();
>> filter->SetMarkerImage(markerImage);
>> filter->SetMaskImage(maskImage);
>> filter->Update();
>>
>> // write results
>> WriterType::Pointer writer = WriterType::New();
>> writer->SetFileName( outputFilename );
>> writer->SetInput( filter->GetOutput());
>> try
>> {
>> writer->Update();
>> }
>> catch( itk::ExceptionObject & err )
>> {
>> std::cerr << "ExceptionObject caught !" << std::endl;
>> std::cerr << err << std::endl;
>> return EXIT_FAILURE;
>> }
>> }
>>
>>
>> Thank you very much!
>>
>> Thanks,
>> Tina
>>
>>
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.html
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-users
>>
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.itk.org/pipermail/insight-users/attachments/20110804/e3c15e91/attachment-0001.htm>
>
> ------------------------------
>
> Message: 4
> Date: Thu, 4 Aug 2011 14:46:25 -0400
> From: qi yang <tinaqiyang at gmail.com>
> Subject: Re: [Insight-users] Question about
> itkReconstructionByDilationImageFilter
> To: robert tamburo <robert.tamburo at gmail.com>
> Cc: insight-users <insight-users at itk.org>
> Message-ID:
> <CAOA0kRpSMyoDdB2vXSpw_y0_-EincxZMqZqtDzaCyn7TtOMjCA at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi Robert,
>
> Thank you very much!
> It works!
>
> Thanks,
> Tina
>
> On Thu, Aug 4, 2011 at 2:35 PM, robert tamburo <robert.tamburo at gmail.com>wrote:
>
>> markerImage is being set to maskImage on the second Update() call. Try
>> removing markerImage from the filter pipeline by calling
>> markerImage->DisconnectPipeline() after setting it to the reader output.
>> Since you are reusing the reader, you should also use
>> UpdateLargestPossibleRegion() instead of Update(). This updates the size
>> information.
>>
>> // Get marker image
>> ReaderType::Pointer reader = ReaderType::New();
>> reader->SetFileName( inputFilenameMarker );
>> reader->Update();
>> ImageType::Pointer markerImage = ImageType::New();
>> markerImage = reader->GetOutput();
>>
>> // Get mask image
>> reader->SetFileName( inputFilenameMask );
>> reader->Update();
>> ImageType::Pointer maskImage = ImageType::New();
>> maskImage = reader->GetOutput();
>>
>> On Thu, Aug 4, 2011 at 2:18 PM, qi yang <tinaqiyang at gmail.com> wrote:
>>
>>> Hi there,
>>>
>>> I am new to ITK. I have a question about
>>> using itkReconstructionByDilationImageFilter. Can anyone help me out?
>>> I have implemented a portion of simple code to input marker and mask
>>> images to itkReconstructionByDilationImageFilter and get output.
>>> But the output image I got is always the same as the mask image.
>>> At the same time, I used MeVisLab itkReconstructionByDilationImageFilter
>>> module to find out what's the ouput image using the same marker and mask
>>> images.
>>> I got the different output which I expected.
>>> So I think there must be something wrong with my code. The following is
>>> the code:
>>>
>>> #include "itkImage.h"
>>> #include "itkImageFileReader.h"
>>> #include "itkImageFileWriter.h"
>>> #include "itkReconstructionByDilationImageFilter.h"
>>> int main()
>>> {
>>> typedef unsigned char PixelType;
>>> const unsigned int Dimension = 2;
>>> typedef itk::Image< PixelType, Dimension > ImageType;
>>> typedef itk::ImageFileReader< ImageType > ReaderType;
>>> typedef itk::ImageFileWriter< ImageType > WriterType;
>>>
>>> const char *inputFilenameMarker = "C:\\marker.tif";
>>> const char *inputFilenameMask = "C:\\mask.tif";
>>> const char *outputFilename = "C:\\ITKresult.tif";
>>>
>>> // Get marker image
>>> ReaderType::Pointer reader = ReaderType::New();
>>> reader->SetFileName( inputFilenameMarker );
>>> reader->Update();
>>> ImageType::Pointer markerImage = ImageType::New();
>>> markerImage = reader->GetOutput();
>>>
>>> // Get mask image
>>> reader->SetFileName( inputFilenameMask );
>>> reader->Update();
>>> ImageType::Pointer maskImage = ImageType::New();
>>> maskImage = reader->GetOutput();
>>>
>>> // dilation
>>> typedef itk::ReconstructionByDilationImageFilter<ImageType, ImageType>
>>> FilterType;
>>> FilterType::Pointer filter = FilterType::New();
>>> filter->SetMarkerImage(markerImage);
>>> filter->SetMaskImage(maskImage);
>>> filter->Update();
>>>
>>> // write results
>>> WriterType::Pointer writer = WriterType::New();
>>> writer->SetFileName( outputFilename );
>>> writer->SetInput( filter->GetOutput());
>>> try
>>> {
>>> writer->Update();
>>> }
>>> catch( itk::ExceptionObject & err )
>>> {
>>> std::cerr << "ExceptionObject caught !" << std::endl;
>>> std::cerr << err << std::endl;
>>> return EXIT_FAILURE;
>>> }
>>> }
>>>
>>>
>>> Thank you very much!
>>>
>>> Thanks,
>>> Tina
>>>
>>>
>>> _____________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Kitware offers ITK Training Courses, for more information visit:
>>> http://www.kitware.com/products/protraining.html
>>>
>>> Please keep messages on-topic and check the ITK FAQ at:
>>> http://www.itk.org/Wiki/ITK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.itk.org/mailman/listinfo/insight-users
>>>
>>>
>>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.itk.org/pipermail/insight-users/attachments/20110804/813e8067/attachment-0001.htm>
>
> ------------------------------
>
> Message: 5
> Date: Fri, 05 Aug 2011 08:34:32 +0200
> From: "Chr. Rossmanith" <cr at neuro.ma.uni-heidelberg.de>
> Subject: Re: [Insight-users] Creating 3D images from 2D DICOM series
> To: insight-users at itk.org
> Message-ID: <4E3B8EF8.7040605 at neuro.ma.uni-heidelberg.de>
> Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"
>
> Hi,
>
> if you just want to convert into a 3D format you could use mcverter from
> MRIConvert to convert the 2D slices into a 3D Nifti volume.
>
> Christina Ro?manith
>
>
>
> Am 02.08.2011 06:13, schrieb emreturkoz:
>> I have images of a brain scan, which are in DICOM format and around 150
>> images in total. I want to make a 3D volume out of it. Is there a way to
>> achive that with ITK tools?
>>
>> Thank you,
>> Emre.
>>
>> --
>> View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Creating-3D-images-from-2D-DICOM-series-tp6643613p6643613.html
>> Sent from the ITK Insight Users mailing list archive at Nabble.com.
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.html
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-users
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.itk.org/pipermail/insight-users/attachments/20110805/c62273be/attachment-0001.htm>
>
> ------------------------------
>
> Message: 6
> Date: Fri, 5 Aug 2011 07:39:35 -0400
> From: Luis Ibanez <luis.ibanez at kitware.com>
> Subject: [Insight-users] Agenda for Today's tcon
> To: itk <Insight-users at itk.org>
> Message-ID:
> <CABAUzPqAa2jtVKvfoxfoDc3KkfaoZ6p7NAjQG87Qxug-hs9j2w at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> The agenda for today's tcon has been posted at:
>
> http://www.itk.org/Wiki/ITK/Tcons/Agendas/2011_08_06
>
> Please feel free to add any topics of your interest.
>
> Thanks
>
> Luis
>
>
> ------------------------------
>
> Message: 7
> Date: Fri, 05 Aug 2011 09:51:18 -0400
> From: "Kevin H. Hobbs" <hobbsk at ohio.edu>
> Subject: Re: [Insight-users] VNLFFT vs. FFTW
> To: Cory Quammen <cquammen at cs.unc.edu>
> Cc: Insight Users Mailing List <insight-users at itk.org>
> Message-ID: <4E3BF556.1010406 at ohio.edu>
> Content-Type: text/plain; charset="iso-8859-1"
>
> On 08/03/2011 04:59 PM, Cory Quammen wrote:
>> Kevin,
>>
>> What might be happening is a side-effect of FFTW returning an image
>> that is about half the image size in the first (x) dimension. The
>> problem is that itk::FFTRealToComplexConjugateImageFilter will produce
>> an output image of the same size if the input image has size N *or*
>> size N+1 in the x-dimension. Unfortunately, you have to tell
>> itk::FFTComplexConjugateToRealImageFilter whether the original real
>> image input for FFTRealToComplexConjugateImageFilter has an even or
>> odd size in the x-dimension using SetActualXDimensionIsOdd() for it to
>> compute the output size correctly. For VNL, you don't have to do this,
>> but with FFTW you do.
>>
>> Can you see if adding a call to SetActualXDimensionIsOdd() fixes some
>> of your problems?
>>
>> Thanks,
>> Cory
>>
>
> It does not. If I switch back to using the FFTW classes and add
> SetActualXDimensionIsOddOff I still get an output image that is twice
> the size of the original image.
>
> Just in case I'm doing something else stupid I'm including the source
> code for both the program I use to create the mask and the program to
> apply the mask.
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: FFT.cxx
> Type: text/x-c++src
> Size: 3069 bytes
> Desc: not available
> URL: <http://www.itk.org/pipermail/insight-users/attachments/20110805/9ade063a/attachment-0002.cxx>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: FFTMaskIFFT.cxx
> Type: text/x-c++src
> Size: 2398 bytes
> Desc: not available
> URL: <http://www.itk.org/pipermail/insight-users/attachments/20110805/9ade063a/attachment-0003.cxx>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: signature.asc
> Type: application/pgp-signature
> Size: 253 bytes
> Desc: OpenPGP digital signature
> URL: <http://www.itk.org/pipermail/insight-users/attachments/20110805/9ade063a/attachment-0001.pgp>
>
> ------------------------------
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
> End of Insight-users Digest, Vol 88, Issue 8
> ********************************************
>
More information about the Insight-users
mailing list