Skip to content

Commit 17220a5

Browse files
committed
Remove LaueOps::generateMisorientationColors due to licensing.
Original author LPGL the original code which was copied into this repository by accident. Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
1 parent 5dfb133 commit 17220a5

24 files changed

+9
-1815
lines changed

Source/EbsdLib/LaueOps/CubicLowOps.cpp

Lines changed: 0 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,128 +1135,6 @@ EbsdLib::UInt8ArrayType::Pointer CubicLowOps::generateIPFTriangleLegend(int imag
11351135
return image;
11361136
}
11371137

1138-
// -----------------------------------------------------------------------------
1139-
//
1140-
// -----------------------------------------------------------------------------
1141-
EbsdLib::Rgb CubicLowOps::generateMisorientationColor(const QuatD& q, const QuatD& refFrame) const
1142-
{
1143-
throw std::out_of_range("generateMisorientationColor::generateMisorientationColor NOT Implemented");
1144-
1145-
// double n1, n2, n3, w;
1146-
double x, x1, x2, x3, x4;
1147-
double y, y1, y2, y3, y4;
1148-
double z, z1, z2, z3, z4;
1149-
double k, h, s, v, c, r, g, b;
1150-
1151-
QuatD q1 = q;
1152-
QuatD q2 = refFrame;
1153-
1154-
OrientationD axisAngle = calculateMisorientation(q1, q2);
1155-
1156-
// eq c7.1
1157-
k = tan(axisAngle[3] / 2.0);
1158-
x = axisAngle[0];
1159-
y = axisAngle[1];
1160-
z = axisAngle[2];
1161-
OrientationType rod(x, y, z, k);
1162-
rod = getMDFFZRod(rod);
1163-
x = rod[0];
1164-
y = rod[1];
1165-
z = rod[2];
1166-
k = rod[3];
1167-
1168-
// eq c7.2
1169-
k = atan2(y, x);
1170-
if(k < M_PI_4)
1171-
{
1172-
x1 = z;
1173-
y1 = x;
1174-
z1 = y;
1175-
}
1176-
else
1177-
{
1178-
x1 = y;
1179-
y1 = z;
1180-
z1 = x;
1181-
}
1182-
1183-
// eq c7.3
1184-
// 3 rotation matricies (in paper) can be multiplied into one (here) for simplicity / speed
1185-
// g1*g2*g3 = {{sqrt(2/3), 0, 1/sqrt(3)},{-1/sqrt(6), 1/sqrt(2), 1/sqrt(3)},{-1/sqrt(6), 1/sqrt(2), 1/sqrt(3)}}
1186-
x2 = x1 * sqrt(2.0f / 3.0) - (y1 + z1) / sqrt(6.0);
1187-
y2 = (y1 - z1) / sqrt(2.0);
1188-
z2 = (x1 + y1 + z1) / sqrt(3.0);
1189-
1190-
// eq c7.4
1191-
k = (sqrt(3.0) * y2 + x2) / (2.0f * pow(x2 * x2 + y2 * y2, 1.5f));
1192-
x3 = x2 * (x2 + sqrt(3.0) * y2) * (x2 - sqrt(3.0) * y2) * k;
1193-
y3 = y2 * (y2 + sqrt(3.0) * x2) * (sqrt(3.0) * x2 - y2) * k;
1194-
z3 = z2 * sqrt(3.0);
1195-
1196-
// eq c7.5 these hsv are from 0 to 1 in cartesian coordinates
1197-
x4 = -x3;
1198-
y4 = -y3;
1199-
z4 = z3;
1200-
1201-
// convert to traditional hsv (0-1)
1202-
h = fmod(atan2(y4, x4) + 2.0f * M_PI, 2.0f * M_PI) / (2.0f * M_PI);
1203-
s = sqrt(x4 * x4 + y4 * y4);
1204-
v = z4;
1205-
if(v > 0)
1206-
{
1207-
s = s / v;
1208-
}
1209-
1210-
// hsv to rgb (from wikipedia hsv/hsl page)
1211-
c = v * s;
1212-
k = c * (1 - fabs(fmod(h * 6, 2) - 1)); // x in wiki article
1213-
h = h * 6;
1214-
r = 0;
1215-
g = 0;
1216-
b = 0;
1217-
1218-
if(h >= 0)
1219-
{
1220-
if(h < 1)
1221-
{
1222-
r = c;
1223-
g = k;
1224-
}
1225-
else if(h < 2)
1226-
{
1227-
r = k;
1228-
g = c;
1229-
}
1230-
else if(h < 3)
1231-
{
1232-
g = c;
1233-
b = k;
1234-
}
1235-
else if(h < 4)
1236-
{
1237-
g = k;
1238-
b = c;
1239-
}
1240-
else if(h < 5)
1241-
{
1242-
r = k;
1243-
b = c;
1244-
}
1245-
else if(h < 6)
1246-
{
1247-
r = c;
1248-
b = k;
1249-
}
1250-
}
1251-
1252-
// adjust lumosity and invert
1253-
r = (r + (v - c));
1254-
g = (g + (v - c));
1255-
b = (b + (v - c));
1256-
1257-
return EbsdLib::RgbColor::dRgb(static_cast<int32_t>(r * 255), static_cast<int32_t>(g * 255), static_cast<int32_t>(b * 255), 255);
1258-
}
1259-
12601138
// -----------------------------------------------------------------------------
12611139
CubicLowOps::Pointer CubicLowOps::NullPointer()
12621140
{

Source/EbsdLib/LaueOps/CubicLowOps.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,6 @@ class EbsdLib_EXPORT CubicLowOps : public LaueOps
205205
*/
206206
EbsdLib::Rgb generateRodriguesColor(double r1, double r2, double r3) const override;
207207

208-
/**
209-
* @brief generateMisorientationColor Generates a color based on the method developed by C. Schuh and S. Patala.
210-
* @param q Quaternion representing the direction
211-
* @param refDir The sample reference direction
212-
* @return Returns the ARGB Quadruplet EbsdLib::Rgb
213-
*/
214-
EbsdLib::Rgb generateMisorientationColor(const QuatD& q, const QuatD& refFrame) const override;
215-
216208
/**
217209
* @brief generatePoleFigure This method will generate a number of pole figures for this crystal symmetry and the Euler
218210
* angles that are passed in.

0 commit comments

Comments
 (0)