Code Monkey home page Code Monkey logo

Comments (3)

PaulHax avatar PaulHax commented on August 13, 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?

from volview.

luferau avatar luferau commented on August 13, 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

from volview.

PaulHax avatar PaulHax commented on August 13, 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.

from volview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.