Class OCR

java.lang.Object
com.pixelmed.doseocr.OCR

public class OCR extends Object

A class for OCR of GE and Siemens modality dose report screen saves.

  • Field Details

    • defaultFileNameOfKnownGlyphs

      public static String defaultFileNameOfKnownGlyphs
  • Constructor Details

  • Method Details

    • getCommonAttributeList

      public AttributeList getCommonAttributeList()
    • getEightBitImageSuitableForThresholding

      public static BufferedImage getEightBitImageSuitableForThresholding(AttributeList list) throws DicomException

      Get an 8 bit image suitable for thresholding.

      Parameters:
      list - the list
      Returns:
      the image
      Throws:
      DicomException
    • doCommonConstructorStuff

      protected void doCommonConstructorStuff(AttributeList list, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs) throws IOException, ParserConfigurationException, SAXException, Exception

      Perform OCR on the supplied image AttributeList.

      Parameters:
      list - the AttributeList of the dose screen image file on which to perform OCR
      fileNameOfKnownGlyphs - file of known glyphs
      fileNameToRecordNewGlyphs - where to record new glyphs
      Throws:
      IOException
      ParserConfigurationException
      SAXException
      Exception
    • doCommonConstructorStuff

      protected void doCommonConstructorStuff(AttributeList list, BufferedImage image, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs) throws IOException, ParserConfigurationException, SAXException, Exception

      Perform OCR on the supplied image with AttributeList.

      Parameters:
      list - the AttributeList of the dose screen image file on which to perform OCR
      image - the dose screen image on which to perform OCR
      fileNameOfKnownGlyphs - file of known glyphs
      fileNameToRecordNewGlyphs - where to record new glyphs
      Throws:
      IOException
      ParserConfigurationException
      SAXException
      Exception
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isGEDoseScreenSeriesNumber

      protected static boolean isGEDoseScreenSeriesNumber(String seriesNumber)
    • isPossiblyGEDoseScreenSeries

      public static boolean isPossiblyGEDoseScreenSeries(String manufacturer, String modality, String seriesNumber, String seriesDescription)
    • isPossiblyGEDoseScreenSeries

      public static boolean isPossiblyGEDoseScreenSeries(AttributeList list)
    • isPossiblyGEDoseScreenInstance

      public static boolean isPossiblyGEDoseScreenInstance(String manufacturer, String sopClassUID, String imageType)
    • isPossiblyGEDoseScreenInstance

      public static boolean isPossiblyGEDoseScreenInstance(AttributeList list)
    • isGEDoseScreenInstance

      public static boolean isGEDoseScreenInstance(AttributeList list)
    • isPossiblySiemensDoseScreenSeries

      public static boolean isPossiblySiemensDoseScreenSeries(String manufacturer, String modality, String seriesNumber, String seriesDescription)
    • isPossiblySiemensDoseScreenSeries

      public static boolean isPossiblySiemensDoseScreenSeries(AttributeList list)
    • isPossiblySiemensDoseScreenInstance

      public static boolean isPossiblySiemensDoseScreenInstance(String manufacturer, String sopClassUID, String imageType)
    • isPossiblySiemensDoseScreenInstance

      public static boolean isPossiblySiemensDoseScreenInstance(AttributeList list)
    • isSiemensDoseScreenInstance

      public static boolean isSiemensDoseScreenInstance(AttributeList list)
    • isPossiblyToshibaDoseScreenSeries

      public static boolean isPossiblyToshibaDoseScreenSeries(String manufacturer, String modality, String seriesNumber, String seriesDescription)
    • isPossiblyToshibaDoseScreenSeries

      public static boolean isPossiblyToshibaDoseScreenSeries(AttributeList list)
    • isPossiblyToshibaDoseScreenInstance

      public static boolean isPossiblyToshibaDoseScreenInstance(String manufacturer, String sopClassUID, String imageType)
    • isPossiblyToshibaDoseScreenInstance

      public static boolean isPossiblyToshibaDoseScreenInstance(AttributeList list)
    • isToshibaDoseScreenInstance

      public static boolean isToshibaDoseScreenInstance(AttributeList list)
    • isPossiblyDoseScreenSeries

      public static boolean isPossiblyDoseScreenSeries(String manufacturer, String modality, String seriesNumber, String seriesDescription)
    • isPossiblyDoseScreenSeries

      public static boolean isPossiblyDoseScreenSeries(AttributeList list)
    • isPossiblyDoseScreenInstance

      public static boolean isPossiblyDoseScreenInstance(String manufacturer, String sopClassUID, String imageType)
    • isPossiblyDoseScreenInstance

      public static boolean isPossiblyDoseScreenInstance(AttributeList list)
    • isDoseScreenInstance

      public static boolean isDoseScreenInstance(AttributeList list)
    • getCTDoseFromOCROfGEDoseScreen

      public static CTDose getCTDoseFromOCROfGEDoseScreen(OCR ocr, String startDateTime, String endDateTime, CTIrradiationEventDataFromImages eventDataFromImages, boolean buildSR) throws IOException

      Create a CTDose instance from the OCR already performed on a GE dose screen image.

      Parameters:
      ocr - the object from the OCR performed in the image
      startDateTime - the acquisition start date and time
      endDateTime - the acquisition end date and time
      eventDataFromImages - the pre event data from the reconstructed images
      buildSR - whether or not to extract composite context from the list for use later to build an RDSR
      Throws:
      IOException
    • getCTDoseFromOCROfSiemensDoseScreen

      public static CTDose getCTDoseFromOCROfSiemensDoseScreen(OCR ocr, String startDateTime, String endDateTime, CTIrradiationEventDataFromImages eventDataFromImages, boolean buildSR) throws IOException

      Create a CTDose instance from the OCR already performed on a Siemens dose screen image.

      Parameters:
      ocr - the object from the OCR performed in the image
      startDateTime - the acquisition start date and time
      endDateTime - the acquisition end date and time
      eventDataFromImages - the pre event data from the reconstructed images
      buildSR - whether or not to extract composite context from the list for use later to build an RDSR
      Throws:
      IOException
    • getCTDoseFromOCROfToshibaDoseScreen

      public static CTDose getCTDoseFromOCROfToshibaDoseScreen(OCR ocr, String startDateTime, String endDateTime, CTIrradiationEventDataFromImages eventDataFromImages, boolean buildSR) throws IOException

      Create a CTDose instance from the OCR already performed on a Toshiba dose screen image.

      Parameters:
      ocr - the object from the OCR performed in the image
      startDateTime - the acquisition start date and time
      endDateTime - the acquisition end date and time
      eventDataFromImages - the pre event data from the reconstructed images
      buildSR - whether or not to extract composite context from the list for use later to build an RDSR
      Throws:
      IOException
    • getCTDoseFromOCROfDoseScreen

      public static CTDose getCTDoseFromOCROfDoseScreen(OCR ocr, CTIrradiationEventDataFromImages eventDataFromImages, boolean buildSR) throws IOException

      Create a CTDose instance from the OCR already performed on a dose screen image.

      Also extracts start and end date and time and default anatomical information.

      Parameters:
      ocr - the object from the OCR performed in the image
      eventDataFromImages - the pre event data from the reconstructed images
      buildSR - whether or not to extract composite context from the list for use later to build an RDSR
      Throws:
      IOException
    • main

      public static final void main(String[] arg)

      Extract the CT dose information in a screen save image using optical character recognition, correlate it with any acquired CT slice images.

      Parameters:
      arg - an array of 1 to 6 strings - the path to a dose screen save image or folder of screens (or "-" if to search for dose screens amongst acquired images), then optionally the path to a DICOMDIR or folder containing acquired CT slice images (or "-" if none and more arguments) then optionally the name of Dose SR file to write (or "-" if none and more arguments) then optionally the file containing the text glyphs to use during recognition rather than the default (or "-" if none and more arguments), then optionally the name of a file to write any newly trained glyphs to