                       level,
                       cols,
                       rows,
-                      _levels,
+                      _levels-1,
                       extrema_counter,
                       oct_obj.getExtrema( level ),
                       num_blocks,

    inline __device__
    bool first_contrast_ok( const float val ) const;

    inline __device__
    bool refine( const float3& d, int3& n, const int width, const int height, const int maxlevel );
};

template<>

    ec.ypos    = yn;
    ec.sigma   = d_sigma0 * pow(d_sigma_k, sn); // * 2;
        // const float sigma_k = powf(2.0f, 1.0f / levels );


// #ifdef DEBUG_MEGA_LOOP
    // float sigw = 3.0f * ec.sigma;
    // int   rad  = (int)rintf((3.0f * sigw));

    // if( sn < -1 ) {
        // printf("o/l=%d/%d pos=(%0.1f, %0.1f, %0.1f) n.z=%d d.z=%0.2f det=%0.2f scale=%0.2f pixel radius=%d conv=%s\n", debug_octave, level, ec.xpos, ec.ypos, sn, n.z, d.z, det, ec.sigma, rad, debug_converged ? "yes" : "no" );
    // } else if( sn > maxlevel ) {
        // printf("o/l=%d/%d pos=(%0.1f, %0.1f, %0.1f) n.z=%d d.z=%0.2f det=%0.2f scale=%0.2f pixel radius=%d conv=%s\n", debug_octave, level, ec.xpos, ec.ypos, sn, n.z, d.z, det, ec.sigma, rad, debug_converged ? "yes" : "no" );
    // } else if( sn > maxlevel-1 ) {
        // printf("o/l=%d/%d pos=(%0.1f, %0.1f, %0.1f) n.z=%d d.z=%0.2f det=%0.2f scale=%0.2f pixel radius=%d conv=%s\n", debug_octave, level, ec.xpos, ec.ypos, sn, n.z, d.z, det, ec.sigma, rad, debug_converged ? "yes" : "no" );
    // } else if( not debug_converged ) {
        // printf("o/l=%d/%d pos=(%0.1f, %0.1f, %0.1f) n.z=%d d.z=%0.2f det=%0.2f scale=%0.2f pixel radius=%d conv=%s\n", debug_octave, level, ec.xpos, ec.ypos, sn, n.z, d.z, det, ec.sigma, rad, debug_converged ? "yes" : "no" );
    // }
// #endif // DEBUG_MEGA_LOOP


#ifdef PRINT_EXTREMA_DEBUG_INFO
    printf("Found an extremum at %d %d (o=%d,l=%d)     -> x:%.8f y:%.8f z:%.8f sigma:%0.8f\n", x, y, debug_octave, level, xn, yn, sn, ec.sigma );
#endif // PRINT_EXTREMA_DEBUG_INFO

    ec.orientation = 0;
