From b89e66ff1abaaa4a9bdbe96e9ad9363df4e05df8 Mon Sep 17 00:00:00 2001 From: Shreeraj Jadhav Date: Fri, 28 Jun 2024 00:11:47 -0400 Subject: [PATCH] fix: use const pointer to input segmentations --- apps/seg/itkimage2segimage.cxx | 4 ++-- include/dcmqi/ConverterBase.h | 2 +- include/dcmqi/Itk2DicomConverter.h | 2 +- libsrc/Itk2DicomConverter.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/seg/itkimage2segimage.cxx b/apps/seg/itkimage2segimage.cxx index 4377bb1d..ac7ae31e 100644 --- a/apps/seg/itkimage2segimage.cxx +++ b/apps/seg/itkimage2segimage.cxx @@ -28,7 +28,7 @@ int main(int argc, char *argv[]) return EXIT_FAILURE; } - vector segmentations; + vector segmentations; for(size_t segFileNumber=0; segFileNumber fileOrder(segImageFiles.size()); fill(fileOrder.begin(), fileOrder.end(), -1); - vector segmentationsReordered(segImageFiles.size()); + vector segmentationsReordered(segImageFiles.size()); for(size_t filePosition=0;filePosition(mappingPosition)].asCString(); diff --git a/include/dcmqi/ConverterBase.h b/include/dcmqi/ConverterBase.h index a9fd4010..bb4acedf 100644 --- a/include/dcmqi/ConverterBase.h +++ b/include/dcmqi/ConverterBase.h @@ -299,7 +299,7 @@ namespace dcmqi { // AF: I could not quickly figure out how to template this function over image type - suggestions are welcomed! static vector > getSliceMapForSegmentation2DerivationImage(const vector dcmDatasets, - const ShortImageType::Pointer &labelImage) { + const ShortImageType::ConstPointer &labelImage) { // Find mapping from the segmentation slice number to the derivation image // Assume that orientation of the segmentation is the same as the source series unsigned numLabelSlices = labelImage->GetLargestPossibleRegion().GetSize()[2]; diff --git a/include/dcmqi/Itk2DicomConverter.h b/include/dcmqi/Itk2DicomConverter.h index d89b9d2d..0d671744 100644 --- a/include/dcmqi/Itk2DicomConverter.h +++ b/include/dcmqi/Itk2DicomConverter.h @@ -63,7 +63,7 @@ namespace dcmqi { * @return A pointer to the resulting DICOM Segmentation object. */ static DcmDataset* itkimage2dcmSegmentation(vector dcmDatasets, - vector segmentations, + vector segmentations, const string &metaData, bool skipEmptySlices=true, bool useLabelIDAsSegmentNumber=false, diff --git a/libsrc/Itk2DicomConverter.cpp b/libsrc/Itk2DicomConverter.cpp index 694cc9e4..1151a77b 100644 --- a/libsrc/Itk2DicomConverter.cpp +++ b/libsrc/Itk2DicomConverter.cpp @@ -26,7 +26,7 @@ namespace dcmqi { // ------------------------------------------------------------------------------------- DcmDataset* Itk2DicomConverter::itkimage2dcmSegmentation(vector dcmDatasets, - vector segmentations, + vector segmentations, const string &metaData, bool skipEmptySlices, bool useLabelIDAsSegmentNumber,