Class: Dicom_Pixeler

Source Location: /tools/pixeler.php

Class Overview [line 30]

Nanodicom_Core
   |
   --Nanodicom
      |
      --Dicom_Pixeler

Dicom_Pixeler class.

Author(s):

Version:

  • 2.0

Copyright:

  • (c) 2010-2011

Variables

Constants

Methods


Inherited Variables

Inherited Constants

Inherited Methods

Class: Nanodicom_Core

Nanodicom_Core::__construct()
Create a new Nanodicom instance. It is usually called from a class extended from core, ie Dumper
Nanodicom_Core::array_get()
Public static method to get the value from an array. If index does not exist, it returns the default.
Nanodicom_Core::dataset_value()
Public method to get and set values when passing a dataset.
Nanodicom_Core::decode_transfer_syntax()
Get the VR mode and endian from a transfer syntax.
Nanodicom_Core::extend()
Public method to extend the tool to include other tools.
Nanodicom_Core::factory()
Create a new Nanodicom instance. It is usually called from a class extended from Nanodicom, ie Dumper
Nanodicom_Core::flush()
Public method to flush the object
Nanodicom_Core::get()
Public method to get the value of an element.
Nanodicom_Core::get_transfer_syntax()
Public method to get the transfer syntax used
Nanodicom_Core::is_dicom()
Public method to quickly check if file is DICOM. Does a brute force parse of the object and checks the returned status.
Nanodicom_Core::last_error()
Returns the last error found
Nanodicom_Core::parse()
Parses the object.
Nanodicom_Core::profiler_diff()
Public method to show the profiling time for methods. Profiling names MUST be equal to method names.
Nanodicom_Core::set_vr_reading_list()
Public method to set the vrs to read
Nanodicom_Core::summary()
Public method to get the summary of the given file.
Nanodicom_Core::value()
Public method to get and set values, but only values at top level.
Nanodicom_Core::write()
Returns a blob of the current dataset
Nanodicom_Core::write_file()
Writes the file to the specified location
Nanodicom_Core::_check_deflate()
Nanodicom_Core::_check_list()
Checks if the given group and element are part of the list of elements to look for.
Nanodicom_Core::_check_proper_endian()
Check that proper endian is used
Nanodicom_Core::_check_proper_endian_same()
Returns the same values passed
Nanodicom_Core::_decode_vr()
Decodes the proper vr from the group, element, current vr and length.
Nanodicom_Core::_dummy()
Dummy function to be used instead of other time consuming functions.
Nanodicom_Core::_forward()
Moves the current_pointer forward
Nanodicom_Core::_parse()
Parsing code
Nanodicom_Core::_proper_name()
Get the proper name of the tag name. Removes spaces and _, and converts it to lowercase.
Nanodicom_Core::_read()
Reads specified number of bytes from blob, or checks if there is still data left to be read
Nanodicom_Core::_read_element()
Read an element
Nanodicom_Core::_read_file()
Read file or blob accordingly
Nanodicom_Core::_read_float()
Reads a float
Nanodicom_Core::_read_int_32()
Reads integers
Nanodicom_Core::_read_int_64()
Reads an integer for 64-bit machines
Nanodicom_Core::_read_value()
Read the value of an Tag element accordingly. No numeric values are interpreted. No reading of PN
Nanodicom_Core::_read_value_from_blob()
Read the value from the blob
Nanodicom_Core::_rewind()
Set the current_pointer to a given value
Nanodicom_Core::_tell()
Finds current position of pointer
Nanodicom_Core::_update_group_length()
Updates the group length value if exists
Nanodicom_Core::_write()
Creates a binary string from the current dataset
Nanodicom_Core::_write_float()
Writes a float
Nanodicom_Core::_write_int_32()
Writes an integer for 32-bit machines.
Nanodicom_Core::_write_int_64()
Writes an integer for 64-bit machines. Uses 32-bit function
Nanodicom_Core::__call()
Magic method to call an undefined method. It will look for methods on children Performance is better when called directly
Nanodicom_Core::__get()
Magic method, calls [Nanodicom::value] with the same parameters. Used to get values by name.
Nanodicom_Core::__set()
Magic method, calls [Nanodicom::value] with the corresponding group and element based on the tag name.
Nanodicom_Core::__toString()
Returns the name of the loaded file or 'blob'
Nanodicom_Core::__unset()
Magic method to unset a tag element. To be used wisely.


Class Details

Dicom_Pixeler class.

Extends Nanodicom. Pixel data reader. Currently support:

Tags:

[ Top ]


Class Variables

static $driver =  'gd'

[line 35]

Tags:

  • var - driver to be used: GD (gd), ImageMagick (imagick), GraphicsMagick (gmagick)
  • access - public

Type: string

Overrides:

[ Top ]

static $reading_image_transfer_syntaxes = array(
      // Implicit VR Little Endian "1.2.840.10008.1.2"
      Nanodicom::IMPLICIT_VR_LITTLE_ENDIAN => array(
         'name' => 'Implicit VR Little Endian'
      ),// Explicit VR Little Endian "1.2.840.10008.1.2.1"
Nanodicom::EXPLICIT_VR_LITTLE_ENDIAN=>array('name'=>'Explicit VR Little Endian'),// Explicit VT Big Endian "1.2.840.10008.1.2.2"
Nanodicom::EXPLICIT_VR_BIG_ENDIAN=>array('name'=>'Explicit VR Big Endian'),// DICOM Deflated Little Endian (Explicit VR)
'1.2.840.10008.1.2.1.99'=>array('name'=>'DICOM Deflated Little Endian (Explicit VR)'),// Jpeg Lossy Baseline (1) - 8 bits
'1.2.840.10008.1.2.4.50'=>array('name'=>'Jpeg Lossy Baseline (1) - 8 bits'),// RLE - Run Length Encoding, Lossless
'1.2.840.10008.1.2.5'=>array('name'=>'RLE - Run Length Encoding, Lossless'),)

