Package com.pixelmed.dicom

# Class FunctionalGroupUtilities

java.lang.Object
com.pixelmed.dicom.FunctionalGroupUtilities

public class FunctionalGroupUtilities extends Object

A class contain useful methods for manipulating Functional Group Sequences.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
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 Summary

Constructors
Constructor
Description
`FunctionalGroupUtilities()`

## Method Summary

Modifier and Type
Method
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, 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, 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.

### Methods inherited from class java.lang.Object

`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### FunctionalGroupUtilities

public FunctionalGroupUtilities()

## Method Details

### createSharedFunctionalGroupsIfNotPresent

public static AttributeList createSharedFunctionalGroupsIfNotPresent(AttributeList list)

Create shared functional group sequences if not already present.

Parameters:
  `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 added
Returns:
  attribute list with empty per-frame and shared functional group sequences added

### createFunctionalGroupsIfNotPresent

public static AttributeList createFunctionalGroupsIfNotPresent(AttributeList list, int numberOfFrames)

Create shared and per-frame functional group sequences if not already present.

Parameters:
  `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 added
  `numberOfFrames` - number of frames
Returns:
  attribute list with empty per-frame and shared functional group sequences added

### generateUnassignedConvertedAttributesSequenceFunctionalGroups

public static AttributeList generateUnassignedConvertedAttributesSequenceFunctionalGroups(AttributeList list, int numberOfFrames)

Create shared and per-frame Unassigned Converted Attributes functional group sequences if not already present.

Parameters:
  `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 added
  `numberOfFrames` - number of frames
Returns:
  attribute list with functional group sequences added

### generatePixelValueTransformationFunctionalGroup

public static AttributeList generatePixelValueTransformationFunctionalGroup(AttributeList list, int numberOfFrames, double rescaleSlope, double rescaleIntercept, String rescaleType) throws DicomException

Insert a shared functional group sequence Pixel Value Transformation Sequence entry.

Parameters:
  `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 added
  `numberOfFrames` - number of frames
  `rescaleSlope` - rescale slope
  `rescaleIntercept` - rescale intercept
  `rescaleType` - rescale type
Returns:
  attribute list with per-frame and shared functional group sequences for VOI added
Throws:
  `DicomException` - if error in DICOM encoding

### generateVOILUTFunctionalGroup

public static AttributeList generateVOILUTFunctionalGroup(AttributeList list, int numberOfFrames, double windowWidth, double windowCenter, String voiLUTFunction) throws DicomException

Insert a shared functional group sequence Frame VOI LUT Sequence entry.

Parameters:
  `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 added
  `numberOfFrames` - number of frames
  `windowWidth` - window width
  `windowCenter` - window center
  `voiLUTFunction` - VOI LUT function
Returns:
  attribute list with per-frame and shared functional group sequences for VOI added
Throws:
  `DicomException` - if error in DICOM encoding

### generateFrameTypeSharedFunctionalGroup

public static AttributeList generateFrameTypeSharedFunctionalGroup(AttributeList list, AttributeTag tFrameTypeSequence, Attribute aFrameType) throws DicomException

Insert a shared functional group sequence FrameTypeSequence entry.

Parameters:
  `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 added
  `tFrameTypeSequence` - the Functional Group Sequence tag (e.g., TagFromName.ParametricMapFrameTypeSequence)
  `aFrameType` - a FrameType attribute with values
Returns:
  attribute list with per-frame and shared functional group sequences for FrameTypeSequence added
Throws:
  `DicomException` - if error in DICOM encoding

### removeFunctionalGroup

public static void removeFunctionalGroup(AttributeList list, AttributeTag functionalGroupSequenceTag)

Remove a specified functional group sequences from the shared and per-frame functional group sequences.

Parameters:
  `list` - an attribute list
  `functionalGroupSequenceTag` - functional group to remove

### removeAllButSelected

public static void removeAllButSelected(SequenceAttribute functionalGroupsSequence, FunctionalGroupUtilities.Selector selector)

Remove the unselected functional groups.

Parameters:
  `functionalGroupsSequence` - the Shared or Per-Frame functional group Attribute to edit
  `selector` - the functional groups to keep

### removeAllButSelected

public static void removeAllButSelected(AttributeList list, FunctionalGroupUtilities.Selector selector)

Remove the unselected functional groups.

Parameters:
  `list` - the top level data set list of attributes containing the Shared and Per-Frame functional groups to edit
  `selector` - the functional groups to keep

### isSpatial

public static boolean isSpatial(AttributeTag tag)

### isFrameContent

public static boolean isFrameContent(AttributeTag tag)

### isUnclassified

public static boolean isUnclassified(AttributeTag tag)