127 center(0) =
static_cast<float>(
width) / 2.0f;
128 center(1) =
static_cast<float>(
height) / 2.0f;
129 center(2) =
static_cast<float>(
depth) / 2.0f;
133 P0(0) =
c_ras[0] - (M(0, 0) * center(0) + M(0, 1) * center(1) + M(0, 2) * center(2));
134 P0(1) =
c_ras[1] - (M(1, 0) * center(0) + M(1, 1) * center(1) + M(1, 2) * center(2));
135 P0(2) =
c_ras[2] - (M(2, 0) * center(0) + M(2, 1) * center(1) + M(2, 2) * center(2));
138 Matrix4f vox2ras = Matrix4f::Identity();
139 vox2ras.block<3, 3>(0, 0) = M / 1000.0f;
140 vox2ras(0, 3) = P0(0) / 1000.0f;
141 vox2ras(1, 3) = P0(1) / 1000.0f;
142 vox2ras(2, 3) = P0(2) / 1000.0f;