コード例 #1
0
ファイル: PhToHDF5.cpp プロジェクト: kglowins/DREAM3D
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
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;
}
コード例 #2
0
ファイル: PhToHDF5.cpp プロジェクト: tuks188/DREAM3D
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
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;
}
コード例 #3
0
ファイル: PhToHDF5.cpp プロジェクト: kglowins/DREAM3D
/**
 *
 * @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;
}
コード例 #4
0
ファイル: PhToHDF5.cpp プロジェクト: tuks188/DREAM3D
/**
 *
 * @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;
}