Package com.pixelmed.doseocr
Class OCR
- java.lang.Object
-
- com.pixelmed.doseocr.OCR
-
public class OCR extends java.lang.Object
A class for OCR of GE and Siemens modality dose report screen saves.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
defaultFileNameOfKnownGlyphs
-
Constructor Summary
Constructors Constructor Description OCR(AttributeList list)
OCR(AttributeList list, int debugLevel)
OCR(AttributeList list, java.lang.String fileNameOfKnownGlyphs, java.lang.String fileNameToRecordNewGlyphs, int debugLevel)
OCR(java.awt.image.BufferedImage image, java.lang.String fileNameOfKnownGlyphs, java.lang.String fileNameToRecordNewGlyphs, int debugLevel)
OCR(java.lang.String screenFilesPath)
OCR(java.lang.String screenFilesPath, java.lang.String fileNameOfKnownGlyphs, java.lang.String fileNameToRecordNewGlyphs, int debugLevel)
OCR(java.util.List<java.lang.String> screenFilesPaths)
OCR(java.util.List<java.lang.String> screenFilesPaths, int debugLevel)
OCR(java.util.List<java.lang.String> screenFilesPaths, java.lang.String fileNameOfKnownGlyphs, java.lang.String fileNameToRecordNewGlyphs, int debugLevel)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doCommonConstructorStuff(AttributeList list, java.awt.image.BufferedImage image, java.lang.String fileNameOfKnownGlyphs, java.lang.String fileNameToRecordNewGlyphs, int debugLevel)
protected void
doCommonConstructorStuff(AttributeList list, java.lang.String fileNameOfKnownGlyphs, java.lang.String fileNameToRecordNewGlyphs, int debugLevel)
AttributeList
getCommonAttributeList()
static CTDose
getCTDoseFromOCROfDoseScreen(OCR ocr, int debugLevel, CTIrradiationEventDataFromImages eventDataFromImages, boolean buildSR)
static CTDose
getCTDoseFromOCROfGEDoseScreen(OCR ocr, int debugLevel, java.lang.String startDateTime, java.lang.String endDateTime, CTIrradiationEventDataFromImages eventDataFromImages, boolean buildSR)
static CTDose
getCTDoseFromOCROfSiemensDoseScreen(OCR ocr, int debugLevel, java.lang.String startDateTime, java.lang.String endDateTime, CTIrradiationEventDataFromImages eventDataFromImages, boolean buildSR)
static CTDose
getCTDoseFromOCROfToshibaDoseScreen(OCR ocr, int debugLevel, java.lang.String startDateTime, java.lang.String endDateTime, CTIrradiationEventDataFromImages eventDataFromImages, boolean buildSR)
static java.awt.image.BufferedImage
getEightBitImageSuitableForThresholding(AttributeList list, int debugLevel)
static boolean
isDoseScreenInstance(AttributeList list)
static boolean
isGEDoseScreenInstance(AttributeList list)
protected static boolean
isGEDoseScreenSeriesNumber(java.lang.String seriesNumber)
static boolean
isPossiblyDoseScreenInstance(AttributeList list)
static boolean
isPossiblyDoseScreenInstance(java.lang.String manufacturer, java.lang.String sopClassUID, java.lang.String imageType)
static boolean
isPossiblyDoseScreenSeries(AttributeList list)
static boolean
isPossiblyDoseScreenSeries(java.lang.String manufacturer, java.lang.String modality, java.lang.String seriesNumber, java.lang.String seriesDescription)
static boolean
isPossiblyGEDoseScreenInstance(AttributeList list)
static boolean
isPossiblyGEDoseScreenInstance(java.lang.String manufacturer, java.lang.String sopClassUID, java.lang.String imageType)
static boolean
isPossiblyGEDoseScreenSeries(AttributeList list)
static boolean
isPossiblyGEDoseScreenSeries(java.lang.String manufacturer, java.lang.String modality, java.lang.String seriesNumber, java.lang.String seriesDescription)
static boolean
isPossiblySiemensDoseScreenInstance(AttributeList list)
static boolean
isPossiblySiemensDoseScreenInstance(java.lang.String manufacturer, java.lang.String sopClassUID, java.lang.String imageType)
static boolean
isPossiblySiemensDoseScreenSeries(AttributeList list)
static boolean
isPossiblySiemensDoseScreenSeries(java.lang.String manufacturer, java.lang.String modality, java.lang.String seriesNumber, java.lang.String seriesDescription)
static boolean
isPossiblyToshibaDoseScreenInstance(AttributeList list)
static boolean
isPossiblyToshibaDoseScreenInstance(java.lang.String manufacturer, java.lang.String sopClassUID, java.lang.String imageType)
static boolean
isPossiblyToshibaDoseScreenSeries(AttributeList list)
static boolean
isPossiblyToshibaDoseScreenSeries(java.lang.String manufacturer, java.lang.String modality, java.lang.String seriesNumber, java.lang.String seriesDescription)
static boolean
isSiemensDoseScreenInstance(AttributeList list)
static boolean
isToshibaDoseScreenInstance(AttributeList list)
static void
main(java.lang.String[] arg)
Extract the CT dose information in a screen save image using optical character recognition, correlate it with any acquired CT slice images.java.lang.String
toString()
-
-
-
Constructor Detail
-
OCR
public OCR(java.lang.String screenFilesPath) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.lang.Exception
- Throws:
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.lang.Exception
-
OCR
public OCR(java.lang.String screenFilesPath, java.lang.String fileNameOfKnownGlyphs, java.lang.String fileNameToRecordNewGlyphs, int debugLevel) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.lang.Exception
- Throws:
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.lang.Exception
-
OCR
public OCR(java.util.List<java.lang.String> screenFilesPaths, java.lang.String fileNameOfKnownGlyphs, java.lang.String fileNameToRecordNewGlyphs, int debugLevel) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.lang.Exception
- Throws:
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.lang.Exception
-
OCR
public OCR(java.util.List<java.lang.String> screenFilesPaths) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.lang.Exception
- Throws:
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.lang.Exception
-
OCR
public OCR(java.util.List<java.lang.String> screenFilesPaths, int debugLevel) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.lang.Exception
- Throws:
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.lang.Exception
-
OCR
public OCR(AttributeList list) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.lang.Exception
- Throws:
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.lang.Exception
-
OCR
public OCR(AttributeList list, int debugLevel) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.lang.Exception
- Throws:
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.lang.Exception
-
OCR
public OCR(AttributeList list, java.lang.String fileNameOfKnownGlyphs, java.lang.String fileNameToRecordNewGlyphs, int debugLevel) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.lang.Exception
- Throws:
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.lang.Exception
-
OCR
public OCR(java.awt.image.BufferedImage image, java.lang.String fileNameOfKnownGlyphs, java.lang.String fileNameToRecordNewGlyphs, int debugLevel) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.lang.Exception
- Throws:
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.lang.Exception
-
-
Method Detail
-
getCommonAttributeList
public AttributeList getCommonAttributeList()
-
getEightBitImageSuitableForThresholding
public static java.awt.image.BufferedImage getEightBitImageSuitableForThresholding(AttributeList list, int debugLevel) throws DicomException
- Throws:
DicomException
-
doCommonConstructorStuff
protected void doCommonConstructorStuff(AttributeList list, java.lang.String fileNameOfKnownGlyphs, java.lang.String fileNameToRecordNewGlyphs, int debugLevel) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.lang.Exception
- Throws:
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.lang.Exception
-
doCommonConstructorStuff
protected void doCommonConstructorStuff(AttributeList list, java.awt.image.BufferedImage image, java.lang.String fileNameOfKnownGlyphs, java.lang.String fileNameToRecordNewGlyphs, int debugLevel) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, java.lang.Exception
- Throws:
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.lang.Exception
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
isGEDoseScreenSeriesNumber
protected static boolean isGEDoseScreenSeriesNumber(java.lang.String seriesNumber)
-
isPossiblyGEDoseScreenSeries
public static boolean isPossiblyGEDoseScreenSeries(java.lang.String manufacturer, java.lang.String modality, java.lang.String seriesNumber, java.lang.String seriesDescription)
-
isPossiblyGEDoseScreenSeries
public static boolean isPossiblyGEDoseScreenSeries(AttributeList list)
-
isPossiblyGEDoseScreenInstance
public static boolean isPossiblyGEDoseScreenInstance(java.lang.String manufacturer, java.lang.String sopClassUID, java.lang.String imageType)
-
isPossiblyGEDoseScreenInstance
public static boolean isPossiblyGEDoseScreenInstance(AttributeList list)
-
isGEDoseScreenInstance
public static boolean isGEDoseScreenInstance(AttributeList list)
-
isPossiblySiemensDoseScreenSeries
public static boolean isPossiblySiemensDoseScreenSeries(java.lang.String manufacturer, java.lang.String modality, java.lang.String seriesNumber, java.lang.String seriesDescription)
-
isPossiblySiemensDoseScreenSeries
public static boolean isPossiblySiemensDoseScreenSeries(AttributeList list)
-
isPossiblySiemensDoseScreenInstance
public static boolean isPossiblySiemensDoseScreenInstance(java.lang.String manufacturer, java.lang.String sopClassUID, java.lang.String imageType)
-
isPossiblySiemensDoseScreenInstance
public static boolean isPossiblySiemensDoseScreenInstance(AttributeList list)
-
isSiemensDoseScreenInstance
public static boolean isSiemensDoseScreenInstance(AttributeList list)
-
isPossiblyToshibaDoseScreenSeries
public static boolean isPossiblyToshibaDoseScreenSeries(java.lang.String manufacturer, java.lang.String modality, java.lang.String seriesNumber, java.lang.String seriesDescription)
-
isPossiblyToshibaDoseScreenSeries
public static boolean isPossiblyToshibaDoseScreenSeries(AttributeList list)
-
isPossiblyToshibaDoseScreenInstance
public static boolean isPossiblyToshibaDoseScreenInstance(java.lang.String manufacturer, java.lang.String sopClassUID, java.lang.String imageType)
-
isPossiblyToshibaDoseScreenInstance
public static boolean isPossiblyToshibaDoseScreenInstance(AttributeList list)
-
isToshibaDoseScreenInstance
public static boolean isToshibaDoseScreenInstance(AttributeList list)
-
isPossiblyDoseScreenSeries
public static boolean isPossiblyDoseScreenSeries(java.lang.String manufacturer, java.lang.String modality, java.lang.String seriesNumber, java.lang.String seriesDescription)
-
isPossiblyDoseScreenSeries
public static boolean isPossiblyDoseScreenSeries(AttributeList list)
-
isPossiblyDoseScreenInstance
public static boolean isPossiblyDoseScreenInstance(java.lang.String manufacturer, java.lang.String sopClassUID, java.lang.String imageType)
-
isPossiblyDoseScreenInstance
public static boolean isPossiblyDoseScreenInstance(AttributeList list)
-
isDoseScreenInstance
public static boolean isDoseScreenInstance(AttributeList list)
-
getCTDoseFromOCROfGEDoseScreen
public static CTDose getCTDoseFromOCROfGEDoseScreen(OCR ocr, int debugLevel, java.lang.String startDateTime, java.lang.String endDateTime, CTIrradiationEventDataFromImages eventDataFromImages, boolean buildSR) throws java.io.IOException
- Throws:
java.io.IOException
-
getCTDoseFromOCROfSiemensDoseScreen
public static CTDose getCTDoseFromOCROfSiemensDoseScreen(OCR ocr, int debugLevel, java.lang.String startDateTime, java.lang.String endDateTime, CTIrradiationEventDataFromImages eventDataFromImages, boolean buildSR) throws java.io.IOException
- Throws:
java.io.IOException
-
getCTDoseFromOCROfToshibaDoseScreen
public static CTDose getCTDoseFromOCROfToshibaDoseScreen(OCR ocr, int debugLevel, java.lang.String startDateTime, java.lang.String endDateTime, CTIrradiationEventDataFromImages eventDataFromImages, boolean buildSR) throws java.io.IOException
- Throws:
java.io.IOException
-
getCTDoseFromOCROfDoseScreen
public static CTDose getCTDoseFromOCROfDoseScreen(OCR ocr, int debugLevel, CTIrradiationEventDataFromImages eventDataFromImages, boolean buildSR) throws java.io.IOException
- Throws:
java.io.IOException
-
main
public static final void main(java.lang.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 then optionally the debug level
-
-