/** * This is a callback to be executed before resampleSingle is executed. The bilinear interpolation * coefficients are computed here and vary with the single, active slice. The offset into the * intermediate image is also computed since this also varies with the active slice. If encoding * of transparent data has occurred in the renderer constructor, then the current slice of the * encoding table is initialized for use by resampleSingle. */ protected void beforeResampleSingle() { // compute the 0-direction index ranges and weighting factors float fMin = (m_afShear[0] * m_iSlice) + m_afOffset[0]; m_afA[0] = fMin - (float) Math.floor(fMin); m_afB[0] = 1.0f - m_afA[0]; int iMin0 = (int) Math.ceil(fMin); // compute the 0-direction index ranges and weighting factors fMin = (m_afShear[1] * m_iSlice) + m_afOffset[1]; m_afA[1] = fMin - (float) Math.floor(fMin); m_afB[1] = 1.0f - m_afA[1]; int iMin1 = (int) Math.ceil(fMin); // offset into intermediate image of rendered voxel data m_iInterOffset = iMin0 + (m_iInterBound * iMin1); if (m_bDoEncodeSkip) { m_aasSliceEncode = m_aaasVolumeEncode[m_iSlice]; } }