Copyright
Copyright 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 by Paolo Brandoli.
Imebra is available for free under the FreeBSD License.
You can download the latest version of imebra from http://imebra.com
Donations
Want to keep Imebra free and updated? Consider making a donation to the developer.
Introduction
Imebra is an open source Dicom library. The library has been designed to handle Dicom files, but it includes also some classes that manage jpeg and other image files.
At the moment the library provides the following features:
- dicom files parser and builder
- jpeg files parser and builder
- image decompression and compression in the following formats:
- jpeg baseline (8 bits per color channel lossy)
- jpeg baseline extended (12 bits per color channel lossy)
- jpeg lossless (up to 16 bits per color channel lossless)
- raw dicom (up to 16 bits per color channel lossless)
- rle dicom (up to 16 bits per color channel lossless)
- multi platform
- self contained (the library uses only functions from the standard C library and the standard template library)
- color space conversion
- support for nested datasets (sequences)
- support for Unicode and different Dicom charsets
- DICOMDIR parser and writer
- support for transactions
- load larger tags only when necessary
What Imebra does NOT do?
- the library doesn't check for a Dicom stream validity; this feature will be introduced with the support for dicom objects.
- the library doesn't support network communication
Where to start
After reading the License agreement, you should read the Getting started and the section The Imebra's structure.
A guide that will help you to include Imebra in your project can be found in Adding Imebra to your project.
If you want to build the examples and the test units you should read Compiling the examples and the test units.
A detailed reference of the C++ classes that compose Imebra is included in this manual.
Migrating projects written for older versions of Imebra
Imebra 2011 introduces some breaking changes in the transform classes and access to the images' pixels.
Most of the changes are due to the fact that now the imageHandler class has been replaced by a dataHandlerNumericBase class, which is a template class (now image classes store the pixels using 1, 2 or 4 bytes per color component, while the old version always used 4 bytes per color component).
Migrating code that uses classes derived from transform
Because the new image objects return a data handler that can point to different integer types, the transforms classes have been modified accordingly and now supply a template function that can operate on different data types. This information can be ignored if you don't have to write new transforms, since the correct template function is called by the base transform class.
The changes that affect the interface of the transform classes (and therefore needs changes in your application if you use the transforms) are the following:
- a transform cannot no longer accept several input images and several output images
- input and output images don't have to be declared before running the transform, but are specified when calling the function that actually run the transform
- transforms don't allocate the output image anymore: the caller has to provide a valid output image, but it can ask the transform for hints about the required output image
- transforms now are stateless: the same transform can be run several times on different images
Changes log for Imebra 2011 build 2011-09-18_22-24-41
- Updated to compile with Visual Studio on x64 arch
- Improved performances of IDCT
- Improved performance of Jpeg decoder
- Improved the performances of the huffman decoder
changeLog Changes for version 2011-06-29_23-24-13
- Fixes #84 (VOILUT returns always a MONOCHROME2 image)
- Fixes #85 (GetImage() fails when a file contains a single frame splitted across several buffers and the offset table is empty)
- Fixes #86 (The automatic build doesn't set the product name in the source files)
Changes for version 2011-04-18_22-48-29
Changes for version 2011-03-01_21-54-48
- Improved tests of the Dicom codec (now test all the bit depths)
- Added detailed documentation for compilation of the examples
- Fixes #73 (The Dicom codec returns black images when highbit=31)
- Fixes #74 (When the transfer syntax as implicit VRs then the VR for image data should be OW)
- Fixes #75 (The dataset doesn't set the b2complement flag when the data is stored in signed 32bit)
Changes for version 2011-01-22_13-58-55
- License changed from GPL3 to FreeBSD
- new folders structure
- puntoexe::imebra::image now returns a puntoexe::imebra::handlers::dataHandlerNumericBase instead of puntoexe::imebra::handlers::imageHandler
- breaking changes in puntoexe::imebra::handlers::dataHandlerNumeric
- breaking changes in puntoexe::imebra::transforms::transform (now the transforms work with new dataHandlerNumeric)
- The palette tags now are embedded in the puntoexe::imebra::image objects
- Added the example changeTransferSyntax
- Fixes #59 (Old Dicom formats may not be recognized)
- Fixes #61 (directoryRecord must have a method setFilePart())
- Fixes #62 (Speed up the drawBitmap class)
- Fixes #63 (Regression when reading uncompressed non interleaved images)
- Fixes #65 (When a tag is set twice using the default VR in a transaction then the second write operation resets the VR)
- Fixes #66 (The dataset doesn't consider the planar configuration)
- Fixes #67 (When an undefined-length sequence doesn't contains the end-of-sequence then an exception is thrown when the end of the file is reached)
- Fixes #68 (drawBitmap should be able to draw b/w images)
- Fixes #71 (File Meta should always use Explicit VR Little Endian Transfer Syntax)
Changes for version 0.0.48
- Fixes #44 (Add the "const" modifier to all the relevant functions in the data handlers)
- Fixes #55 (Add const qualifier to functions that require them)
- Fixes #56 (The external lock in baseObject may create circular references)
- Fixes #57 (RGBToPALETTECOLOR causes memory leaks)
- Fixes #58 (The destructors of objects derived from baseObject must be protected, since they can be deleted only by themself)
- Increased the speed of CopyFromInt32Interleaved
- Increased the speed of dicomCodec::ReadPixel when bitsAllocated == 8 or 16
- Improved the speed of streamWriter::write()
- Increased the speed of streamWriter::writeBits
- The file reading related function now return the read byte or bits by value
Changes for version 0.0.47
- Makefiles for the example applications are being provided
- Fixes #33 (When launched without parameters, dicomdirItems should display the version)
- Fixes #42 (When a dicomdir destructor is called, the it delete all the children elements. This may cause a stack overflow when an element call release on the next sibling item and the number of siblings is high)
- Fixes #46 (Checking for LUT validity will help dicom2jpeg to ignore the LUT if it contains invalid data)
- Fixes #49 (The codepage "CHAR" used to indicate the locale charset in charsetConversion.cpp causes an exception during the initialization of ICONV. The usage of "" instead of "char" works properly)
- Fixes #50 (mbxInt32 and imbxUint32 are wrongly mapped to long and unsigned long. It should be mapped to int and unsigned int)
- Fixes #51 (wrong parameters in memset)
- Fixes #52 (The charset conversion uses different error reporting in ICONV and Windows API)
Changes for version 0.0.46
- Fixes #32 (When launched without parameters, dicom2jpeg should display the version)
- Fixes #34 (The on-line documentation should have to Google Analytics tracking code)
- Fixes #37 (Change the title of the documentation to: Imebra - Open source dicom library)
- Fixes #39 (The class dataHandlerNumeric calculates the wrong size)
Changes for version 0.0.45
- Fixes #1 (The library's version should be visible in the source code)
- Added DICOMDIR creator/parser
- Added an example that extract a DICOMDIR to an XML file
- Fixes #4 (A sequence tag should have the type set to SQ, but the writer uses the first buffer's type, therefore the data type is incorrect)
- Fixes #5 (When writing sequences, the tag's length is not calculated correctly)
- Fixes #6 (dicomCodec::getDataSetLength doesn't calculate the correct size)
- dicom2jpeg can now invoke ffmpeg and create movies
- Mercurial is now used as version control (was SVN)
- Corrected documentation
- Changed open source license to Affero GPL 3
Changes for version 0.0.44 (Beta)
- Added the function puntoexe::imebra::transforms::VOILUT::getCenterWidth()
- The jpegCodec returns an image with color space "YBR_FULL" when the image is compressed in lossy mode and the dataset specifies the color space "RGB"
- Enhanced precision in the RGB to YBR_FULL color conversion
- Enhanced precision in the YBR_FULL to RGB color conversion
- Several optimization in the uncompressed Dicom image decoder
- Added the class puntoexe::imebra::trasforms::transformBuffersInPlace
- puntoexe::imebra::VOILUT and puntoexe::imebra::modalityVOILUT now derive from puntoexe::imebra::trasforms::transformBuffersInPlace
- puntoexe::imebra::viewHelper releases the dataset when no images are displayed
- Several optimizations in the Jpeg image decoder
- puntoexe::streamReader::read() throws an exception when the end of file is reached
- added puntoexe::streamReader::endReached()
- Several optimizations in puntoexe::streamReader
- Several optimizations in the Huffman decoder
Changes for version 0.0.41 (Alpha)
- Added the example dicom2jpeg
Changes for version 0.0.40 (Alpha)
- Closes #12 (Subsampled images are saved/loaded incorrectly by the jpeg codec)
- Closes #13 (When saving a jpeg image from a dataset and it doesn't need to be converted an exception is thrown)
- Closes #14 (When saving an image the subsampling flags don't match the quality)
Changes for version 0.0.38 (Alpha)
- Removed dependence from charsetsList in data, buffer, dataSet, dataGroup, dataHandler
- Closes #9 (The lossless jpeg codec saves corrupted images)
- Closes #10 (A basic offset table is added even when it shouldn't)
- Now non encapsulated images are saved one after another even when their length is odd: no padding bytes are inserted
- closes #11 (The 32 bits tag's length is truncated (only the lower 16 bits are correct) )
- The images build during the test units had a reduced range. Corrected
- Now the jpeg codec creates the offset table when loading an image
Changes for version 0.0.36 (Alpha)
- Closes #7 (memoryPool isn't thread safe)
- The memory string now is managed by an auto_ptr
- In the memoryPool minimized the number of moved pointers when a memory object is reused
- The dataSet doesn't need to retrieve the images handlers anymore when updating the offsets table
- The dicom codec doesn't need to retrieve the handlers anymore when calculating the tag size
- viewHelper now accepts a null pointer as image
- VOILUT now returns the right voilut description
- puntoexe::memory hides the string of bytes
- Added the class puntoexe::imebra::waveform to handle waveforms embedded in puntoexe::imebra::dataSet
- Added SWIG headers (partial)
Changes for version 0.0.35 (Alpha)
Changes for version 0.0.34 (Alpha)
- Closes #2 (The code assumes that wchar_t is 2 bytes long, while some systems have wchar_t=4 bytes long)
- Closes #3 (Usage of ICONV should check for return value E2BIG)
- Added casting operators () to puntoexe::ptr
Changes for version 0.0.33 (Alpha)
- Corrected the ptr class so baseObject compiles on GCC
- Corrected thread (removed orphan functions)
- Now charsetConversion throws an exception if a charset is not supported by the system
Changes for version 0.0.32 (Alpha)
- The PDF documentation is back
Changes for version 0.0.31 (Alpha)
- The smart pointer puntoexe::ptr is able to cast the object's type.
- The reference counter in puntoexe::baseObject now is set to 0 at construction time and should be increased by the application. It doesn't affect your code if you used the smart pointer puntoexe::ptr.
- Updated the documentation to reflect recent changes
- The criticalSection now has its own class
- Added the class thread
Changes for version 0.0.30 (Alpha)
- Now the library doesn't fail when the dataset has an empty images' offset table
- Now the Dicom codec doesn't switch to implicit datatype when a tag without datatype is found in the group 0x0002.
The tag without datatype is still recognized. This solves a problem with dicom files generated by DicomWorks
Changes for version 0.0.29 (Alpha)
Changes for version 0.0.28 (Alpha)
Changes for version 0.0.27 (Alpha)
- Corrected the sample Let's read an image
- Corrected a bug in the memoryManager's destructor
- Now the memory manager's parameters can be configured with preprocessor definitions
Changes for version 0.0.26 (Alpha)
- Replaced "informations" with "information" and "infos" with "info"
The function exceptionsManager::getExceptionInfos became exceptionsManager::getExceptionInfo
The function exceptionsManager::clearExceptionInfos became exceptionsManager::clearExceptionInfo
- Corrected an issue in the RLE Dicom codec:
after reading a segment the decoder was seeking to the wrong position in the dicom file, while writing it was writing wrong offsets
- Improved performances in the Jpeg IDCT function
Changes for version 0.0.25 (Alpha)
- Introduced common lock objects
- Introduced the transactions
- Compiles also on Embedded Visual C++ 4 (requires STLPORT, see sourceforge.net/projects/stlport)
- Introduced the view helper class
Changes for version 0.0.24 (Alpha)
- Introduced support for Unicode and different dicom charsets
- Modified several files to solve problems with Borland C++ Builder 2006
- The dicom codec now uses a dataHandlerRaw to read the tags from the file (previously it was using a normal dataHandler)
- Updated the documentation
- Modified the exceptionManager: now it store a list of objects instead of a list of strings
Changes for version 0.0.22 (Alpha)
- Corrected the transformHighBit class
- Modified the exceptionsManager (now it stores the messages per thread and not per exception)