public Bitmap Render(IImageSpace3D <float, float> source_image)
        {
            Bitmap destination_image = new Bitmap(resolution_x, resolution_y);

            float[] coordinates_y = ToolsCollection.Copy(render_origen);
            for (int index_y = 0; index_y < resolution_x; index_y++)
            {
                ToolsMathCollection.AddRBA <float>(algebra, coordinates_y, render_stride_y, coordinates_y);

                float[] coordinates_x = ToolsCollection.Copy(coordinates_y);
                for (int index_x = 0; index_x < resolution_y; index_x++)
                {
                    float[] coordinates_z = ToolsCollection.Copy(coordinates_x);
                    float   max_value     = source_image.GetLocationValue(coordinates_z);
                    ToolsMathCollection.AddRBA(algebra, coordinates_z, render_stride_z, coordinates_z);

                    for (int index_z = 1; index_z < resolution_z; index_z++)
                    {
                        float value = source_image.GetLocationValue(coordinates_z);
                        if (this.comparer.Compare(max_value, value) == -1)
                        {
                            max_value = value;
                        }
                        ToolsMathCollection.AddRBA(algebra, coordinates_z, render_stride_z, coordinates_z);
                    }
                    destination_image.SetPixel(index_x, index_y, this.converter.Compute(max_value));

                    ToolsMathCollection.AddRBA(algebra, coordinates_x, render_stride_x, coordinates_x);
                }
            }
            return(destination_image);
        }
Exemple #2
0
        public Bitmap Render(IImageSpace3D <float, float> source_image)
        {
            float [,] image = new float [this.resolution[0], this.resolution[1]];

            Parallel.For(0, this.resolution[1], index_y =>
            {
                float[] coordinates_y = ToolsMathCollection.AddMultiple <float>(algebra, coordinates_origen, render_stride_y, index_y);
                for (int index_x = 0; index_x < this.resolution[0]; index_x++)
                {
                    float[] coordinates_x   = ToolsMathCollection.AddMultiple <float>(algebra, coordinates_y, render_stride_x, index_x);
                    image[index_x, index_y] = Projection(coordinates_x, this.render_stride_z, this.resolution[2], source_image);
                }
            });


            //for (int index_y = 0; index_y < this.resolution[1]; index_y++)
            //{
            //    float[] coordinates_y = ToolsMathArray.AddMultiple<float>(algebra, coordinates_origen, render_stride_y, index_y);
            //    for (int index_x = 0; index_x < this.resolution[0]; index_x++)
            //    {
            //        float[] coordinates_x = ToolsMathArray.AddMultiple<float>(algebra, coordinates_y, render_stride_x, index_x);

            //        float value = Projection(coordinates_x, this.render_stride_z, this.resolution[2], source_image);
            //        destination_image.SetPixel(index_x, index_y, this.converter.Compute(value));
            //    }

            //}
            return(ConvertToBitmap(image));
        }
Exemple #3
0
 protected override float Projection(float[] origen, float[] stride_size, int stride_count, IImageSpace3D <float, float> source_image)
 {
     float[] coordinates = ToolsCollection.Copy(origen);
     for (int index_z = 0; index_z < stride_count; index_z++)
     {
         float value = source_image.GetLocationValue(coordinates);
         if (this.comparer.Compare(value, min_value) == 1)
         {
             return(value);
         }
         ToolsMathCollection.AddRBA(algebra, coordinates, stride_size, coordinates);
     }
     return(min_value);
 }
Exemple #4
0
 public void Render(IImageSpace3D <float, float> image, float resolution)
 {
 }
Exemple #5
0
 protected abstract float Projection(float[] origen, float[] stride_size, int stride_count, IImageSpace3D <float, float> source_image);