BBTK_BLACK_BOX_IMPLEMENTATION(GetInfoGdcmReader,bbtk::AtomicBlackBox);
void GetInfoGdcmReader::Process()
{
-
+ // Reset de reader, f
+ bbUserFinalizeProcessing();
+
f = GDCM_NAME_SPACE::File::New();
f->SetFileName( bbGetInputIn() );
bool res = f->Load();
bbSetOutputOut(0);
return;
}
- // Get info from the image file
+ // Get info from THE image file (only *one* as input)
int i;
std::vector<double> v_iop;
float iop[6];
f->GetImageOrientationPatient(iop);
+
for(i=0; i< 6; i++)
v_iop.push_back(iop[i]);
bbSetOutputIOP(v_iop );
std::vector<double> v_ipp;
float ipp[3];
f->GetImagePositionPatient(ipp);
+
for(i=0; i< 3; i++)
v_ipp.push_back(ipp[i]);
bbSetOutputIPP(v_ipp );
std::vector<double> v_pixelspacing;
v_pixelspacing.push_back(f->GetXSpacing());
v_pixelspacing.push_back(f->GetYSpacing());
- if (f->GetZSize() != 1) {
+
+ if (f->GetZSize() != 1)
+ {
v_pixelspacing.push_back(f->GetZSpacing());
}
bbSetOutputPixelSpacing(v_pixelspacing);
bbSetOutputOut( reader->GetOutput() );
}
-void GetInfoGdcmReader::bbUserConstructor()
+void GetInfoGdcmReader::bbUserSetDefaultValues()
{
- bbSetInputIn("");
+ reader=NULL;
+ f=NULL;
+ bbSetInputIn("");
}
-void GetInfoGdcmReader::bbUserCopyConstructor(bbtk::BlackBox::Pointer)
+void GetInfoGdcmReader::bbUserInitializeProcessing()
{
-
}
-void GetInfoGdcmReader::bbUserDestructor()
+
+
+
+void GetInfoGdcmReader::bbUserFinalizeProcessing()
{
- if(reader)
+ if( reader )
+ {
reader->Delete();
+ reader=NULL;
+ }
if(f)
+ {
f->Delete();
+ f=NULL;
+ }
}
}