Skip to content

Commit 63b5b8b

Browse files
committed
Squashed commit of the following:
STYLE: documentation and style fixes BUG: fix pixel and physical dimension population for writing - have metadata dictionary populate and save dimension values BUG: fix microsoft-specific errors and register scancoio for use in test for aim writing WIP: Have write convert back to Scanco units Merge changes from incorporate aimio: WIP: Move header reading/writing to completely depend on subclass ScancoHeaderIO WIP: Have ISQ write all metadata as read in WIP: Use AimIO method for reading ISQ This method defines header structures and reads header bytes directly into them for access - add test for reader update in conversion test WIP: Complete reading extended header from data struct - add documentation and style fixes WIP: have aim reader use struct header datatype WIP: switch reading to scancoheaderio class WIP: add class files for header reader and writers WIP: add class files and definitions for separating header reading and writing Merge changes from main: BUG: fix creation date output in header write STYLE: Move unrelated data manipulation functions out of main class STYLE: Add and update doxygen comments for functions STYLE: fix spacing for ITK style checks BUG: fix CI and compiler warnings and errors BUG: remove depreciated sprintf
1 parent c22c53b commit 63b5b8b

File tree

4 files changed

+52
-45
lines changed

4 files changed

+52
-45
lines changed

include/itkScancoDataManipulation.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ struct itkScancoHeaderData
6868
itkScancoPixelData m_PixelData; // Pixel data information
6969
};
7070

71-
#define GetConstMacro(name, type) \
71+
#define ScancoGetConstMacro(name, type) \
7272
virtual type Get##name() const { return this->m_HeaderData.m_##name; } \
7373
ITK_MACROEND_NOOP_STATEMENT
7474

75-
#define SetMacro(name, type) \
75+
#define ScancoSetMacro(name, type) \
7676
virtual void Set##name(type _arg) \
7777
{ \
7878
itkDebugMacro("setting " #name " to " << _arg); \

include/itkScancoImageIO.h

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -195,20 +195,20 @@ class IOScanco_EXPORT ScancoImageIO : public ImageIOBase
195195
this->Modified();
196196
}
197197

198-
GetConstMacro(PatientIndex, int);
199-
SetMacro(PatientIndex, int);
198+
ScancoGetConstMacro(PatientIndex, int);
199+
ScancoSetMacro(PatientIndex, int);
200200

201-
GetConstMacro(ScannerID, int);
202-
SetMacro(ScannerID, int);
201+
ScancoGetConstMacro(ScannerID, int);
202+
ScancoSetMacro(ScannerID, int);
203203

204-
GetConstMacro(SliceThickness, double);
205-
SetMacro(SliceThickness, double);
204+
ScancoGetConstMacro(SliceThickness, double);
205+
ScancoSetMacro(SliceThickness, double);
206206

207-
GetConstMacro(SliceIncrement, double);
208-
SetMacro(SliceIncrement, double);
207+
ScancoGetConstMacro(SliceIncrement, double);
208+
ScancoSetMacro(SliceIncrement, double);
209209

210-
GetConstMacro(StartPosition, double);
211-
SetMacro(StartPosition, double);
210+
ScancoGetConstMacro(StartPosition, double);
211+
ScancoSetMacro(StartPosition, double);
212212

213213
/** Set / Get the minimum and maximum values */
214214
const double *
@@ -232,47 +232,47 @@ class IOScanco_EXPORT ScancoImageIO : public ImageIOBase
232232
}
233233
}
234234

235-
GetConstMacro(MuScaling, double);
236-
SetMacro(MuScaling, double);
235+
ScancoGetConstMacro(MuScaling, double);
236+
ScancoSetMacro(MuScaling, double);
237237

238-
GetConstMacro(MuWater, double);
239-
SetMacro(MuWater, double);
238+
ScancoGetConstMacro(MuWater, double);
239+
ScancoSetMacro(MuWater, double);
240240

241-
GetConstMacro(RescaleType, int);
242-
SetMacro(RescaleType, int);
241+
ScancoGetConstMacro(RescaleType, int);
242+
ScancoSetMacro(RescaleType, int);
243243

244-
GetConstMacro(RescaleSlope, double);
245-
SetMacro(RescaleSlope, double);
244+
ScancoGetConstMacro(RescaleSlope, double);
245+
ScancoSetMacro(RescaleSlope, double);
246246

