Example #1
0
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int writeEulerDataToHDF5File(const QString& h5File, QVector<float>& data, int numComp, int32_t rank, hsize_t* dims)
{
  int err = 0;
  err = openHDF5File(h5File, true);

  err = writeScalarData(DREAM3D::Defaults::DataContainerName, data, DREAM3D::CellData::EulerAngles, numComp, rank, dims);
  if (err < 0)
  {
    qDebug() << "Error Writing Scalars '" << DREAM3D::CellData::EulerAngles << "' to " << DREAM3D::Defaults::DataContainerName;
    return err;
  }
  // Close the file when we are done with it.
  err = closeHDF5File();

  return err;
}
Example #2
0
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
int writeEulerDataToHDF5File(const std::string &h5File, std::vector<float> &data, int numComp, int32_t rank, hsize_t* dims)
{
  int err = 0;
  err = openHDF5File(h5File, true);

  err = writeScalarData(DREAM3D::HDF5::VoxelDataContainerName, data, DREAM3D::CellData::EulerAngles.c_str(), numComp, rank, dims);
  if (err < 0)
  {
    std::cout << "Error Writing Scalars '" << DREAM3D::CellData::EulerAngles.c_str() << "' to " << DREAM3D::HDF5::VoxelDataContainerName << std::endl;
    return err;
  }
  // Close the file when we are done with it.
  err = closeHDF5File();

  return err;
}
Example #3
0
/**
 *
 * @param h5File
 * @param data
 * @param nx
 * @param ny
 * @param nz
 * @return
 */
int writePhDataToHDF5File(const QString& h5File, QVector<int>& data, int& nx, int& ny, int& nz)
{
  int err = 0;
  err = openHDF5File(h5File, true);

  int totalPoints = nx * ny * nz;
  int32_t rank = 1;
  hsize_t dims[1] =
  { totalPoints };

  int numComp = 1;
  err = writeScalarData(DREAM3D::Defaults::DataContainerName, data, DREAM3D::CellData::FeatureIds, numComp, rank, dims);
  if (err < 0)
  {
    qDebug() << "Error Writing Scalars '" << DREAM3D::CellData::FeatureIds << "' to " << DREAM3D::Defaults::DataContainerName;
    return err;
  }
  // Close the file when we are done with it.
  err = closeHDF5File();
  return err;
}
Example #4
0
/**
 *
 * @param h5File
 * @param data
 * @param nx
 * @param ny
 * @param nz
 * @return
 */
int writePhDataToHDF5File(const std::string &h5File, std::vector<int> &data, int &nx, int &ny, int &nz)
{
  int err = 0;
  err = openHDF5File(h5File, true);

  int totalPoints = nx * ny * nz;
  int32_t rank = 1;
  hsize_t dims[1] =
  { totalPoints };

  int numComp = 1;
  err = writeScalarData(DREAM3D::HDF5::VoxelDataContainerName, data, DREAM3D::CellData::GrainIds.c_str(), numComp, rank, dims);
  if (err < 0)
  {
    std::cout << "Error Writing Scalars '" << DREAM3D::CellData::GrainIds.c_str() << "' to " << DREAM3D::HDF5::VoxelDataContainerName << std::endl;
    return err;
  }
  // Close the file when we are done with it.
  err = closeHDF5File();
  return err;
}