Formatting NRRD fields
Format number to string |
|
Format a (N,) |
|
Format a (N,) |
|
Format a (N,) |
|
Format a (M,N) |
|
Format a (M,N) |
|
Format a |
|
Format a |
- nrrd.format_matrix(x: ndarray[tuple[int, ...], dtype[_ScalarType_co]]) str[source]
Format a (M,N)
numpy.ndarrayinto 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: ndarray[tuple[int, ...], dtype[_ScalarType_co]]) str[source]
Format a (N,)
numpy.ndarrayinto 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: Optional[ndarray[tuple[int, ...], dtype[_ScalarType_co]]]) str[source]
Format a (M,N)
numpy.ndarrayoffloatinto a NRRD optional matrix stringFunction converts a (M,N)
numpy.ndarrayoffloatinto 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
xmust have a datatype of float because NaN’s are only defined for floating point numbers.- Parameters
- x(M,N)
numpy.ndarrayoffloat Matrix to convert to NRRD vector string
- x(M,N)
- Returns
- matrix
str String containing NRRD matrix
- matrix
- nrrd.format_optional_vector(x: Optional[ndarray[tuple[int, ...], dtype[_ScalarType_co]]]) str[source]
Format a (N,)
numpy.ndarrayinto a NRRD optional vector stringFunction converts a (N,)
numpy.ndarrayorNoneinto a string using NRRD vector format. If the inputxisNone, thenvectorwill be ‘none’See int vector and double vector for more information on the format.
- Parameters
- x(N,)
numpy.ndarrayorNone Vector to convert to NRRD vector string
- x(N,)
- Returns
- vector
str String containing NRRD vector
- vector
- nrrd.format_optional_vector_list(x: List[Optional[ndarray[tuple[int, ...], dtype[_ScalarType_co]]]]) str[source]
Format a
listof (N,)numpy.ndarrayorNoneinto a NRRD optional vector list stringFunction converts a
listof (N,)numpy.ndarrayorNoneinto a string using the NRRD vector list format.See int vector list and double vector list for more information on the format.
- Parameters
- x
listof (N,)numpy.ndarrayorNone Vector list to convert to NRRD vector list string
- x
- Returns
- vector_list
str String containing NRRD vector list
- vector_list
- nrrd.format_vector(x: ndarray[tuple[int, ...], dtype[_ScalarType_co]]) str[source]
Format a (N,)
numpy.ndarrayinto 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
- nrrd.format_vector_list(x: List[ndarray[tuple[int, ...], dtype[_ScalarType_co]]]) str[source]
Format a
listof (N,)numpy.ndarrayinto a NRRD vector list stringSee int vector list and double vector list for more information on the format.
- Parameters
- x
listof (N,)numpy.ndarray Vector list to convert to NRRD vector list string
- x
- Returns
- vector_list
str String containing NRRD vector list
- vector_list