#include "bbTransform3DdicomMetaImageWriter_DicomInfo.h" #include "bbTransform3DdicomPackage.h" namespace bbTransform3Ddicom { BBTK_ADD_BLACK_BOX_TO_PACKAGE(Transform3Ddicom,MetaImageWriter_DicomInfo) BBTK_BLACK_BOX_IMPLEMENTATION(MetaImageWriter_DicomInfo,bbtk::AtomicBlackBox); void MetaImageWriter_DicomInfo::Process() { FILE *ff = fopen( bbGetInputFilename().c_str() ,"w+"); fprintf(ff, "ImagaPositionPatient %f %f %f", bbGetInputIPP()[0], bbGetInputIPP()[1], bbGetInputIPP()[2]); fprintf(ff, "ImageOrientationPatient %f %f %f %f %f %f", bbGetInputIOP()[0], bbGetInputIOP()[1], bbGetInputIOP()[2], bbGetInputIOP()[3], bbGetInputIOP()[4], bbGetInputIOP()[5]); fprintf(ff, "Spacing %f %f %f", bbGetInputPixelSpacing()[0], bbGetInputPixelSpacing()[1], bbGetInputPixelSpacing()[2]); fclose(ff); } /* void MetaImageWriter_DicomInfo::bbUserConstructor() { bbSetInputFilename(""); } void MetaImageWriter_DicomInfo::bbUserCopyConstructor(bbtk::BlackBox::Pointer) { } void MetaImageWriter_DicomInfo::bbUserDestructor() { } */ //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== void MetaImageWriter_DicomInfo::bbUserSetDefaultValues() { bbSetInputFilename(""); } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== void MetaImageWriter_DicomInfo::bbUserInitializeProcessing() { // THE INITIALIZATION METHOD BODY : // Here does nothing // but this is where you should allocate the internal/output pointers // if any } //===== // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost) //===== void MetaImageWriter_DicomInfo::bbUserFinalizeProcessing() { // THE FINALIZATION METHOD BODY : // Here does nothing // but this is where you should desallocate the internal/output pointers // if any } } // EO namespace bbTransform3Ddicom