com.pixelmed.dicom
Class DicomFileUtilities

java.lang.Object
  extended by com.pixelmed.dicom.DicomFileUtilities

public class DicomFileUtilities
extends Object

Various static methods helpful for handling DICOM files.


Method Summary
static boolean isDicomOrAcrNemaFile(File file)
          Does the file contain a DICOM (or DICOM-like ACR-NEMA) dataset ?
static boolean isDicomOrAcrNemaFile(String filename)
          Does the file contain a DICOM (or DICOM-like ACR-NEMA) dataset ?
static void main(String[] arg)
          Iterate through a list of files and report which are DICOM and which are not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isDicomOrAcrNemaFile

public static boolean isDicomOrAcrNemaFile(String filename)

Does the file contain a DICOM (or DICOM-like ACR-NEMA) dataset ?

Any exceptions during attempts to read are caught and false returned.

Parameters:
filename - the file
Returns:
true if file exists, can be read, and seems to contain a DICOM or ACR-NEMA dataset (with or without a PS 3.10 preamble and meta information header)

isDicomOrAcrNemaFile

public static boolean isDicomOrAcrNemaFile(File file)

Does the file contain a DICOM (or DICOM-like ACR-NEMA) dataset ?

Any exceptions during attempts to read are (silently) caught and false returned.

Note that this method may return true but DicomInputStream and AttributeList may fail to read the file, since it may be "bad" ways that are not supported, e.g., missing TransferSyntaxUID in meta information header, etc.

Will detect files with:

Will reject everything else, including files with:

Parameters:
file - the file
Returns:
true if file exists, can be read, and seems to contain a DICOM or ACR-NEMA dataset (with or without a PS 3.10 preamble and meta information header)

main

public static void main(String[] arg)

Iterate through a list of files and report which are DICOM and which are not.

Parameters:
arg - a list of files to test