Examples¶
Here is an end to end example
Clone the git repo
$ git clone https://github.com/Steven-N-Hart/dicom_wsi.git
$ cd dicom_wsi
$ mkdir example
$ cd example
Install the required packages as described here
Downloading the svs file
$ wget http://openslide.cs.cmu.edu/download/openslide-testdata/Aperio/CMU-1-JP2K-33005.svs
getting the annotations file
$ cp ../tests/CMU-1-JP2K-33005.xml .
Getting the input yaml file to generate the dicom file.Modifying values for params ‘WSIFile’,’OutFilePrefix’,’Annotations’.
Annotations are optional, if you want to skip annotations, then remove ‘Annotations’ param in the base.yaml file Below command will replace the paths for params ‘WSIFile’,’OutFilePrefix’,’Annotations’ to current directory
$ cat ../dicom_wsi/yaml/base.yaml |sed -e 's/tests\///g'|sed -e 's/.\///g' > base.yaml
Running the dicom_wsi tool & generating the dicom files
$ python ../dicom_wsi/cli.py -y base.yaml
Following dicom files will be generated (Multiple dicom files for multiple levels).
$ ls output.*.dcm
Optional: Validating the generated dicom files.
Download this tool dciodvfy to validate the generated dicom files
Other functions¶
Extracting Annotations from Dicom file to a python dictionary(Here i’m running it on only one level Dicom file)
$ python ../dicom_wsi/mods/extract_annotations.py -D output.2-0.dcm
Extracting images from Dicom file
$ python ../dicom_wsi/mods/extract_image_patches.py -D output.2-0.dcm -d output_images