#include <vtkGdcmWriter.h>
Public Member Functions | |
vtkTypeRevisionMacro (vtkGdcmWriter, vtkImageWriter) | |
void | PrintSelf (ostream &os, vtkIndent indent) |
vtkSetObjectMacro (LookupTable, vtkLookupTable) | |
vtkGetObjectMacro (LookupTable, vtkLookupTable) | |
void | SetWriteTypeToDcmImplVR () |
void | SetWriteTypeToDcmExplVR () |
void | SetWriteTypeToAcr () |
void | SetWriteTypeToAcrLibido () |
vtkSetMacro (WriteType, int) | |
vtkGetMacro (WriteType, int) | |
const char * | GetWriteTypeAsString () |
Static Public Member Functions | |
static vtkGdcmWriter * | New () |
Protected Member Functions | |
vtkGdcmWriter () | |
~vtkGdcmWriter () | |
virtual void | RecursiveWrite (int axis, vtkImageData *image, ofstream *file) |
virtual void | RecursiveWrite (int axis, vtkImageData *image, vtkImageData *cache, ofstream *file) |
void | WriteDcmFile (char *fileName, vtkImageData *image) |
Private Attributes | |
vtkLookupTable * | LookupTable |
int | WriteType |
Definition at line 35 of file vtkGdcmWriter.h.
|
|
|
Definition at line 46 of file vtkGdcmWriter.cxx.
|
|
Definition at line 61 of file vtkGdcmWriter.cxx. References VTK_GDCM_WRITE_TYPE_ACR, VTK_GDCM_WRITE_TYPE_ACR_LIBIDO, VTK_GDCM_WRITE_TYPE_EXPLICIT_VR, VTK_GDCM_WRITE_TYPE_IMPLICIT_VR, and WriteType. Referenced by PrintSelf(). 00062 { 00063 switch(WriteType) 00064 { 00065 case VTK_GDCM_WRITE_TYPE_EXPLICIT_VR : 00066 return "Explicit VR"; 00067 case VTK_GDCM_WRITE_TYPE_IMPLICIT_VR : 00068 return "Implicit VR"; 00069 case VTK_GDCM_WRITE_TYPE_ACR : 00070 return "ACR"; 00071 case VTK_GDCM_WRITE_TYPE_ACR_LIBIDO : 00072 return "ACR Libido"; 00073 default : 00074 return "Unknow type"; 00075 } 00076 }
|
|
Referenced by main(). |
|
Definition at line 52 of file vtkGdcmWriter.cxx. References GetWriteTypeAsString(). 00053 { 00054 this->Superclass::PrintSelf(os, indent); 00055 00056 os << indent << "Write type : " << this->GetWriteTypeAsString(); 00057 }
|
|
Definition at line 256 of file vtkGdcmWriter.cxx. References RecursiveWrite(), and WriteDcmFile(). 00258 { 00259 int idx, min, max; 00260 00261 // if the file is already open then just write to it 00262 if( file ) 00263 { 00264 vtkErrorMacro( << "File musn't be open"); 00265 return; 00266 } 00267 00268 // if we need to open another slice, do it 00269 if( (axis + 1) == this->FileDimensionality ) 00270 { 00271 // determine the name 00272 if (this->FileName) 00273 { 00274 sprintf(this->InternalFileName, "%s", this->FileName); 00275 } 00276 else 00277 { 00278 if (this->FilePrefix) 00279 { 00280 sprintf(this->InternalFileName, this->FilePattern, 00281 this->FilePrefix, this->FileNumber); 00282 } 00283 else 00284 { 00285 sprintf(this->InternalFileName, this->FilePattern,this->FileNumber); 00286 } 00287 // Remove this code in case user is using VTK 4.2... 00288 #if !(VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION == 2) 00289 if (this->FileNumber < this->MinimumFileNumber) 00290 { 00291 this->MinimumFileNumber = this->FileNumber; 00292 } 00293 else if (this->FileNumber > this->MaximumFileNumber) 00294 { 00295 this->MaximumFileNumber = this->FileNumber; 00296 } 00297 #endif 00298 } 00299 00300 // Write the file 00301 WriteDcmFile(this->InternalFileName,image); 00302 ++this->FileNumber; 00303 return; 00304 } 00305 00306 // if the current region is too high a dimension for the file 00307 // the we will split the current axis 00308 cache->GetAxisUpdateExtent(axis, min, max); 00309 00310 // if it is the y axis then flip by default 00311 if (axis == 1 && !this->FileLowerLeft) 00312 { 00313 for(idx = max; idx >= min; idx--) 00314 { 00315 cache->SetAxisUpdateExtent(axis, idx, idx); 00316 this->RecursiveWrite(axis - 1, cache, image, file); 00317 } 00318 } 00319 else 00320 { 00321 for(idx = min; idx <= max; idx++) 00322 { 00323 cache->SetAxisUpdateExtent(axis, idx, idx); 00324 this->RecursiveWrite(axis - 1, cache, image, file); 00325 } 00326 } 00327 00328 // restore original extent 00329 cache->SetAxisUpdateExtent(axis, min, max); 00330 }
|
|
Write of the files The call to this method is recursive if there is some files to write Definition at line 234 of file vtkGdcmWriter.cxx. Referenced by RecursiveWrite(). 00236 { 00237 if(file) 00238 { 00239 vtkErrorMacro( << "File must not be open"); 00240 return; 00241 } 00242 00243 if( image->GetScalarType() == VTK_FLOAT || 00244 image->GetScalarType() == VTK_DOUBLE ) 00245 { 00246 vtkErrorMacro(<< "Bad input type. Scalar type must not be of type " 00247 << "VTK_FLOAT or VTKDOUBLE (found:" 00248 << image->GetScalarTypeAsString()); 00249 return; 00250 } 00251 00252 RecursiveWrite(axis,image, image, file); 00253 //WriteDcmFile(this->FileName,image); 00254 }
|
|
Definition at line 48 of file vtkGdcmWriter.h. References VTK_GDCM_WRITE_TYPE_ACR. 00048 {SetWriteType(VTK_GDCM_WRITE_TYPE_ACR); };
|
|
Definition at line 49 of file vtkGdcmWriter.h. References VTK_GDCM_WRITE_TYPE_ACR_LIBIDO. 00049 {SetWriteType(VTK_GDCM_WRITE_TYPE_ACR_LIBIDO); };
|
|
Definition at line 47 of file vtkGdcmWriter.h. References VTK_GDCM_WRITE_TYPE_IMPLICIT_VR. 00047 {SetWriteType(VTK_GDCM_WRITE_TYPE_IMPLICIT_VR);};
|
|
Definition at line 46 of file vtkGdcmWriter.h. References VTK_GDCM_WRITE_TYPE_EXPLICIT_VR. 00046 {SetWriteType(VTK_GDCM_WRITE_TYPE_EXPLICIT_VR);};
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 65 of file vtkGdcmWriter.h. |
|
Definition at line 66 of file vtkGdcmWriter.h. Referenced by GetWriteTypeAsString(), and WriteDcmFile(). |