-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Evgeniy Sidenko
committed
Aug 14, 2024
1 parent
c6c3351
commit 775442c
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
29 changes: 29 additions & 0 deletions
29
Examples/src/modifyingandconvertingimages/dicom/SupportDicomYBR422.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# GROUP: TEST_FILE_FORMATS | ||
from aspose.imaging import Image | ||
import os | ||
|
||
|
||
# Initialization | ||
def get_data_root_dir_local(): | ||
if 'BASE_DIR' in os.environ: | ||
return os.environ["BASE_DIR"] | ||
return "." | ||
|
||
|
||
if 'get_data_root_dir' not in dir(): | ||
get_data_root_dir = get_data_root_dir_local | ||
|
||
if 'get_output_dir' not in dir(): | ||
get_output_dir = get_data_root_dir_local | ||
|
||
# Example code: | ||
# The path to the documents directory. | ||
data_dir = os.path.join(get_data_root_dir(), 'dicom') | ||
out_file = os.path.join(get_output_dir(), 'SupportDicomYBR422.png') | ||
|
||
input_path = os.path.join(data_dir, "input.dcm") | ||
with Image.load(input_path) as image: | ||
image.save(out_file); | ||
|
||
if 'SAVE_OUTPUT' not in os.environ: | ||
os.remove(out_file) |