Skip to content

Commit 775442c

Browse files
author
Evgeniy Sidenko
committed
Updated to 24.8
1 parent c6c3351 commit 775442c

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

Examples/data/dicom/input.dcm

195 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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)

0 commit comments

Comments
 (0)