MCPcopy Create free account
hub / github.com/MITK/MITK / vtkResliceRound

Function vtkResliceRound

Modules/Segmentation/src/Algorithms/mitkVtkImageOverwrite.cpp:85–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85inline int vtkResliceRound(double x)
86{
87#if defined mips || defined sparc || defined __ppc__
88 return static_cast<int>(static_cast<unsigned int>(x + 2147483648.5) - 2147483648U);
89#elif defined i386 || defined _M_IX86
90 union {
91 double d;
92 unsigned int i[2];
93 } dual;
94 dual.d = x + 103079215104.5; // (2**(52-16))*1.5
95 return static_cast<int>((dual.i[1] << 16) | ((dual.i[0]) >> 16));
96#elif defined ia64 || defined __ia64__ || defined IA64
97 x += 103079215104.5;
98 long long i = static_cast<long long>(x);
99 return static_cast<int>(i - 103079215104LL);
100#else
101 return static_cast<int>(floor(x + 0.5));
102#endif
103}
104
105//----------------------------------------------------------------------------
106mitkVtkImageOverwrite::mitkVtkImageOverwrite()

Callers 2

vtkResliceClampFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected