Class OCR
A class for OCR of GE and Siemens modality dose report screen saves.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOCR(AttributeList list) Perform OCR on the supplied image AttributeList.OCR(AttributeList list, int debugLevel) Perform OCR on the supplied image AttributeList.OCR(AttributeList list, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs) Perform OCR on the supplied image AttributeList.OCR(AttributeList list, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs, int debugLevel) Perform OCR on the supplied image AttributeList.OCR(BufferedImage image, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs) Perform OCR on the supplied image.OCR(BufferedImage image, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs, int debugLevel) Perform OCR on the supplied image.Perform OCR on the supplied image files.OCR(String screenFilesPath, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs, int debugLevel) Perform OCR on the supplied image files.Perform OCR on the supplied image files.Perform OCR on the supplied image files.Perform OCR on the supplied image files.OCR(List<String> screenFilesPaths, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs, int debugLevel) Perform OCR on the supplied image files. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoCommonConstructorStuff(AttributeList list, BufferedImage image, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs) Perform OCR on the supplied image with AttributeList.protected voiddoCommonConstructorStuff(AttributeList list, BufferedImage image, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs, int debugLevel) Perform OCR on the supplied image with AttributeList.protected voiddoCommonConstructorStuff(AttributeList list, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs) Perform OCR on the supplied image AttributeList.protected voiddoCommonConstructorStuff(AttributeList list, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs, int debugLevel) Perform OCR on the supplied image AttributeList.static CTDosegetCTDoseFromOCROfDoseScreen(OCR ocr, int debugLevel, CTIrradiationEventDataFromImages eventDataFromImages, boolean buildSR) Create a CTDose instance from the OCR already performed on a dose screen image.static CTDosegetCTDoseFromOCROfDoseScreen(OCR ocr, CTIrradiationEventDataFromImages eventDataFromImages, boolean buildSR) Create a CTDose instance from the OCR already performed on a dose screen image.static CTDosegetCTDoseFromOCROfGEDoseScreen(OCR ocr, int debugLevel, String startDateTime, String endDateTime, CTIrradiationEventDataFromImages eventDataFromImages, boolean buildSR) Create a CTDose instance from the OCR already performed on a GE dose screen image.static CTDosegetCTDoseFromOCROfGEDoseScreen(OCR ocr, String startDateTime, String endDateTime, CTIrradiationEventDataFromImages eventDataFromImages, boolean buildSR) Create a CTDose instance from the OCR already performed on a GE dose screen image.static CTDosegetCTDoseFromOCROfSiemensDoseScreen(OCR ocr, int debugLevel, String startDateTime, String endDateTime, CTIrradiationEventDataFromImages eventDataFromImages, boolean buildSR) Create a CTDose instance from the OCR already performed on a Siemens dose screen image.static CTDosegetCTDoseFromOCROfSiemensDoseScreen(OCR ocr, String startDateTime, String endDateTime, CTIrradiationEventDataFromImages eventDataFromImages, boolean buildSR) Create a CTDose instance from the OCR already performed on a Siemens dose screen image.static CTDosegetCTDoseFromOCROfToshibaDoseScreen(OCR ocr, int debugLevel, String startDateTime, String endDateTime, CTIrradiationEventDataFromImages eventDataFromImages, boolean buildSR) Create a CTDose instance from the OCR already performed on a Toshiba dose screen image.static CTDosegetCTDoseFromOCROfToshibaDoseScreen(OCR ocr, String startDateTime, String endDateTime, CTIrradiationEventDataFromImages eventDataFromImages, boolean buildSR) Create a CTDose instance from the OCR already performed on a Toshiba dose screen image.static BufferedImageGet an 8 bit image suitable for thresholding.static BufferedImagegetEightBitImageSuitableForThresholding(AttributeList list, int debugLevel) Get an 8 bit image suitable for thresholding.static booleanstatic booleanprotected static booleanisGEDoseScreenSeriesNumber(String seriesNumber) static booleanstatic booleanisPossiblyDoseScreenInstance(String manufacturer, String sopClassUID, String imageType) static booleanstatic booleanisPossiblyDoseScreenSeries(String manufacturer, String modality, String seriesNumber, String seriesDescription) static booleanstatic booleanisPossiblyGEDoseScreenInstance(String manufacturer, String sopClassUID, String imageType) static booleanstatic booleanisPossiblyGEDoseScreenSeries(String manufacturer, String modality, String seriesNumber, String seriesDescription) static booleanstatic booleanisPossiblySiemensDoseScreenInstance(String manufacturer, String sopClassUID, String imageType) static booleanstatic booleanisPossiblySiemensDoseScreenSeries(String manufacturer, String modality, String seriesNumber, String seriesDescription) static booleanstatic booleanisPossiblyToshibaDoseScreenInstance(String manufacturer, String sopClassUID, String imageType) static booleanstatic booleanisPossiblyToshibaDoseScreenSeries(String manufacturer, String modality, String seriesNumber, String seriesDescription) static booleanstatic booleanstatic final voidExtract the CT dose information in a screen save image using optical character recognition, correlate it with any acquired CT slice images.toString()
-
Field Details
-
defaultFileNameOfKnownGlyphs
-
-
Constructor Details
-
OCR
public OCR(String screenFilesPath) throws IOException, ParserConfigurationException, SAXException, Exception -
OCR
public OCR(String screenFilesPath, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs, int debugLevel) throws IOException, ParserConfigurationException, SAXException, Exception Perform OCR on the supplied image files.
- Parameters:
screenFilesPath- the path to the dose screen image files on which to perform OCRfileNameOfKnownGlyphs- file of known glyphsfileNameToRecordNewGlyphs- where to record new glyphsdebugLevel- ignored- Throws:
IOExceptionParserConfigurationExceptionSAXExceptionException
-
OCR
public OCR(String screenFilesPath, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs) throws IOException, ParserConfigurationException, SAXException, Exception Perform OCR on the supplied image files.
- Parameters:
screenFilesPath- the path to the dose screen image files on which to perform OCRfileNameOfKnownGlyphs- file of known glyphsfileNameToRecordNewGlyphs- where to record new glyphs- Throws:
IOExceptionParserConfigurationExceptionSAXExceptionException
-
OCR
public OCR(List<String> screenFilesPaths, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs, int debugLevel) throws IOException, ParserConfigurationException, SAXException, Exception Perform OCR on the supplied image files.
- Parameters:
screenFilesPaths- the paths to the dose screen image files on which to perform OCRfileNameOfKnownGlyphs- file of known glyphsfileNameToRecordNewGlyphs- where to record new glyphsdebugLevel- ignored- Throws:
IOExceptionParserConfigurationExceptionSAXExceptionException
-
OCR
public OCR(List<String> screenFilesPaths, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs) throws IOException, ParserConfigurationException, SAXException, Exception Perform OCR on the supplied image files.
- Parameters:
screenFilesPaths- the paths to the dose screen image files on which to perform OCRfileNameOfKnownGlyphs- file of known glyphsfileNameToRecordNewGlyphs- where to record new glyphs- Throws:
IOExceptionParserConfigurationExceptionSAXExceptionException
-
OCR
public OCR(List<String> screenFilesPaths, int debugLevel) throws IOException, ParserConfigurationException, SAXException, Exception Perform OCR on the supplied image files.
- Parameters:
screenFilesPaths- the paths to the dose screen image files on which to perform OCRdebugLevel- ignored- Throws:
IOExceptionParserConfigurationExceptionSAXExceptionException
-
OCR
public OCR(List<String> screenFilesPaths) throws IOException, ParserConfigurationException, SAXException, Exception Perform OCR on the supplied image files.
- Parameters:
screenFilesPaths- the paths to the dose screen image files on which to perform OCR- Throws:
IOExceptionParserConfigurationExceptionSAXExceptionException
-
OCR
public OCR(AttributeList list, int debugLevel) 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 OCRdebugLevel- ignored- Throws:
IOExceptionParserConfigurationExceptionSAXExceptionException
-
OCR
public OCR(AttributeList list) 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- Throws:
IOExceptionParserConfigurationExceptionSAXExceptionException
-
OCR
public OCR(AttributeList list, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs, int debugLevel) 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 OCRfileNameOfKnownGlyphs- file of known glyphsfileNameToRecordNewGlyphs- where to record new glyphsdebugLevel- ignored- Throws:
IOExceptionParserConfigurationExceptionSAXExceptionException
-
OCR
public OCR(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 OCRfileNameOfKnownGlyphs- file of known glyphsfileNameToRecordNewGlyphs- where to record new glyphs- Throws:
IOExceptionParserConfigurationExceptionSAXExceptionException
-
OCR
public OCR(BufferedImage image, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs, int debugLevel) throws IOException, ParserConfigurationException, SAXException, Exception Perform OCR on the supplied image.
- Parameters:
image- the dose screen image on which to perform OCRfileNameOfKnownGlyphs- file of known glyphsfileNameToRecordNewGlyphs- where to record new glyphsdebugLevel- ignored- Throws:
IOExceptionParserConfigurationExceptionSAXExceptionException
-
OCR
public OCR(BufferedImage image, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs) throws IOException, ParserConfigurationException, SAXException, Exception Perform OCR on the supplied image.
- Parameters:
image- the dose screen image on which to perform OCRfileNameOfKnownGlyphs- file of known glyphsfileNameToRecordNewGlyphs- where to record new glyphs- Throws:
IOExceptionParserConfigurationExceptionSAXExceptionException
-
-
Method Details
-
getCommonAttributeList
-
getEightBitImageSuitableForThresholding
public static BufferedImage getEightBitImageSuitableForThresholding(AttributeList list, int debugLevel) throws DicomException Get an 8 bit image suitable for thresholding.
- Parameters:
list- the listdebugLevel- ignored- Returns:
- the image
- Throws:
DicomException
-
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, int debugLevel) 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 OCRfileNameOfKnownGlyphs- file of known glyphsfileNameToRecordNewGlyphs- where to record new glyphsdebugLevel- ignored- Throws:
IOExceptionParserConfigurationExceptionSAXExceptionException
-
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 OCRfileNameOfKnownGlyphs- file of known glyphsfileNameToRecordNewGlyphs- where to record new glyphs- Throws:
IOExceptionParserConfigurationExceptionSAXExceptionException
-
doCommonConstructorStuff
protected void doCommonConstructorStuff(AttributeList list, BufferedImage image, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs, int debugLevel) 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 OCRimage- the dose screen image on which to perform OCRfileNameOfKnownGlyphs- file of known glyphsfileNameToRecordNewGlyphs- where to record new glyphsdebugLevel- ignored- Throws:
IOExceptionParserConfigurationExceptionSAXExceptionException
-
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 OCRimage- the dose screen image on which to perform OCRfileNameOfKnownGlyphs- file of known glyphsfileNameToRecordNewGlyphs- where to record new glyphs- Throws:
IOExceptionParserConfigurationExceptionSAXExceptionException
-
toString
-
isGEDoseScreenSeriesNumber
-
isPossiblyGEDoseScreenSeries
-
isPossiblyGEDoseScreenSeries
-
isPossiblyGEDoseScreenInstance
-
isPossiblyGEDoseScreenInstance
-
isGEDoseScreenInstance
-
isPossiblySiemensDoseScreenSeries
-
isPossiblySiemensDoseScreenSeries
-
isPossiblySiemensDoseScreenInstance
-
isPossiblySiemensDoseScreenInstance
-
isSiemensDoseScreenInstance
-
isPossiblyToshibaDoseScreenSeries
-
isPossiblyToshibaDoseScreenSeries
-
isPossiblyToshibaDoseScreenInstance
-
isPossiblyToshibaDoseScreenInstance
-
isToshibaDoseScreenInstance
-
isPossiblyDoseScreenSeries
-
isPossiblyDoseScreenSeries
-
isPossiblyDoseScreenInstance
-
isPossiblyDoseScreenInstance
-
isDoseScreenInstance
-
getCTDoseFromOCROfGEDoseScreen
public static CTDose getCTDoseFromOCROfGEDoseScreen(OCR ocr, int debugLevel, 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 imagedebugLevel- ignoredstartDateTime- the acquisition start date and timeendDateTime- the acquisition end date and timeeventDataFromImages- the pre event data from the reconstructed imagesbuildSR- whether or not to extract composite context from the list for use later to build an RDSR- Throws:
IOException
-
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 imagestartDateTime- the acquisition start date and timeendDateTime- the acquisition end date and timeeventDataFromImages- the pre event data from the reconstructed imagesbuildSR- 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, int debugLevel, 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 imagedebugLevel- ignoredstartDateTime- the acquisition start date and timeendDateTime- the acquisition end date and timeeventDataFromImages- the pre event data from the reconstructed imagesbuildSR- 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 imagestartDateTime- the acquisition start date and timeendDateTime- the acquisition end date and timeeventDataFromImages- the pre event data from the reconstructed imagesbuildSR- 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, int debugLevel, 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 imagedebugLevel- ignoredstartDateTime- the acquisition start date and timeendDateTime- the acquisition end date and timeeventDataFromImages- the pre event data from the reconstructed imagesbuildSR- 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 imagestartDateTime- the acquisition start date and timeendDateTime- the acquisition end date and timeeventDataFromImages- the pre event data from the reconstructed imagesbuildSR- 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, int debugLevel, CTIrradiationEventDataFromImages eventDataFromImages, boolean buildSR) throws IOException Create a CTDose instance from the OCR already performed on a dose screen image.
- Parameters:
ocr- the object from the OCR performed in the imagedebugLevel- ignoredeventDataFromImages- the pre event data from the reconstructed imagesbuildSR- 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 imageeventDataFromImages- the pre event data from the reconstructed imagesbuildSR- whether or not to extract composite context from the list for use later to build an RDSR- Throws:
IOException
-
main
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
-