Class MapReader
Class for reading and writing 3D-map files.
Inheritance
Inherited Members
Namespace: CoreLibrary
Assembly: CoreLibrary.dll
Syntax
public class MapReader
Methods
DeleteStack(String, String, Boolean)
Delete written stacks from harddrive.
Declaration
public static void DeleteStack(string filepath, string template, bool multifile)
Parameters
Type | Name | Description |
---|---|---|
System.String | filepath | Filepath to the deleted file. |
System.String | template | Template for stack written in multiple files. |
System.Boolean | multifile | Is the stack in multiple files. |
Exceptions
Type | Condition |
---|---|
StackDeleteException | Thrown when failed to delete stack |
MakeImgSeqTemplateGuess(String)
Makes a guess what image sequence template name could be from the file name.
Declaration
public static string MakeImgSeqTemplateGuess(string filepath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filepath | Filepath of some picture of the image sequence stack. |
Returns
Type | Description |
---|---|
System.String | Guess for the image sequence filename template. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when failed to guess template name |
System.IO.IOException | Thrown when failed to do IO operations to the image sequence file |
MakeRawXStack(String, String, String, Int32, Int32, Int32, Int32)
Makes a new stack from the original raw stack that is Y-axel oriented and writes it to harddrive.
Declaration
public static void MakeRawXStack(string filepath, string destinationPath, string xStackName, int heigth, int width, int z, int byteDepth)
Parameters
Type | Name | Description |
---|---|---|
System.String | filepath | Path to original stack. |
System.String | destinationPath | Path to new stack, if "" will be put in a new folder in the same filepath as the original stack. |
System.String | xStackName | Name of the new stack file, if "" will be the same name as original + y. |
System.Int32 | heigth | Heigth of the raw file. |
System.Int32 | width | Width of the raw file. |
System.Int32 | z | Depth of the stack. |
System.Int32 | byteDepth | How many bytes represents 1 pixel. |
Exceptions
Type | Condition |
---|---|
StackWriteException | Thrown when failed to write stack |
MakeRawYStack(String, String, String, Int32, Int32, Int32, Int32)
Makes a new stack from the original raw stack that is Y-axel oriented and writes it to harddrive.
Declaration
public static void MakeRawYStack(string filepath, string destinationPath, string yStackName, int heigth, int width, int z, int byteDepth)
Parameters
Type | Name | Description |
---|---|---|
System.String | filepath | Path to original stack. |
System.String | destinationPath | Path to new stack, if "" will be put in a new folder in the same filepath as the original stack. |
System.String | yStackName | Name of the new stack file, if "" will be the same name as original + y. |
System.Int32 | heigth | Heigth of the raw file. |
System.Int32 | width | Width of the raw file. |
System.Int32 | z | Depth of the stack. |
System.Int32 | byteDepth | How many bytes represents 1 pixel. |
Exceptions
Type | Condition |
---|---|
StackWriteException | Thrown when failed to write stack |
MakeSeqXStack(String, String, String, String)
Makes a new stack from the original stack that is X-axel oriented and writes it to harddrive.
Declaration
public static void MakeSeqXStack(string filepath, string template, string destinationPath, string xStackName)
Parameters
Type | Name | Description |
---|---|---|
System.String | filepath | Path to the original stack. |
System.String | template | Template to filter files from the folder. |
System.String | destinationPath | Where the program writes the stack. |
System.String | xStackName | Template name for the written image files. |
Exceptions
Type | Condition |
---|---|
StackWriteException | Thrown when failed to write stack |
MakeSeqYStack(String, String, String, String)
Makes a new stack from the original stack that is Y-axel oriented and writes it to harddrive.
Declaration
public static void MakeSeqYStack(string filepath, string template, string destinationPath, string yStackName)
Parameters
Type | Name | Description |
---|---|---|
System.String | filepath | Path to the original stack. |
System.String | template | Template to filter files from the folder. |
System.String | destinationPath | Where the program writes the stack. |
System.String | yStackName | Template name for the written image files. |
Exceptions
Type | Condition |
---|---|
StackWriteException | Thrown when failed to write stack |
RawSlices(String, Int32, Int32, Int32)
Gets the stack size of raw data image stack.
Declaration
public static int RawSlices(string filepath, int width, int height, int byteDepth)
Parameters
Type | Name | Description |
---|---|---|
System.String | filepath | Location of the file. |
System.Int32 | width | Width of one image in the stack. |
System.Int32 | height | Heigth of one image in the stack. |
System.Int32 | byteDepth | How many bytes represents one pixel |
Returns
Type | Description |
---|---|
System.Int32 | Size of the raw stack. |
Read3Dtif(String, Int32)
Reads a 2D image from 3D tif file.
Declaration
public static MagickImage Read3Dtif(string filepath, int depth)
Parameters
Type | Name | Description |
---|---|---|
System.String | filepath | Filepath of the image. |
System.Int32 | depth | The depth of the 2D slice. |
Returns
Type | Description |
---|---|
MagickImage | A MagickImage object from the read file. |
Exceptions
Type | Condition |
---|---|
ImageReadException | Thrown when failed to read image |
ReadImgSeq(String, Int32, String)
Reads a 2D image from image sequence.
Declaration
public static MagickImage ReadImgSeq(string filepath, int depth, string template)
Parameters
Type | Name | Description |
---|---|---|
System.String | filepath | Location of the stack files. |
System.Int32 | depth | The depth of the 2D slice. |
System.String | template |
Returns
Type | Description |
---|---|
MagickImage | A MagickImage object from the read file. |
Exceptions
Type | Condition |
---|---|
ImageReadException | Thrown when failed to read image |
ReadRaw(String, Int32, Int32, Int32, Int32, Boolean)
Declaration
public static MagickImage ReadRaw(string filepath, int depth, int width, int height, int byteDepth, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
System.String | filepath | |
System.Int32 | depth | |
System.Int32 | width | |
System.Int32 | height | |
System.Int32 | byteDepth | |
System.Boolean | littleEndian |
Returns
Type | Description |
---|---|
MagickImage |
SequenceSlices(String, String)
Gets the stack size of image sequence.
Declaration
public static int SequenceSlices(string filepath, string template)
Parameters
Type | Name | Description |
---|---|---|
System.String | filepath | Path file to the sequence. |
System.String | template | Template for filtering. |
Returns
Type | Description |
---|---|
System.Int32 | How many slices there are. |
ThreeDTifSlices(String)
Gets the stack size of 3D tif stack.
Declaration
public static int ThreeDTifSlices(string filepath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filepath | Location of the file. |
Returns
Type | Description |
---|---|
System.Int32 | Size of the 3D tif stack. |