public class FunctionalGroupUtilities
extends java.lang.Object
A class contain useful methods for manipulating Functional Group Sequences.
Modifier and Type | Class and Description |
---|---|
static class |
FunctionalGroupUtilities.Selector
A class to select which functional groups are copied or propagated or removed or not during operations on functional groups.
|
Constructor and Description |
---|
FunctionalGroupUtilities() |
Modifier and Type | Method and Description |
---|---|
static AttributeList |
createFunctionalGroupsIfNotPresent(AttributeList list,
int numberOfFrames)
Create shared and per-frame functional group sequences if not already present.
|
static AttributeList |
createSharedFunctionalGroupsIfNotPresent(AttributeList list)
Create shared functional group sequences if not already present.
|
static AttributeList |
generateFrameTypeSharedFunctionalGroup(AttributeList list,
AttributeTag tFrameTypeSequence,
Attribute aFrameType)
Insert a shared functional group sequence FrameTypeSequence entry.
|
static AttributeList |
generatePixelValueTransformationFunctionalGroup(AttributeList list,
int numberOfFrames,
double rescaleSlope,
double rescaleIntercept,
java.lang.String rescaleType)
Insert a shared functional group sequence Pixel Value Transformation Sequence entry.
|
static AttributeList |
generateUnassignedConvertedAttributesSequenceFunctionalGroups(AttributeList list,
int numberOfFrames)
Create shared and per-frame Unassigned Converted Attributes functional group sequences if not already present.
|
static AttributeList |
generateVOILUTFunctionalGroup(AttributeList list,
int numberOfFrames,
double windowWidth,
double windowCenter,
java.lang.String voiLUTFunction)
Insert a shared functional group sequence Frame VOI LUT Sequence entry.
|
static boolean |
isFrameContent(AttributeTag tag) |
static boolean |
isSpatial(AttributeTag tag) |
static boolean |
isUnclassified(AttributeTag tag) |
static void |
removeAllButSelected(AttributeList list,
FunctionalGroupUtilities.Selector selector)
Remove the unselected functional groups.
|
static void |
removeAllButSelected(SequenceAttribute functionalGroupsSequence,
FunctionalGroupUtilities.Selector selector)
Remove the unselected functional groups.
|
static void |
removeFunctionalGroup(AttributeList list,
AttributeTag functionalGroupSequenceTag)
Remove a specified functional group sequences from the shared and per-frame functional group sequences.
|
public static AttributeList createFunctionalGroupsIfNotPresent(AttributeList list, int numberOfFrames)
Create shared and per-frame functional group sequences if not already present.
list
- an existing (possibly empty) attribute list, if null, a new one will be created; may already shared and per-frame functional group sequences or they will be addednumberOfFrames
- number of framespublic static AttributeList createSharedFunctionalGroupsIfNotPresent(AttributeList list)
Create shared functional group sequences if not already present.
list
- an existing (possibly empty) attribute list, if null, a new one will be created; may already shared and per-frame functional group sequences or they will be addedpublic static AttributeList generateFrameTypeSharedFunctionalGroup(AttributeList list, AttributeTag tFrameTypeSequence, Attribute aFrameType) throws DicomException
Insert a shared functional group sequence FrameTypeSequence entry.
list
- an existing (possibly empty) attribute list, if null, a new one will be created; may already shared and per-frame functional group sequences or they will be addedtFrameTypeSequence
- the Functional Group Sequence tag (e.g., TagFromName.ParametricMapFrameTypeSequence)aFrameType
- a FrameType attribute with valuesDicomException
- if error in DICOM encodingpublic static AttributeList generatePixelValueTransformationFunctionalGroup(AttributeList list, int numberOfFrames, double rescaleSlope, double rescaleIntercept, java.lang.String rescaleType) throws DicomException
Insert a shared functional group sequence Pixel Value Transformation Sequence entry.
list
- an existing (possibly empty) attribute list, if null, a new one will be created; may already shared and per-frame functional group sequences or they will be addednumberOfFrames
- number of framesrescaleSlope
- rescale sloperescaleIntercept
- rescale interceptrescaleType
- rescale typeDicomException
- if error in DICOM encodingpublic static AttributeList generateUnassignedConvertedAttributesSequenceFunctionalGroups(AttributeList list, int numberOfFrames)
Create shared and per-frame Unassigned Converted Attributes functional group sequences if not already present.
list
- an existing (possibly empty) attribute list, if null, a new one will be created; may already shared and per-frame functional group sequences or they will be addednumberOfFrames
- number of framespublic static AttributeList generateVOILUTFunctionalGroup(AttributeList list, int numberOfFrames, double windowWidth, double windowCenter, java.lang.String voiLUTFunction) throws DicomException
Insert a shared functional group sequence Frame VOI LUT Sequence entry.
list
- an existing (possibly empty) attribute list, if null, a new one will be created; may already shared and per-frame functional group sequences or they will be addednumberOfFrames
- number of frameswindowWidth
- window widthwindowCenter
- window centervoiLUTFunction
- VOI LUT functionDicomException
- if error in DICOM encodingpublic static boolean isFrameContent(AttributeTag tag)
public static boolean isSpatial(AttributeTag tag)
public static boolean isUnclassified(AttributeTag tag)
public static void removeAllButSelected(AttributeList list, FunctionalGroupUtilities.Selector selector)
Remove the unselected functional groups.
list
- the top level data set list of attributes containing the Shared and Per-Frame functional groups to editselector
- the functional groups to keeppublic static void removeAllButSelected(SequenceAttribute functionalGroupsSequence, FunctionalGroupUtilities.Selector selector)
Remove the unselected functional groups.
functionalGroupsSequence
- the Shared or Per-Frame functional group Attribute to editselector
- the functional groups to keeppublic static void removeFunctionalGroup(AttributeList list, AttributeTag functionalGroupSequenceTag)
Remove a specified functional group sequences from the shared and per-frame functional group sequences.
list
- an attribute listfunctionalGroupSequenceTag
- functional group to remove