Exemplo n.º 1
0
        /// <summary>
        /// Creates a new image volume with a border of the supplied size
        /// around the supplied image volume.
        /// </summary>
        public static Volume <T> CopyWithBorder <T>(this Volume <T> volume, Border2l border)
        {
            var iv = new V3l(volume.SX + border.Min.X + border.Max.X,
                             volume.SY + border.Min.Y + border.Max.Y,
                             volume.SZ).CreateImageVolume <T>();

            iv.SubCenter(border).Set(volume);
            return(iv);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new image volume with a border of the supplied size
        /// around the supplied image volume.
        /// </summary>
        public static Volume <T1> MapWithBorder <T, T1>(
            this Volume <T> volume, Border2l border,
            Func <T, T1> item_fun)
        {
            var iv = new V3l(volume.SX + border.Min.X + border.Max.X,
                             volume.SY + border.Min.Y + border.Max.Y,
                             volume.SZ).CreateImageVolume <T1>();

            iv.SubCenter(border).SetMap(volume, item_fun);
            return(iv);
        }