#include <math.h>
int main(int argc, char *argv [])
{
if( argc < 2 ) return 1;
const char *filename = argv[1];
{
std::cerr << "Failed to read: " << filename << std::endl;
return 1;
}
{
}
int dims[2] = {};
{
std::cout << csael << std::endl;
std::cout <<
"Columns:" << el.
GetValue() << std::endl;
}
{
std::cout << csael2 << std::endl;
std::cout <<
"Rows:" << el2.
GetValue() << std::endl;
}
double spacing[2] = { 1. , 1. };
bool spacingfound = false;
{
{
std::cout << csael3 << std::endl;
std::cout <<
"PixelSpacing:" << el3.
GetValue() <<
"," << el3.
GetValue(1) << std::endl;
spacingfound = true;
}
}
if( !spacingfound )
{
std::cerr << "Problem with PixelSpacing" << std::endl;
}
if( !dims[0] || !dims[1] )
{
std::cerr << "Problem with dims" << std::endl;
return 1;
}
std::string outfilename = "outcsa.dcm";
{
std::cerr << "could not write: " << outfilename << std::endl;
return 1;
}
return 0;
}
void SetNumberOfDimensions(unsigned int dim)
void SetDataElement(DataElement const &de)
Definition gdcmBitmap.h:76
void SetDimension(unsigned int idx, unsigned int dim)
void SetPhotometricInterpretation(PhotometricInterpretation const &pi)
void SetPixelFormat(PixelFormat const &pf)
Definition gdcmBitmap.h:115
Class to represent a CSA Element.
Definition gdcmCSAElement.h:30
bool IsEmpty() const
Check if CSA Element is empty.
Definition gdcmCSAElement.h:68
Value const & GetValue() const
Set/Get Value (bytes array, SQ of items, SQ of fragments):
Definition gdcmCSAElement.h:61
Class to represent a Data Element either Implicit or Explicit.
Definition gdcmDataElement.h:59
Class to represent a Data Set (which contains Data Elements)
Definition gdcmDataSet.h:56
const DataElement & GetDataElement(const Tag &t) const
Definition gdcmDataSet.h:188
bool FindDataElement(const PrivateTag &t) const
Look up if private tag 't' is present in the dataset:
Element class.
Definition gdcmElement.h:70
const VRToType< TVR >::Type & GetValue(unsigned int idx=0) const
Definition gdcmElement.h:94
void Set(Value const &v)
Definition gdcmElement.h:161
const DataSet & GetDataSet() const
Get Data Set.
Definition gdcmFile.h:57
ImageWriter.
Definition gdcmImageWriter.h:33
bool Write() override
Write.
const Image & GetImage() const override
Definition gdcmImageWriter.h:41
Image.
Definition gdcmImage.h:47
void SetSpacing(const double spacing[3])
Class to represent an PhotometricInterpretation.
Definition gdcmPhotometricInterpretation.h:29
@ MONOCHROME2
Definition gdcmPhotometricInterpretation.h:34
Class to represent a Private DICOM Data Element (Attribute) Tag (Group, Element, Owner)
Definition gdcmPrivateTag.h:39
Reader ala DOM (Document Object Model)
Definition gdcmReader.h:54
const File & GetFile() const
Set/Get File.
Definition gdcmReader.h:72
virtual bool Read()
Main function to read a file.
void SetFileName(const char *filename_native)
void SetFileName(const char *filename_native)
Set the filename of DICOM file to write: