Dicom package: Difference between revisions

From Octave
Jump to navigation Jump to search
No edit summary
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
At an early development stage. [http://octave.svn.sourceforge.net/viewvc/octave/trunk/octave-forge/extra/dicom/ octave-forge svn]
The {{Forge|dicom}} package is part of the [[Octave Forge]] project. The package is currently maintained by John Donoghue.
*Maintainer: Andy Buckle [http://sourceforge.net/sendmessage.php?touser=1760416contact]
*Contributors: Judd Storrs, Kris Thielemans


Auto-generated docs from the current package: {{Forge|dicom}}
= What is the aim of this package? =
 
== What is the aim of this package? ==
Digital communications in medicine (DICOM) is an information standard. Originally created for image transfer, the standard now deals with an large range of medical data. See http://medical.nema.org/ for more info.
Digital communications in medicine (DICOM) is an information standard. Originally created for image transfer, the standard now deals with an large range of medical data. See http://medical.nema.org/ for more info.


This package provides functions to read and (eventually) write DICOM files. The functions in the package are intended to have similar usage as
This package provides functions to read and write DICOM files. The functions in the package are intended to have similar usage as
the dicom functions in the Matlab Image Processing Toolbox. In Octave they are separate: most image package users will not use dicom, and its dependency might be considered troublesome.
the dicom functions in the Matlab Image Processing Toolbox. In Octave they are separate: most image package users will not use dicom, and its dependency might be considered troublesome.


== Platforms ==
= Installation =
*Linux. Tested on OpenSuSE 11.4 and Ubuntu. No known issues. GDCM is required: see below.
*mingw
**Ben Lindner's Octave 3.2.4 and the mingw build environment (gcc 4.4.0): dicom package 0.1.1 does not build against this older version of the Octave API.
**Tatsuro/Nitzan's Octave 3.4.3 and mingw build environment (gcc 4.5.2): gdcm and dicom package build OK. Get segfault in ntdll.dll when one of the dicom*.oct files calls something from a gdcm*.dll.
**mxe-octave: dicom and gdcm distributed as part of the installed package.
*Cygwin: Panic when oct file called (or maybe when oct file uses gdcm dll). Need to try rebaseall
 
==Supporting library==
[http://sourceforge.net/apps/mediawiki/gdcm/index.php?title=Main_Page GDCM]. You can usually get this via your package manager, e.g. on Ubuntu
 
sudo apt-get install libgdcm2.0


Alternatively, build it yourself. Get the source with subversion.
== package requirements ==


svn co https://gdcm.svn.sourceforge.net/svnroot/gdcm/branches/gdcm-2-0
The {{Forge|dicom}} package requires the [[http://gdcm.sourceforge.net/wiki/index.php/Main_Page GDCM]] libraries and include files to be installed in order to compile.


cmake and g++ are required. create a gdcmbin directory parallel to the gdcm-2-0 directory. Change to gdcmbin and then run cmake (Linux/cygwin).
for fedora: yum install gdcm-devel


> mkdir gdcmbin
for ubuntu: apt install libgdcm-dev
> ls
gdcmbin gdcm-2-0
> cd gdcmbin
> cmake -DGDCM_BUILD_SHARED_LIBS=ON ../gdcm-2-0/


This creates a Makefile in your gdcmbin directory. You can easily edit cmake options with "make edit_cache", for example to build applications like gdcmdump. "make help" is also very useful.


make install
== octave installation ==


On my system, I also had to add this to my ~/.bashrc.
From octave commmand line:


  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
  >> pkg install -forge dicom


Mingw32 is similar. Get openSSL: [http://www.slproweb.com/products/Win32OpenSSL.html Win32 Openssl v1.0.0a Light]
== Using it ==


cmake -G "MinGW Makefile" -DGDCM_BUILD_SHARED_LIBS=ON ..\gdcm-2-0
Load it before any usage:
mingw32-make all


On Cygwin gdcm 2.0.18 (and maybe some other versions) may have a problem with newer cmake. This kludge persuades cmake to define WIN32.
>> pkg load dicom


cmake -DGDCM_BUILD_SHARED_LIBS=ON -DCMAKE_CXX_COMPILER=g++.exe -DCMAKE_LEGACY_CYGWIN_WIN32=1 ../gdcm-2.0.18/


==Features==
=Features=
All of these still need work, but they exist, and are usable to some extent.
The following functions are available:
*dicomdict (load different dict - file follows same format as Matlab's)
*dicomdict (load different dict - file follows same format as Matlab's)
*dicominfo (load metadata into octave struct. possible bug in SQ loading)
*dicominfo (load metadata into octave struct)
*dicomdisp (Display the structure of a dicom file)
*dicomlookup (keyword <-> tag)
*dicomlookup (keyword <-> tag)
*dicomread (load pixel data, 2D or 3D int types. Does not yield colormaps, yet.)
*dicomread (load pixel data, 2D or 3D int types. Does not yield colormaps, yet.)
Line 62: Line 41:
*dicomuid (generate a DICOM unique id)
*dicomuid (generate a DICOM unique id)
*isdicom (verify if a file is a DICOM formatted file)
*isdicom (verify if a file is a DICOM formatted file)
*dicomanon(anonomize a file)
*dicomfind(find an attribute in a file or dicom struct)
*dicomupdate(Update an attribute value in a dicom struct)


==Todo==
*dicomanon
==Questions==
I don't have a Matlab license available. I would like to make this package compatible with the dicom functions in Matlab's image processing toolbox, as far as possible.
*Octave (and Matlab) stores images (y,x) and DICOM is intrinsically (x,y). Does Matlab transpose images when it loads them?
**matlab reads the data from the dicom file as if it's a raw block of numbers (and then converts if necessary). We think that current Octave/dicom behaviour is compatible with matlab.
*I would like people to try m-files that worked with Matlab to let me know of problems.
*(not necessarily) Matlab related: I need examples of odd DICOM files. I have plenty with complex metadata, but I need some with unusual images.
**More than one sample per pixel
**Colour
**Float types
*DA (date) VR: does Matlab turn them into a string?
*if the user supplies metadata (eg HighBit?, BitsStored?) that describe the type of the pixels and this is not in agreement with the type of the image matrix supplied, does Matlab
**silently convert the image pixel type to match the metadata?
**silently convert the metadata to match the pixel type?
**error and do nothing?
== Answered ==
*dicominfo: Items in sequences are not necessarily the same, so are stored as nested structs like dcm.RTDoseROISequence.Item_1.DoseUnits(as Matlab)
*What does dicominfo do when a tag is not in its dictionary? Answer: assign to a field like Private_3243_0010 (as Matlab)


== See also ==
= See also =
* {{Forge|dicom}} at [[Octave Forge]].
* {{Forge|dicom}} at [[Octave Forge]].
* [http://sourceforge.net/projects/gdcm/ Grassroots DICOM].
* [https://sourceforge.net/projects/gdcm/ Grassroots DICOM].


[[Category:Octave-Forge]]
[[Category:Octave Forge]][[Category:Packages]]

Latest revision as of 20:54, 1 July 2022

The dicom package is part of the Octave Forge project. The package is currently maintained by John Donoghue.

What is the aim of this package?[edit]

Digital communications in medicine (DICOM) is an information standard. Originally created for image transfer, the standard now deals with an large range of medical data. See http://medical.nema.org/ for more info.

This package provides functions to read and write DICOM files. The functions in the package are intended to have similar usage as the dicom functions in the Matlab Image Processing Toolbox. In Octave they are separate: most image package users will not use dicom, and its dependency might be considered troublesome.

Installation[edit]

package requirements[edit]

The dicom package requires the [GDCM] libraries and include files to be installed in order to compile.

for fedora: yum install gdcm-devel

for ubuntu: apt install libgdcm-dev


octave installation[edit]

From octave commmand line:

>> pkg install -forge dicom

Using it[edit]

Load it before any usage:

>> pkg load dicom


Features[edit]

The following functions are available:

  • dicomdict (load different dict - file follows same format as Matlab's)
  • dicominfo (load metadata into octave struct)
  • dicomdisp (Display the structure of a dicom file)
  • dicomlookup (keyword <-> tag)
  • dicomread (load pixel data, 2D or 3D int types. Does not yield colormaps, yet.)
  • dicomwrite (write pixel data to a DICOM format file)
  • dicomuid (generate a DICOM unique id)
  • isdicom (verify if a file is a DICOM formatted file)
  • dicomanon(anonomize a file)
  • dicomfind(find an attribute in a file or dicom struct)
  • dicomupdate(Update an attribute value in a dicom struct)


See also[edit]