GDCM  3.0.24
CreateJPIPDataSet.cxx
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/*
* This example was created during the GSOC 2011 project for
* JPIP
*/
#include "gdcmAnonymizer.h"
#include "gdcmWriter.h"
#include "gdcmFile.h"
#include "gdcmTag.h"
#include "gdcmSystem.h"
#include "gdcmAttribute.h"
int main(int argc, char *argv[])
{
if( argc < 2 )
{
std::cerr << argv[0] << " output.dcm" << std::endl;
return 1;
}
const char *outfilename = argv[1];
gdcm::File &file = w.GetFile();
gdcm::DataSet &ds = file.GetDataSet();
//w.SetCheckFileMetaInformation( true );
w.SetFileName( outfilename );
anon.SetFile( file );
anon.Replace( gdcm::Tag(0x0008,0x16), ms.GetString() );
std::cout << ms.GetString() << std::endl;
anon.Replace( gdcm::Tag(0x0008,0x18), gen.Generate() );
//
anon.Replace( gdcm::Tag(0x0010,0x10), "JPIP^EXAMPLE" );
anon.Replace( gdcm::Tag(0x0010,0x20), "012345" );
anon.Empty( gdcm::Tag(0x0010,0x30) );
anon.Empty( gdcm::Tag(0x0010,0x40) );
anon.Empty( gdcm::Tag(0x0008,0x20) );
anon.Empty( gdcm::Tag(0x0008,0x30) );
anon.Empty( gdcm::Tag(0x0008,0x90) );
anon.Empty( gdcm::Tag(0x0020,0x10) );
anon.Empty( gdcm::Tag(0x0020,0x11) );
anon.Empty( gdcm::Tag(0x0008,0x50) );
anon.Empty( gdcm::Tag(0x0020,0x0013) );
anon.Replace( gdcm::Tag(0x0020,0xd), gen.Generate() );
anon.Replace( gdcm::Tag(0x0020,0xe), gen.Generate() );
anon.Replace( gdcm::Tag(0x0008,0x64), "WSD " );
anon.Replace( gdcm::Tag(0x0008,0x60), "OT" );
at.SetValue( "http://dicom.example.com/jpipserver.cgi?target=img.jp2" );
// Need to retrieve the PixelFormat information from the given file
if (!w.Write() )
{
std::cerr << "Could not write: " << outfilename << std::endl;
return 1;
}
return 0;
}
Anonymizer.
Definition: gdcmAnonymizer.h:78
void SetFile(const File &f)
Set/Get File.
Definition: gdcmAnonymizer.h:126
bool Empty(Tag const &t)
Make Tag t empty (if not found tag will be created)
bool Replace(Tag const &t, const char *value)
Attribute class This class use template metaprograming tricks to let the user know when the template ...
Definition: gdcmAttribute.h:86
void SetValue(ArrayType v, unsigned int idx=0)
Definition: gdcmAttribute.h:169
DataElement GetAsDataElement() const
Definition: gdcmAttribute.h:183
Class to represent a Data Set (which contains Data Elements)
Definition: gdcmDataSet.h:56
void Insert(const DataElement &de)
Definition: gdcmDataSet.h:128
void SetDataSetTransferSyntax(const TransferSyntax &ts)
a DICOM File
Definition: gdcmFile.h:34
const DataSet & GetDataSet() const
Get Data Set.
Definition: gdcmFile.h:57
const FileMetaInformation & GetHeader() const
Get File Meta Information.
Definition: gdcmFile.h:48
MediaStorage.
Definition: gdcmMediaStorage.h:44
@ SecondaryCaptureImageStorage
Definition: gdcmMediaStorage.h:65
const char * GetString() const
Return the Media String of the object.
Class to represent a DICOM Data Element (Attribute) Tag (Group, Element).
Definition: gdcmTag.h:39
@ JPIPReferenced
Definition: gdcmTransferSyntax.h:85
Class for generating unique UID.
Definition: gdcmUIDGenerator.h:28
const char * Generate()
Writer ala DOM (Document Object Model)
Definition: gdcmWriter.h:49
File & GetFile()
Definition: gdcmWriter.h:67
virtual bool Write()
Main function to tell the writer to write.
void SetFileName(const char *filename_native)
Set the filename of DICOM file to write:

Generated on Fri May 3 2024 05:26:10 for GDCM by doxygen 1.9.1
SourceForge.net Logo