Formatting NRRD fields
Format number to string |
|
Format a (N,) |
|
Format a (N,) |
|
Format a (N,) |
|
Format a (M,N) |
|
Format a (M,N) |
- nrrd.format_matrix(x: ~nptyping.base_meta_classes.NDArray[~nptyping.base_meta_classes.Shape[*, *], ~typing.Any]) str [source]
Format a (M,N)
numpy.ndarray
into a NRRD matrix stringSee int matrix and double matrix for more information on the format.
- Parameters
- x(M,N)
numpy.ndarray
Matrix to convert to NRRD vector string
- x(M,N)
- Returns
- matrix
str
String containing NRRD matrix
- matrix
- nrrd.format_number(x: Union[int, float]) str [source]
Format number to string
Function converts a number to string. For numbers of class
float
, up to 17 digits will be used to print the entire floating point number. Any padding zeros will be removed at the end of the number.See int and double for more information on the format.
Note
IEEE754-1985 standard says that 17 significant decimal digits are required to adequately represent a 64-bit floating point number. Not all fractional numbers can be exactly represented in floating point. An example is 0.1 which will be approximated as 0.10000000000000001.
- nrrd.format_number_list(x: ~nptyping.base_meta_classes.NDArray[~nptyping.base_meta_classes.Shape[*], ~typing.Any]) str [source]
Format a (N,)
numpy.ndarray
into a NRRD number list.See int list and double list for more information on the format.
- Parameters
- x(N,)
numpy.ndarray
Vector to convert to NRRD number list string
- x(N,)
- Returns
- list
str
String containing NRRD list
- list
- nrrd.format_optional_matrix(x: ~typing.Optional[~nptyping.base_meta_classes.NDArray[~nptyping.base_meta_classes.Shape[*, *], ~typing.Any]]) str [source]
Format a (M,N)
numpy.ndarray
offloat
into a NRRD optional matrix stringFunction converts a (M,N)
numpy.ndarray
offloat
into a string using the NRRD matrix format. For any rows of the matrix that contain all NaNs for each element, the row will be replaced with a ‘none’ indicating the row has no vector.See double matrix for more information on the format.
Note
x
must have a datatype of float because NaN’s are only defined for floating point numbers.- Parameters
- x(M,N)
numpy.ndarray
offloat
Matrix to convert to NRRD vector string
- x(M,N)
- Returns
- matrix
str
String containing NRRD matrix
- matrix
- nrrd.format_optional_vector(x: ~typing.Optional[~nptyping.base_meta_classes.NDArray[~nptyping.base_meta_classes.Shape[*], ~typing.Any]]) str [source]
Format a (N,)
numpy.ndarray
into a NRRD optional vector stringFunction converts a (N,)
numpy.ndarray
orNone
into a string using NRRD vector format. If the inputx
isNone
, thenvector
will be ‘none’See int vector and double vector for more information on the format.
- Parameters
- x(N,)
numpy.ndarray
orNone
Vector to convert to NRRD vector string
- x(N,)
- Returns
- vector
str
String containing NRRD vector
- vector
- nrrd.format_vector(x: ~nptyping.base_meta_classes.NDArray[~nptyping.base_meta_classes.Shape[*], ~typing.Any]) str [source]
Format a (N,)
numpy.ndarray
into a NRRD vector stringSee int vector and double vector for more information on the format.
- Parameters
- x(N,)
numpy.ndarray
Vector to convert to NRRD vector string
- x(N,)
- Returns
- vector
str
String containing NRRD vector
- vector