247-
GetConstMacro(RescaleIntercept, double);
248-
SetMacro(RescaleIntercept, double);
247+
ScancoGetConstMacro(RescaleIntercept, double);
248+
ScancoSetMacro(RescaleIntercept, double);
249249

250-
GetConstMacro(NumberOfSamples, int);
251-
SetMacro(NumberOfSamples, int);
250+
ScancoGetConstMacro(NumberOfSamples, int);
251+
ScancoSetMacro(NumberOfSamples, int);
252252

253-
GetConstMacro(NumberOfProjections, int);
254-
SetMacro(NumberOfProjections, int);
253+
ScancoGetConstMacro(NumberOfProjections, int);
254+
ScancoSetMacro(NumberOfProjections, int);
255255

256-
GetConstMacro(ScanDistance, double);
257-
SetMacro(ScanDistance, double);
256+
ScancoGetConstMacro(ScanDistance, double);
257+
ScancoSetMacro(ScanDistance, double);
258258

259-
GetConstMacro(ScannerType, int);
260-
SetMacro(ScannerType, int);
259+
ScancoGetConstMacro(ScannerType, int);
260+
ScancoSetMacro(ScannerType, int);
261261

262-
GetConstMacro(SampleTime, double);
263-
SetMacro(SampleTime, double);
262+
ScancoGetConstMacro(SampleTime, double);
263+
ScancoSetMacro(SampleTime, double);
264264

265-
GetConstMacro(MeasurementIndex, int);
266-
SetMacro(MeasurementIndex, int);
265+
ScancoGetConstMacro(MeasurementIndex, int);
266+
ScancoSetMacro(MeasurementIndex, int);
267267

268-
GetConstMacro(Site, int);
269-
SetMacro(Site, int);
268+
ScancoGetConstMacro(Site, int);
269+
ScancoSetMacro(Site, int);
270270

271-
GetConstMacro(ReferenceLine, int);
272-
SetMacro(ReferenceLine, int);
271+
ScancoGetConstMacro(ReferenceLine, int);
272+
ScancoSetMacro(ReferenceLine, int);
273273

274-
GetConstMacro(ReconstructionAlg, int);
275-
SetMacro(ReconstructionAlg, int);
274+
ScancoGetConstMacro(ReconstructionAlg, int);
275+
ScancoSetMacro(ReconstructionAlg, int);
276276

277277
/** Get a string that states patient name.
278278
* Max size: 40 characters. */
@@ -312,11 +312,11 @@ class IOScanco_EXPORT ScancoImageIO : public ImageIOBase
312312
this->Modified();
313313
}
314314

315-
GetConstMacro(Energy, double);
316-
SetMacro(Energy, double);
315+
ScancoGetConstMacro(Energy, double);
316+
ScancoSetMacro(Energy, double);
317317

318-
GetConstMacro(Intensity, double);
319-
SetMacro(Intensity, double);
318+
ScancoGetConstMacro(Intensity, double);
319+
ScancoSetMacro(Intensity, double);
320320

321321
protected:
322322
ScancoImageIO();

src/itkScancoImageIO.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ ScancoImageIO::ReadImageInformation()
286286
}
287287
else
288288
{
289+
this->SetPixelType(IOPixelEnum::SCALAR);
289290
this->SetComponentType(IOComponentEnum::SHORT);
290291
this->m_Compression = 0;
291292
}

test/itkScancoImageIOTest.cxx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ itkScancoImageIOTest(int argc, char * argv[])
3737
}
3838
const char * inputFileName = argv[1];
3939
const char * outputFileName = argv[2];
40+
bool expectFailure = false;
41+
if (argc > 3)
42+
{
43+
expectFailure = true;
44+
std::cout << "Expecting failure for this test." << std::endl;
45+
}
4046

4147
// ATTENTION THIS IS THE PIXEL TYPE FOR
4248
// THE RESULTING IMAGE
@@ -73,7 +79,7 @@ itkScancoImageIOTest(int argc, char * argv[])
7379
{
7480
std::cerr << "Exception in the file reader " << std::endl;
7581
std::cerr << error << std::endl;
76-
if (argc == 3) // should fail
82+
if (expectFailure)
7783
{
7884
return EXIT_SUCCESS;
7985
}

0 commit comments

Comments
 (0)