Skip to content

Commit

Permalink
Merge branch 'release'
Browse files Browse the repository at this point in the history
  • Loading branch information
malaterre committed Oct 30, 2023
2 parents d95b92c + b578ec5 commit d31fb17
Show file tree
Hide file tree
Showing 79 changed files with 159 additions and 156 deletions.
3 changes: 3 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[codespell]
skip = ./Utilities/gdcmcharls,./Utilities/gdcmopenjpeg,./Utilities/gdcmrle,./Utilities/gdcmexpat,./Utilities/gdcmjpeg,./Utilities/gdcmzlib,./Utilities/pvrg,./Utilities/socketxx
ignore-words-list = convertor,possibile,iif,comando,oly,ofthe,didi,promis,alue,tutoriels,som,tabl,psot,cna,varian,pres,comparaison,serie,ore,ect,mor,setts,unknow,inout,te,nd,te,pinter,fo,ot,siz,ist,shs,invers,studi,wallthickness,vas,fith
2 changes: 1 addition & 1 deletion Applications/Cxx/puff.c
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ local int fixed(struct state *s)
* are themselves compressed using Huffman codes and run-length encoding. In
* the list of code lengths, a 0 symbol means no code, a 1..15 symbol means
* that length, and the symbols 16, 17, and 18 are run-length instructions.
* Each of 16, 17, and 18 are follwed by extra bits to define the length of
* Each of 16, 17, and 18 are followed by extra bits to define the length of
* the run. 16 copies the last length 3 to 6 times. 17 represents 3 to 10
* zero lengths, and 18 represents 11 to 138 zero lengths. Unused symbols
* are common, hence the special coding for zero lengths.
Expand Down
2 changes: 1 addition & 1 deletion Examples/Csharp/BasicImageAnonymizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static int Main(string[] args)
{
string filename = args[0];

// instanciate the reader:
// instantiate the reader:
gdcm.ImageReader reader = new gdcm.ImageReader();
reader.SetFileName( filename );

Expand Down
2 changes: 1 addition & 1 deletion Examples/Csharp/DecompressImageMultiframe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static int Main(string[] args)
// Create a new SequenceOfFragments C++ object, store it as a SmartPointer :
SmartPtrFrag sq = SequenceOfFragments.New();

// Yeah, the file are not garantee to be in order, please adapt...
// Yeah, the files are not guaranteed to be in order, please adapt...
for(uint i = 0; i < nfiles; ++i)
{
System.Console.WriteLine( filenames[(int)i] );
Expand Down
2 changes: 1 addition & 1 deletion Examples/Csharp/ReformatFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static int Main(string[] args)

UIDGenerator uid = new UIDGenerator(); // helper for uid generation
FileDerivation fd = new FileDerivation();
// For the pupose of this execise we will pretend that this image is referencing
// For the purpose of this exercise we will pretend that this image is referencing
// two source image (we need to generate fake UID for that).
string ReferencedSOPClassUID = "1.2.840.10008.5.1.4.1.1.7"; // Secondary Capture
fd.AddReference( ReferencedSOPClassUID, uid.Generate() );
Expand Down
2 changes: 1 addition & 1 deletion Examples/Csharp/StandardizeFiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static bool ProcessOneFile( string filename, string outfilename )
}

ImageChangeTransferSyntax change = new ImageChangeTransferSyntax();
change.SetForce( false ); // do we really want to recompress when input is alread compressed in same alg ?
change.SetForce( false ); // do we really want to recompress when input is already compressed in same alg ?
change.SetCompressIconImage( false ); // Keep it simple
change.SetTransferSyntax( new TransferSyntax( TransferSyntax.TSType.JPEG2000Lossless ) );
change.SetInput( reader.GetPixmap() );
Expand Down
4 changes: 2 additions & 2 deletions Examples/Cxx/DumpExamCard.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ struct param
void read( std::istream & is )
{
is.read( name, 32 + 1);
// This is always the same issue the string can contains garbarge from previous run,
// This is always the same issue the string can contains garbage from previous run,
// we need to print only until the first \0 character:
assert( strlen( name ) <= 32 );
is.read( (char*)&boolean,1);
Expand Down Expand Up @@ -528,7 +528,7 @@ Wotsit ?
//fn += ".xml";
std::ofstream csv( fn.c_str() );

// let's do some bookeeping:
// let's do some bookkeeping:
uint32_t nfloats = 0;
uint32_t nints = 0;
uint32_t nstrings = 0;
Expand Down
2 changes: 1 addition & 1 deletion Examples/Cxx/FixBrokenJ2K.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
// -> BuggyJ2Kvvvua-fixed2-j2k.dcm

/*
* This program attemps to fix a broken J2K/DICOM:
* This program attempts to fix a broken J2K/DICOM:
* It contains 2 bugs:
* 1. The first 8 bytes seems to be random bytes: remove them
* 2. YCC is set to 1, while image is grayscale need to set it back to 0
Expand Down
6 changes: 3 additions & 3 deletions Examples/Cxx/FixJAIBugJPEGLS.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ int main(int argc, char *argv[])
char errorMsg[256+1]={'\0'};
if (JpegLsReadHeader(buffer, totalLen, &metadata, errorMsg) != charls::ApiResult::OK)
{
std::cerr << "Cant parse jpegls: " << errorMsg << std::endl;
std::cerr << "Can't parse jpegls: " << errorMsg << std::endl;
return 1;
}

Expand Down Expand Up @@ -170,7 +170,7 @@ int main(int argc, char *argv[])
}
if( !marker_lse )
{
std::cerr << "Cant handle: " << metadata.bitsPerSample << std::endl;
std::cerr << "Can't handle: " << metadata.bitsPerSample << std::endl;
return 1;
}

Expand All @@ -184,7 +184,7 @@ int main(int argc, char *argv[])
#endif

const char *pbyteCompressed = vbuffer.data();
size_t cbyteCompressed = vbuffer.size(); // updated legnth
size_t cbyteCompressed = vbuffer.size(); // updated length

JlsParameters params;
JpegLsReadHeader(pbyteCompressed, cbyteCompressed, &params, nullptr);
Expand Down
2 changes: 1 addition & 1 deletion Examples/Cxx/GenFakeImage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ int main(int, char *[])

// Step 2: DERIVED object
gdcm::FileDerivation fd;
// For the pupose of this execise we will pretend that this image is referencing
// For the purpose of this exercise we will pretend that this image is referencing
// two source image (we need to generate fake UID for that).
const char ReferencedSOPClassUID[] = "1.2.840.10008.5.1.4.1.1.7"; // Secondary Capture
fd.AddReference( ReferencedSOPClassUID, uid.Generate() );
Expand Down
2 changes: 1 addition & 1 deletion Examples/Cxx/HelloVizWorld.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int main(int argc, char *argv[])
const char *filename = argv[1];
const char *outfilename = argv[2];

// Instanciate the image reader:
// Instantiate the image reader:
gdcm::ImageReader reader;
reader.SetFileName( filename );
if( !reader.Read() )
Expand Down
4 changes: 2 additions & 2 deletions Examples/Cxx/HelloWorld.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ int main(int argc, char *argv[])
const char *filename = argv[1];
const char *outfilename = argv[2];

// Instanciate the reader:
// Instantiate the reader:
gdcm::Reader reader;
reader.SetFileName( filename );
if( !reader.Read() )
Expand All @@ -50,7 +50,7 @@ int main(int argc, char *argv[])
// the dataset is the the set of element we are interested in:
gdcm::DataSet &ds = file.GetDataSet();

// Contruct a static(*) type for Image Comments :
// Construct a static(*) type for Image Comments :
gdcm::Attribute<0x0020,0x4000> imagecomments;
imagecomments.SetValue( "Hello, World !" );

Expand Down
2 changes: 1 addition & 1 deletion Examples/Cxx/LargeVRDSExplicit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* gdcmConformanceTests/RTStruct_VRDSAsVRUN.dcm
*
* This is an advanced example. Its goal is to explain one dark corner of DICOM PS 3.10
* file format. The idea is that when writting an Attribute in an Explicit Transfer
* file format. The idea is that when writing an Attribute in an Explicit Transfer
* Syntax one, cannot always use V:DS for writing a VR:DS attribute since dong so
* would imply using a VL:16bits.
* This example shows that converting from Implicit to Explicit should preserver VR:UN
Expand Down
2 changes: 1 addition & 1 deletion Examples/Cxx/MrProtocol.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ One can find it also in the protocol:
...
*/
// Below is an attemp to play with the CSAHeader dict:
// Below is an attempt to play with the CSAHeader dict:
#if 0
const char gspec[] = "sGRADSPEC.flSensitivityX";
it = mymap.find( gspec );
Expand Down
2 changes: 1 addition & 1 deletion Examples/Cxx/PatchFile.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ int main(int argc, char *argv[])
}
std::cout << bv->GetLength() << " " << len << std::endl;

std::cout << "Sucess to rewrite image !" << std::endl;
std::cout << "Success to rewrite image !" << std::endl;
image.Print( std::cout );
return 0;
}
2 changes: 1 addition & 1 deletion Examples/Cxx/PrintLUT.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int main(int argc, char *argv[])
}
const char *filename = argv[1];

