false DOESN'T flip the image.
To be used by aware people only!
Program: gdcm
Module: $RCSfile: vtkGdcmReader.cxx,v $
Language: C++
- Date: $Date: 2007/12/13 16:18:13 $
- Version: $Revision: 1.94 $
+ Date: $Date: 2009/04/18 14:42:51 $
+ Version: $Revision: 1.95 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// sh->SetDropDuplicatePositions(true);
//
// // Sorting the list is mandatory
-// // a side effect is to compute ZSpacing for the fle set
+// // a side effect is to compute ZSpacing for the file set
// sh->OrderFileList(l); // sort the list
//
// vtkGdcmReader *reader = vtkGdcmReader::New();
#include <vtkPointData.h>
#include <vtkLookupTable.h>
-vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.94 $")
+vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.95 $")
vtkStandardNewMacro(vtkGdcmReader)
//-----------------------------------------------------------------------------
// this->Execution=false; // For VTK5.0
this->KeepOverlays = false;
+
+ this->FlipY = true; // to keep old behaviour
}
vtkGdcmReader::~vtkGdcmReader()
{
//size = fileH->GetImageDataSize();
// useless - just an accessor; 'size' unused
- src = (unsigned char*)fileH->GetImageData();
+ //if (this->GetFlipY())
+ src = (unsigned char*)fileH->GetImageData();
+ //else
+ // dest = (unsigned char*)fileH->GetImageData();
}
+
+if (this->GetFlipY()) {
unsigned char *dst = dest + planeSize - lineSize;
for (int plane = 0; plane < numPlanes; plane++)
{
}
dst += 2 * planeSize;
}
-
+}
+else
+{
+ memcpy((void*)dest, (void*)src, numPlanes * numLines * lineSize);
+}
fileH->Delete();
}
Program: gdcm
Module: $RCSfile: vtkGdcmReader.h,v $
Language: C++
- Date: $Date: 2007/09/04 16:21:50 $
- Version: $Revision: 1.35 $
+ Date: $Date: 2009/04/18 14:42:51 $
+ Version: $Revision: 1.36 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// Description:
// If this flag is set and the DICOM reader encounters a dicom file with
// lookup table the data will be kept as unsigned chars and a lookuptable
- // will be exported and accessible through GetLookupTable()
+ // will be exported and accessible through GetLookupTable()
+
vtkSetMacro(AllowLookupTable, bool);
vtkGetMacro(AllowLookupTable, bool);
vtkBooleanMacro(AllowLookupTable, bool);
-
vtkSetMacro(KeepOverlays, bool);
vtkGetMacro(KeepOverlays, bool);
vtkBooleanMacro(KeepOverlays, bool);
+
+ vtkSetMacro(FlipY, bool);
+ vtkGetMacro(FlipY, bool);
+ vtkBooleanMacro(FlipY, bool);
vtkGetObjectMacro(LookupTable, vtkLookupTable);
bool KeepOverlays;
+ bool FlipY;
+
/// Pointer to a user suplied function to allow modification of pixel order
VOID_FUNCTION_PUINT8_PFILE_POINTER UserFunction;
Program: gdcm
Module: $RCSfile: vtkgdcmViewer2.cxx,v $
Language: C++
- Date: $Date: 2007/10/03 15:50:13 $
- Version: $Revision: 1.15 $
+ Date: $Date: 2009/04/18 14:42:51 $
+ Version: $Revision: 1.16 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
reader->SetKeepOverlays(true);
}
+// not a very clever way to pass several params
+// but it's just for checking
+ if (strcmp (argv[argc-1], "n") == 0)
+ {
+ argc--; // Is it allowed?!?
+ reader->SetFlipY(false);
+ }
+
if( argc == 2 )
reader->SetFileName( argv[1] );
else