ImageDev

WriteArrayXd

Writes an ArrayXd object in a binary or text file.

Function Syntax

This function returns None.
// Function prototype
void writeArrayXd( std::shared_ptr<iolink::ArrayXd> inputArrayXd, std::string filePath, WriteArrayXd::WriteType writeType, bool overwrite );
This function returns None.
// Function prototype.
write_array_xd(input_array_xd: Union[idt.NDArrayFloat, None],
               file_path: str = "",
               write_type: WriteArrayXd.WriteType = WriteArrayXd.WriteType.BINARY,
               overwrite: bool = False) -> None
This function returns None.
// Function prototype.
public static void
WriteArrayXd( IOLink.ArrayXd inputArrayXd,
              String filePath = "",
              WriteArrayXd.WriteType writeType = ImageDev.WriteArrayXd.WriteType.BINARY,
              bool overwrite = false );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputArrayXd
The input ArrayXd object to write. ArrayXd nullptr
input
filePath
The file path where the ArrayXd is written. String ""
input
writeType
The type of writting.
The ArrayXd can be written as text or binary.
TEXT Writes as text.
BINARY Writes as binary.
Enumeration BINARY
input
overwrite
Allows the overwriting of an existing file. Bool false
Parameter Name Description Type Supported Values Default Value
input
input_array_xd
The input ArrayXd object to write. arrayXd nullptr
input
file_path
The file path where the ArrayXd is written. string ""
input
write_type
The type of writting.
The ArrayXd can be written as text or binary.
TEXT Writes as text.
BINARY Writes as binary.
enumeration BINARY
input
overwrite
Allows the overwriting of an existing file. bool False
Parameter Name Description Type Supported Values Default Value
input
inputArrayXd
The input ArrayXd object to write. ArrayXd nullptr
input
filePath
The file path where the ArrayXd is written. String ""
input
writeType
The type of writting.
The ArrayXd can be written as text or binary.
TEXT Writes as text.
BINARY Writes as binary.
Enumeration BINARY
input
overwrite
Allows the overwriting of an existing file. Bool false

Object Examples

std::shared_ptr< iolink::ArrayXd> surfaceMesh( new iolink::ArrayXd( { 0 } ) );
readArrayXd( std::string( IMAGEDEVDATA_OBJECTS_FOLDER ) + "surfaceMesh.arrayxd", surfaceMesh);

WriteArrayXd writeArrayXdAlgo;
writeArrayXdAlgo.setInputArrayXd( surfaceMesh );
writeArrayXdAlgo.setFilePath( "output_writeArrayXd.arrayxd" );
writeArrayXdAlgo.setWriteType( WriteArrayXd::WriteType::TEXT );
writeArrayXdAlgo.setOverwrite( true );
writeArrayXdAlgo.execute();
surface_mesh = np.zeros(0, dtype=np.double)
surface_mesh = imagedev.read_array_xd(imagedev_data.get_object_path("surfaceMesh.arrayxd"), surface_mesh)

write_array_xd_algo = imagedev.WriteArrayXd()
write_array_xd_algo.input_array_xd = surface_mesh
write_array_xd_algo.file_path = "output_writeArrayXd.arrayxd"
write_array_xd_algo.write_type = imagedev.WriteArrayXd.TEXT
write_array_xd_algo.overwrite = True
write_array_xd_algo.execute()
IOLink.ArrayXd surfaceMesh = new IOLink.ArrayXd(new IOLink.VectorXu64( 0 ) ) ;
surfaceMesh = Data.ReadArrayXd( @"Data/objects/surfaceMesh.arrayxd", surfaceMesh );

WriteArrayXd writeArrayXdAlgo = new WriteArrayXd
{
    inputArrayXd = surfaceMesh,
    filePath = "output_writeArrayXd.arrayxd",
    writeType = WriteArrayXd.WriteType.TEXT,
    overwrite = true
};
writeArrayXdAlgo.Execute();

Function Examples

std::shared_ptr< iolink::ArrayXd> surfaceMesh( new iolink::ArrayXd( { 0 } ) );
readArrayXd( std::string( IMAGEDEVDATA_OBJECTS_FOLDER ) + "surfaceMesh.arrayxd", surfaceMesh);

writeArrayXd( surfaceMesh, "output_writeArrayXd.arrayxd", WriteArrayXd::WriteType::TEXT, true );
surface_mesh = np.zeros(0, dtype=np.double)
surface_mesh = imagedev.read_array_xd(imagedev_data.get_object_path("surfaceMesh.arrayxd"), surface_mesh)

imagedev.write_array_xd(surface_mesh, "output_writeArrayXd.arrayxd", imagedev.WriteArrayXd.TEXT, True)
IOLink.ArrayXd surfaceMesh = new IOLink.ArrayXd(new IOLink.VectorXu64( 0 ) ) ;
surfaceMesh = Data.ReadArrayXd( @"Data/objects/surfaceMesh.arrayxd", surfaceMesh );

Data.WriteArrayXd( surfaceMesh, "output_writeArrayXd.arrayxd", WriteArrayXd.WriteType.TEXT, true );