com.pixelmed.convert

## Class NIfTI1ToDicom

- java.lang.Object
- - com.pixelmed.convert.NIfTI1ToDicom

    public class NIfTI1ToDicom
    extends java.lang.Object

A class for converting NIfTI-1 image input format files into images of a specified or appropriate SOP Class.

### Constructor Summary

Constructors
Constructor and Description
`NIfTI1ToDicom(java.lang.String inputFileName, java.lang.String outputFileName, java.lang.String patientName, java.lang.String patientID, java.lang.String studyID, java.lang.String seriesNumber, java.lang.String instanceNumber)` Read a NIfTI-1 image input format files and create an image of a specified or appropriate SOP Class.
`NIfTI1ToDicom(java.lang.String inputFileName, java.lang.String outputFileName, java.lang.String patientName, java.lang.String patientID, java.lang.String studyID, java.lang.String seriesNumber, java.lang.String instanceNumber, java.lang.String modality, java.lang.String sopClass)` Read a NIfTI-1 image input format files and create an image of a specified or appropriate SOP Class.

### Method Summary

Methods
`static AttributeList` `createFunctionalGroupsIfNotPresent(AttributeList list, int numberOfFrames)` Create shared and per-frame functional group sequences if not already present.
`static AttributeList` `generateDICOMPixelDataModuleAttributesFromNIfTI1File(java.io.File inputFile, NIfTI1Header nifti, AttributeList list)` Using a NIfTI-1 image input file and header, create DICOM Pixel Data Module attributes.
`static AttributeList` `generateGeometryFunctionalGroupsFromNIfTI1Header(NIfTI1Header nifti, AttributeList list, int numberOfFrames)` Read a per-frame and shared functional group sequences for the geometry defined in a NIfTI-1 file header.
`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` `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 void` `main(java.lang.String[] arg)` Read a NIfTI-1 image input format files and create an image of a specified or appropriate SOP Class.

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

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

### Constructor Detail

#### NIfTI1ToDicom

    public NIfTI1ToDicom(java.lang.String inputFileName,
                 java.lang.String outputFileName,
                 java.lang.String patientName,
                 java.lang.String patientID,
                 java.lang.String studyID,
                 java.lang.String seriesNumber,
                 java.lang.String instanceNumber)
                  throws java.io.IOException,
                         DicomException,
                         NIfTI1Exception

Read a NIfTI-1 image input format files and create an image of a specified or appropriate SOP Class.

Parameters:
  `inputFileName` -
  `outputFileName` -
  `patientName` -
  `patientID` -
  `studyID` -
  `seriesNumber` -
  `instanceNumber` -
Throws:
  `java.io.IOException`
  `DicomException`
  `NIfTI1Exception`

#### NIfTI1ToDicom

    public NIfTI1ToDicom(java.lang.String inputFileName,
                 java.lang.String outputFileName,
                 java.lang.String patientName,
                 java.lang.String patientID,
                 java.lang.String studyID,
                 java.lang.String seriesNumber,
                 java.lang.String instanceNumber,
                 java.lang.String modality,
                 java.lang.String sopClass)
                  throws java.io.IOException,
                         DicomException,
                         NIfTI1Exception

Read a NIfTI-1 image input format files and create an image of a specified or appropriate SOP Class.

Parameters:
  `inputFileName` -
  `outputFileName` -
  `patientName` -
  `patientID` -
  `studyID` -
  `seriesNumber` -
  `instanceNumber` -
  `modality` - may be null
  `sopClass` - may be null
Throws:
  `java.io.IOException`
  `DicomException`
  `NIfTI1Exception`

### Method Detail

#### 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` - return attribute list with empty per-frame and shared functional group sequences fadded
Throws:
  `DicomException`

#### generatePixelValueTransformationFunctionalGroup

    public 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.

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` -
  `rescaleSlope` -
  `rescaleIntercept` -
  `rescaleType` - return attribute list with per-frame and shared functional group sequences for VOI added
Throws:
  `DicomException`

#### generateVOILUTFunctionalGroup

    public 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.

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` -
  `windowWidth` -
  `windowCenter` -
  `voiLUTFunction` - return attribute list with per-frame and shared functional group sequences for VOI added
Throws:
  `DicomException`

#### generateGeometryFunctionalGroupsFromNIfTI1Header

    public static AttributeList generateGeometryFunctionalGroupsFromNIfTI1Header(NIfTI1Header nifti,
                                                                 AttributeList list,
                                                                 int numberOfFrames)
                                                                          throws DicomException

Read a per-frame and shared functional group sequences for the geometry defined in a NIfTI-1 file header.

Parameters:
  `nifti` - a NIfTI-1 header
  `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` - return attribute list with per-frame and shared functional group sequences for geometry added
Throws:
  `DicomException`

#### generateDICOMPixelDataModuleAttributesFromNIfTI1File

    public static AttributeList generateDICOMPixelDataModuleAttributesFromNIfTI1File(java.io.File inputFile,
                                                                     NIfTI1Header nifti,
                                                                     AttributeList list)
                                                                              throws java.io.IOException,
                                                                                     DicomException,
                                                                                     NIfTI1Exception

Using a NIfTI-1 image input file and header, create DICOM Pixel Data Module attributes.

Parameters:
  `inputFile` - a NIfTI-1 format image file
  `nifti` - a NIfTI-1 header already read from the inputFile
  `list` - an existing (possibly empty) attribute list, if null, a new one will be created; may already include "better" image pixel module attributes to use return attribute list with Image Pixel Module (including Pixel Data) and other attributes added
Throws:
  `java.io.IOException`
  `DicomException`
  `NIfTI1Exception`

#### main

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

Read a NIfTI-1 image input format files and create an image of a specified or appropriate SOP Class.

Parameters:
  `arg` - seven, eight or nine parameters, the inputFile, outputFile, patientName, patientID, studyID, seriesNumber, instanceNumber, and optionally the modality, and SOP Class