Esempio n. 1
0
        private unsafe static void CopyToSigned16(ImageGraphic image, itkImageBase itkImage)
        {
            fixed(byte *pSrcByte = image.PixelData.Raw)
            {
                itkImageRegionIterator_ISS2 inputIt = new itkImageRegionIterator_ISS2(itkImage, itkImage.LargestPossibleRegion);
                short *pSrc   = (short *)pSrcByte;
                int    height = image.Rows;
                int    width  = image.Columns;
                short  pixelValue;

                for (int y = 0; y < height; y++)
                {
                    for (int x = 0; x < width; x++)
                    {
                        pixelValue = pSrc[0];
                        inputIt.Set(pixelValue);
                        pSrc++;
                        inputIt++;
                    }
                }
            }
        }
Esempio n. 2
0
 private unsafe static void CopyToUnsigned16(ImageGraphic image, itkImageBase itkImage)
 {
     fixed (byte* pSrcByte = image.PixelData.Raw)
     {
         // itkImageIterator has F, SS, and UC
         itkImageRegionIterator_ISS2 inputIt = new itkImageRegionIterator_ISS2(itkImage, itkImage.LargestPossibleRegion);
         ushort* pSrc = (ushort*)pSrcByte;
         int height = image.Rows;
         int width = image.Columns;
         ushort pixelValue;
         for (int y = 0; y < height; y++)
         {
             for (int x = 0; x < width; x++)
             {
                 pixelValue = pSrc[0];
                 inputIt.Set(pixelValue);
                 pSrc++;
                 inputIt++;
             }
         }
     }
 }