You are reading the documentation for version 2.4 of OpenStructure. You may also want to read the documentation for:
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.7.1
1.8
1.9
1.10
1.11
2.0
2.1
2.2
2.3
2.3.1
devel
|
Type: | Vec3 |
---|
spatial_origin
¶The spatial origin of an image is the first pixel of its extent. Specifically, this is the top left pixel for 2D images and the top-front-left corner for 3Dimages.
Type: | Point |
---|
domain
¶The current domain of the image. See The data domain. Read-only.
Apply
(algorithm)¶Applies an algorithm on an image and returns a new ImageHandle containing the modified image. See img.alg - Image Processing Algorithms
Parameters: | algorithm (Instance of an algorithm class - See img.alg - Image Processing Algorithms.) – algorithm |
---|---|
Return type: | ImageHandle |
ApplyIP
(algorithm)¶Applies an algorithm on an image, overwriting the current content. See :doc:../alg/alg`
Parameters: | algorithm (Instance of an algorithm class - See: doc:../alg/alg.) – algorithm |
---|
CenterSpatialOrigin
()¶Sets the The spatial origin of an image in such a way that the central pixel has all 0 indexes, e.g. (0,0) or (0,0,0) for 3d images.
CoordToIndex
(coord)¶Returns the indexes of an image corresponding to the specified absolute coordinates. (See The absolute origin). A given set of absolute coordinates will almost never fall exactly at the center of a pixel, so this method return fractional indexes.
Parameters: | coord (Vec3 ) – Absolute coordinates |
---|---|
Return type: | Vec3 |
Copy
()¶Creates a and returns a copy of the ImageHandle. The new handle does not point to the same underlying data as the old one, but to a complete and separate copy of the original data.
Return type: | ImageHandle |
---|
Extract
(extent)¶Creates and returns a new image that contains a copy of a portion of the
original image. The extracted image keeps the same The data domain of
the original image, but extractions from images in the ‘FREQUENCY’ or
‘HALF FREQUENCY’ domains result in COMPLEX ` :obj:`SPATIAL
images.
This transformation is necessary, since the there is no guarantee that the
extracted FREQUENCY
sub-image is centered around the origin and
hence back-transformable to SPATIAL
.
Parameters: | extent (Extent ) – Portion of the image to extract |
---|---|
Return type: | ImageHandle |
FractionalIndexToCoord
(frac_pixel)¶Same as IndexToCoord()
, but introduces subpixel precision by
accepting fractional numbers for pixel indexes.
Parameters: | frac_pixel (Vec3 ) – Fractional pixel indexes |
---|---|
Return type: | Vec3 |
GetAbsoluteOrigin
()¶Returns the The absolute origin of an image
Return type: | Vec3 |
---|
GetComplex
(pixel)¶Returns the complex value of the specified image pixel. If the image holds data of the ‘REAL’ The data domain, the method return s complex value with the pixel content as real part and a null imaginary part.
Parameters: | pixel (Point ) – Image pixel |
---|---|
Return type: | complex |
GetFrequencySampling
()¶Returns the Pixel sampling of the image in the FREQUENCY
The data domain
Return type: | Vec3 |
---|
GetIntpolComplex
(frac_pixel)¶Returns the interpolated complex value of the virtual pixel corresponding to the specified fractional indexes. This is computed by calculating a weighted vector sum of the values of the surrounding pixels. If the image holds data of the ‘REAL’ The data domain, the method computes the interpolated value using bilinear interpolation (trilinear for 3D images), then returns a complex value with the interpolated value as real part and a null imaginary part.
Parameters: | frac_pixel (Vec3 ) – Fractional pixel indexes |
---|---|
Return type: | complex |
GetIntpolReal
(frac_pixel)¶Returns the interpolated value of the virtual pixel corresponding to the
specified fractional indexes. This is computed by using bilinear
interpolation (trilinear for 3D images). If the image holds data of the
COMPLEX ` :ref:`data-domain
, the method computes the interpolated
value as a weighted vector sum of the values of the surrounding pixels,
then returns the amplitude of the interpolated value.
Parameters: | frac_pixel (Vec3 ) – Fractional pixel indexes |
---|---|
Return type: | float |
GetPixelSampling
()¶Returns the Pixel sampling of the image in the current The data domain.
Return type: | Vec3 |
---|
GetReal
(pixel)¶Returns the value of the specified image pixel. If the image holds data of
the COMPLEX ` :ref:`data-domain
, the method return the amplitude of
the pixel content.
Parameters: | pixel (Point ) – Image pixel |
---|---|
Return type: | float |
GetSpatialOrigin
()¶Returns the The spatial origin of the image.
Return type: | Point |
---|
GetSpatialSampling
()¶Return the Pixel sampling of the image in the SPATIAL
The data domain.
Return type: | Vec3 |
---|
GetType
()¶Returns the The data domain of the image (REAL
or COMPLEX
)
Return type: | DataType ??????????? |
---|
IndexToCoord
(pixel)¶Returns the absolute coordinates (See The absolute origin) corresponding
to the pixel with the specified indexes. Please note this method always
returns the coordinates corresponding to the center of the pixel. When
sub-pixel precision is needed, the method FractionalIndexToCoord()
can be used.
Parameters: | pixel (Point ) – |
---|---|
Return type: | Vec3 |
IsFrequency
()¶Returns true if the The data domain of the image is FREQUENCY or HALF-FREQUENCY
Return type: | bool |
---|
IsSpatial
()¶Returns true if the The data domain of the image is SPATIAL
.
Return type: | bool |
---|
IsValid
()¶Returns true, when the image handle is valid, false if not. It is an error to call any method on the image handle other than IsValid when this method returns false.
Return type: | bool |
---|
Paste
(source_image)¶Copies the content of a different image into the current one, overwriting
pre-existing data . The values of pixels with given indexes in the source
image are copied into pixels with the same indexes in the target image. If
the two images have different extents (see Extent
), pixels that do
not exist in both are ignored. Please notice that this method only copies
the pixel content: all other properties of the image are left untouched.
Parameters: | source_image (ImageHandle ) – Source image that gets pasted into the current one |
---|
SetAbsoluteOrigin
(coord)¶Sets the The absolute origin of the image to the specified coordinates
Parameters: | coord (Vec3 ) – Absolute coordinates |
---|
SetComplex
(pixel, value)¶Sets the content of the specified pixel to the provided value. If the image holds data of the ‘REAL’ The data domain, the method sets the pixel to the amplitude of the provided. value.
Parameters: |
|
---|
SetPixelSampling
(sampling)¶Sets the Pixel sampling of the image to the provided values in the current The data domain.
Parameters: | sampling (Vec3 ) – Size of a pixel in x,y and z direction respectively |
---|
SetReal
(pixel, value)¶Sets the content of the specified pixel to the provided value. If the
image holds data of the COMPLEX
The data domain, the method sets
the pixel to a value has a real part equal to the provided value and a null
complex part.
Parameters: |
|
---|
SetSpatialOrigin
(pixel_indexes)¶Sets the The spatial origin of the image to the provided indexes.
Parameters: | pixel_indexes (Point ) – Indexes of the first pixel of the image |
---|---|
Return type: | None |
SetSpatialSampling
(sampl)¶Sets the Pixel sampling if the image to the provided values in the spatial The data domain
Parameters: | sampl (Vec3 ) – Size of a pixel in x,y and z direction respectively |
---|
Enter search terms or a module, class or function name.
img
- Images and Density Maps