#include <iostream>
using namespace OdimH5v20;
int main(int argc, char* argv[])
{
if (argc != 2)
{
std::cout << "Usage: " << argv[0] << " <odimh5file>" << std::endl;
return -1;
}
std::set<std::string> quantities;
try
{
volume->
getHow()->
set(
"attributo intero inventato", (
int)100);
volume->
getHow()->
set(
"attributo stringa inventato",
"valore stringa inventato");
for (int s=0; s<10; s++)
{
const int NUMBINS = 1;
const int NUMRAYS = 1;
scan->
getWhat()->
set(
"attributo intero inventato", (
int)100);
scan->
getWhat()->
set(
"attributo stringa inventato",
"valore stringa inventato");
for (std::set<std::string>::iterator i=quantities.begin(); i!=quantities.end(); i++)
{
std::string quantityName = *i;
data->
getWhat()->
set(
"attributo intero inventato", (
int)100);
data->
getWhat()->
set(
"attributo stringa inventato",
"valore stringa inventato");
for (int i=0; i<NUMRAYS; i++)
for (int j=0; j<NUMBINS; j++)
matrixW.
elem(i,j) = 65 + ((i * j) % 120);
delete data;
double offset = 123.456;
double gain = (NUMRAYS * NUMBINS * 0.5 - offset) / 256.;
data2->
getWhat()->
set(
"attributo intero inventato", (
int)100);
data2->
getWhat()->
set(
"attributo stringa inventato",
"valore stringa inventato");
for (int i=0; i<NUMRAYS; i++)
for (int j=0; j<NUMBINS; j++)
matrixV.
elem(i,j) = (float)(i * j * 0.5 + offset);
data2->
writeAndTranslate(matrixV, (
float)offset, (
float)gain, H5::PredType::NATIVE_UINT8);
delete data2;
}
delete scan;
}
std::cout << "Esecuzione terminata" << std::endl;
}
catch (std::exception& stde)
{
std::cerr << "Errore di esecuzione: " << stde.what() << std::endl;
}
catch (...)
{
std::cerr << "Errore sconociuto" << std::endl;
}
delete dumper;
delete volume;
delete factory;
return 0;
}