Skip to content

Commit

Permalink
BUG: AngReader - only fixOrderData on square grids?
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
  • Loading branch information
imikejackson committed Oct 3, 2023
1 parent 7d87e2c commit 4c85341
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 38 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# set project's name
project(EbsdLibProj VERSION 1.0.25)
project(EbsdLibProj VERSION 1.0.26)

# ---------- Setup output Directories -------------------------
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY
Expand Down
33 changes: 16 additions & 17 deletions Source/EbsdLib/IO/TSL/AngReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,27 +406,26 @@ int AngReader::readFile()
setErrorMessage(result.second);
return result.first;
}
}

std::vector<std::string> arrayNames = {"Phi1", "Phi", "Phi2", "X Position", "Y Position", "Image Quality", "Confidence Index", "PhaseData", "SEM Signal", "Fit"};
for(const auto& arrayName : arrayNames)
{
void* oldArray = getPointerByName(arrayName);

if(getPointerType(arrayName) == EbsdLib::NumericTypes::Type::Float)
{
CopyTupleUsingIndexList<float>(oldArray, indexMap);
}
else if(getPointerType(arrayName) == EbsdLib::NumericTypes::Type::Int32)
std::vector<std::string> arrayNames = {"Phi1", "Phi", "Phi2", "X Position", "Y Position", "Image Quality", "Confidence Index", "PhaseData", "SEM Signal", "Fit"};
for(const auto& arrayName : arrayNames)
{
CopyTupleUsingIndexList<int32_t>(oldArray, indexMap);
}
else
{
std::cout << "Type returned was not of Float or int32. The Array name probably isn't correct." << std::endl;
void* oldArray = getPointerByName(arrayName);

if(getPointerType(arrayName) == EbsdLib::NumericTypes::Type::Float)
{
CopyTupleUsingIndexList<float>(oldArray, indexMap);
}
else if(getPointerType(arrayName) == EbsdLib::NumericTypes::Type::Int32)
{
CopyTupleUsingIndexList<int32_t>(oldArray, indexMap);
}
else
{
std::cout << "Type returned was not of Float or int32. The Array name probably isn't correct." << std::endl;
}
}
}

return getErrorCode();
}

Expand Down
43 changes: 23 additions & 20 deletions Source/EbsdLib/IO/TSL/H5OIMReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,33 +169,36 @@ int H5OIMReader::readFile()
}

std::vector<int64_t> indexMap;
std::pair<int, std::string> result = fixOrderOfData(indexMap);

if(result.first < 0)
{
std::cout << result.second << std::endl;
return result.first;
}

std::vector<std::string> arrayNames = {"Phi1", "Phi", "Phi2", "X Position", "Y Position", "Image Quality", "Confidence Index", "PhaseData", "SEM Signal", "Fit"};
for(const auto& arrayName : arrayNames)
std::string grid = getGrid();
if(grid.find(EbsdLib::Ang::SquareGrid) == 0)
{
void* oldArray = getPointerByName(arrayName);
std::pair<int, std::string> result = fixOrderOfData(indexMap);

if(getPointerType(arrayName) == EbsdLib::NumericTypes::Type::Float)
{
CopyTupleUsingIndexList<float>(oldArray, indexMap);
}
else if(getPointerType(arrayName) == EbsdLib::NumericTypes::Type::Int32)
if(result.first < 0)
{
CopyTupleUsingIndexList<int32_t>(oldArray, indexMap);
std::cout << result.second << std::endl;
return result.first;
}
else

std::vector<std::string> arrayNames = {"Phi1", "Phi", "Phi2", "X Position", "Y Position", "Image Quality", "Confidence Index", "PhaseData", "SEM Signal", "Fit"};
for(const auto& arrayName : arrayNames)
{
std::cout << "Type returned was not of Float or int32. The Array name probably isn't correct." << std::endl;
void* oldArray = getPointerByName(arrayName);

if(getPointerType(arrayName) == EbsdLib::NumericTypes::Type::Float)
{
CopyTupleUsingIndexList<float>(oldArray, indexMap);
}
else if(getPointerType(arrayName) == EbsdLib::NumericTypes::Type::Int32)
{
CopyTupleUsingIndexList<int32_t>(oldArray, indexMap);
}
else
{
std::cout << "Type returned was not of Float or int32. The Array name probably isn't correct." << std::endl;
}
}
}

return getErrorCode();
}

Expand Down

0 comments on commit 4c85341

Please sign in to comment.