[ITK-dev] vtk transform filter on .RAW
Marco Dev
marco.dev.open at gmail.com
Mon Aug 17 10:14:56 EDT 2015
Hi,
why does not work vtk transform filter correctly on .RAW file
I read the .raw file through ifstream then create a image type from this
buffer as follow bellow:
ifstream fin(filePath[0], ios::in | ios::binary);
signed short iSample;
cout << "Samples Output" << endl;
while (fin.read((char *)&iSample, sizeof(signed short)))
{
m_Short.push_back(iSample);
}
cout << " size of short vector " << m_Short.size();
m_Aloc = (signed short*)malloc(m_Short.size() * 2);
int counter = 0;
for (std::vector<signed short>::iterator it = m_Short.begin(); it !=
m_Short.end(); ++it, counter++){
m_Aloc[counter] = (*it);
}
.
. // set nidex size orientation spacing ,,,,, to itk filter
.
.
importFilter->SetImportPointer(m_Aloc,sizeX*sizeY*sizeZ, true);
try
{
importFilter->Update();
pVol = importFilter->GetOutput();
}
catch (itk::ExceptionObject & err)
{
return false;
}
pVol->Register();
typedef itk::ImageToVTKImageFilter<ImageType> itkVtkConverter;
itkVtkConverter::Pointer conv = itkVtkConverter::New();
conv->SetInput(pVol);
conv->Update();
vtkSmartPointer<vtkImageData> vtkImage =
vtkSmartPointer<vtkImageData>::New();
vtkImage->ShallowCopy(conv->GetOutput());
//shallow copy is vtk's equivalent of disconnect pipeline
volumeRayCatMapper =
vtkSmartPointer<vtkFixedPointVolumeRayCastMapper>::New();
volumeRayCatMapper->SetInputData(vtkImage);
.
.
.
.
//Skin
color->AddRGBPoint(-3024, 0, 0, 0, 0.5, 0.0);
color->AddRGBPoint(-1000, .62, .36, .18, 0.5, 0.0);
color->AddRGBPoint(-500, .88, .60, .29, 0.33, 0.45);
color->AddRGBPoint(3071, .83, .66, 1, 0.5, 0.0);
compositeOpacity->AddPoint(-3024, 0, 0.5, 0.0);
compositeOpacity->AddPoint(-1000, 0, 0.5, 0.0);
compositeOpacity->AddPoint(-500, 1.0, 0.33, 0.45);
compositeOpacity->AddPoint(3071, 1.0, 0.5, 0.0);
volumeRayCatMapper->SetBlendModeToComposite();
volumeProperty->ShadeOn();
volumeProperty->SetAmbient(0.1);
volumeProperty->SetDiffuse(0.9);
volumeProperty->SetSpecular(0.2);
volumeProperty->SetSpecularPower(10.0);
volumeProperty->SetScalarOpacityUnitDistance(0.8919);
why does not work correctly on volume ?
if I read the dicom series from itk reader it does work correctly
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-developers/attachments/20150817/497a6711/attachment.html>
More information about the Insight-developers
mailing list