[line 53]

Supported Image Transfer Syntaxes for reading image data indexed by Value of the Transfer Syntax each array contains: Name.

Tags:

  • access - public

Type: array

Overrides:

[ Top ]

$_cols

[line 38]

Tags:

  • access - protected

Type: mixed

Overrides:

[ Top ]

$_dose_scaling

[line 41]

Tags:

  • access - protected

Type: mixed

Overrides:

[ Top ]

$_endian

[line 39]

Tags:

  • access - protected

Type: mixed

Overrides:

[ Top ]

$_pixel_representation

[line 45]

Tags:

  • access - protected

Type: mixed

Overrides:

[ Top ]

$_rescale_intercept

[line 43]

Tags:

  • access - protected

Type: mixed

Overrides:

[ Top ]

$_rescale_slope

[line 42]

Tags:

  • access - protected

Type: mixed

Overrides:

[ Top ]

$_rows

[line 37]

Tags:

  • access - protected

Type: mixed

Overrides:

[ Top ]

$_samples_per_pixel

[line 44]

Tags:

  • access - protected

Type: mixed

Overrides:

[ Top ]

$_vr_mode

[line 40]

Tags:

  • access - protected

Type: mixed

Overrides:

[ Top ]


Class Methods

static complement2

static integer complement2( integer $number, [integer $high_bit = 15])

[line 797]

Static method to find the complement of 2, returns an integer.

Tags:

  • return - the number after complement's 2 applied
  • access - public

Parameters:

  • integer $number - the integer number to convert
  • integer $high_bit - the high bit for the value. By default 15 (assumes 2 bytes)

[ Top ]

static create_image

static mixed create_image( integer $cols, integet $rows)

[line 723]

Public static method to create an instance of the image

Tags:

  • return - the corresponding object from the set driver or false on failure
  • access - public

Parameters:

  • integer $cols - the number of columns
  • integet $rows - the number of rows

[ Top ]

get_driver

string get_driver( )

[line 97]

Public method to get the driver currently set

Tags:

  • return - the current driver set
  • access - public

Parameters:

[ Top ]

get_images

mixed get_images( [integer $width = NULL], [integer $center = NULL])

[line 110]

Public method to get the images from the dicom object

Tags:

  • return - false if something is missing or not image data found, otherwise an array of GD objects
  • access - public

Parameters:

  • integer $width - a default window width
  • integer $center - a default window center

[ Top ]

set_driver

object the set_driver( string $driver)

[line 86]

Public method to set the driver to be used

Tags:

  • return - instance to allow chaining
  • access - public

Parameters:

  • string $driver - name of the driver

[ Top ]

write_image

boolean write_image( resource $image, string $location, [ $format = 'jpg'])

[line 592]

Public method to write images based on library used and format

Tags:

  • return - true on success, false on failure
  • access - public

Parameters:

  • resource $image - the image object instance
  • string $location - the format to be saved. defaults to jpeg
  • $format -

[ Top ]

_allocate_color_gray

mixed _allocate_color_gray( resource $image, integer $gray)

[line 674]

Internal method to allocate the color for image instance (gray)

Tags:

  • return - color value or class, false on failure
  • access - protected

Parameters:

  • resource $image - the image object instance
  • integer $gray - the gray value

[ Top ]

_allocate_color_rgb

mixed _allocate_color_rgb( resource $image, integer $rgb)

[line 655]

Internal method to allocate the color for image instance (color)

Tags:

  • return - color value or class, false on failure
  • access - protected

Parameters:

  • resource $image - the image object instance
  • integer $rgb - the color value

[ Top ]

_check_driver

bool _check_driver( )

[line 744]

Internal method to check if drivers are installed

Tags:

  • return - true if driver is installed, false otherwise
  • access - protected

Parameters:

[ Top ]

_read_gray

integer _read_gray( string $blob, integer $current_position, integet $bytes_to_read)

[line 765]

Internal method to read a 'gray' value.

Tags:

  • return - the gray or color value at the given location
  • access - protected

Parameters:

  • string $blob - the blob that holds the pixel data
  • integer $current_position - the current position in the string to read
  • integet $bytes_to_read - the number of bytes to read

[ Top ]

_read_image_blob

mixed _read_image_blob( string $string)

[line 633]

Internal method to read image from blob (string)

Tags:

  • return - an instance of the image based on library (driver), false on failure
  • access - protected

Parameters:

  • string $string - the binary data to be read

[ Top ]

_set_pixel

boolean _set_pixel( resource &$image, integer $x, integer $y, integer $color)

[line 695]

Internal method to set a pixel into the existing image object instance

Tags:

  • return - true on success, false on failure
  • access - protected

Parameters:

  • resource &$image - the image object instance
  • integer $x - the x position
  • integer $y - the y position
  • integer $color - the color to be set

[ Top ]


Class Constants


Documentation generated on Thu, 08 Sep 2011 17:22:24 -0700 by phpDocumentor 1.4.3