Skip to content
Snippets Groups Projects
Commit d80575c9 authored by Tamino Huxohl's avatar Tamino Huxohl
Browse files

fix mu map dataset and add options for display

parent aa3f3119
No related branches found
No related tags found
No related merge requests found
...@@ -70,7 +70,7 @@ class MuMapDataset(Dataset): ...@@ -70,7 +70,7 @@ class MuMapDataset(Dataset):
def __getitem__(self, index: int): def __getitem__(self, index: int):
row = self.table.iloc[index] row = self.table.iloc[index]
recon_file = os.path.join(self.dir_images, row[header.file_recon_nac_nsc]) recon_file = os.path.join(self.dir_images, row[headers.file_recon_nac_nsc])
mu_map_file = os.path.join(self.dir_images, row[headers.file_mu_map]) mu_map_file = os.path.join(self.dir_images, row[headers.file_mu_map])
recon = pydicom.dcmread(recon_file).pixel_array recon = pydicom.dcmread(recon_file).pixel_array
...@@ -105,9 +105,15 @@ if __name__ == "__main__": ...@@ -105,9 +105,15 @@ if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Visualize the images of a MuMapDataset", formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser = argparse.ArgumentParser(description="Visualize the images of a MuMapDataset", formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument("dataset_dir", type=str, help="the directory from which the dataset is loaded") parser.add_argument("dataset_dir", type=str, help="the directory from which the dataset is loaded")
parser.add_argument("--unaligned", action="store_true", help="do not perform center alignment of reconstruction an mu-map slices") parser.add_argument("--unaligned", action="store_true", help="do not perform center alignment of reconstruction an mu-map slices")
parser.add_argument("--show_bed", action="store_true", help="do not remove the bed contour from the mu map")
parser.add_argument("--full_mu_map", action="store_true", help="do not remove broken slices of the mu map")
args = parser.parse_args() args = parser.parse_args()
dataset = MuMapDataset(args.dataset_dir, align=not args.unaligned) align = not args.unaligned
discard_mu_map_slices = not args.full_mu_map
bed_contours_file = None if args.show_bed else DEFAULT_BED_CONTOURS_FILENAME
dataset = MuMapDataset(args.dataset_dir, align=align, discard_mu_map_slices=discard_mu_map_slices, bed_contours_file=bed_contours_file)
wname = "Dataset" wname = "Dataset"
cv.namedWindow(wname, cv.WINDOW_NORMAL) cv.namedWindow(wname, cv.WINDOW_NORMAL)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment