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 void
doCommonConstructorStuff
(AttributeList list, BufferedImage image, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs) Perform OCR on the supplied image with AttributeList.protected void
doCommonConstructorStuff
(AttributeList list, BufferedImage image, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs, int debugLevel) Perform OCR on the supplied image with AttributeList.protected void
doCommonConstructorStuff
(AttributeList list, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs) Perform OCR on the supplied image AttributeList.protected void
doCommonConstructorStuff
(AttributeList list, String fileNameOfKnownGlyphs, String fileNameToRecordNewGlyphs, int debugLevel) Perform OCR on the supplied image AttributeList.static CTDose
getCTDoseFromOCROfDoseScreen
(OCR ocr, int debugLevel, CTIrradiationEventDataFromImages eventDataFromImages, boolean buildSR) Create a CTDose instance from the OCR already performed on a dose screen image.static CTDose
getCTDoseFromOCROfDoseScreen
(OCR ocr, CTIrradiationEventDataFromImages eventDataFromImages, boolean buildSR) Create a CTDose instance from the OCR already performed on a dose screen image.static CTDose
getCTDoseFromOCROfGEDoseScreen
(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 CTDose
getCTDoseFromOCROfGEDoseScreen
(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 CTDose
getCTDoseFromOCROfSiemensDoseScreen
(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 CTDose
getCTDoseFromOCROfSiemensDoseScreen
(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 CTDose
getCTDoseFromOCROfToshibaDoseScreen
(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 CTDose
getCTDoseFromOCROfToshibaDoseScreen
(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 BufferedImage
Get an 8 bit image suitable for thresholding.static BufferedImage
getEightBitImageSuitableForThresholding
(AttributeList list, int debugLevel) Get an 8 bit image suitable for thresholding.static boolean
static boolean
protected static boolean
isGEDoseScreenSeriesNumber
(String seriesNumber) static boolean
static boolean
isPossiblyDoseScreenInstance
(String manufacturer, String sopClassUID, String imageType) static boolean
static boolean
isPossiblyDoseScreenSeries
(String manufacturer, String modality, String seriesNumber, String seriesDescription) static boolean
static boolean
isPossiblyGEDoseScreenInstance
(String manufacturer, String sopClassUID, String imageType) static boolean
static boolean
isPossiblyGEDoseScreenSeries
(String manufacturer, String modality, String seriesNumber, String seriesDescription) static boolean
static boolean
isPossiblySiemensDoseScreenInstance
(String manufacturer, String sopClassUID, String imageType) static boolean
static boolean
isPossiblySiemensDoseScreenSeries
(String manufacturer, String modality, String seriesNumber, String seriesDescription) static boolean
static boolean
isPossiblyToshibaDoseScreenInstance
(String manufacturer, String sopClassUID, String imageType) static boolean
static boolean
isPossiblyToshibaDoseScreenSeries
(String manufacturer, String modality, String seriesNumber, String seriesDescription) static boolean
static boolean
static final void
Extract 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:
IOException
ParserConfigurationException
SAXException
Exception
-
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:
IOException
ParserConfigurationException
SAXException
Exception
-
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:
IOException
ParserConfigurationException
SAXException
Exception
-
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:
IOException
ParserConfigurationException
SAXException
Exception
-
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:
IOException
ParserConfigurationException
SAXException
Exception
-
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:
IOException
ParserConfigurationException
SAXException
Exception
-
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:
IOException
ParserConfigurationException
SAXException
Exception
-
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:
IOException
ParserConfigurationException
SAXException
Exception
-
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:
IOException
ParserConfigurationException
SAXException
Exception
-
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:
IOException
ParserConfigurationException
SAXException
Exception
-
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:
IOException
ParserConfigurationException
SAXException
Exception
-
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:
IOException
ParserConfigurationException
SAXException
Exception
-
-
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:
IOException
ParserConfigurationException
SAXException
Exception
-
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:
IOException
ParserConfigurationException
SAXException
Exception
-
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:
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 OCRimage
- the dose screen image on which to perform OCRfileNameOfKnownGlyphs
- file of known glyphsfileNameToRecordNewGlyphs
- where to record new glyphs- Throws:
IOException
ParserConfigurationException
SAXException
Exception
-
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
-