add getPatch function

get linear indices of patch from center
getPatchの出力をベクトルに変更