When I read a dicom series with a series reader in itk,
I always find the origin=[0 0 0] and spacing=[1 1 1], the same for all different datasets.
* main function:-
void main()
{
reader = READ_DCM(Input_DCM_Paths[0]);
cout<<" Reading Done!!"<<endl;
cout<< " Origin: " <<reader->GetOutput()->GetOrigin()<< endl;
cout<< " Spacing: " <<reader->GetOutput()->GetSpacing()<< endl;
}
* reader function:-
SeriesReaderType::Pointer READ_DCM (std::string InputFolder)
{
SeriesReaderType::Pointer seriesReader = SeriesReaderType::New();
seriesReader->SetImageIO(itk::GDCMImageIO::New());
itk::GDCMSeriesFileNames::Pointer nameGenerator = itk::GDCMSeriesFileNames::New();
nameGenerator->SetUseSeriesDetails(true);
nameGenerator->SetDirectory(InputFolder);
std::string seriesID = nameGenerator->GetSeriesUIDs().begin()->c_str();
seriesReader->SetFileNames(nameGenerator->GetFileNames(seriesID));
seriesReader->Update();
return seriesReader;
}
* 1st series output in itk:-
* 1st series output in matlab:-
What's worng with my 'series reader' code ?? I followed the "reading part" in this example.
gdcminfo
next time. You are dealing with a Secondary Capture Image Storage instance. This instance does not define Pixel Spacing attribute therefore it is correct to assume (1,1) for pixel spacing (same goes for IPP). – malat