Skip to content

Use const pointer to input segmentations #502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/seg/itkimage2segimage.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ int main(int argc, char *argv[])
return EXIT_FAILURE;
}

vector<ShortImageType::Pointer> segmentations;
vector<ShortImageType::ConstPointer> segmentations;

for(size_t segFileNumber=0; segFileNumber<segImageFiles.size(); segFileNumber++){
ShortReaderType::Pointer reader = ShortReaderType::New();
Expand Down Expand Up @@ -98,7 +98,7 @@ int main(int argc, char *argv[])
Json::Value reorderedSegmentAttributes;
vector<int> fileOrder(segImageFiles.size());
fill(fileOrder.begin(), fileOrder.end(), -1);
vector<ShortImageType::Pointer> segmentationsReordered(segImageFiles.size());
vector<ShortImageType::ConstPointer> segmentationsReordered(segImageFiles.size());
for(size_t filePosition=0;filePosition<segImageFiles.size();filePosition++){
for(size_t mappingPosition=0;mappingPosition<segImageFiles.size();mappingPosition++){
string mappingItem = metaRoot["segmentAttributesFileMapping"][static_cast<int>(mappingPosition)].asCString();
Expand Down
2 changes: 1 addition & 1 deletion include/dcmqi/ConverterBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<vector<int> > getSliceMapForSegmentation2DerivationImage(const vector<DcmDataset*> 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];
Expand Down
2 changes: 1 addition & 1 deletion include/dcmqi/Itk2DicomConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace dcmqi {
* @return A pointer to the resulting DICOM Segmentation object.
*/
static DcmDataset* itkimage2dcmSegmentation(vector<DcmDataset*> dcmDatasets,
vector<ShortImageType::Pointer> segmentations,
vector<ShortImageType::ConstPointer> segmentations,
const string &metaData,
bool skipEmptySlices=true,
bool useLabelIDAsSegmentNumber=false,
Expand Down
2 changes: 1 addition & 1 deletion libsrc/Itk2DicomConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace dcmqi {
// -------------------------------------------------------------------------------------

DcmDataset* Itk2DicomConverter::itkimage2dcmSegmentation(vector<DcmDataset*> dcmDatasets,
vector<ShortImageType::Pointer> segmentations,
vector<ShortImageType::ConstPointer> segmentations,
const string &metaData,
bool skipEmptySlices,
bool useLabelIDAsSegmentNumber,
Expand Down
Loading