From fc1dda13ded85440c7d2b4ced3ccb86f9f028649 Mon Sep 17 00:00:00 2001 From: Mogtaba-Alim Date: Wed, 31 Jan 2024 11:45:09 -0500 Subject: [PATCH] fixed merge between SEGs and CTs, in matchCTtoSegmentation --- src/readii/metadata.py | 2 +- src/readii/negative_controls.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/readii/metadata.py b/src/readii/metadata.py index ac9b783..ab4044a 100644 --- a/src/readii/metadata.py +++ b/src/readii/metadata.py @@ -73,7 +73,7 @@ def matchCTtoSegmentation(imgFileListPath: str, # Merge the CT and segmentation dataframes based on the CT ID (referenced in the segmentation rows) # Uses only segmentation keys, so no extra CTs are kept # If multiple CTs have the same ID, they are both included in this table - samplesWSeg = allCTRows.merge(allSegRows, how='right', + samplesWSeg = allCTRows.merge(allSegRows, how='inner', left_on=['series', 'patient_ID'], right_on=['reference_ct', 'patient_ID'], suffixes=('_CT','_seg')) diff --git a/src/readii/negative_controls.py b/src/readii/negative_controls.py index f797e65..7847c28 100644 --- a/src/readii/negative_controls.py +++ b/src/readii/negative_controls.py @@ -459,7 +459,7 @@ def applyNegativeControl(nc_type: str, baseImage: sitk.Image, baseROI: sitk.Imag return shuffleNonROI(baseImage, baseROI, roiLabel) elif nc_type == "randomized_sampled_full": # Make negative control version of ctImage (random sampled pixels from original distribution, same size) - return RandomizeImageFromDistribtutionSampling(baseImage) + return randomizeImageFromDistribtutionSampling(baseImage) elif nc_type == "randomized_sampled_roi": # Make negative control version of ctImage (random sampled pixels from original distribution inside ROI, same size) return makeRandomFromRoiDistribution(baseImage, baseROI, roiLabel)