Skip to content

This repo allows conversion of DICOMs RTStruct data to numpy and rudimentary visualization.

Notifications You must be signed in to change notification settings

khaledbousabarah/RTStruct_to_Numpy

Repository files navigation

RTStruct to Numpy

Installation

python setup.py install

Requires installation of dicom_decompresser: https://github.com/khaledbousabarah/Dicom_Decompress

Usage

Define a path containing the RTStruct and the corresponding Dicom Images

import rts_to_npy

study = rts_to_npy.load(dicom_path)

By default only contours with less than 50000 coordinates will be loaded. This can be changed using the optional parameter max_number_of_coords.

The function returns an object containing the image with all VOIs.

study = rts_to_npy.load(dicom_path)

print(study) # List VOIs by name

study.image	# Returns image as numpy

study.Cerebellum.npy() # Returns mask of VOI named Cerebellum as numpy

study.Cerebellum.plot() # Plots image with contour (slice and zoom optional)

About

This repo allows conversion of DICOMs RTStruct data to numpy and rudimentary visualization.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages