\input texinfo @c -*-texinfo-*-
@c Copyright (c) 2019-2020, John Donoghue <john.donoghue@ieee.org>
@c Octave Dicom -Dicom File I/O for GNU octave.

@c For manually generating the documentation use
@c   LANGUAGE=en makeinfo --html --no-split dicom.texi

@c %*** Start of HEADER
@setfilename dicom.info
@settitle Octave Dicom - Dicom File I/O for GNU octave
@afourpaper
@paragraphindent 0
@finalout
@set VERSION 0.4.0
@set COPYRIGHT_DATE 2019-2020
@c @afourwide
@c %*** End of the HEADER

@include macros.texi

@c %*** Start of TITLEPAGE
@titlepage
@title Dicom Toolkit @value{VERSION}
@subtitle Dicom File I/O for @acronym{GNU} Octave.
@author John Donoghue
@page
@vskip 0pt plus 1filll
Copyright @copyright{} @value{COPYRIGHT_DATE} John Donoghue

Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.

Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.

Permission is granted to copy and distribute translations of this manual
into another language, under the same conditions as for modified versions.

@page
@heading Distribution
The @acronym{GNU} Octave Dicom package is @dfn{free} software.
Free software is a matter of the users' freedom to run, copy, distribute,
study, change and improve the software.
This means that everyone is free to use it and free to redistribute it
on certain conditions.  The @acronym{GNU} Octave Dicom package
is not, however, in the public domain.  It is copyrighted and there are
restrictions on its distribution, but the restrictions are designed to
ensure that others will have the same freedom to use and redistribute
Octave that you have.  The precise conditions can be found in the
@acronym{GNU} General Public License that comes with the @acronym{GNU}
Octave Dicom package and that also appears in @ref{Copying}.

To download a copy of the @acronym{GNU} Octave Dicom package, please visit
@url{http://octave.sourceforge.net/dicom/}.

@end titlepage
@c %*** End of TITLEPAGE

@c %*** Start of BODY
@contents
@ifnottex
@node Top
@top Introduction
The Dicom toolkit is a set of Dicom file I/O routines for GNU Octave
@end ifnottex

@menu
* Installing and loading::    Installing and loading the Dicom toolkit
* Basic Usage Overview::      Basic Usage Overview
* Function Reference::        Dicom toolkit functions
* Copying::                   Copying
* Index::                     Index
@end menu

@c -------------------------------------------------------------------------
@node Installing and loading
@chapter Installing and loading
@cindex Installing and loading

The Dicom toolkit must be installed and then loaded to be used.

It can be installed in @acronym{GNU} Octave directly from octave-forge,
or can be installed in an off-line mode via a downloaded tarball.

The toolkit has a dependency on the GDCM library (@url{https://http://gdcm.sourceforge.net/}), so it must be installed in order
to successfully install the Dicom toolkit.

For fedora: @code{yum install gdcm-devel} 

For ubuntu: @code{apt install libgdcm2-dev} 

The toolkit must be then be loaded once per each @acronym{GNU} Octave session in order to use its functionality.

@section Online Direct install
@cindex Online install
With an internet connection available, the Dicom package can be installed from
octave-forge using the following command within @acronym{GNU} Octave:

@example
pkg install -forge dicom
@end example

The latest released version of the toolkit will be downloaded and installed.

@section Off-line install
@cindex Off-line install
With the Dicom toolkit package already downloaded, and in the current directory when running
@acronym{GNU} Octave, the package can be installed using the following command within @acronym{GNU} Octave:

@example
pkg install dicom-@value{VERSION}.tar.gz
@end example

@section Loading
@cindex Loading
Regardless of the method of installing the Dicom toolkit, in order to use its functions,
the toolkit must be loaded using the pkg load command:

@example
pkg load dicom
@end example

The toolkit must be loaded on each @acronym{GNU} Octave session.

@c -------------------------------------------------------------------------
@node Basic Usage Overview
@chapter Basic Usage Overview
@cindex Basic Usage Overview

Dicom files consist of metadata and image data within a file. The Dicom toolkit provides functions to 
read and write dicom data.

@example

%% read the meta information from a dicom file
> info = dicominfo ('test.dcm');
info =
  scalar structure containing the fields:
    Filename = a.dcm
    FileModDate = 04-Feb-2017 02:08:31
    FileMetaInformationVersion =
      0  1
    MediaStorageSOPClassUID = 1.2.840.10008.5.1.4.1.1.7
    MediaStorageSOPInstanceUID = 1.2.826.0.1.3680043.2.1143.4379544382488839209812957878553810312
    TransferSyntaxUID = 1.2.840.10008.1.2
    ImplementationClassUID = 1.2.826.0.1.3680043.2.1143.107.104.103.115.2.6.3
    ImplementationVersionName = GDCM 2.6.3
    SourceApplicationEntityTitle = GDCM
    ImageType = DERIVED \SECONDARY  
    SOPClassUID = 1.2.840.10008.5.1.4.1.1.7
    SOPInstanceUID = 1.2.826.0.1.3680043.2.1143.4379544382488839209812957878553810312
    StudyDate = 20170203
    StudyTime = 210831.360586 
    Modality = OT
    ConversionType = WSD 
    NominalScannedPixelSpacing =
       1
       1
    StudyInstanceUID = 1.2.826.0.1.3680043.2.1143.1282184104726305239898701219563360204
    SeriesInstanceUID = 1.2.826.0.1.3680043.2.1143.9385265081744858155080799316976198629
    SamplesPerPixel = 1
    PhotometricInterpretation = MONOCHROME1 
    Rows = 10
    Columns = 5
    BitsAllocated = 8
    BitsStored = 8
    HighBit = 7
    PixelRepresentation = 0
    RescaleIntercept = 0
    RescaleSlope =  1
    RescaleType = US
    PixelData = not assigned


%% read the image data
> image = dicomread('test.dcm')
image = dicomread ('a.dcm')
image =
  0  0  0  0  0
  0  0  0  0  0
  0  0  0  0  0
  0  0  0  0  0
  0  0  0  0  0
  0  0  0  0  0
  0  0  0  0  0
  0  0  0  0  0
  0  0  0  0  0
  0  0  0  0  0
@end example

Help for each function can be displayed by  @code{help thefunctionname}

ie: 
@example
help dicominfo
@end example


@c -------------------------------------------------------------------------
@node Function Reference
@chapter Function Reference
@cindex Function Reference

The functions currently available in the Dicom toolkit are described below;

@include functions.texi

@c -------------------------------------------------------------------------

@include gpl.texi

@c -------------------------------------------------------------------------
@node Index 
@unnumbered Index 
 
@printindex cp
 
@bye
