MCPcopy Create free account
hub / github.com/SimpleITK/SimpleITK / Main

Method Main

Testing/Unit/CSharp/CSharpImageTest.cs:25–126  ·  view source on GitHub ↗

Main entry point.

(string[] args)

Source from the content-addressed store, hash-verified

23
24 /// <summary>Main entry point.</summary>
25 public static int Main (string[] args) {
26 int success = ExitSuccess;
27 try {
28 Image image = new Image(100, 100, PixelId.sitkInt8);
29 Image image2 = new Image(100, 100, PixelId.sitkInt8);
30
31
32 image += 10;
33 image -= 1;
34 CheckHash(image, "1cda91cc1bf474a25d6365f7fa7ef1fc75b3c7c9", ref success);
35 image *= 2;
36 image /= 3;
37 CheckHash(image, "856f68940ff670209aa9d60f38fc4cca1880f647", ref success);
38
39
40 // image with just one 7 reset zero
41 image *= 0;
42 VectorUInt32 idx = new VectorUInt32();
43 idx.Add(0);
44 idx.Add(0);
45 image.SetPixelAsInt8( idx, 7 );
46
47 // Unary operators
48 CheckHash(-image, "fe7e0c8ac8252189cf5766a352397bc62dd42e4d", ref success);
49 CheckHash(+image, "6cccaa2d5c958e79ebd5ca4a0b00bee747797c8d", ref success);
50 CheckHash(!image, "f4695dbf5bc9ea2796b2e4f360ea4b5ecbf70c37", ref success);
51 CheckHash(~image, "746470f03126f653cc23265e0b1c1fe16a952745", ref success);
52 CheckHash(image, "6cccaa2d5c958e79ebd5ca4a0b00bee747797c8d", ref success);
53
54
55 // Comparison operators
56 CheckHash( image < 7, "f4695dbf5bc9ea2796b2e4f360ea4b5ecbf70c37", ref success);
57 CheckHash( image > 7, "f907b7bf318b79fd6b9da589646f8b1dac77d0c8", ref success);
58 CheckHash( image <= 7, "cef864600fc947062ac359fe9a7cc049c7273b8e", ref success);
59 CheckHash( image >= 7, "52f583bfeb07a6c4c5a26b28f8ae180bf8e0079b", ref success);
60
61 CheckHash( image < image2, "f907b7bf318b79fd6b9da589646f8b1dac77d0c8", ref success);
62 CheckHash( image > image2, "52f583bfeb07a6c4c5a26b28f8ae180bf8e0079b", ref success);
63 CheckHash( image <= image2, "f4695dbf5bc9ea2796b2e4f360ea4b5ecbf70c37", ref success);
64 CheckHash( image >= image2, "cef864600fc947062ac359fe9a7cc049c7273b8e", ref success);
65
66 // Binary bitwise operators
67 image &= 5;;
68 image |= 7;
69 image ^= 8;
70 CheckHash(image, "0c26e6610c876b83cf681688eb8e80b952a394ce", ref success);
71
72 image &= image;
73 image ^= image;
74 image |= image;
75 CheckHash( image, "f907b7bf318b79fd6b9da589646f8b1dac77d0c8", ref success); // just zeros
76
77
78 // image of 1s
79 image *= 0;
80 image += 1;
81
82 image += image;

Callers

nothing calls this directly

Calls 12

SetPixelAsInt8Method · 0.80
GetBufferAsInt8Method · 0.80
GetBufferAsUInt8Method · 0.80
GetBufferAsInt16Method · 0.80
GetBufferAsUInt16Method · 0.80
GetBufferAsInt32Method · 0.80
GetBufferAsUInt32Method · 0.80
GetBufferAsInt64Method · 0.80
GetBufferAsUInt64Method · 0.80
GetBufferAsFloatMethod · 0.80
GetBufferAsDoubleMethod · 0.80
GetBufferAsVoidMethod · 0.80

Tested by

no test coverage detected