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

fix: Save units and calibration #354

Merged
merged 10 commits into from
Jun 19, 2023
Merged

Conversation

wayfarer3130
Copy link
Contributor

@wayfarer3130 wayfarer3130 commented Jun 19, 2023

This change adds the ability to save the user calibration as well as saving the no-units calibration (there doesn't seem to be a "pixel" units right now)

The proposed format for the user calibration is:

{
                RelationshipType: "CONTAINS",
                ValueType: "NUM",
                ConceptNameCodeSequence: {

**This is the code value/meaning for a calibration object, in this case a calibration ruler**
                    CodeValue: "102304005",
                    CodingSchemeDesignator: "SCT",

**Consider the code meaning 'Calibration Ruler'?**
                    CodeMeaning: "Measuring Ruler"
                },
                MeasuredValueSequence: {
                    MeasurementUnitsCodeSequence: - mm measurement,
                    NumericValue: distance entered by the user
                },
                ContentSequence: {
                    RelationshipType: "INFERRED FROM",
                    ValueType: "SCOORD",
                    GraphicType: "POLYLINE",
**Include the image points for the calibration ruler**
                    GraphicData: - points in the image that show the image referenced,
                    ContentSequence: {
                        RelationshipType: "SELECTED FROM",
                        ValueType: "IMAGE",
**The image that is calibrated**
                        ReferencedSOPSequence
                    }
                }
            }

@wayfarer3130 wayfarer3130 changed the title [WIP] fix: Save units and caliibration fix: Save units and calibration Jun 19, 2023
@wayfarer3130
Copy link
Contributor Author

@pieper - I added a full set of unit tests to this. There are a bunch of identical changes to support this, but the actual change is really limited to three changes:
Add Calibration object
Add unit2CodingValue function to determine the correct coding value
Change all the TID300 types to get the right units.

Then, I added unit tests for all the above.

Copy link
Collaborator

@pieper pieper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice - thanks 👍

@pieper pieper merged commit 764214b into dcmjs-org:master Jun 19, 2023
@github-actions
Copy link

🎉 This PR is included in version 0.29.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants