[vtkusers] using VTKImageExport

cspl affable at hd2.dot.net.in
Tue Jun 17 01:26:39 EDT 2003


Hi Friends


   I am using vtkImageFFT and vtkImageRFFT in my applicaction  along with vtkIimageButterworkHighpassFilter.I am also using vtkImageExtractComponents with SetComponents to 0.When importing the image I am using the unsigned character buffer .After the above operations I am exporting to the same buffer.Here I am getting the Exception which is 'some instruction reference at some location ,that memory location  could not  be read '.I am getting the error when export to the buffer by using vtkImageExport.Is there any changes in the buffer values type.I could not understand clearly what is the output of vtkimageFFT and vtkImageRFFT.Here I am enclosing my code.

              m_dstImage->GrayScale();
              UpdateAllViews(NULL);
              BYTE* aImgBits=m_dstImage->GetBits();
   
              int xdim=m_srcImage->GetWidth();
              int ydim=m_srcImage->GetHeight();
            vtkImageImport *importer = vtkImageImport::New();
 importer->SetDataExtent(0,xdim-1  ,0,ydim-1 ,0,0 );
 importer->SetWholeExtent(0, xdim-1  ,0,ydim -1,0,0 );
 importer->SetDataScalarTypeUnsignedChar();
              importer->SetImportVoidPointer(aImgBits);
  
 vtkImageFFT *fft=vtkImageFFT::New();
             fft->SetDimensionality(2);
             fft->SetInput(importer->GetOutput());
 
 vtkImageButterworthHighPass *filter=vtkImageButterworthHighPass::New();
              filter->SetInput(fft->GetOutput());
 filter->SetOrder(2);
 filter->SetXCutOff(0.2);
              filter->SetYCutOff(0.1);
 filter->ReleaseDataFlagOff();

 vtkImageRFFT *rfft=vtkImageRFFT::New();
              rfft->SetDimensionality(2);
 rfft->SetInput(filter->GetOutput());
 
 vtkImageExtractComponents *ecomp=vtkImageExtractComponents ::New();
 ecomp->SetInput(rfft->GetOutput());
              ecomp->SetComponents(0);
    
              vtkImageExport *exporter = vtkImageExport::New();
              exporter->SetInput(ecomp->GetOutput());
 exporter->Export(aImgBits);

 importer->Delete();
 exporter->Delete();
 filter->Delete();
              fft->Delete();
 rfft->Delete();
 UpdateAllViews(NULL,WM_USER_NEWIMAGE);


  Thanking You
     Chandu  
                  
 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030617/5195ec1f/attachment.htm>


More information about the vtkusers mailing list