|
| static Filt | GetFilter (string name) |
| |
| static Filt | GetFilter (int type, int index) |
| |
| static BioImage | Base (string id, string name, bool inPlace) |
| |
| static BioImage | Base2 (string id, string id2, string name, bool inPlace) |
| |
| static BioImage | InPlace (string id, string name, bool inPlace) |
| |
| static BioImage | InPlace2 (string id, string id2, string name, bool inPlace) |
| |
| static BioImage | InPlacePartial (string id, string name, bool inPlace) |
| |
| static BioImage | Resize (string id, string name, bool inPlace, int w, int h) |
| |
| static BioImage | Rotate (string id, string name, bool inPlace, float angle, int a, int r, int g, int b) |
| |
| static BioImage | Transformation (string id, string name, bool inPlace, float angle) |
| |
| static BioImage | Copy (string id, string name, bool inPlace) |
| |
| static BioImage | Crop (string id, double x, double y, double w, double h) |
| |
| static BioImage | Crop (string id, RectangleD r) |
| |
| static void | Init () |
| | It creates a dictionary of filters and their names.
|
| |
◆ Base()
| static BioImage BioLib.Filters.Base |
( |
string | id, |
|
|
string | name, |
|
|
bool | inPlace ) |
|
static |
It takes an image, applies a filter to it, and returns the filtered image
- Parameters
-
| id | The id of the image to apply the filter to. |
| name | The name of the filter. |
| inPlace | If true, the image will be modified in place. If false, a new image will be created. |
- Returns
- The image that was filtered.
436 {
438 if (!inPlace)
440 try
441 {
443 BaseFilter fi = (BaseFilter)f.
filt;
444 for (
int i = 0; i < img.
Buffers.Count; i++)
445 {
448 }
449 if (!inPlace)
450 {
452 }
453 }
454 catch (Exception e)
455 {
456 MessageDialog dialog = new MessageDialog(null, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok, e.Message);
457 dialog.Show();
458 }
459 return img;
460 }
AForge.Bitmap Bitmap
Definition Bio.cs:53
static Bitmap bm
Definition Bio.cs:8524
static BioImage Copy(BioImage b, bool rois)
Definition Bio.cs:2133
List< AForge.Bitmap > Buffers
Definition Bio.cs:1980
IFilter filt
Definition Bio.cs:389
static Filt GetFilter(string name)
Definition Bio.cs:406
static void AddImage(BioImage im)
Definition Bio.cs:86
static BioImage GetImage(string ids)
Definition Bio.cs:73
◆ Base2()
| static BioImage BioLib.Filters.Base2 |
( |
string | id, |
|
|
string | id2, |
|
|
string | name, |
|
|
bool | inPlace ) |
|
static |
It takes two images, applies a filter to the first image, and then applies the second image to the first image
- Parameters
-
| id | the image id |
| id2 | The image to be filtered |
| name | The name of the filter. |
| inPlace | If true, the image will be modified in place. If false, a new image will be created. |
- Returns
- The image that was filtered.
472 {
475 if (!inPlace)
477 try
478 {
480 BaseFilter2 fi = (BaseFilter2)f.
filt;
481 for (
int i = 0; i < img.
Buffers.Count; i++)
482 {
483 fi.OverlayImage = c2.
Buffers[i];
485 }
486 if (!inPlace)
487 {
489 }
490 return img;
491 }
492 catch (Exception e)
493 {
494 MessageDialog dialog = new MessageDialog(null, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok, e.Message);
495 dialog.Show();
496 }
497 return img;
498 }
◆ Copy()
| static BioImage BioLib.Filters.Copy |
( |
string | id, |
|
|
string | name, |
|
|
bool | inPlace ) |
|
static |
It takes an image, applies a filter to it, and returns the filtered image
- Parameters
-
| id | the id of the image to be filtered |
| name | The name of the filter to apply |
| inPlace | If true, the image will be modified in place. If false, a copy of the image will be created and the copy will be modified. |
- Returns
- The image that was copied.
724 {
726 if (!inPlace)
728 try
729 {
731 BaseUsingCopyPartialFilter fi = (BaseUsingCopyPartialFilter)f.
filt;
732 for (
int i = 0; i < img.
Buffers.Count; i++)
733 {
735 }
736 if (!inPlace)
737 {
739 }
740 }
741 catch (Exception e)
742 {
743 MessageDialog dialog = new MessageDialog(null, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok, e.Message);
744 dialog.Show();
745 }
746 return img;
747 }
◆ Crop() [1/2]
| static BioImage BioLib.Filters.Crop |
( |
string | id, |
|
|
double | x, |
|
|
double | y, |
|
|
double | w, |
|
|
double | h ) |
|
static |
It takes an image, crops it, and returns the cropped image
- Parameters
-
| id | the id of the image to crop |
| x | x coordinate of the top left corner of the rectangle |
| y | y-coordinate of the top-left corner of the rectangle |
| w | width |
| h | height |
- Returns
- The cropped image.
758 {
761 Rectangle rec =
new Rectangle((
int)r.X, (
int)r.Y, (
int)Math.Abs(r.Width), (
int)Math.Abs(r.Height));
763 for (
int i = 0; i < img.
Buffers.Count; i++)
764 {
766 }
769 img.StackThreshold(true);
770 else
771 img.StackThreshold(false);
772 return img;
773 }
AForge.Rectangle Rectangle
Definition Bio.cs:61
AForge.RectangleD RectangleD
Definition Fiji.cs:27
int bitsPerPixel
Definition Bio.cs:2065
PointD ToImageSpace(PointD p)
Convert a point in the stage coordinate system to a point in the image coordinate system.
Definition Bio.cs:3624
◆ Crop() [2/2]
This function takes a string and a rectangle and returns a BioImage
- Parameters
-
| id | the id of the image to crop |
| RectangleD | |
- Returns
- A BioImage object.
781 {
782 return Crop(
id, r.X, r.Y, r.W, r.H);
783 }
static BioImage Crop(string id, double x, double y, double w, double h)
Definition Bio.cs:757
◆ GetFilter() [1/2]
| static Filt BioLib.Filters.GetFilter |
( |
int | type, |
|
|
int | index ) |
|
static |
It returns a filter from the filters dictionary, using the indexs array to find the index of the filter in the dictionary
- Parameters
-
| type | The type of filter you want to get. |
| index | The index of the filter in the list of filters. |
- Returns
- The value of the filter at the index of the type and index.
423 {
425 }
static List< Filt > filters
Definition Bio.cs:426
static int[,] indexs
Definition Bio.cs:400
◆ GetFilter() [2/2]
| static Filt BioLib.Filters.GetFilter |
( |
string | name | ) |
|
|
static |
It takes a string as an argument and returns a filter object
- Parameters
-
| name | The name of the filter. |
- Returns
- The value of the key "name" in the dictionary "filters"
407 {
409 {
410 if (item.
name == name)
411 return item;
412 }
413 return null;
414 }
string name
Definition Bio.cs:388
◆ Init()
| static void BioLib.Filters.Init |
( |
| ) |
|
|
static |
It creates a dictionary of filters and their names.
787 {
788
791 Filt f =
new Filt(
"AdaptiveSmoothing",
new AdaptiveSmoothing(),
Filt.
Type.Base);
794 f =
new Filt(
"BayerFilter",
new BayerFilter(),
Filt.
Type.Base);
797 f =
new Filt(
"BayerFilterOptimized",
new BayerFilterOptimized(),
Filt.
Type.Base);
800 f =
new Filt(
"BayerDithering",
new BayerDithering(),
Filt.
Type.Base);
803 f =
new Filt(
"ConnectedComponentsLabeling",
new ConnectedComponentsLabeling(),
Filt.
Type.Base);
806 f =
new Filt(
"ExtractChannel",
new ExtractChannel(),
Filt.
Type.Base);
809 f =
new Filt(
"ExtractNormalizedRGBChannel",
new ExtractNormalizedRGBChannel(),
Filt.
Type.Base);
812 f =
new Filt(
"Grayscale",
new Grayscale(0.2125, 0.7154, 0.0721),
Filt.
Type.Base);
814
815
817 f =
new Filt(
"WaterWave",
new WaterWave(),
Filt.
Type.Base);
820 f =
new Filt(
"YCbCrExtractChannel",
new YCbCrExtractChannel(),
Filt.
Type.Base);
823
824
825 f =
new Filt(
"ThresholdedDifference",
new ThresholdedDifference(),
Filt.
Type.Base2);
828 f =
new Filt(
"ThresholdedEuclideanDifference",
new ThresholdedEuclideanDifference(),
Filt.
Type.Base2);
831
832
834 f =
new Filt(
"BackwardQuadrilateralTransformation",
new BackwardQuadrilateralTransformation(),
Filt.
Type.InPlace);
837 f =
new Filt(
"BlobsFiltering",
new BlobsFiltering(),
Filt.
Type.InPlace);
840 f =
new Filt(
"BottomHat",
new BottomHat(),
Filt.
Type.InPlace);
843 f =
new Filt(
"BradleyLocalThresholding",
new BradleyLocalThresholding(),
Filt.
Type.InPlace);
852 f =
new Filt(
"CanvasMove",
new CanvasMove(
new IntPoint()),
Filt.
Type.InPlace);
855 f =
new Filt(
"FillHoles",
new FillHoles(),
Filt.
Type.InPlace);
858 f =
new Filt(
"FlatFieldCorrection",
new FlatFieldCorrection(),
Filt.
Type.InPlace);
861 f =
new Filt(
"TopHat",
new TopHat(),
Filt.
Type.InPlace);
863
864
869 f =
new Filt(
"Difference",
new Difference(),
Filt.
Type.InPlace2);
872 f =
new Filt(
"Intersect",
new Intersect(),
Filt.
Type.InPlace2);
881 f =
new Filt(
"MoveTowards",
new MoveTowards(),
Filt.
Type.InPlace2);
884 f =
new Filt(
"StereoAnaglyph",
new StereoAnaglyph(),
Filt.
Type.InPlace2);
887 f =
new Filt(
"Subtract",
new Subtract(),
Filt.
Type.InPlace2);
889
890
891
892
894 f =
new Filt(
"AdditiveNoise",
new AdditiveNoise(),
Filt.
Type.InPlacePartial);
896
897
899 f =
new Filt(
"BrightnessCorrection",
new BrightnessCorrection(),
Filt.
Type.InPlacePartial);
902 f =
new Filt(
"ChannelFiltering",
new ChannelFiltering(),
Filt.
Type.InPlacePartial);
905 f =
new Filt(
"ColorFiltering",
new ColorFiltering(),
Filt.
Type.InPlacePartial);
908 f =
new Filt(
"ColorRemapping",
new ColorRemapping(),
Filt.
Type.InPlacePartial);
911 f =
new Filt(
"ContrastCorrection",
new ContrastCorrection(),
Filt.
Type.InPlacePartial);
914 f =
new Filt(
"ContrastStretch",
new ContrastStretch(),
Filt.
Type.InPlacePartial);
916
917
918
920 f =
new Filt(
"EuclideanColorFiltering",
new EuclideanColorFiltering(),
Filt.
Type.InPlacePartial);
923 f =
new Filt(
"GammaCorrection",
new GammaCorrection(),
Filt.
Type.InPlacePartial);
926 f =
new Filt(
"HistogramEqualization",
new HistogramEqualization(),
Filt.
Type.InPlacePartial);
929 f =
new Filt(
"HorizontalRunLengthSmoothing",
new HorizontalRunLengthSmoothing(),
Filt.
Type.InPlacePartial);
932 f =
new Filt(
"HSLFiltering",
new HSLFiltering(),
Filt.
Type.InPlacePartial);
935 f =
new Filt(
"HueModifier",
new HueModifier(),
Filt.
Type.InPlacePartial);
938 f =
new Filt(
"Invert",
new Invert(),
Filt.
Type.InPlacePartial);
941 f =
new Filt(
"LevelsLinear",
new LevelsLinear(),
Filt.
Type.InPlacePartial);
944 f =
new Filt(
"LevelsLinear16bpp",
new LevelsLinear16bpp(),
Filt.
Type.InPlacePartial);
946
947
948
949
950
952 f =
new Filt(
"OrderedDithering",
new OrderedDithering(),
Filt.
Type.InPlacePartial);
955 f =
new Filt(
"OtsuThreshold",
new OtsuThreshold(),
Filt.
Type.InPlacePartial);
958 f =
new Filt(
"Pixellate",
new Pixellate(),
Filt.
Type.InPlacePartial);
961 f =
new Filt(
"PointedColorFloodFill",
new PointedColorFloodFill(),
Filt.
Type.InPlacePartial);
964 f =
new Filt(
"PointedMeanFloodFill",
new PointedMeanFloodFill(),
Filt.
Type.InPlacePartial);
967 f =
new Filt(
"ReplaceChannel",
new Invert(),
Filt.
Type.InPlacePartial);
970 f =
new Filt(
"RotateChannels",
new LevelsLinear(),
Filt.
Type.InPlacePartial);
973 f =
new Filt(
"SaltAndPepperNoise",
new LevelsLinear16bpp(),
Filt.
Type.InPlacePartial);
976 f =
new Filt(
"SaturationCorrection",
new SaturationCorrection(),
Filt.
Type.InPlacePartial);
979 f =
new Filt(
"Sepia",
new Sepia(),
Filt.
Type.InPlacePartial);
982 f =
new Filt(
"SimplePosterization",
new SimplePosterization(),
Filt.
Type.InPlacePartial);
985 f =
new Filt(
"SISThreshold",
new SISThreshold(),
Filt.
Type.InPlacePartial);
987
988
989
990
992 f =
new Filt(
"ThresholdWithCarry",
new ThresholdWithCarry(),
Filt.
Type.InPlacePartial);
995 f =
new Filt(
"VerticalRunLengthSmoothing",
new VerticalRunLengthSmoothing(),
Filt.
Type.InPlacePartial);
998 f =
new Filt(
"YCbCrFiltering",
new YCbCrFiltering(),
Filt.
Type.InPlacePartial);
1001 f =
new Filt(
"YCbCrLinear",
new YCbCrLinear(),
Filt.
Type.InPlacePartial);
1003
1004
1005
1006
1008 f =
new Filt(
"ResizeBicubic",
new ResizeBicubic(0, 0),
Filt.
Type.Resize);
1011 f =
new Filt(
"ResizeBilinear",
new ResizeBilinear(0, 0),
Filt.
Type.Resize);
1014 f =
new Filt(
"ResizeNearestNeighbor",
new ResizeNearestNeighbor(0, 0),
Filt.
Type.Resize);
1016
1017
1019 f =
new Filt(
"RotateBicubic",
new RotateBicubic(0),
Filt.
Type.Rotate);
1022 f =
new Filt(
"RotateBilinear",
new RotateBilinear(0),
Filt.
Type.Rotate);
1025 f =
new Filt(
"RotateNearestNeighbor",
new RotateNearestNeighbor(0),
Filt.
Type.Rotate);
1027
1028
1033 f =
new Filt(
"QuadrilateralTransformation",
new QuadrilateralTransformation(),
Filt.
Type.Transformation);
1035
1036
1037
1038
1040 f =
new Filt(
"Shrink",
new Shrink(),
Filt.
Type.Transformation);
1043 f =
new Filt(
"SimpleQuadrilateralTransformation",
new SimpleQuadrilateralTransformation(),
Filt.
Type.Transformation);
1046 f =
new Filt(
"TransformFromPolar",
new TransformFromPolar(),
Filt.
Type.Transformation);
1049 f =
new Filt(
"TransformToPolar",
new TransformToPolar(),
Filt.
Type.Transformation);
1051
1052
1054 f =
new Filt(
"BinaryDilatation3x3",
new BinaryDilatation3x3(),
Filt.
Type.Copy);
1057 f =
new Filt(
"BilateralSmoothing ",
new BilateralSmoothing(),
Filt.
Type.Copy);
1060 f =
new Filt(
"BinaryErosion3x3 ",
new BinaryErosion3x3(),
Filt.
Type.Copy);
1062
1063 }
Type
Definition Bio.cs:377
◆ InPlace()
| static BioImage BioLib.Filters.InPlace |
( |
string | id, |
|
|
string | name, |
|
|
bool | inPlace ) |
|
static |
It takes an image, applies a filter to it, and returns the image
- Parameters
-
| id | The id of the image to apply the filter to. |
| name | The name of the filter |
| inPlace | If true, the image will be modified in place. If false, a copy of the image will be created and modified. |
- Returns
- The image that was passed in.
508 {
510 if (!inPlace)
512 try
513 {
515 BaseInPlaceFilter fi = (BaseInPlaceFilter)f.
filt;
516 for (
int i = 0; i < img.
Buffers.Count; i++)
517 {
519 }
520 if (!inPlace)
521 {
523 }
524 return img;
525 }
526 catch (Exception e)
527 {
528 MessageDialog dialog = new MessageDialog(null, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok, e.Message);
529 dialog.Show();
530 }
531 return img;
532 }
◆ InPlace2()
| static BioImage BioLib.Filters.InPlace2 |
( |
string | id, |
|
|
string | id2, |
|
|
string | name, |
|
|
bool | inPlace ) |
|
static |
This function takes an image, applies a filter to it, and returns the filtered image
- Parameters
-
| id | the image id |
| id2 | the image to be filtered |
| name | The name of the filter |
| inPlace | true or false |
- Returns
- The image that was passed in.
542 {
545 if (!inPlace)
547 try
548 {
550 BaseInPlaceFilter2 fi = (BaseInPlaceFilter2)f.
filt;
551 for (
int i = 0; i < img.
Buffers.Count; i++)
552 {
553 fi.OverlayImage = c2.
Buffers[i];
555 }
556 if (!inPlace)
557 {
559 }
560 return img;
561 }
562 catch (Exception e)
563 {
564 MessageDialog dialog = new MessageDialog(null, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok, e.Message);
565 dialog.Show();
566 }
567 return img;
568 }
◆ InPlacePartial()
| static BioImage BioLib.Filters.InPlacePartial |
( |
string | id, |
|
|
string | name, |
|
|
bool | inPlace ) |
|
static |
It takes an image, applies a filter to it, and returns the filtered image
- Parameters
-
| id | the id of the image to be filtered |
| name | The name of the filter |
| inPlace | If true, the image is modified in place. If false, a copy of the image is created and modified. |
- Returns
- The image that was passed in.
578 {
580 if (!inPlace)
582 try
583 {
585 BaseInPlacePartialFilter fi = (BaseInPlacePartialFilter)f.
filt;
586 for (
int i = 0; i < img.
Buffers.Count; i++)
587 {
589 }
590 if (!inPlace)
591 {
593 }
594 return img;
595 }
596 catch (Exception e)
597 {
598 MessageDialog dialog = new MessageDialog(null, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok, e.Message);
599 dialog.Show();
600 }
601 return img;
602 }
◆ Resize()
| static BioImage BioLib.Filters.Resize |
( |
string | id, |
|
|
string | name, |
|
|
bool | inPlace, |
|
|
int | w, |
|
|
int | h ) |
|
static |
This function takes an image, resizes it, and returns the resized image
- Parameters
-
| id | the id of the image to be resized |
| name | The name of the filter to use. |
| inPlace | If true, the image will be modified in place. If false, a new image will be created. |
| w | width |
| h | height |
- Returns
- The image that was resized.
614 {
616 if (!inPlace)
618 try
619 {
621 BaseResizeFilter fi = (BaseResizeFilter)f.
filt;
622 fi.NewHeight = h;
623 fi.NewWidth = w;
624 for (
int i = 0; i < img.
Buffers.Count; i++)
625 {
627 }
628 if (!inPlace)
629 {
631 }
632 }
633 catch (Exception e)
634 {
635 MessageDialog dialog = new MessageDialog(null, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok, e.Message);
636 dialog.Show();
637 }
638 return img;
639 }
◆ Rotate()
| static BioImage BioLib.Filters.Rotate |
( |
string | id, |
|
|
string | name, |
|
|
bool | inPlace, |
|
|
float | angle, |
|
|
int | a, |
|
|
int | r, |
|
|
int | g, |
|
|
int | b ) |
|
static |
It takes an image, rotates it, and returns the rotated image
- Parameters
-
| id | the id of the image to be rotated |
| name | The name of the filter |
| inPlace | whether to apply the filter to the original image or to a copy of it |
| angle | the angle to rotate the image |
| a | alpha |
| r | red |
| g | the image to be rotated |
| b | blue |
- Returns
- The image that was rotated.
653 {
655 if (!inPlace)
657 try
658 {
660 BaseRotateFilter fi = (BaseRotateFilter)f.
filt;
661 fi.Angle = angle;
662 fi.FillColor =
Color.FromArgb(a, r, g,
b);
663 for (
int i = 0; i < img.
Buffers.Count; i++)
664 {
666 }
667 if (!inPlace)
668 {
670 }
671 }
672 catch (Exception e)
673 {
674 MessageDialog dialog = new MessageDialog(null, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok, e.Message);
675 dialog.Show();
676 }
677 return img;
678
679 }
AForge.Color Color
Definition Bio.cs:55
return b
Definition Bio.cs:7393
◆ Transformation()
| static BioImage BioLib.Filters.Transformation |
( |
string | id, |
|
|
string | name, |
|
|
bool | inPlace, |
|
|
float | angle ) |
|
static |
This function takes an image, applies a transformation filter to it, and returns the transformed image
- Parameters
-
| id | the id of the image to be transformed |
| name | The name of the filter. |
| inPlace | If true, the image will be modified in place. If false, a new image will be created. |
| angle | the angle of rotation |
- Returns
- The image that was transformed.
691 {
693 if (!inPlace)
695 try
696 {
698 BaseTransformationFilter fi = (BaseTransformationFilter)f.
filt;
699 for (
int i = 0; i < img.
Buffers.Count; i++)
700 {
702 }
703 if (!inPlace)
704 {
706 }
707 }
708 catch (Exception e)
709 {
710 MessageDialog dialog = new MessageDialog(null, DialogFlags.Modal, MessageType.Info, ButtonsType.Ok, e.Message);
711 dialog.Show();
712 }
713 return img;
714 }
◆ filters
| List<Filt> BioLib.Filters.filters = new List<Filt>() |
|
static |
◆ indexs
| int [,] BioLib.Filters.indexs |
|
static |
The documentation for this class was generated from the following file: