Package com.pixelmed.apps

## Class MergeFunctionalGroups

- java.lang.Object
- - com.pixelmed.apps.MergeFunctionalGroups

-     public class MergeFunctionalGroups
      extends java.lang.Object

  A class containing an application for merging the functional groups of multiple instances for consistency.

  The merge can be performed on specified subsets of functional groups, such as those related to spatial information.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `protected class` | `MergeFunctionalGroups.OurFirstPassMediaImporter` |
    `protected class` | `MergeFunctionalGroups.OurSecondPassMediaImporter` |

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected java.lang.String` | `dstFolderName` |
    `protected java.lang.String` | `ourAETitle` |
    `protected FunctionalGroupUtilities.Selector` | `selector` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `MergeFunctionalGroups​(FunctionalGroupUtilities.Selector selector, java.lang.String[] srcs, java.lang.String dstFolderName, MessageLogger logger)` | Merge the functional groups of multiple instances for consistency.
    `MergeFunctionalGroups​(FunctionalGroupUtilities.Selector selector, java.lang.String src, java.lang.String dstFolderName, MessageLogger logger)` | Merge the functional groups of multiple instances for consistency.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static void` | `main​(java.lang.String[] arg)` | Merge the functional groups of multiple instances for consistency.
    `protected void` | `mergeDimensionsModule​(AttributeList newList)` |
    `protected void` | `mergeSelectedFunctionalGroup​(SequenceAttribute mergedSharedOrPerFrameFunctionalGroupsSequence, SequenceAttribute newSharedOrPerFrameFunctionalGroupsSequence)` |
    `protected void` | `mergeSelectedFunctionalGroups​(AttributeList newList)` |
    `protected void` | `replaceDimensionsModuleWithMerged​(AttributeList targetList)` |
    `protected void` | `replaceFunctionalGroupsWithMerged​(AttributeList targetList)` |

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

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

- - ### Field Detail

    - #### ourAETitle

          protected java.lang.String ourAETitle

    - #### dstFolderName

          protected java.lang.String dstFolderName

    - #### selector

          protected FunctionalGroupUtilities.Selector selector

  - ### Constructor Detail

    - #### MergeFunctionalGroups

          public MergeFunctionalGroups​(FunctionalGroupUtilities.Selector selector,
                                       java.lang.String src,
                                       java.lang.String dstFolderName,
                                       MessageLogger logger)
                                throws java.io.IOException,
                                       DicomException

      Merge the functional groups of multiple instances for consistency.

      Parameters:
        `selector` - selected functional groups to merge
        `src` - source folder or DICOMDIR
        `dstFolderName` - destination folder
        `logger` - logger to send progress, warnings and errors
      Throws:
        `java.io.IOException` - if there is a problem reading or writing
        `DicomException` - if there is a problem parsing or extracting required content

    - #### MergeFunctionalGroups

          public MergeFunctionalGroups​(FunctionalGroupUtilities.Selector selector,
                                       java.lang.String[] srcs,
                                       java.lang.String dstFolderName,
                                       MessageLogger logger)
                                throws java.io.IOException,
                                       DicomException

      Merge the functional groups of multiple instances for consistency.

      Parameters:
        `selector` - selected functional groups to merge
        `srcs` - source folders or DICOMDIRs
        `dstFolderName` - destination folder
        `logger` - logger to send progress, warnings and errors
      Throws:
        `java.io.IOException` - if there is a problem reading or writing
        `DicomException` - if there is a problem parsing or extracting required content

  - ### Method Detail

    - #### mergeDimensionsModule

          protected void mergeDimensionsModule​(AttributeList newList)
                                        throws DicomException

      Throws:
        `DicomException`

    - #### replaceDimensionsModuleWithMerged

          protected void replaceDimensionsModuleWithMerged​(AttributeList targetList)

    - #### mergeSelectedFunctionalGroup

          protected void mergeSelectedFunctionalGroup​(SequenceAttribute mergedSharedOrPerFrameFunctionalGroupsSequence,
                                                      SequenceAttribute newSharedOrPerFrameFunctionalGroupsSequence)
                                               throws DicomException

      Throws:
        `DicomException`

    - #### mergeSelectedFunctionalGroups

          protected void mergeSelectedFunctionalGroups​(AttributeList newList)
                                                throws DicomException

      Throws:
        `DicomException`

    - #### replaceFunctionalGroupsWithMerged

          protected void replaceFunctionalGroupsWithMerged​(AttributeList targetList)

    - #### main

          public static void main​(java.lang.String[] arg)

      Merge the functional groups of multiple instances for consistency.

      The files are processed in the order in which they are specified on the command line, and when there is a conflict, the first encountered functional group values are used.

      Functional group arguments recognized are -all|-spatial|-framecontent|-unclassified.

      If -framecontent is specified, the Dimensions Module will also be merged (the earliest encountered will be used).

      Parameters:
        `arg` - array of 2 or more strings - an optional list of functional groups to merge (if absent, defaults to all), followed by one or more source folders or DICOMDIR (to merge and use as a source of functional groups), and a destination folder