本文整理汇总了C++中MultiArray::reshape方法的典型用法代码示例。如果您正苦于以下问题:C++ MultiArray::reshape方法的具体用法?C++ MultiArray::reshape怎么用?C++ MultiArray::reshape使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MultiArray
的用法示例。
在下文中一共展示了MultiArray::reshape方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
// MAIN
int main(int argc, char** argv) {
if(argc != 3) {
std::cout << "usage: " << argv[0] << " infile.sif outfile" << std::endl << std::endl;
std::cout << "Converts one sif file to tiff stack" << std::endl;
return 2;
}
std::string infile = argv[1];
std::string outfile = argv[2];
try
{
MultiArray<3,float> in;
typedef MultiArray<3, float>::difference_type Shape;
int width, height, stacksize;
HDF5ImportInfo info(infile.c_str(), "/data");
width = info.shapeOfDimension(0);
height = info.shapeOfDimension(1);
stacksize = info.shapeOfDimension(2);
// create a 3D array of appropriate size
in.reshape(Shape(width,height,stacksize));
readHDF5(info, in); //Eingabe Bild
std::cout << "Images with Shape: " << Shape(width, height, stacksize) << std::endl;
std::cout << "Processing a stack of " << stacksize << " images..." << std::endl;
exportVolume(in, VolumeExportInfo(outfile.c_str(), ".tif"));
}
catch (vigra::StdException & e)
{
std::cout<<"There was an error:"<<std::endl;
std::cout << e.what() << std::endl;
return 1;
}
}