Skip to content

Commit 4c85341

Browse files
committed
BUG: AngReader - only fixOrderData on square grids?
Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
1 parent 7d87e2c commit 4c85341

File tree

3 files changed

+40
-38
lines changed

3 files changed

+40
-38
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
1515
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
1616

1717
# set project's name
18-
project(EbsdLibProj VERSION 1.0.25)
18+
project(EbsdLibProj VERSION 1.0.26)
1919

2020
# ---------- Setup output Directories -------------------------
2121
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY

Source/EbsdLib/IO/TSL/AngReader.cpp

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -406,27 +406,26 @@ int AngReader::readFile()
406406
setErrorMessage(result.second);
407407
return result.first;
408408
}
409-
}
410-
411-
std::vector<std::string> arrayNames = {"Phi1", "Phi", "Phi2", "X Position", "Y Position", "Image Quality", "Confidence Index", "PhaseData", "SEM Signal", "Fit"};
412-
for(const auto& arrayName : arrayNames)
413-
{
414-
void* oldArray = getPointerByName(arrayName);
415409

416-
if(getPointerType(arrayName) == EbsdLib::NumericTypes::Type::Float)
417-
{
418-
CopyTupleUsingIndexList<float>(oldArray, indexMap);
419-
}
420-
else if(getPointerType(arrayName) == EbsdLib::NumericTypes::Type::Int32)
410+
std::vector<std::string> arrayNames = {"Phi1", "Phi", "Phi2", "X Position", "Y Position", "Image Quality", "Confidence Index", "PhaseData", "SEM Signal", "Fit"};
411+
for(const auto& arrayName : arrayNames)
421412
{
422-
CopyTupleUsingIndexList<int32_t>(oldArray, indexMap);
423-
}
424-
else
425-
{
426-
std::cout << "Type returned was not of Float or int32. The Array name probably isn't correct." << std::endl;
413+
void* oldArray = getPointerByName(arrayName);
414+
415+
if(getPointerType(arrayName) == EbsdLib::NumericTypes::Type::Float)
416+
{
417+
CopyTupleUsingIndexList<float>(oldArray, indexMap);
418+
}
419+
else if(getPointerType(arrayName) == EbsdLib::NumericTypes::Type::Int32)
420+
{
421+
CopyTupleUsingIndexList<int32_t>(oldArray, indexMap);
422+
}
423+
else
424+
{
425+
std::cout << "Type returned was not of Float or int32. The Array name probably isn't correct." << std::endl;
426+
}
427427
}
428428
}
429-
430429
return getErrorCode();
431430
}
432431

Source/EbsdLib/IO/TSL/H5OIMReader.cpp

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -169,33 +169,36 @@ int H5OIMReader::readFile()
169169
}
170170

171171
std::vector<int64_t> indexMap;
172-
std::pair<int, std::string> result = fixOrderOfData(indexMap);
173-
174-
if(result.first < 0)
175-
{
176-
std::cout << result.second << std::endl;
177-
return result.first;
178-
}
179-
180-
std::vector<std::string> arrayNames = {"Phi1", "Phi", "Phi2", "X Position", "Y Position", "Image Quality", "Confidence Index", "PhaseData", "SEM Signal", "Fit"};
181-
for(const auto& arrayName : arrayNames)
172+
std::string grid = getGrid();
173+
if(grid.find(EbsdLib::Ang::SquareGrid) == 0)
182174
{
183-
void* oldArray = getPointerByName(arrayName);
175+
std::pair<int, std::string> result = fixOrderOfData(indexMap);
184176

185-
if(getPointerType(arrayName) == EbsdLib::NumericTypes::Type::Float)
186-
{
187-
CopyTupleUsingIndexList<float>(oldArray, indexMap);
188-
}
189-
else if(getPointerType(arrayName) == EbsdLib::NumericTypes::Type::Int32)
177+
if(result.first < 0)
190178
{
191-
CopyTupleUsingIndexList<int32_t>(oldArray, indexMap);
179+
std::cout << result.second << std::endl;
180+
return result.first;
192181
}
193-
else
182+
183+
std::vector<std::string> arrayNames = {"Phi1", "Phi", "Phi2", "X Position", "Y Position", "Image Quality", "Confidence Index", "PhaseData", "SEM Signal", "Fit"};
184+
for(const auto& arrayName : arrayNames)
194185
{
195-
std::cout << "Type returned was not of Float or int32. The Array name probably isn't correct." << std::endl;
186+
void* oldArray = getPointerByName(arrayName);
187+
188+
if(getPointerType(arrayName) == EbsdLib::NumericTypes::Type::Float)
189+
{
190+
CopyTupleUsingIndexList<float>(oldArray, indexMap);
191+
}
192+
else if(getPointerType(arrayName) == EbsdLib::NumericTypes::Type::Int32)
193+
{
194+
CopyTupleUsingIndexList<int32_t>(oldArray, indexMap);
195+
}
196+
else
197+
{
198+
std::cout << "Type returned was not of Float or int32. The Array name probably isn't correct." << std::endl;
199+
}
196200
}
197201
}
198-
199202
return getErrorCode();
200203
}
201204

0 commit comments

Comments
 (0)