13#ifndef ML_TVIRTUAL_VOLUME_H
14#define ML_TVIRTUAL_VOLUME_H
229 _convenienceInstance =
nullptr;
241 bool areExceptionsOn=
false)
247 _init(*_convenienceInstance);
260 bool areExceptionsOn =
false)
267 _init(*_convenienceInstance);
276 delete _convenienceInstance;
277 _convenienceInstance =
nullptr;
305 inline void setCursorValue(
DATATYPE val);
347 bool moveCursorXWrapAround();
391 template <
typename OUTDTYPE>
403 SubImageBox box = SubImageBox::intersect(_virtVol->getBox(), outSubImg.
getBox());
411 for (p.u = box.
v1.u; p.u <= box.
v2.u; p.u++){
412 for (p.t = box.
v1.t; p.t <= box.
v2.t; p.t++){
413 for (p.c = box.
v1.c; p.c <= box.
v2.c; p.c++){
414 for (p.z = box.
v1.z; p.z <= box.
v2.z; p.z++){
415 for (p.y = box.
v1.y; p.y <= box.
v2.y; p.y++){
424 setCursorPosition(p);
430 for (; p.x <= box.
v2.x; p.x++){
435 *
oP =
static_cast<OUTDTYPE>(getCursorValue());
612 inline bool _isMapped1D (
const ImageVector &pos)
const;
613 inline bool _isMapped2D (
const ImageVector &pos)
const;
614 inline bool _isMapped3D (
const ImageVector &pos)
const;
615 inline bool _isMapped4D (
const ImageVector &pos)
const;
616 inline bool _isMapped5D (
const ImageVector &pos)
const;
617 inline bool _isMapped6D (
const ImageVector &pos)
const;
619 inline bool _isMapped1DE(
const ImageVector &pos)
const;
620 inline bool _isMapped2DE(
const ImageVector &pos)
const;
621 inline bool _isMapped3DE(
const ImageVector &pos)
const;
622 inline bool _isMapped4DE(
const ImageVector &pos)
const;
623 inline bool _isMapped5DE(
const ImageVector &pos)
const;
624 inline bool _isMapped6DE(
const ImageVector &pos)
const;
690 inline void _setCursorPos1D (
const ImageVector & p);
691 inline void _setCursorPos2D (
const ImageVector & p);
692 inline void _setCursorPos3D (
const ImageVector & p);
693 inline void _setCursorPos4D (
const ImageVector & p);
694 inline void _setCursorPos5D (
const ImageVector & p);
695 inline void _setCursorPos6D (
const ImageVector & p);
697 inline void _setCursorPos1DE(
const ImageVector & p);
698 inline void _setCursorPos2DE(
const ImageVector & p);
699 inline void _setCursorPos3DE(
const ImageVector & p);
700 inline void _setCursorPos4DE(
const ImageVector & p);
701 inline void _setCursorPos5DE(
const ImageVector & p);
702 inline void _setCursorPos6DE(
const ImageVector & p);
735 inline void _moveCursorOffset1D (
const ImageVector & p);
736 inline void _moveCursorOffset2D (
const ImageVector & p);
737 inline void _moveCursorOffset3D (
const ImageVector & p);
738 inline void _moveCursorOffset4D (
const ImageVector & p);
739 inline void _moveCursorOffset5D (
const ImageVector & p);
740 inline void _moveCursorOffset6D (
const ImageVector & p);
742 inline void _moveCursorOffset1DE(
const ImageVector & p);
743 inline void _moveCursorOffset2DE(
const ImageVector & p);
744 inline void _moveCursorOffset3DE(
const ImageVector & p);
745 inline void _moveCursorOffset4DE(
const ImageVector & p);
746 inline void _moveCursorOffset5DE(
const ImageVector & p);
747 inline void _moveCursorOffset6DE(
const ImageVector & p);
791 inline void _moveFX() { _cPos.x++; _cIdx +=
static_cast<MLuint>(_pStrides.x);
if ((_cPos.x & _idxMask.x) == 0){ _cPageIdx +=
static_cast<MLuint>(_strides.x); } }
792 inline void _moveFY() { _cPos.y++; _cIdx +=
static_cast<MLuint>(_pStrides.y);
if ((_cPos.y & _idxMask.y) == 0){ _cPageIdx +=
static_cast<MLuint>(_strides.y); } }
793 inline void _moveFZ() { _cPos.z++; _cIdx +=
static_cast<MLuint>(_pStrides.z);
if ((_cPos.z & _idxMask.z) == 0){ _cPageIdx +=
static_cast<MLuint>(_strides.z); } }
794 inline void _moveFC() { _cPos.c++; _cIdx +=
static_cast<MLuint>(_pStrides.c);
if ((_cPos.c & _idxMask.c) == 0){ _cPageIdx +=
static_cast<MLuint>(_strides.c); } }
795 inline void _moveFT() { _cPos.t++; _cIdx +=
static_cast<MLuint>(_pStrides.t);
if ((_cPos.t & _idxMask.t) == 0){ _cPageIdx +=
static_cast<MLuint>(_strides.t); } }
796 inline void _moveFU() { _cPos.u++; _cIdx +=
static_cast<MLuint>(_pStrides.u);
if ((_cPos.u & _idxMask.u) == 0){ _cPageIdx +=
static_cast<MLuint>(_strides.u); } }
830 inline void _moveBX() { _cPos.x--; _cIdx -=
static_cast<MLuint>(_pStrides.x);
if ((_cPos.x & _idxMask.x) == _idxMask.x){ _cPageIdx -=
static_cast<MLuint>(_strides.x); } }
831 inline void _moveBY() { _cPos.y--; _cIdx -=
static_cast<MLuint>(_pStrides.y);
if ((_cPos.y & _idxMask.y) == _idxMask.y){ _cPageIdx -=
static_cast<MLuint>(_strides.y); } }
832 inline void _moveBZ() { _cPos.z--; _cIdx -=
static_cast<MLuint>(_pStrides.z);
if ((_cPos.z & _idxMask.z) == _idxMask.z){ _cPageIdx -=
static_cast<MLuint>(_strides.z); } }
833 inline void _moveBC() { _cPos.c--; _cIdx -=
static_cast<MLuint>(_pStrides.c);
if ((_cPos.c & _idxMask.c) == _idxMask.c){ _cPageIdx -=
static_cast<MLuint>(_strides.c); } }
834 inline void _moveBT() { _cPos.t--; _cIdx -=
static_cast<MLuint>(_pStrides.t);
if ((_cPos.t & _idxMask.t) == _idxMask.t){ _cPageIdx -=
static_cast<MLuint>(_strides.t); } }
835 inline void _moveBU() { _cPos.u--; _cIdx -=
static_cast<MLuint>(_pStrides.u);
if ((_cPos.u & _idxMask.u) == _idxMask.u){ _cPageIdx -=
static_cast<MLuint>(_strides.u); } }
839#define _VV_MOVEBE_TEST(Q) if (_cPos.Q >= 0){ _cPageIdx -= static_cast<MLuint>(_strides.Q); } \
840 else{ _cPos.Q++; _cIdx += static_cast<MLuint>(_pStrides.Q); throw(ML_OUT_OF_RANGE); }
849#undef _VV_MOVEBE_TEST
926 GetVoxelFunc _getVoxelFunc;
929 SetVoxelFunc _setVoxelFunc;
932 IsMappedFunc _isMappedFunc;
935 SetCursorPosFunc _setCursorPosFunc;
938 MoveCursorOffsetFunc _moveCursorOffsetFunc;
942 MoveCursorPosFunc _moveFXFunc;
943 MoveCursorPosFunc _moveFYFunc;
944 MoveCursorPosFunc _moveFZFunc;
945 MoveCursorPosFunc _moveFCFunc;
946 MoveCursorPosFunc _moveFTFunc;
947 MoveCursorPosFunc _moveFUFunc;
949 MoveCursorPosFunc _moveBXFunc;
950 MoveCursorPosFunc _moveBYFunc;
951 MoveCursorPosFunc _moveBZFunc;
952 MoveCursorPosFunc _moveBCFunc;
953 MoveCursorPosFunc _moveBTFunc;
954 MoveCursorPosFunc _moveBUFunc;
984template <
typename DATATYPE>
987 for (
MLuint c=0; c < num; c++){
988 *results = _getVoxelFunc(
this, *pos);
994template <
typename DATATYPE>
1003template <
typename DATATYPE>
1011template <
typename DATATYPE>
1015 _setCursorPosFunc(
this,
zeroPos);
1027template <
typename DATATYPE>
1030 if (_cPos.x < _extD.x){ _moveFXFunc(
this);
return true; }
1032 if (_cPos.y < _extD.y){ _moveFYFunc(
this); }
1034 if (_cPos.z < _extD.z){ _moveFZFunc(
this); }
1036 if (_cPos.c < _extD.c){ _moveFCFunc(
this); }
1038 if (_cPos.t < _extD.t){ _moveFTFunc(
this); }
1040 if (_cPos.u < _extD.u){ _moveFUFunc(
this); }
1057 _setCursorPosFunc(
this, _cPos);
1063template <
typename DATATYPE>
1092template <
typename DATATYPE>
1101template <
typename DATATYPE>
1142template <
typename DATATYPE>
1149 "Mismatch of data type of virtual volume and template typename");
1155 _ext =
vVol._origVolumeExt;
1157 _pageArray =
vVol._pageArray;
1158 _rShift =
vVol._rShift;
1159 _strides =
vVol._strides;
1160 _pStrides =
vVol._pStrides;
1161 _idxMask =
vVol._idxMask;
1162 _useExc =
vVol._areExceptionsOn;
1175 _moveFXFunc = _moveFXCBE;
1176 _moveFYFunc = _moveFYCBE;
1177 _moveFZFunc = _moveFZCBE;
1178 _moveFCFunc = _moveFCCBE;
1179 _moveFTFunc = _moveFTCBE;
1180 _moveFUFunc = _moveFUCBE;
1182 _moveBXFunc = _moveBXCBE;
1183 _moveBYFunc = _moveBYCBE;
1184 _moveBZFunc = _moveBZCBE;
1185 _moveBCFunc = _moveBCCBE;
1186 _moveBTFunc = _moveBTCBE;
1187 _moveBUFunc = _moveBUCBE;
1190 switch (
vVol.getDim()){
1192 _getVoxelFunc = _getVoxel1DCBE;
1193 _setVoxelFunc = _setVoxel1DCBE;
1194 _setCursorPosFunc = _setCursorPos1DCBE;
1195 _moveCursorOffsetFunc = _moveCursorOffset1DCBE;
1196 _isMappedFunc = _isMapped1DCBE;
1199 _getVoxelFunc = _getVoxel2DCBE;
1200 _setVoxelFunc = _setVoxel2DCBE;
1201 _setCursorPosFunc = _setCursorPos2DCBE;
1202 _moveCursorOffsetFunc = _moveCursorOffset2DCBE;
1203 _isMappedFunc = _isMapped2DCBE;
1206 _getVoxelFunc = _getVoxel3DCBE;
1207 _setVoxelFunc = _setVoxel3DCBE;
1208 _setCursorPosFunc = _setCursorPos3DCBE;
1209 _moveCursorOffsetFunc = _moveCursorOffset3DCBE;
1210 _isMappedFunc = _isMapped3DCBE;
1213 _getVoxelFunc = _getVoxel4DCBE;
1214 _setVoxelFunc = _setVoxel4DCBE;
1215 _setCursorPosFunc = _setCursorPos4DCBE;
1216 _moveCursorOffsetFunc = _moveCursorOffset4DCBE;
1217 _isMappedFunc = _isMapped4DCBE;
1220 _getVoxelFunc = _getVoxel5DCBE;
1221 _setVoxelFunc = _setVoxel5DCBE;
1222 _setCursorPosFunc = _setCursorPos5DCBE;
1223 _moveCursorOffsetFunc = _moveCursorOffset5DCBE;
1224 _isMappedFunc = _isMapped5DCBE;
1227 _getVoxelFunc = _getVoxel6DCBE;
1228 _setVoxelFunc = _setVoxel6DCBE;
1229 _setCursorPosFunc = _setCursorPos6DCBE;
1230 _moveCursorOffsetFunc = _moveCursorOffset6DCBE;
1231 _isMappedFunc = _isMapped6DCBE;
1234 _getVoxelFunc = _getVoxel6DCBE;
1235 _setVoxelFunc = _setVoxel6DCBE;
1236 _moveCursorOffsetFunc = _moveCursorOffset6DCBE;
1237 _setCursorPosFunc = _setCursorPos6DCBE;
1238 _isMappedFunc = _isMapped6DCBE;
1239 _virtVol->invalidate();
1247 _moveFXFunc = _moveFXCB;
1248 _moveFYFunc = _moveFYCB;
1249 _moveFZFunc = _moveFZCB;
1250 _moveFCFunc = _moveFCCB;
1251 _moveFTFunc = _moveFTCB;
1252 _moveFUFunc = _moveFUCB;
1254 _moveBXFunc = _moveBXCB;
1255 _moveBYFunc = _moveBYCB;
1256 _moveBZFunc = _moveBZCB;
1257 _moveBCFunc = _moveBCCB;
1258 _moveBTFunc = _moveBTCB;
1259 _moveBUFunc = _moveBUCB;
1262 switch (
vVol.getDim()){
1264 _getVoxelFunc = _getVoxel1DCB;
1265 _setVoxelFunc = _setVoxel1DCB;
1266 _setCursorPosFunc = _setCursorPos1DCB;
1267 _moveCursorOffsetFunc = _moveCursorOffset1DCB;
1268 _isMappedFunc = _isMapped1DCB;
1271 _getVoxelFunc = _getVoxel2DCB;
1272 _setVoxelFunc = _setVoxel2DCB;
1273 _setCursorPosFunc = _setCursorPos2DCB;
1274 _moveCursorOffsetFunc = _moveCursorOffset2DCB;
1275 _isMappedFunc = _isMapped2DCB;
1278 _getVoxelFunc = _getVoxel3DCB;
1279 _setVoxelFunc = _setVoxel3DCB;
1280 _setCursorPosFunc = _setCursorPos3DCB;
1281 _moveCursorOffsetFunc = _moveCursorOffset3DCB;
1282 _isMappedFunc = _isMapped3DCB;
1285 _getVoxelFunc = _getVoxel4DCB;
1286 _setVoxelFunc = _setVoxel4DCB;
1287 _setCursorPosFunc = _setCursorPos4DCB;
1288 _moveCursorOffsetFunc = _moveCursorOffset4DCB;
1289 _isMappedFunc = _isMapped4DCB;
1292 _getVoxelFunc = _getVoxel5DCB;
1293 _setVoxelFunc = _setVoxel5DCB;
1294 _setCursorPosFunc = _setCursorPos5DCB;
1295 _moveCursorOffsetFunc = _moveCursorOffset5DCB;
1296 _isMappedFunc = _isMapped5DCB;
1299 _getVoxelFunc = _getVoxel6DCB;
1300 _setVoxelFunc = _setVoxel6DCB;
1301 _setCursorPosFunc = _setCursorPos6DCB;
1302 _moveCursorOffsetFunc = _moveCursorOffset6DCB;
1303 _isMappedFunc = _isMapped6DCB;
1306 _getVoxelFunc = _getVoxel6DCB;
1307 _setVoxelFunc = _setVoxel6DCB;
1308 _setCursorPosFunc = _setCursorPos6DCB;
1309 _moveCursorOffsetFunc = _moveCursorOffset6DCB;
1310 _isMappedFunc = _isMapped6DCBE;
1311 _virtVol->invalidate();
1319template <
typename DATATYPE>
1326 _pageArray =
nullptr;
1330 _getVoxelFunc =
nullptr;
1331 _setVoxelFunc =
nullptr;
1332 _setCursorPosFunc =
nullptr;
1333 _moveCursorOffsetFunc =
nullptr;
1334 _isMappedFunc =
nullptr;
1335 _moveFXFunc =
nullptr;
1336 _moveFYFunc =
nullptr;
1337 _moveFZFunc =
nullptr;
1338 _moveFCFunc =
nullptr;
1339 _moveFTFunc =
nullptr;
1340 _moveFUFunc =
nullptr;
1341 _moveBXFunc =
nullptr;
1342 _moveBYFunc =
nullptr;
1343 _moveBZFunc =
nullptr;
1344 _moveBCFunc =
nullptr;
1345 _moveBTFunc =
nullptr;
1346 _moveBUFunc =
nullptr;
1361template <
typename DATATYPE>
1364 PageBuffer *
const page = _pageArray + (pos.x >> _rShift.x);
1369template <
typename DATATYPE>
1374 PageBuffer *
const page = _pageArray + (
px >> _rShift.x);
1380template <
typename DATATYPE>
1383 PageBuffer *
const page = _pageArray + ((pos.x >> _rShift.x) + (pos.y >> _rShift.y)*_strides.y);
1388template <
typename DATATYPE>
1394 PageBuffer *
const page = _pageArray + ((
px >> _rShift.x) + (
py >> _rShift.y)*_strides.y);
1401template <
typename DATATYPE>
1404 PageBuffer *
const page = _pageArray + ((pos.x >> _rShift.x) +
1405 (pos.y >> _rShift.y)*_strides.y +
1406 (pos.z >> _rShift.z)*_strides.z);
1407 return (
static_cast<DATATYPE*
>(page->
_getPageFkt(page)))[pos.x + pos.y*_pStrides.y + pos.z*_pStrides.z];
1411template <
typename DATATYPE>
1417 if ((
px < 0) || (
px >= _ext.x) || (
py < 0) || (
py >= _ext.y) ||
1419 PageBuffer *
const page = _pageArray + ((
px >> _rShift.x) +
1420 (
py >> _rShift.y)*_strides.y +
1421 (
pz >> _rShift.z)*_strides.z);
1428template <
typename DATATYPE>
1431 PageBuffer *
const page = _pageArray + ((pos.x >> _rShift.x) +
1432 (pos.y >> _rShift.y)*_strides.y +
1433 (pos.z >> _rShift.z)*_strides.z +
1434 (pos.c >> _rShift.c)*_strides.c);
1442template <
typename DATATYPE>
1449 if ((
px < 0) || (
px >= _ext.x) || (
py < 0) || (
py >= _ext.y) ||
1451 PageBuffer *
const page = _pageArray + ((
px >> _rShift.x) +
1452 (
py >> _rShift.y)*_strides.y +
1453 (
pz >> _rShift.z)*_strides.z +
1454 (
pc >> _rShift.c)*_strides.c);
1462template <
typename DATATYPE>
1465 PageBuffer *
const page = _pageArray + ((pos.x >> _rShift.x) +
1466 (pos.y >> _rShift.y)*_strides.y +
1467 (pos.z >> _rShift.z)*_strides.z +
1468 (pos.c >> _rShift.c)*_strides.c +
1469 (pos.t >> _rShift.t)*_strides.t);
1478template <
typename DATATYPE>
1486 if ((
px < 0) || (
px >= _ext.x) || (
py < 0) || (
py >= _ext.y) ||
1487 (
pz < 0) || (
pz >= _ext.z) || (
pc < 0) || (
pc >= _ext.c) ||
1489 PageBuffer *
const page = _pageArray + ((
px >> _rShift.x) +
1490 (
py >> _rShift.y)*_strides.y +
1491 (
pz >> _rShift.z)*_strides.z +
1492 (
pc >> _rShift.c)*_strides.c +
1493 (
pt >> _rShift.t)*_strides.t);
1502template <
typename DATATYPE>
1505 PageBuffer *
const page = _pageArray + ((pos.x >> _rShift.x) +
1506 (pos.y >> _rShift.y)*_strides.y +
1507 (pos.z >> _rShift.z)*_strides.z +
1508 (pos.c >> _rShift.c)*_strides.c +
1509 (pos.t >> _rShift.t)*_strides.t +
1510 (pos.u >> _rShift.u)*_strides.u);
1520template <
typename DATATYPE>
1529 if ((
px < 0) || (
px >= _ext.x) || (
py < 0) || (
py >= _ext.y) ||
1530 (
pz < 0) || (
pz >= _ext.z) || (
pc < 0) || (
pc >= _ext.c) ||
1532 PageBuffer *
const page = _pageArray + ((
px >> _rShift.x) +
1533 (
py >> _rShift.y)*_strides.y +
1534 (
pz >> _rShift.z)*_strides.z +
1535 (
pc >> _rShift.c)*_strides.c +
1536 (
pt >> _rShift.t)*_strides.t +
1537 (
pu >> _rShift.u)*_strides.u);
1555template <
typename DATATYPE>
1558 PageBuffer *
const page = _pageArray + (pos.x >> _rShift.x);
1564template <
typename DATATYPE>
1569 PageBuffer *
const page = _pageArray + (
px >> _rShift.x);
1577template <
typename DATATYPE>
1580 PageBuffer *
const page = _pageArray + ((pos.x >> _rShift.x) + (pos.y >> _rShift.y)*_strides.y);
1586template <
typename DATATYPE>
1592 PageBuffer *
const page = _pageArray + ((
px >> _rShift.x) + (
py >> _rShift.y)*_strides.y);
1600template <
typename DATATYPE>
1603 PageBuffer *
const page = _pageArray + ((pos.x >> _rShift.x) +
1604 (pos.y >> _rShift.y)*_strides.y +
1605 (pos.z >> _rShift.z)*_strides.z);
1611template <
typename DATATYPE>
1617 if ((
px < 0) || (
px >= _ext.x) || (
py < 0) || (
py >= _ext.y) ||
1619 PageBuffer *
const page = _pageArray + ((
px >> _rShift.x) +
1620 (
py >> _rShift.y)*_strides.y +
1621 (
pz >> _rShift.z)*_strides.z);
1629template <
typename DATATYPE>
1632 PageBuffer *
const page = _pageArray + ((pos.x >> _rShift.x) +
1633 (pos.y >> _rShift.y)*_strides.y +
1634 (pos.z >> _rShift.z)*_strides.z +
1635 (pos.c >> _rShift.c)*_strides.c);
1640 pos.c*_pStrides.c] =
voxVal;
1644template <
typename DATATYPE>
1651 if ((
px < 0) || (
px >= _ext.x) || (
py < 0) || (
py >= _ext.y) ||
1653 PageBuffer *
const page = _pageArray + ((
px >> _rShift.x) +
1654 (
py >> _rShift.y)*_strides.y +
1655 (
pz >> _rShift.z)*_strides.z +
1656 (
pc >> _rShift.c)*_strides.c);
1667template <
typename DATATYPE>
1670 PageBuffer *
const page = _pageArray + ((pos.x >> _rShift.x) +
1671 (pos.y >> _rShift.y)*_strides.y +
1672 (pos.z >> _rShift.z)*_strides.z +
1673 (pos.c >> _rShift.c)*_strides.c +
1674 (pos.t >> _rShift.t)*_strides.t);
1680 pos.t*_pStrides.t] =
voxVal;
1684template <
typename DATATYPE>
1692 if ((
px < 0) || (
px >= _ext.x) || (
py < 0) || (
py >= _ext.y) ||
1693 (
pz < 0) || (
pz >= _ext.z) || (
pc < 0) || (
pc >= _ext.c) ||
1695 PageBuffer *
const page = _pageArray + ((
px >> _rShift.x) +
1696 (
py >> _rShift.y)*_strides.y +
1697 (
pz >> _rShift.z)*_strides.z +
1698 (
pc >> _rShift.c)*_strides.c +
1699 (
pt >> _rShift.t)*_strides.t);
1711template <
typename DATATYPE>
1714 PageBuffer *
const page = _pageArray + ((pos.x >> _rShift.x) +
1715 (pos.y >> _rShift.y)*_strides.y +
1716 (pos.z >> _rShift.z)*_strides.z +
1717 (pos.c >> _rShift.c)*_strides.c +
1718 (pos.t >> _rShift.t)*_strides.t +
1719 (pos.u >> _rShift.u)*_strides.u);
1726 pos.u*_pStrides.u] =
voxVal;
1730template <
typename DATATYPE>
1739 if ((
px < 0) || (
px >= _ext.x) || (
py < 0) || (
py >= _ext.y) ||
1740 (
pz < 0) || (
pz >= _ext.z) || (
pc < 0) || (
pc >= _ext.c) ||
1742 PageBuffer *
const page = _pageArray + ((
px >> _rShift.x) +
1743 (
py >> _rShift.y)*_strides.y +
1744 (
pz >> _rShift.z)*_strides.z +
1745 (
pc >> _rShift.c)*_strides.c +
1746 (
pt >> _rShift.t)*_strides.t +
1747 (
pu >> _rShift.u)*_strides.u);
1767template <
typename DATATYPE>
1771 _cIdx =
static_cast<MLuint>(p.x);
1772 _cPageIdx =
static_cast<MLuint>(p.x >> _rShift.x);
1776template <
typename DATATYPE>
1783 _cPageIdx =
static_cast<MLuint>(
px >> _rShift.x);
1789template <
typename DATATYPE>
1794 _cIdx =
static_cast<MLuint>(p.x + p.y*_pStrides.y);
1795 _cPageIdx =
static_cast<MLuint>((p.x >> _rShift.x) +
1796 (p.y >> _rShift.y)*_strides.y);
1800template <
typename DATATYPE>
1808 _cIdx =
static_cast<MLuint>(
px +
py*_pStrides.y);
1809 _cPageIdx =
static_cast<MLuint>((
px >> _rShift.x) +
1810 (
py >> _rShift.y)*_strides.y);
1816template <
typename DATATYPE>
1822 _cIdx =
static_cast<MLuint>(p.x + p.y*_pStrides.y + p.z*_pStrides.z);
1823 _cPageIdx =
static_cast<MLuint>((p.x >> _rShift.x) +
1824 (p.y >> _rShift.y)*_strides.y +
1825 (p.z >> _rShift.z)*_strides.z);
1829template <
typename DATATYPE>
1835 if ((
px < 0) || (
px >= _ext.x) || (
py < 0) || (
py >= _ext.y) ||
1840 _cIdx =
static_cast<MLuint>(
px +
py*_pStrides.y +
pz*_pStrides.z);
1841 _cPageIdx =
static_cast<MLuint>((
px >> _rShift.x) +
1842 (
py >> _rShift.y)*_strides.y +
1843 (
pz >> _rShift.z)*_strides.z);
1849template <
typename DATATYPE>
1856 _cIdx =
static_cast<MLuint>(p.x + p.y*_pStrides.y + p.z*_pStrides.z + p.c*_pStrides.c);
1857 _cPageIdx =
static_cast<MLuint>((p.x >> _rShift.x) +
1858 (p.y >> _rShift.y)*_strides.y +
1859 (p.z >> _rShift.z)*_strides.z +
1860 (p.c >> _rShift.c)*_strides.c);
1864template <
typename DATATYPE>
1871 if ((
px < 0) || (
px >= _ext.x) || (
py < 0) || (
py >= _ext.y) ||
1877 _cIdx =
static_cast<MLuint>(
px +
py*_pStrides.y +
pz*_pStrides.z +
pc*_pStrides.c);
1878 _cPageIdx =
static_cast<MLuint>((
px >> _rShift.x) +
1879 (
py >> _rShift.y)*_strides.y +
1880 (
pz >> _rShift.z)*_strides.z +
1881 (
pc >> _rShift.c)*_strides.c);
1887template <
typename DATATYPE>
1894 _cIdx =
static_cast<MLuint>(p.x + p.y*_pStrides.y + p.z*_pStrides.z + p.c*_pStrides.c + p.t*_pStrides.t);
1897 _cPageIdx =
static_cast<MLuint>((p.x >> _rShift.x) +
1898 (p.y >> _rShift.y)*_strides.y +
1899 (p.z >> _rShift.z)*_strides.z +
1900 (p.c >> _rShift.c)*_strides.c +
1901 (p.t >> _rShift.t)*_strides.t);
1905template <
typename DATATYPE>
1913 if ((
px < 0) || (
px >= _ext.x) || (
py < 0) || (
py >= _ext.y) ||
1914 (
pz < 0) || (
pz >= _ext.z) || (
pc < 0) || (
pc >= _ext.c) ||
1921 _cIdx =
static_cast<MLuint>(
px +
py*_pStrides.y +
pz*_pStrides.z +
pc*_pStrides.c +
pt*_pStrides.t);
1924 _cPageIdx =
static_cast<MLuint>((
px >> _rShift.x) +
1925 (
py >> _rShift.y)*_strides.y +
1926 (
pz >> _rShift.z)*_strides.z +
1927 (
pc >> _rShift.c)*_strides.c +
1928 (
pt >> _rShift.t)*_strides.t);
1934template <
typename DATATYPE>
1941 _cIdx =
static_cast<MLuint>(p.x + p.y*_pStrides.y + p.z*_pStrides.z +
1942 p.c*_pStrides.c + p.t*_pStrides.t + p.u*_pStrides.u);
1945 _cPageIdx =
static_cast<MLuint>((p.x >> _rShift.x) +
1946 (p.y >> _rShift.y)*_strides.y +
1947 (p.z >> _rShift.z)*_strides.z +
1948 (p.c >> _rShift.c)*_strides.c +
1949 (p.t >> _rShift.t)*_strides.t +
1950 (p.u >> _rShift.u)*_strides.u);
1954template <
typename DATATYPE>
1963 if ((
px < 0) || (
px >= _ext.x) || (
py < 0) || (
py >= _ext.y) ||
1964 (
pz < 0) || (
pz >= _ext.z) || (
pc < 0) || (
pc >= _ext.c) ||
1971 _cIdx =
static_cast<MLuint>(
px +
py*_pStrides.y +
pz*_pStrides.z +
1972 pc*_pStrides.c +
pt*_pStrides.t +
pu*_pStrides.u);
1975 _cPageIdx =
static_cast<MLuint>((
px >> _rShift.x) +
1976 (
py >> _rShift.y)*_strides.y +
1977 (
pz >> _rShift.z)*_strides.z +
1978 (
pc >> _rShift.c)*_strides.c +
1979 (
pt >> _rShift.t)*_strides.t +
1980 (
pu >> _rShift.u)*_strides.u);
1993template <
typename DATATYPE>
1997 _cIdx =
static_cast<MLuint>(_cPos.x);
1998 _cPageIdx =
static_cast<MLuint>(_cPos.x >> _rShift.x);
2002template <
typename DATATYPE>
2009 _cPageIdx =
static_cast<MLuint>(
px >> _rShift.x);
2015template <
typename DATATYPE>
2020 _cIdx =
static_cast<MLuint>(_cPos.x + _cPos.y*_pStrides.y);
2021 _cPageIdx =
static_cast<MLuint>((_cPos.x >> _rShift.x) + (_cPos.y >> _rShift.y)*_strides.y);
2025template <
typename DATATYPE>
2033 _cIdx =
static_cast<MLuint>(
px +
py*_pStrides.y);
2034 _cPageIdx =
static_cast<MLuint>((
px >> _rShift.x) + (
py >> _rShift.y)*_strides.y);
2040template <
typename DATATYPE>
2046 _cIdx =
static_cast<MLuint>(_cPos.x + _cPos.y*_pStrides.y + _cPos.z*_pStrides.z);
2047 _cPageIdx =
static_cast<MLuint>((_cPos.x >> _rShift.x) +
2048 (_cPos.y >> _rShift.y)*_strides.y +
2049 (_cPos.z >> _rShift.z)*_strides.z);
2053template <
typename DATATYPE>
2059 if ((
px < 0) || (
px >= _ext.x) || (
py < 0) || (
py >= _ext.y) ||
2064 _cIdx =
static_cast<MLuint>(
px +
py*_pStrides.y +
pz*_pStrides.z);
2065 _cPageIdx =
static_cast<MLuint>((
px >> _rShift.x) +
2066 (
py >> _rShift.y)*_strides.y +
2067 (
pz >> _rShift.z)*_strides.z);
2073template <
typename DATATYPE>
2080 _cIdx =
static_cast<MLuint>(_cPos.x + _cPos.y*_pStrides.y + _cPos.z*_pStrides.z + _cPos.c*_pStrides.c);
2081 _cPageIdx =
static_cast<MLuint>((_cPos.x >> _rShift.x) +
2082 (_cPos.y >> _rShift.y)*_strides.y +
2083 (_cPos.z >> _rShift.z)*_strides.z +
2084 (_cPos.c >> _rShift.c)*_strides.c);
2088template <
typename DATATYPE>
2095 if ((
px < 0) || (
px >= _ext.x) || (
py < 0) || (
py >= _ext.y) ||
2101 _cIdx =
static_cast<MLuint>(
px +
py*_pStrides.y +
pz*_pStrides.z +
pc*_pStrides.c);
2102 _cPageIdx =
static_cast<MLuint>((
px >> _rShift.x) +
2103 (
py >> _rShift.y)*_strides.y +
2104 (
pz >> _rShift.z)*_strides.z +
2105 (
pc >> _rShift.c)*_strides.c);
2111template <
typename DATATYPE>
2118 _cIdx =
static_cast<MLuint>(_cPos.x +
2119 _cPos.y*_pStrides.y + _cPos.z*_pStrides.z +
2120 _cPos.c*_pStrides.c + _cPos.t*_pStrides.t);
2123 _cPageIdx =
static_cast<MLuint>((_cPos.x >> _rShift.x) +
2124 (_cPos.y >> _rShift.y)*_strides.y +
2125 (_cPos.z >> _rShift.z)*_strides.z +
2126 (_cPos.c >> _rShift.c)*_strides.c +
2127 (_cPos.t >> _rShift.t)*_strides.t);
2131template <
typename DATATYPE>
2139 if ((
px < 0) || (
px >= _ext.x) || (
py < 0) || (
py >= _ext.y) ||
2140 (
pz < 0) || (
pz >= _ext.z) || (
pc < 0) || (
pc >= _ext.c) ||
2147 _cIdx =
static_cast<MLuint>(
px +
py*_pStrides.y +
pz*_pStrides.z +
pc*_pStrides.c +
pt*_pStrides.t);
2150 _cPageIdx =
static_cast<MLuint>((
px >> _rShift.x) +
2151 (
py >> _rShift.y)*_strides.y +
2152 (
pz >> _rShift.z)*_strides.z +
2153 (
pc >> _rShift.c)*_strides.c +
2154 (
pt >> _rShift.t)*_strides.t);
2160template <
typename DATATYPE>
2167 _cIdx =
static_cast<MLuint>(_cPos.x + _cPos.y*_pStrides.y + _cPos.z*_pStrides.z +
2168 _cPos.c*_pStrides.c + _cPos.t*_pStrides.t + _cPos.u*_pStrides.u);
2171 _cPageIdx =
static_cast<MLuint>((_cPos.x >> _rShift.x) +
2172 (_cPos.y >> _rShift.y)*_strides.y +
2173 (_cPos.z >> _rShift.z)*_strides.z +
2174 (_cPos.c >> _rShift.c)*_strides.c +
2175 (_cPos.t >> _rShift.t)*_strides.t +
2176 (_cPos.u >> _rShift.u)*_strides.u);
2180template <
typename DATATYPE>
2189 if ((
px < 0) || (
px >= _ext.x) || (
py < 0) || (
py >= _ext.y) ||
2190 (
pz < 0) || (
pz >= _ext.z) || (
pc < 0) || (
pc >= _ext.c) ||
2197 _cIdx =
static_cast<MLuint>(
px +
py*_pStrides.y +
pz*_pStrides.z +
2198 pc*_pStrides.c +
pt*_pStrides.t +
pu*_pStrides.u);
2201 _cPageIdx =
static_cast<MLuint>((
px >> _rShift.x) + (
py >> _rShift.y)*_strides.y +
2202 (
pz >> _rShift.z)*_strides.z + (
pc >> _rShift.c)*_strides.c +
2203 (
pt >> _rShift.t)*_strides.t + (
pu >> _rShift.u)*_strides.u);
2215template <
typename DATATYPE>
2218 const PageBuffer *
const page = _pageArray + (pos.x >> _rShift.x);
2219 return page->
_getPageFkt != VirtualVolume::_loadPageCB;
2223template <
typename DATATYPE>
2228 const PageBuffer *
const page = _pageArray + (
px >> _rShift.x);
2229 return page->
_getPageFkt != VirtualVolume::_loadPageCB;
2235template <
typename DATATYPE>
2238 const PageBuffer *
const page = _pageArray + ((pos.x >> _rShift.x) + (pos.y >> _rShift.y)*_strides.y);
2239 return page->
_getPageFkt != VirtualVolume::_loadPageCB;
2243template <
typename DATATYPE>
2249 const PageBuffer *
const page = _pageArray + ((
px >> _rShift.x) + (
py >> _rShift.y)*_strides.y);
2250 return page->
_getPageFkt != VirtualVolume::_loadPageCB;
2256template <
typename DATATYPE>
2259 const PageBuffer *
const page = _pageArray + ((pos.x >> _rShift.x) +
2260 (pos.y >> _rShift.y)*_strides.y +
2261 (pos.z >> _rShift.z)*_strides.z);
2262 return page->
_getPageFkt != VirtualVolume::_loadPageCB;
2266template <
typename DATATYPE>
2272 if ((
px < 0) || (
px >= _ext.x) || (
py < 0) || (
py >= _ext.y) ||
2274 const PageBuffer *
const page = _pageArray + ((
px >> _rShift.x) +
2275 (
py >> _rShift.y)*_strides.y +
2276 (
pz >> _rShift.z)*_strides.z);
2277 return page->
_getPageFkt != VirtualVolume::_loadPageCB;
2283template <
typename DATATYPE>
2286 const PageBuffer *
const page = _pageArray + ((pos.x >> _rShift.x) +
2287 (pos.y >> _rShift.y)*_strides.y +
2288 (pos.z >> _rShift.z)*_strides.z +
2289 (pos.c >> _rShift.c)*_strides.c);
2290 return page->
_getPageFkt != VirtualVolume::_loadPageCB;
2294template <
typename DATATYPE>
2301 if ((
px < 0) || (
px >= _ext.x) || (
py < 0) || (
py >= _ext.y) ||
2303 const PageBuffer *
const page = _pageArray + ((
px >> _rShift.x) +
2304 (
py >> _rShift.y)*_strides.y +
2305 (
pz >> _rShift.z)*_strides.z +
2306 (
pc >> _rShift.c)*_strides.c);
2307 return page->
_getPageFkt != VirtualVolume::_loadPageCB;
2313template <
typename DATATYPE>
2316 const PageBuffer *
const page = _pageArray + ((pos.x >> _rShift.x) +
2317 (pos.y >> _rShift.y)*_strides.y +
2318 (pos.z >> _rShift.z)*_strides.z +
2319 (pos.c >> _rShift.c)*_strides.c +
2320 (pos.t >> _rShift.t)*_strides.t);
2321 return page->
_getPageFkt != VirtualVolume::_loadPageCB;
2325template <
typename DATATYPE>
2333 if ((
px < 0) || (
px >= _ext.x) || (
py < 0) || (
py >= _ext.y) ||
2334 (
pz < 0) || (
pz >= _ext.z) || (
pc < 0) || (
pc >= _ext.c) ||
2336 const PageBuffer *
const page = _pageArray + ((
px >> _rShift.x) +
2337 (
py >> _rShift.y)*_strides.y +
2338 (
pz >> _rShift.z)*_strides.z +
2339 (
pc >> _rShift.c)*_strides.c +
2340 (
pt >> _rShift.t)*_strides.t);
2341 return page->
_getPageFkt != VirtualVolume::_loadPageCB;
2347template <
typename DATATYPE>
2350 const PageBuffer *
const page = _pageArray + ((pos.x >> _rShift.x) +
2351 (pos.y >> _rShift.y)*_strides.y +
2352 (pos.z >> _rShift.z)*_strides.z +
2353 (pos.c >> _rShift.c)*_strides.c +
2354 (pos.t >> _rShift.t)*_strides.t +
2355 (pos.u >> _rShift.u)*_strides.u);
2356 return page->
_getPageFkt != VirtualVolume::_loadPageCB;
2360template <
typename DATATYPE>
2369 if ((
px < 0) || (
px >= _ext.x) || (
py < 0) || (
py >= _ext.y) ||
2370 (
pz < 0) || (
pz >= _ext.z) || (
pc < 0) || (
pc >= _ext.c) ||
2372 const PageBuffer *
const page = _pageArray + ((
px >> _rShift.x) +
2373 (
py >> _rShift.y)*_strides.y +
2374 (
pz >> _rShift.z)*_strides.z +
2375 (
pc >> _rShift.c)*_strides.c +
2376 (
pt >> _rShift.t)*_strides.t +
2377 (
pu >> _rShift.u)*_strides.u);
2378 return page->
_getPageFkt != VirtualVolume::_loadPageCB;
Class to manage a binary image.
The class PagedImage, representing a fragmented image that manages properties and data of an image lo...
const SubImageBox & getBox() const
Returns the box describing the origin/extent of the subimage.
VectorType v1
Corner v1 of the subimage region (included in region).
static TSubImageBox< intT > intersect(const TSubImageBox< intT > &box1, const TSubImageBox< intT > &box2)
Returns the overlapping region of subimage regions box1 and box2.
VectorType v2
Corner v2 of the subimage region (also included in region!).
This template class manages/represents a rectangular 6D image region in memory that is organized line...
const DATATYPE * getImagePointer(const ImageVector &position) const
Returns a pointer to voxel data of image voxel at 6D position position relative to the origin of the ...
The TVirtualVolume class implements random access to a paged input image or a pure virtual image with...
static void _moveFZCB(TVirtualVolume *obj)
static void _setVoxel4DCBE(TVirtualVolume *obj, const ImageVector &pos, DATATYPE voxVal)
static void setInt64ValueWrapped(void *vv, const ImageVector &pos, MLint64 v)
static void _moveBUCBE(TVirtualVolume *obj)
static MLdouble getDoubleCursorValueWrapped(void *vv)
static void _moveCursorOffset3DCB(TVirtualVolume *obj, const ImageVector &p)
static void _moveFYCBE(TVirtualVolume *obj)
static bool _isMapped5DCB(const TVirtualVolume *obj, const ImageVector &pos)
virtual ~TVirtualVolume()
Destructor.
static void _setVoxel6DCB(TVirtualVolume *obj, const ImageVector &pos, DATATYPE voxVal)
static bool _isMapped4DCBE(const TVirtualVolume *obj, const ImageVector &pos)
void reverseMoveCursorZ()
void setCursorPosition(const ImageVector &pos)
Set the cursor to a certain position.
static void _moveCursorOffset2DCBE(TVirtualVolume *obj, const ImageVector &p)
static MLint64 getInt64ValueWrapped(void *vv, const ImageVector &pos)
static void reverseMoveCursorUWrapped(void *vv)
static void _setCursorPos4DCB(TVirtualVolume *obj, const ImageVector &p)
static void setIntValueWrapped(void *vv, const ImageVector &pos, MLint v)
static void setDoubleValueWrapped(void *vv, const ImageVector &pos, MLdouble v)
static void _moveBXCB(TVirtualVolume *obj)
static void _setCursorPos3DCB(TVirtualVolume *obj, const ImageVector &p)
static void fillDoubleWrapped(void *vv, const ImageVector &v1, const ImageVector &v2, MLdouble v)
static void _setCursorPos6DCB(TVirtualVolume *obj, const ImageVector &p)
static MLdouble getDoubleValueWrapped(void *vv, const ImageVector &pos)
static void setDoubleCursorValueWrapped(void *vv, MLdouble v)
void reverseMoveCursorT()
static void reverseMoveCursorCWrapped(void *vv)
static bool _isMapped2DCBE(const TVirtualVolume *obj, const ImageVector &pos)
static MLint64 getInt64CursorValueWrapped(void *vv)
static void setLDoubleCursorValueWrapped(void *vv, MLldouble v)
static void fillLDoubleWrapped(void *vv, const ImageVector &v1, const ImageVector &v2, MLldouble v)
static DATATYPE _getVoxel3DCBE(TVirtualVolume *obj, const ImageVector &pos)
static void _moveBTCB(TVirtualVolume *obj)
static void _setVoxel3DCBE(TVirtualVolume *obj, const ImageVector &pos, DATATYPE voxVal)
static bool _isMapped1DCB(const TVirtualVolume *obj, const ImageVector &pos)
DATATYPE ComponentType
A typedef to "export" the type of voxels components.
DATATYPE * getWrittenPageData(MLuint32 wp) const
Returns typed pointer to data of written page with page id wp.
static void reverseMoveCursorZWrapped(void *vv)
TVirtualVolume()
Hide the default constructor to avoid incorrect usage due to missing initializations.
static DATATYPE _getVoxel1DCBE(TVirtualVolume *obj, const ImageVector &pos)
static void setIntCursorValueWrapped(void *vv, MLint v)
static void setCursorPositionWrapped(void *vv, const ImageVector &pos)
static void _moveCursorOffset3DCBE(TVirtualVolume *obj, const ImageVector &p)
static MLint getIntCursorValueWrapped(void *vv)
static void _moveFTCB(TVirtualVolume *obj)
static void _setCursorPos5DCBE(TVirtualVolume *obj, const ImageVector &p)
static MLint getIntValueWrapped(void *vv, const ImageVector &pos)
Wrapper functions for non template application interfaces.
static const ImageVector & getCursorPositionWrapped(void *vv)
static void moveCursorByOffsetWrapped(void *vv, const ImageVector &off)
static void _moveCursorOffset1DCB(TVirtualVolume *obj, const ImageVector &p)
static DATATYPE _getVoxel4DCBE(TVirtualVolume *obj, const ImageVector &pos)
static void _moveFYCB(TVirtualVolume *obj)
static void moveCursorUWrapped(void *vv)
static void moveCursorYWrapped(void *vv)
static bool isMappedWrapped(void *vv, const ImageVector &pos)
static void moveCursorTWrapped(void *vv)
static bool _isMapped6DCB(const TVirtualVolume *obj, const ImageVector &pos)
static void _setVoxel5DCBE(TVirtualVolume *obj, const ImageVector &pos, DATATYPE voxVal)
static void _setCursorPos3DCBE(TVirtualVolume *obj, const ImageVector &p)
static void _setCursorPos2DCBE(TVirtualVolume *obj, const ImageVector &p)
static void _setVoxel6DCBE(TVirtualVolume *obj, const ImageVector &pos, DATATYPE voxVal)
static void _moveCursorOffset5DCBE(TVirtualVolume *obj, const ImageVector &p)
static void _moveBXCBE(TVirtualVolume *obj)
static void _moveBCCBE(TVirtualVolume *obj)
static void _moveFXCBE(TVirtualVolume *obj)
static void _moveFUCBE(TVirtualVolume *obj)
void copyMaskToSubImage(TSubImage< OUTDTYPE > &outSubImg, BitImage &maskBits, bool maskValue=true, bool writeBK=false, OUTDTYPE bkVal=ml_cast_from_scalar< OUTDTYPE >(0))
Takes overlapping region from *this, outSubImg and maskBits and copies all voxels from *this to outSu...
static DATATYPE _getVoxel4DCB(TVirtualVolume *obj, const ImageVector &pos)
VirtualVolume & getVirtualVolume()
Returns the pointer to the wrapped untyped virtual volume.
static bool _isMapped3DCBE(const TVirtualVolume *obj, const ImageVector &pos)
static void moveCursorXWrapped(void *vv)
static void _moveCursorOffset5DCB(TVirtualVolume *obj, const ImageVector &p)
TVirtualVolume(const ImageVector &ext, MLdouble fillVal=0, MLint maxNumKB=-1, bool areExceptionsOn=false)
Convenience constructor (3) creating an untyped virtual volume inside the typed one to avoid addition...
static bool _isMapped1DCBE(const TVirtualVolume *obj, const ImageVector &pos)
static void _setVoxel1DCBE(TVirtualVolume *obj, const ImageVector &pos, DATATYPE voxVal)
static void _moveBTCBE(TVirtualVolume *obj)
static bool _isMapped6DCBE(const TVirtualVolume *obj, const ImageVector &pos)
static void _setVoxel2DCB(TVirtualVolume *obj, const ImageVector &pos, DATATYPE voxVal)
static void reverseMoveCursorTWrapped(void *vv)
static bool _isMapped2DCB(const TVirtualVolume *obj, const ImageVector &pos)
static void resetCursorWrapped(void *vv)
void reverseMoveCursorU()
static void _moveFZCBE(TVirtualVolume *obj)
DATATYPE getValue(const ImageVector &pos)
Get a voxel value from the virtual volume.
static void fillIntWrapped(void *vv, const ImageVector &v1, const ImageVector &v2, MLint v)
static void _setCursorPos6DCBE(TVirtualVolume *obj, const ImageVector &p)
static void _moveFCCB(TVirtualVolume *obj)
static void _setCursorPos2DCB(TVirtualVolume *obj, const ImageVector &p)
static void _setCursorPos1DCB(TVirtualVolume *obj, const ImageVector &p)
static void _setVoxel4DCB(TVirtualVolume *obj, const ImageVector &pos, DATATYPE voxVal)
static void moveCursorCWrapped(void *vv)
static bool _isMapped5DCBE(const TVirtualVolume *obj, const ImageVector &pos)
static DATATYPE _getVoxel1DCB(TVirtualVolume *obj, const ImageVector &pos)
static void _setCursorPos4DCBE(TVirtualVolume *obj, const ImageVector &p)
static void _moveBYCB(TVirtualVolume *obj)
static DATATYPE _getVoxel6DCBE(TVirtualVolume *obj, const ImageVector &pos)
static DATATYPE _getVoxel2DCB(TVirtualVolume *obj, const ImageVector &pos)
static bool moveCursorXWrapAroundWrapped(void *vv)
void reverseMoveCursorY()
static void moveCursorZWrapped(void *vv)
static void setInt64CursorValueWrapped(void *vv, MLint64 v)
static void _moveBUCB(TVirtualVolume *obj)
static bool _isMapped4DCB(const TVirtualVolume *obj, const ImageVector &pos)
const ImageVector & getCursorPosition() const
Return the current cursor coordinates.
TVirtualVolume(PagedImage *image, MLint maxNumKB=-1, bool areExceptionsOn=false)
Convenience constructor (2) creating an untyped virtual volume inside the typed one to avoid addition...
static void _setCursorPos1DCBE(TVirtualVolume *obj, const ImageVector &p)
static DATATYPE _getVoxel2DCBE(TVirtualVolume *obj, const ImageVector &pos)
static DATATYPE _getVoxel5DCBE(TVirtualVolume *obj, const ImageVector &pos)
static void _moveFXCB(TVirtualVolume *obj)
static void _moveBZCBE(TVirtualVolume *obj)
TVirtualVolume(VirtualVolume &vVol)
Constructor 1.
static void fillInt64Wrapped(void *vv, const ImageVector &v1, const ImageVector &v2, MLint64 v)
static DATATYPE _getVoxel6DCB(TVirtualVolume *obj, const ImageVector &pos)
static void _moveCursorOffset1DCBE(TVirtualVolume *obj, const ImageVector &p)
static void _moveBCCB(TVirtualVolume *obj)
static void _setVoxel5DCB(TVirtualVolume *obj, const ImageVector &pos, DATATYPE voxVal)
static void _moveCursorOffset2DCB(TVirtualVolume *obj, const ImageVector &p)
static MLldouble getLDoubleValueWrapped(void *vv, const ImageVector &pos)
static void _moveCursorOffset6DCB(TVirtualVolume *obj, const ImageVector &p)
static void _moveFCCBE(TVirtualVolume *obj)
static void _moveFTCBE(TVirtualVolume *obj)
static void _moveBZCB(TVirtualVolume *obj)
static bool _isMapped3DCB(const TVirtualVolume *obj, const ImageVector &pos)
void reverseMoveCursorX()
static void reverseMoveCursorXWrapped(void *vv)
TVirtualVolume & operator=(const TVirtualVolume &)
Hide the default assignment operator to avoid incorrect usage due to missing initializations.
void setValue(const ImageVector &pos, DATATYPE data)
Write a voxel into the virtual volume.
static void _moveCursorOffset6DCBE(TVirtualVolume *obj, const ImageVector &p)
static void _moveFUCB(TVirtualVolume *obj)
static void _moveCursorOffset4DCB(TVirtualVolume *obj, const ImageVector &p)
bool isMapped(const ImageVector &pos) const
Returns true if voxel is mapped into memory, otherwise it returns false.
static void _setVoxel1DCB(TVirtualVolume *obj, const ImageVector &pos, DATATYPE voxVal)
void moveCursorByOffset(const ImageVector &off)
Shift cursor to current position + offset.
static void _moveBYCBE(TVirtualVolume *obj)
void copyToSubImage(TSubImage< DATATYPE > &outSubImg)
Copy area from the virtual volume into the subimage given by outSubImg.
static DATATYPE _getVoxel3DCB(TVirtualVolume *obj, const ImageVector &pos)
static void reverseMoveCursorYWrapped(void *vv)
static void _moveCursorOffset4DCBE(TVirtualVolume *obj, const ImageVector &p)
static void _setVoxel3DCB(TVirtualVolume *obj, const ImageVector &pos, DATATYPE voxVal)
static void _setVoxel2DCBE(TVirtualVolume *obj, const ImageVector &pos, DATATYPE voxVal)
static MLldouble getLDoubleCursorValueWrapped(void *vv)
static DATATYPE _getVoxel5DCB(TVirtualVolume *obj, const ImageVector &pos)
static void _setCursorPos5DCB(TVirtualVolume *obj, const ImageVector &p)
void reverseMoveCursorC()
static void setLDoubleValueWrapped(void *vv, const ImageVector &pos, MLldouble v)
This class manages a virtual volume organizing efficient voxel access to the output image of an input...
#define ML_BAD_DATA_TYPE
A wrong or unexpected data type has been passed to an algorithm, which often is a programming error.
#define ML_BAD_DIMENSION
The image or data structure has wrong extent or dimensions.
#define ML_OUT_OF_RANGE
Any coordinate or value is out of range, often a voxel address that is outside of an image or it is e...
#define ML_PRINT_FATAL_ERROR(FUNC_NAME, REASON, HANDLING)
Like ML_PRINT_FATAL_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ) without a runtime object to be du...
#define ML_PRINT_ERROR(FUNC_NAME, REASON, HANDLING)
Like ML_PRINT_ERROR_DUMP(FUNC_NAME, REASON, HANDLING, RT_OBJ) without a runtime object to be dumped.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
#define _VV_MOVEBE_TEST(Q)
Macro to save cursor movement with exception handling if outside image.
MLDataType MLGetDataTypeFromPtr(const T *)
MLuint64 MLuint
An unsigned ML integer type with at least 64 bits used for index calculations on very large images ev...
INT64 MLint64
Include 64-bit integer support for Windows or Unix.
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
PageBuffer is a helper structure to manage one page of input data of the VirtualVolume class and it a...
ReturnPageFunc _getPageFkt
Pointer to function to return the page managed by the PageBuffer.
bool _locked
If true this page contains written data and must not be removed.