Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VolView support Grayscale Softcopy Presentation State? #622

Open
luferau opened this issue Jul 11, 2024 · 3 comments
Open

VolView support Grayscale Softcopy Presentation State? #622

luferau opened this issue Jul 11, 2024 · 3 comments

Comments

@luferau
Copy link

luferau commented Jul 11, 2024

Hello,
I have ORTHANC server where I want to render DICOM documents that contains Grayscale Softcopy Presentation State (GSPS) text and graphical annotations. One of the possibilities is to use a ORTHANC VolView plugin. However, I was unable to display the GSPS data.

Is Kitware VolView support Grayscale Softcopy Presentation State?

Thanks!

@PaulHax
Copy link
Collaborator

PaulHax commented Jul 11, 2024

Hello! That sounds like a nice thing to support. Is that something you can help with? Can you attach a sample DICOM file to this issue?

@luferau
Copy link
Author

luferau commented Jul 12, 2024

Hello @PaulHax, thanks for you attention.

Archive attached with GSPS sample files that provide text and graphics (ELIPSE) annotation for DICOM file and also XML dumps.
gsps-samples.zip

This is how this is rendered in Weasis:
image

Following is the example script that can create GSPS using DCMTK dcmpsmk and dcmodify tools. I hope this helps to better understand tags involved.

#!/bin/bash

INPUT_DICOM=mri-brain.dcm
OUTPUT_GSPS=mri-brain-gsps-text.dcm

CONTENT_LABEL="GSPS Text"
CONTENT_DESCRIPTION="GSPS Text example annotation"
CONTENT_CREATOR_NAME="NAME"

dcmpsmk "$INPUT_DICOM" "$OUTPUT_GSPS"

dcmodify --no-backup --insert "(0070,0080)=$CONTENT_LABEL" "$OUTPUT_GSPS"
dcmodify --no-backup --insert "(0070,0081)=$CONTENT_DESCRIPTION" "$OUTPUT_GSPS"
dcmodify --no-backup --insert "(0070,0084)=$CONTENT_CREATOR_NAME" "$OUTPUT_GSPS"

# Add Graphic Layer Sequence
dcmodify --no-backup --insert "(0070,0060)[0].(0070,0002)=ANNOTATION" "$OUTPUT_GSPS"
dcmodify --no-backup --insert "(0070,0060)[0].(0070,0062)=0" "$OUTPUT_GSPS"
dcmodify --no-backup --insert "(0070,0060)[0].(0070,0068)=Annotations" "$OUTPUT_GSPS"
dcmodify --no-backup --insert "(0070,0060)[0].(0070,0401)=63658\27358\57178" "$OUTPUT_GSPS"

# Add Graphic Annotation Sequence with Text
dcmodify --no-backup --insert "(0070,0001)[0].(0070,0002)=ANNOTATION" "$OUTPUT_GSPS"

# Text annotation 1
dcmodify --no-backup --insert "(0070,0001)[0].(0070,0008)[0].(0070,0003)=PIXEL" "$OUTPUT_GSPS"
dcmodify --no-backup --insert "(0070,0001)[0].(0070,0008)[0].(0070,0006)=Annotation text created with DCMTK #1" "$OUTPUT_GSPS"
dcmodify --no-backup --insert "(0070,0001)[0].(0070,0008)[0].(0070,0010)=200\200" "$OUTPUT_GSPS"
dcmodify --no-backup --insert "(0070,0001)[0].(0070,0008)[0].(0070,0011)=300\300" "$OUTPUT_GSPS"
dcmodify --no-backup --insert "(0070,0001)[0].(0070,0008)[0].(0070,0014)=100\100" "$OUTPUT_GSPS"
dcmodify --no-backup --insert "(0070,0001)[0].(0070,0008)[0].(0070,0015)=Y" "$OUTPUT_GSPS"
dcmodify --no-backup --insert "(0070,0001)[0].(0070,0008)[0].(0070,0232)[0].(0070,0251)=63658\27358\57178" "$OUTPUT_GSPS"
dcmodify --no-backup --insert "(0070,0001)[0].(0070,0008)[0].(0070,0232)[0].(0070,0253)=1" "$OUTPUT_GSPS"

# Text annotation 2
dcmodify --no-backup --insert "(0070,0001)[0].(0070,0008)[1].(0070,0003)=PIXEL" "$OUTPUT_GSPS"
dcmodify --no-backup --insert "(0070,0001)[0].(0070,0008)[1].(0070,0006)=Annotation text created with DCMTK #2" "$OUTPUT_GSPS"
dcmodify --no-backup --insert "(0070,0001)[0].(0070,0008)[1].(0070,0010)=600\200" "$OUTPUT_GSPS"
dcmodify --no-backup --insert "(0070,0001)[0].(0070,0008)[1].(0070,0011)=700\300" "$OUTPUT_GSPS"
dcmodify --no-backup --insert "(0070,0001)[0].(0070,0008)[1].(0070,0014)=800\100" "$OUTPUT_GSPS"
dcmodify --no-backup --insert "(0070,0001)[0].(0070,0008)[1].(0070,0015)=Y" "$OUTPUT_GSPS"
dcmodify --no-backup --insert "(0070,0001)[0].(0070,0008)[1].(0070,0232)[0].(0070,0251)=63658\27358\57178" "$OUTPUT_GSPS"
dcmodify --no-backup --insert "(0070,0001)[0].(0070,0008)[1].(0070,0232)[0].(0070,0253)=1" "$OUTPUT_GSPS"

if [ $? -eq 0 ]; then
    echo "GSPS with text created as $OUTPUT_GSPS"
else
    echo "Failed to create GSPS with text"
fi

@PaulHax
Copy link
Collaborator

PaulHax commented Jul 12, 2024

Thanks for all this! Looks useful.

Next up for VolView file format work is upgrading "segmentation" support. Cuz AI. We could support you if you want to impliment this or if you have some funding to direct Kitware's way.

@PaulHax PaulHax changed the title Is Kitware VolView support Grayscale Softcopy Presentation State? VolView support Grayscale Softcopy Presentation State? Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants