File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
src/modifyingandconvertingimages/dicom Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ # GROUP: TEST_FILE_FORMATS
2+ from aspose .imaging import Image
3+ import os
4+
5+
6+ # Initialization
7+ def get_data_root_dir_local ():
8+ if 'BASE_DIR' in os .environ :
9+ return os .environ ["BASE_DIR" ]
10+ return "."
11+
12+
13+ if 'get_data_root_dir' not in dir ():
14+ get_data_root_dir = get_data_root_dir_local
15+
16+ if 'get_output_dir' not in dir ():
17+ get_output_dir = get_data_root_dir_local
18+
19+ # Example code:
20+ # The path to the documents directory.
21+ data_dir = os .path .join (get_data_root_dir (), 'dicom' )
22+ out_file = os .path .join (get_output_dir (), 'SupportDicomYBR422.png' )
23+
24+ input_path = os .path .join (data_dir , "input.dcm" )
25+ with Image .load (input_path ) as image :
26+ image .save (out_file );
27+
28+ if 'SAVE_OUTPUT' not in os .environ :
29+ os .remove (out_file )
You can’t perform that action at this time.
0 commit comments