// Instanciate the image reader:
// Instantiate the image reader:
gdcm::ImageReader reader;
reader.SetFileName( filename );
if( !reader.Read() )
Expand Down
2 changes: 1 addition & 1 deletion Examples/Cxx/PublicDict.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int main(int , char *[])

//std::cout << pub << std::endl;

// 3 differents way to access the same information
// 3 different ways to access the same information

// 1. From the public dict only:
gdcm::Tag patient_name(0x10,0x10);
Expand Down
2 changes: 1 addition & 1 deletion Examples/Cxx/ReadAndDumpDICOMDIR2.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ const std::vector<std::shared_ptr<DICOMDIRReader::Patient>>& DICOMDIRReader::loa
// VR field
first_item_offset += it->GetVR().GetLength();
// VL field
// For Explicit VR: adventitiously VL field lenght = VR field lenght,
// For Explicit VR: adventitiously VL field length = VR field length,
// for SQ 4 bytes:
// http://dicom.nema.org/medical/dicom/current/output/html/part05.html#table_7.1-1
first_item_offset += it->GetVR().GetLength();
Expand Down
2 changes: 1 addition & 1 deletion Examples/Cxx/ReadAndPrintAttributes.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int main(int argc, char *argv[])
}
const char *filename = argv[1];

// Instanciate the reader:
// Instantiate the reader:
gdcm::Reader reader;
reader.SetFileName( filename );
if( !reader.Read() )
Expand Down
4 changes: 2 additions & 2 deletions Examples/Cxx/pmsct_rgb1.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void delta_decode(const unsigned char *data_in, size_t data_size,
size_t ps = plane_size;

// The following is highly unoptimized as we have nested if statement in a while loop
// we need to switch from one algorithm to ther other (RGB <-> GRAY)
// we need to switch from one algorithm to the other (RGB <-> GRAY)
while (ps)
{
// next byte:
Expand Down Expand Up @@ -130,7 +130,7 @@ void delta_decode(const unsigned char *data_in, size_t data_size,
}
break;
case COLORMODE:
// We are swithing from one mode to the other. The stream contains an intermixed
// We are switching from one mode to the other. The stream contains an intermixed
// compression of RGB codec and GRAY codec. Each one not knowing of the other
// reset old value to 0.
if (graymode)
Expand Down
2 changes: 1 addition & 1 deletion Examples/Python/DumbAnonymizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
(0x0018,0x1250):("Sequence Field","Receive Coil"),
(0x0018,0x0088):("Sequence Field","Spacing Between Slice"),
(0x0018,0x0095):("Sequence Field","Pixel Bandwidth"),
(0x0018,0x0082):("Sequence Field","Invertion Time"),
(0x0018,0x0082):("Sequence Field","Inversion Time"),
}

class MyAnon:
Expand Down
2 changes: 1 addition & 1 deletion Examples/Python/FixCommaBug.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@
print "there is still a comma"
sys.exit(1)

print "Sucess!"
print "Success!"
sys.exit(0) # success
2 changes: 1 addition & 1 deletion Examples/Python/HelloWorld.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# Get the filename from the command line
filename = sys.argv[1]

# Instanciate a gdcm.Reader
# Instantiate a gdcm.Reader
# This is the main class to handle any type of DICOM object
# You should check for gdcm.ImageReader for reading specifically DICOM Image file
r = gdcm.Reader()
Expand Down
2 changes: 1 addition & 1 deletion Examples/Python/PrivateDict.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#gdcm.Trace.DebugOn()
globInst = gdcm.Global.GetInstance()
# Try to load Part3.xml file
# This fils is too big for being accessible directly at runtime.
# This file is too big for being accessible directly at runtime.
globInst.LoadResourcesFiles()


Expand Down
2 changes: 1 addition & 1 deletion Examples/Python/ReWriteSCAsMR.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def CheckSecondaryCaptureObjectIsMRImageStorage(r):

if( CheckSecondaryCaptureObjectIsMRImageStorage(r) ):
# Special handling of the spacing:
# GDCM 1.2.0 would not rewrite correcly DICOM Object and would always set them as 'Secondary Capture Image Storage'
# GDCM 1.2.0 would not rewrite correctly DICOM Object and would always set them as 'Secondary Capture Image Storage'
# while we would rather have 'MR Image Storage'
gdcm.ImageHelper.SetForcePixelSpacing( True )
mrspacing = gdcm.ImageHelper.GetSpacingValue( r.GetFile() )
Expand Down
2 changes: 1 addition & 1 deletion Examples/Python/RemovePrivateTags.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
file1 = sys.argv[1]
file2 = sys.argv[2]

# Instanciate the reader.
# Instantiate the reader.
r = gdcm.Reader()
r.SetFileName( file1 )
if not r.Read():
Expand Down
2 changes: 1 addition & 1 deletion Examples/Python/ScanDirectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def EndFilter(self):
# Get rid of any Warning while parsing the DICOM files
gdcm.Trace.WarningOff()

# instanciate Scanner:
# instantiate Scanner:
sp = gdcm.Scanner.New();
s = sp.__ref__()
w = ProgressWatcher(s, 'Watcher')
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ Major options explained:
* GDCM_WRAP_PHP: turn it on if you want to be able to access the GDCM API via php (experimental)
* GDCM_USE_VTK: turn if on if you want to be able to load DICOM file in VTK context (requires VTK)
* GDCM_BUILD_APPLICATIONS: turn it on if you want the build gdcm applications (gdcmdump, gdcmconv, gdcminfo ...)
* GDCM_BUILD_TESTING: Turn it on if you want to be able to exectute GDCM testing suite
* GDCM_BUILD_TESTING: Turn it on if you want to be able to execute GDCM testing suite
* GDCM_DOCUMENTATION: turn it on if you want to generate the developer documentation (require doxygen)
* GDCM_BUILD_EXAMPLES: turn it on if you want to build simple examples that demonstrates GDCM usage.
2 changes: 1 addition & 1 deletion Source/DataDictionary/gdcmPrivateDefaultDicts.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -4047,7 +4047,7 @@ static const DICT_ENTRY DICOMV3DataDict [] = {
{0x0011,0x0040,"GEMS_GDXE_FALCON_04",VR::SL,VM::VM1,"Pasting Overlap",false },
{0x0011,0x0041,"GEMS_GDXE_FALCON_04",VR::IS,VM::VM24,"Sub-image Collimator Vertices",false },
{0x0011,0x0042,"GEMS_GDXE_FALCON_04",VR::LO,VM::VM1,"View IP",false },
{0x0011,0x0043,"GEMS_GDXE_FALCON_04",VR::IS,VM::VM24,"Key-stone Co-ordinates",false },
{0x0011,0x0043,"GEMS_GDXE_FALCON_04",VR::IS,VM::VM24,"Key-stone Coordinates",false },
{0x0011,0x0044,"GEMS_GDXE_FALCON_04",VR::CS,VM::VM1,"Receptor Type",false },
{0x0011,0x0046,"GEMS_GDXE_FALCON_04",VR::LO,VM::VM1_n,"?",false },
{0x0011,0x0047,"GEMS_GDXE_FALCON_04",VR::DS,VM::VM1,"?",false },
Expand Down
2 changes: 1 addition & 1 deletion Source/DataDictionary/privatedicts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3516,7 +3516,7 @@
<entry owner="GEMS_GDXE_FALCON_04" group="0011" element="xx40" vr="SL" vm="1" name="Pasting Overlap"/>
<entry owner="GEMS_GDXE_FALCON_04" group="0011" element="xx41" vr="IS" vm="24" name="Sub-image Collimator Vertices"/>
<entry owner="GEMS_GDXE_FALCON_04" group="0011" element="xx42" vr="LO" vm="1" name="View IP"/>
<entry owner="GEMS_GDXE_FALCON_04" group="0011" element="xx43" vr="IS" vm="24" name="Key-stone Co-ordinates"/>
<entry owner="GEMS_GDXE_FALCON_04" group="0011" element="xx43" vr="IS" vm="24" name="Key-stone Coordinates"/>
<entry owner="GEMS_GDXE_FALCON_04" group="0011" element="xx44" vr="CS" vm="1" name="Receptor Type"/>
<entry owner="GEMS_GDXE_FALCON_04" group="0011" element="xx46" vr="LO" vm="1-n" name="?"/>
<entry owner="GEMS_GDXE_FALCON_04" group="0011" element="xx47" vr="DS" vm="1" name="?"/>
Expand Down
10 changes: 5 additions & 5 deletions Source/DataStructureAndEncodingDefinition/gdcmVR.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ class GDCM_EXPORT VR
// For some reason this seems slower on my linux box...
is.seekg(2, std::ios::cur );
#else
char dum[2];
is.read(dum, 2);
if( !(dum[0] == 0 && dum[1] == 0 ))
char dumb[2];
is.read(dumb, 2);
if( !(dumb[0] == 0 && dumb[1] == 0 ))
{
// JDDICOM_Sample4.dcm
gdcmDebugMacro( "32bits VR contains non zero bytes. Skipped" );
Expand All @@ -205,8 +205,8 @@ class GDCM_EXPORT VR
// See PS 3.5, Data Element Structure With Explicit VR
if( vrfield & VL32 )
{
const char dum[2] = {0, 0};
os.write(dum,2);
const char dumb[2] = {0, 0};
os.write(dumb,2);
}
return os;
}
Expand Down
4 changes: 2 additions & 2 deletions Source/InformationObjectDefinition/gdcmIODEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Types specified in the Modules in Annex C shall be supported.
class GDCM_EXPORT IODEntry
{
public:
IODEntry(const char *name = "", const char *ref = "", const char *usag = ""):Name(name),Ref(ref),usage(usag) {
IODEntry(const char *name = "", const char *ref = "", const char *inUsage = ""):Name(name),Ref(ref),usage(inUsage) {
}
friend std::ostream& operator<<(std::ostream& _os, const IODEntry &_val);

Expand All @@ -64,7 +64,7 @@ class GDCM_EXPORT IODEntry
void SetRef(const char *ref) { Ref = ref; }
const char *GetRef() const { return Ref.c_str(); }

void SetUsage(const char *usag) { usage = usag; }
void SetUsage(const char *inUsage) { usage = inUsage; }
const char *GetUsage() const { return usage.c_str(); }
Usage::UsageType GetUsageType() const;

Expand Down
2 changes: 1 addition & 1 deletion Source/MediaStorageAndFileFormat/gdcmStreamImageWriter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ int StreamImageWriter::WriteRawHeader(RAWCodec* inCodec, std::ostream* inStream)
//Addition by Manoj
memcpy(&(tmpBuffer1[4*sizeof(uint16_t)]), &fifthTag, sizeof(uint32_t));// Data Element Length 4 bytes

// Basic OffSet Tabl with No Item Value
// Basic OffSet Table with No Item Value
memcpy(&(tmpBuffer1[4*sizeof(uint16_t)+sizeof(uint32_t)]), &sixthTag, sizeof(uint16_t)); //fffe
memcpy(&(tmpBuffer1[5*sizeof(uint16_t)+sizeof(uint32_t)]), &seventhTag, sizeof(uint16_t));//e000
memcpy(&(tmpBuffer1[6*sizeof(uint16_t)+sizeof(uint32_t)]), &eightthTag, sizeof(uint32_t));//00000000H
Expand Down
8 changes: 4 additions & 4 deletions Testing/Source/Common/Cxx/TestSmartPointer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class Foo : public Object {
}
};

class Containter {
class Container {
public:
Containter():Instance(nullptr) {}
Container():Instance(nullptr) {}
SmartPointer<Object> Instance;
};

Expand Down Expand Up @@ -100,8 +100,8 @@ int TestSmartPointer(int, char *[])
Foo &foo = *p7;
foo.foo();

Containter c1;
Containter c2;
Container c1;
Container c2;
c2 = c1;

// TODO:
Expand Down
Loading

0 comments on commit d31fb17

Please sign in to comment.