Module gwy
[hide private]
[frames] | no frames]

Source Code for Module gwy

    1  # vim: set fileencoding=utf-8 : 
    2  # This is dummy GENERATED file used for generation of documentation 
    3   
4 -class Axis:
5 - def __init__(orientation):
6 """ 7 Creates a new axis. 8 9 10 @param orientation: axis orientation I{(int)} 11 @return: New axis as a B{C{GtkWidget}}. I{(L{gtk.Widget})} 12 """ 13 return None
14
15 - def set_logarithmic(is_logarithmic):
16 """ 17 Sets logarithmic mode. 18 19 @param is_logarithmic: logarithmic mode I{(bool)} 20 """ 21 pass
22
23 - def set_visible(is_visible):
24 """ 25 Sets the visibility of an axis. 26 27 @param is_visible: visibility I{(bool)} 28 """ 29 pass
30
31 - def is_visible():
32 """ 33 Determines whether axis is set to be visible. 34 35 Return: B{C{True}} if B{C{axis}} is set to be visible. 36 37 @return: I{(bool)} 38 """ 39 return None
40
41 - def is_logarithmic():
42 """ 43 Determines whether axis is set to be locarithmic. 44 45 46 @return: B{C{True}} if B{C{axis}} is logarithmic. I{(bool)} 47 """ 48 return None
49
50 - def get_orientation():
51 """ 52 Gets the orientation of an axis. 53 54 55 @return: The orientation. I{(GtkPositionType)} 56 """ 57 return None
58
59 - def set_auto(is_auto):
60 """ 61 Enables or disables automatic axis adjustmet. 62 63 @param is_auto: B{C{True}} to enable automatic tick size and distribution adjustment, 64 B{C{False}} to disable it. I{(bool)} 65 """ 66 pass
67
68 - def request_range(min, max):
69 """ 70 Sets the requisition of axis boundaries. 71 72 The axis will adjust the boundaries to satisfy requisition but still have 73 reasonable tick values and spacing. Use L{Axis.get_range}() to obtain the 74 boundaries the axis actually decided to use. 75 76 @param min: Minimum requisition (min boundary value). I{(float)} 77 @param max: Maximum requisition (max boundary value). I{(float)} 78 """ 79 pass
80
81 - def get_range():
82 """ 83 Gets the actual boundaries of an axis. 84 85 @return: Tuple consisting of 2 values (B{C{min}}, B{C{max}}). (I{(float)}, I{(float)}) 86 """ 87 return None, None
88
90 """ 91 Gets the requested boundaries of an axis. 92 93 @return: Tuple consisting of 2 values (B{C{min}}, B{C{max}}). (I{(float)}, I{(float)}) 94 """ 95 return None, None
96
97 - def get_magnification():
98 """ 99 Gets the magnification value of a graph axis. 100 101 102 @return: Magnification value of the axis. I{(float)} 103 """ 104 return None
105
107 """ 108 Gets the magnification string of an axis. 109 110 111 @return: Magnification string of the axis, owned by the axis. I{(string)} 112 """ 113 return None
114
115 - def set_label(label):
116 """ 117 Sets the label text of an axis. 118 119 @param label: The new label text (it can be B{C{None}} for an empty label). I{(string)} 120 """ 121 pass
122
123 - def get_label():
124 """ 125 Gets the label of an axis. 126 127 128 @return: Axis label as a string owned by B{C{axis}}. I{(string)} 129 """ 130 return None
131
132 - def set_si_unit(unit):
133 """ 134 Sets the axis unit. This will be added automatically 135 to the label. B{C{unit}} is duplicated. 136 137 @param unit: axis unit I{(L{SIUnit})} 138 """ 139 pass
140
141 - def enable_label_edit(enable):
142 """ 143 Enables/disables user to change axis label by clicking on axis widget. 144 145 @param enable: enable/disable user to change axis label I{(bool)} 146 """ 147 pass
148
149 - def draw_on_drawable(drawable, gc, xmin, ymin, width, height):
150 """ 151 Draws the x and y-axis on a drawable 152 153 @param drawable: Drawable to draw on. I{(L{gdk.Drawable})} 154 @param gc: Graphics context. 155 It is modified by this function unpredictably. I{(L{gdk.GC})} 156 @param xmin: The minimum x-axis value. I{(int)} 157 @param ymin: The minimum y-axis value. I{(int)} 158 @param width: The width of the x-axis. I{(int)} 159 @param height: The height of the y-axis. I{(int)} 160 """ 161 pass
162
163 - def export_vector(xmin, ymin, width, height, fontsize):
164 """ 165 Renders a graph axis in PostScript. 166 167 This is a helper functions for L{Graph.export_postscript}() and probably 168 not useful anywhere else. 169 170 171 @param xmin: Left edge of the bounding rectangle. I{(int)} 172 @param ymin: Bottom edge of the bounding rectangle. I{(int)} 173 @param width: Width of the bounding rectangle. I{(int)} 174 @param height: Height of the bounding rectangle. I{(int)} 175 @param fontsize: Font size to use. I{(int)} 176 @return: A newly created B{C{GString}}. I{(string)} 177 """ 178 return None
179
180 - def get_major_ticks():
181 """ 182 Gets the positions of major ticks of an axis. 183 184 185 @return: The positions of axis major ticks (as real values, not pixels). 186 The returned array is owned by the axis. I{(list)} 187 """ 188 return None
189 190
191 -class Brick:
192 """ 193 Three-dimensional data representation 194 195 196 B{C{Brick}} represents 3D data arrays in Gwyddion. It is typically useful for 197 different volume data obtained from SPMs, like in force volume measurements. 198 199 """
200 - def __init__(xres, yres, zres, xreal, yreal, zreal, nullme):
201 """ 202 Creates a new data brick. 203 204 @since: 2.31 205 206 @param xres: X resolution, i.e., the number of samples in x direction I{(int)} 207 @param yres: Y resolution, i.e., the number of samples in y direction I{(int)} 208 @param zres: Z resolution, i.e., the number of samples in z direction I{(int)} 209 @param xreal: Real physical dimension in x direction. I{(float)} 210 @param yreal: Real physical dimension in y direction. I{(float)} 211 @param zreal: Real physical dimension in z direction. I{(float)} 212 @param nullme: Whether the data brick should be initialized to zeroes. If B{C{False}}, 213 the data will not be initialized. I{(bool)} 214 @return: A newly created data brick. I{(L{Brick})} 215 """ 216 return None
217
218 - def check_compatibility(brick2, check):
219 """ 220 Checks whether two data bricks are compatible. 221 222 Real dimensions are checked without regard to calibration. Calibrations are 223 considered compatible if either both exist and are identical or none exists. 224 225 @since: 2.51 226 227 @param brick2: Another data brick. I{(L{Brick})} 228 @param check: The compatibility tests to perform. Expected values: C{B{DATA_COMPATIBILITY_RES}}, C{B{DATA_COMPATIBILITY_REAL}}, C{B{DATA_COMPATIBILITY_MEASURE}}, C{B{DATA_COMPATIBILITY_LATERAL}}, C{B{DATA_COMPATIBILITY_VALUE}}, C{B{DATA_COMPATIBILITY_AXISCAL}}, C{B{DATA_COMPATIBILITY_ALL}}. I{(L{DataCompatibilityFlags})} 229 @return: Zero if all tested properties are compatible. Flags corresponding 230 to failed tests if bricks are not compatible. I{(DataCompatibilityFlags)} 231 """ 232 return None
233
234 - def new_alike(nullme):
235 """ 236 Creates a new data brick similar to an existing one. 237 238 Use L{Brick.duplicate}() if you want to copy a data brick including 239 data. 240 241 @since: 2.31 242 243 @param nullme: Whether the data brick should be initialized to zeroes. If B{C{False}}, 244 the data will not be initialized. I{(bool)} 245 @return: A newly created data brick. I{(L{Brick})} 246 """ 247 return None
248
249 - def new_part(xpos, ypos, zpos, xres, yres, zres, keep_offsets):
250 """ 251 Creates a new data brick as a part of existing one. 252 253 Use L{Brick.duplicate}() if you want to copy a whole data brick. 254 255 @since: 2.32 256 257 @param xpos: x position where to start from I{(int)} 258 @param ypos: y position where to start from I{(int)} 259 @param zpos: z position where to start from I{(int)} 260 @param xres: x resolution (width) to be extracted I{(int)} 261 @param yres: y resolution (height) to be extracted I{(int)} 262 @param zres: z resolution (depth) to be extracted I{(int)} 263 @param keep_offsets: keep offsets of data during extraction I{(bool)} 264 @return: A newly created data brick. I{(L{Brick})} 265 """ 266 return None
267
268 - def data_changed():
269 """ 270 Emits signal "data_changed" on a data brick. 271 272 @since: 2.31 273 274 """ 275 pass
276
277 - def copy(dest, nondata_too):
278 """ 279 Copies the contents of an already allocated brick to a brick 280 of the same size. 281 282 @param dest: Destination brick. I{(L{Brick})} 283 @param nondata_too: Whether non-data (units) should be copied too. I{(bool)} 284 """ 285 pass
286
287 - def resample(xres, yres, zres, interpolation):
288 """ 289 Resamples a data brick. 290 291 In other words changes the size of three dimensional field related with data 292 brick. The original values are used for resampling using a requested 293 interpolation alorithm. 294 295 @since: 2.31 296 297 @param xres: Desired x resolution. I{(int)} 298 @param yres: Desired y resolution. I{(int)} 299 @param zres: Desired z resolution. I{(int)} 300 @param interpolation: Interpolation method to use. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 301 """ 302 pass
303
304 - def get_xres():
305 """ 306 Gets the x resolution of a data brick. 307 308 @since: 2.31 309 310 @return: Resolution (number of data points). I{(int)} 311 """ 312 return None
313
314 - def get_yres():
315 """ 316 Gets the y resolution of a data brick. 317 318 @since: 2.31 319 320 @return: Resolution (number of data points). I{(int)} 321 """ 322 return None
323
324 - def get_zres():
325 """ 326 Gets the z resolution of a data brick. 327 328 @since: 2.31 329 330 @return: Resolution (number of data points). I{(int)} 331 """ 332 return None
333
334 - def get_xreal():
335 """ 336 Gets the physical size of a data brick in the x direction. 337 338 @since: 2.31 339 340 @return: Real size of a data brick the x direction. I{(float)} 341 """ 342 return None
343
344 - def get_yreal():
345 """ 346 Gets the physical size of a data brick in the y direction. 347 348 @since: 2.31 349 350 @return: Real size of a data brick the y direction. I{(float)} 351 """ 352 return None
353
354 - def get_zreal():
355 """ 356 Gets the physical size of a data brick in the z direction. 357 358 @since: 2.31 359 360 @return: Real size of a data brick the z direction. I{(float)} 361 """ 362 return None
363
364 - def get_xoffset():
365 """ 366 Gets the offset of data brick origin in x direction. 367 368 @since: 2.31 369 370 @return: Offset value. I{(float)} 371 """ 372 return None
373
374 - def get_yoffset():
375 """ 376 Gets the offset of data brick origin in y direction. 377 378 @since: 2.31 379 380 @return: Offset value. I{(float)} 381 """ 382 return None
383
384 - def get_zoffset():
385 """ 386 Gets the offset of data brick origin in z direction. 387 388 @since: 2.31 389 390 @return: Offset value. I{(float)} 391 """ 392 return None
393
394 - def set_xreal(xreal):
395 """ 396 Sets the real x dimension of a brick. 397 398 @since: 2.31 399 400 @param xreal: New real x dimensions value I{(float)} 401 """ 402 pass
403
404 - def set_yreal(yreal):
405 """ 406 Sets the real y dimension of a brick. 407 408 @since: 2.31 409 410 @param yreal: New real y dimensions value I{(float)} 411 """ 412 pass
413
414 - def set_zreal(zreal):
415 """ 416 Sets the real z dimension of a brick. 417 418 @since: 2.31 419 420 @param zreal: New real z dimensions value I{(float)} 421 """ 422 pass
423
424 - def set_xoffset(xoffset):
425 """ 426 Sets the offset of a data brick origin in the x direction. 427 428 Note offsets don't affect any calculation, nor functions like 429 L{Brick.rtoi}(). 430 431 @since: 2.31 432 433 @param xoffset: New offset value. I{(float)} 434 """ 435 pass
436
437 - def set_yoffset(yoffset):
438 """ 439 Sets the offset of a data brick origin in the y direction. 440 441 Note offsets don't affect any calculation, nor functions like 442 L{Brick.rtoi}(). 443 444 @since: 2.31 445 446 @param yoffset: New offset value. I{(float)} 447 """ 448 pass
449
450 - def set_zoffset(zoffset):
451 """ 452 Sets the offset of a data brick origin in the z direction. 453 454 Note offsets don't affect any calculation, nor functions like 455 L{Brick.rtoi}(). 456 457 @since: 2.31 458 459 @param zoffset: New offset value. I{(float)} 460 """ 461 pass
462
463 - def get_si_unit_x():
464 """ 465 Returns x direction SI unit of a data brick. 466 467 @since: 2.31 468 469 @return: SI unit corresponding to the lateral (X) dimension of the data 470 brick. Its reference count is not incremented. I{(L{SIUnit})} 471 """ 472 return None
473
474 - def get_si_unit_y():
475 """ 476 Returns y direction SI unit of a data brick. 477 478 @since: 2.31 479 480 @return: SI unit corresponding to the lateral (Y) dimension of the data 481 brick. Its reference count is not incremented. I{(L{SIUnit})} 482 """ 483 return None
484
485 - def get_si_unit_z():
486 """ 487 Returns z direction SI unit of a data brick. 488 489 @since: 2.31 490 491 @return: SI unit corresponding to the "height" (Z) dimension of the data 492 brick. Its reference count is not incremented. I{(L{SIUnit})} 493 """ 494 return None
495
496 - def get_si_unit_w():
497 """ 498 Returns value SI unit of a data brick. 499 500 @since: 2.31 501 502 @return: SI unit corresponding to the "value" of the data 503 brick. Its reference count is not incremented. I{(L{SIUnit})} 504 """ 505 return None
506
507 - def set_si_unit_x(si_unit):
508 """ 509 Sets the SI unit corresponding to the lateral (X) dimension of a data 510 brick. 511 512 It does not assume a reference on B{C{si_unit}}, instead it adds its own 513 reference. 514 515 @since: 2.31 516 517 @param si_unit: SI unit to be set. I{(L{SIUnit})} 518 """ 519 pass
520
521 - def set_si_unit_y(si_unit):
522 """ 523 Sets the SI unit corresponding to the lateral (Y) dimension of a data 524 brick. 525 526 It does not assume a reference on B{C{si_unit}}, instead it adds its own 527 reference. 528 529 @since: 2.31 530 531 @param si_unit: SI unit to be set. I{(L{SIUnit})} 532 """ 533 pass
534
535 - def set_si_unit_z(si_unit):
536 """ 537 Sets the SI unit corresponding to the "height" (Z) dimension of a data 538 brick. 539 540 It does not assume a reference on B{C{si_unit}}, instead it adds its own 541 reference. 542 543 @since: 2.31 544 545 @param si_unit: SI unit to be set. I{(L{SIUnit})} 546 """ 547 pass
548
549 - def set_si_unit_w(si_unit):
550 """ 551 Sets the SI unit corresponding to the "value" of a data 552 brick. 553 554 It does not assume a reference on B{C{si_unit}}, instead it adds its own 555 reference. 556 557 @since: 2.31 558 559 @param si_unit: SI unit to be set. I{(L{SIUnit})} 560 """ 561 pass
562
563 - def get_min():
564 """ 565 Find the minimum value in a data brick. 566 567 @since: 2.31 568 569 @return: The minimum value within the brick. I{(float)} 570 """ 571 return None
572
573 - def get_max():
574 """ 575 Find the maximum value in a data brick. 576 577 @since: 2.31 578 579 @return: The maximum value within the brick. I{(float)} 580 """ 581 return None
582
583 - def copy_units(target):
584 """ 585 Sets lateral and value units of a data brick to match another data brick. 586 587 @since: 2.49 588 589 @param target: Target data brick. I{(L{Brick})} 590 """ 591 pass
592
593 - def get_value_format_x(style):
594 """ 595 Finds value format good for displaying coordinates of a data brick. 596 597 @since: 2.31 598 599 @param style: Unit format style. Expected values: C{B{SI_UNIT_FORMAT_NONE}}, C{B{SI_UNIT_FORMAT_PLAIN}}, C{B{SI_UNIT_FORMAT_MARKUP}}, C{B{SI_UNIT_FORMAT_VFMARKUP}}, C{B{SI_UNIT_FORMAT_TEX}}, C{B{SI_UNIT_FORMAT_VFTEX}}, C{B{SI_UNIT_FORMAT_UNICODE}}, C{B{SI_UNIT_FORMAT_VFUNICODE}}. I{(L{SIUnitFormatStyle})} 600 @return: Tuple consisting of 2 values (B{C{value}}, B{C{format}}). (I{(L{SIValueFormat})}, I{(SkipArg)}) 601 """ 602 return None, None
603
604 - def get_value_format_y(style):
605 """ 606 Finds value format good for displaying values of a data brick. 607 608 @since: 2.31 609 610 @param style: Unit format style. Expected values: C{B{SI_UNIT_FORMAT_NONE}}, C{B{SI_UNIT_FORMAT_PLAIN}}, C{B{SI_UNIT_FORMAT_MARKUP}}, C{B{SI_UNIT_FORMAT_VFMARKUP}}, C{B{SI_UNIT_FORMAT_TEX}}, C{B{SI_UNIT_FORMAT_VFTEX}}, C{B{SI_UNIT_FORMAT_UNICODE}}, C{B{SI_UNIT_FORMAT_VFUNICODE}}. I{(L{SIUnitFormatStyle})} 611 @return: Tuple consisting of 2 values (B{C{value}}, B{C{format}}). (I{(L{SIValueFormat})}, I{(SkipArg)}) 612 """ 613 return None, None
614
615 - def get_value_format_z(style):
616 """ 617 Finds value format good for displaying values of a data brick. 618 619 @since: 2.31 620 621 @param style: Unit format style. Expected values: C{B{SI_UNIT_FORMAT_NONE}}, C{B{SI_UNIT_FORMAT_PLAIN}}, C{B{SI_UNIT_FORMAT_MARKUP}}, C{B{SI_UNIT_FORMAT_VFMARKUP}}, C{B{SI_UNIT_FORMAT_TEX}}, C{B{SI_UNIT_FORMAT_VFTEX}}, C{B{SI_UNIT_FORMAT_UNICODE}}, C{B{SI_UNIT_FORMAT_VFUNICODE}}. I{(L{SIUnitFormatStyle})} 622 @return: Tuple consisting of 2 values (B{C{value}}, B{C{format}}). (I{(L{SIValueFormat})}, I{(SkipArg)}) 623 """ 624 return None, None
625
626 - def get_value_format_w(style):
627 """ 628 Finds value format good for displaying values of a data brick. 629 630 Note this functions searches for minimum and maximum value in B{C{brick}}, 631 therefore it's relatively slow. 632 633 @since: 2.31 634 635 @param style: Unit format style. Expected values: C{B{SI_UNIT_FORMAT_NONE}}, C{B{SI_UNIT_FORMAT_PLAIN}}, C{B{SI_UNIT_FORMAT_MARKUP}}, C{B{SI_UNIT_FORMAT_VFMARKUP}}, C{B{SI_UNIT_FORMAT_TEX}}, C{B{SI_UNIT_FORMAT_VFTEX}}, C{B{SI_UNIT_FORMAT_UNICODE}}, C{B{SI_UNIT_FORMAT_VFUNICODE}}. I{(L{SIUnitFormatStyle})} 636 @return: Tuple consisting of 2 values (B{C{value}}, B{C{format}}). (I{(L{SIValueFormat})}, I{(SkipArg)}) 637 """ 638 return None, None
639
640 - def itor(pixpos):
641 """ 642 Transforms pixel coordinate to real (physical) coordinate in x direction. 643 644 That is it maps range [0..x resolution] to range [0..x real-size]. It is not 645 suitable for conversion of matrix indices to physical coordinates, you 646 have to use L{Brick.itor}(B{C{brick}}, B{C{pixpos}} + 0.5) for that. 647 648 @since: 2.31 649 650 @param pixpos: Pixel coordinate. I{(float)} 651 @return: B{C{pixpos}} in real coordinates. I{(float)} 652 """ 653 return None
654
655 - def rtoi(realpos):
656 """ 657 Transforms real (physical) coordinate to pixel coordinate in x axis. 658 659 That is it maps range [0..x real-size] to range [0..x resolution]. 660 661 @since: 2.31 662 663 @param realpos: Real coordinate. I{(float)} 664 @return: B{C{realpos}} in pixel coordinates. I{(float)} 665 """ 666 return None
667
668 - def jtor(pixpos):
669 """ 670 Transforms pixel coordinate to real (physical) coordinate in y direction. 671 672 That is it maps range [0..y resolution] to range [0..y real-size]. It is not 673 suitable for conversion of matrix indices to physical coordinates, you 674 have to use L{Brick.itor}(B{C{brick}}, B{C{pixpos}} + 0.5) for that. 675 676 @since: 2.31 677 678 @param pixpos: Pixel coordinate. I{(float)} 679 @return: B{C{pixpos}} in real coordinates. I{(float)} 680 """ 681 return None
682
683 - def rtoj(realpos):
684 """ 685 Transforms real (physical) coordinate to pixel coordinate in y axis. 686 687 That is it maps range [0..y real-size] to range [0..y resolution]. 688 689 @since: 2.31 690 691 @param realpos: Real coordinate. I{(float)} 692 @return: B{C{realpos}} in pixel coordinates. I{(float)} 693 """ 694 return None
695
696 - def ktor(pixpos):
697 """ 698 Transforms pixel coordinate to real (physical) coordinate in z direction. 699 700 That is it maps range [0..z resolution] to range [0..z real-size]. It is not 701 suitable for conversion of matrix indices to physical coordinates, you 702 have to use L{Brick.itor}(B{C{brick}}, B{C{pixpos}} + 0.5) for that. 703 704 @since: 2.31 705 706 @param pixpos: Pixel coordinate. I{(float)} 707 @return: B{C{pixpos}} in real coordinates. I{(float)} 708 """ 709 return None
710
711 - def rtok(realpos):
712 """ 713 Transforms real (physical) coordinate to pixel coordinate in z axis. 714 715 That is it maps range [0..z real-size] to range [0..z resolution]. 716 717 @since: 2.31 718 719 @param realpos: Real coordinate. I{(float)} 720 @return: B{C{realpos}} in pixel coordinates. I{(float)} 721 """ 722 return None
723
724 - def ktor_cal(pixpos):
725 """ 726 Transforms pixel coordinate to real (physical) coordinate in z direction, 727 taking into account calibration. 728 729 Unlike L{Brick.ktor}(), this function takes into account the B{C{z}} 730 calibration and, if calibration is not present, the B{C{z}} axis offset. 731 Since the calibration is available only for discrete pixel coordinates, 732 the values are interpolated between and clamped if outside the range. 733 734 The values in the calibration are assumed to correspond to pixel centres. 735 This convention is also kept when no calibration is present. 736 737 @since: 2.42 738 739 @param pixpos: Pixel coordinate. I{(float)} 740 @return: B{C{pixpos}} in real coordinates. I{(float)} 741 """ 742 return None
743
744 - def rtok_cal(realpos):
745 """ 746 Transforms real (physical) coordinate to pixel coordinate in z axis, 747 taking into account calibration. 748 749 Unlike L{Brick.rtok}(), this function takes into account the B{C{z}} 750 calibration and, if calibration is not present, the B{C{z}} axis offset. 751 Since the calibration is available only for discrete pixel coordinates, 752 the values are interpolated between and clamped if outside the range. 753 754 The values in the calibration are assumed to correspond to pixel centres. 755 This convention is also kept when no calibration is present. 756 757 @since: 2.42 758 759 @param realpos: Real coordinate. I{(float)} 760 @return: B{C{realpos}} in pixel coordinates. I{(float)} 761 """ 762 return None
763
764 - def get_val(col, row, lev):
765 """ 766 Gets value at given position in a data brick. 767 768 Do not access data with this function inside inner loops, it's slow. 769 Get raw data buffer with L{Brick.get_data_const}() and access it 770 directly instead. 771 772 @since: 2.31 773 774 @param col: Position in the brick (column index). I{(int)} 775 @param row: Position in the brick (row index). I{(int)} 776 @param lev: Position in the brick (level index). I{(int)} 777 @return: Value at given index. I{(float)} 778 """ 779 return None
780
781 - def set_val(col, row, lev, value):
782 """ 783 Sets value at given position in a data brick. 784 785 Do not access data with this function inside inner loops, it's slow. 786 Get raw data buffer with L{Brick.get_data_const}() and access it 787 directly instead. 788 789 @since: 2.31 790 791 @param col: Position in the brick (column index). I{(int)} 792 @param row: Position in the brick (row index). I{(int)} 793 @param lev: Position in the brick (level index). I{(int)} 794 @param value: Value to be set. I{(float)} 795 """ 796 pass
797
798 - def get_val_real(x, y, z):
799 """ 800 Gets value at given position in a data brick, in real coordinates. 801 802 Do not access data with this function inside inner loops, it's slow. 803 Get raw data buffer with L{Brick.get_data_const}() and access it 804 directly instead. 805 806 @since: 2.31 807 808 @param x: Position in the brick (x direction). I{(float)} 809 @param y: Position in the brick (y direction). I{(float)} 810 @param z: Position in the brick (z direction). I{(float)} 811 @return: Value at given index. I{(float)} 812 """ 813 return None
814
815 - def set_val_real(x, y, z, value):
816 """ 817 Sets value at given position in a data brick. 818 819 Do not access data with this function inside inner loops, it's slow. 820 Get raw data buffer with L{Brick.get_data_const}() and access it 821 directly instead. 822 823 @since: 2.31 824 825 @param x: Position in the brick (x direction). I{(float)} 826 @param y: Position in the brick (y direction). I{(float)} 827 @param z: Position in the brick (z direction). I{(float)} 828 @param value: Value to be set. I{(float)} 829 """ 830 pass
831
832 - def get_dval(x, y, z, interpolation):
833 """ 834 Gets interpolated value at arbitrary data brick point indexed by pixel 835 coordinates. 836 837 Note pixel values are centered in intervals [B{C{i}}, B{C{i}}+1]. 838 See also L{Brick.get_dval_real}() that does the same, but takes 839 real coordinates. 840 841 @since: 2.31 842 843 @param x: Position in data brick in range [0, x resolution]. If the value is outside 844 this range, the nearest border value is returned. I{(float)} 845 @param y: Position in data brick in range [0, y resolution]. If the value is outside 846 this range, the nearest border value is returned. I{(float)} 847 @param z: Position in data brick in range [0, z resolution]. If the value is outside 848 this range, the nearest border value is returned. I{(float)} 849 @param interpolation: Interpolation method to use. I{(int)} 850 @return: Value interpolated in the data brick. I{(float)} 851 """ 852 return None
853
854 - def get_dval_real(x, y, z, interpolation):
855 """ 856 Gets interpolated value at arbitrary data brick point indexed by pixel 857 coordinates. 858 859 Note pixel values are centered in intervals [B{C{j}}, B{C{j}}+1]. 860 See also L{Brick.get_dval}() that does the same, but takes 861 pixel coordinates. 862 863 @since: 2.31 864 865 @param x: Position in data brick in range [0, x resolution]. If the value is 866 outside this range, the nearest border value is returned. I{(float)} 867 @param y: Position in data brick in range [0, y resolution]. If the value is 868 outside this range, the nearest border value is returned. I{(float)} 869 @param z: Position in data brick in range [0, z resolution]. If the value is 870 outside this range, the nearest border value is returned. I{(float)} 871 @param interpolation: Interpolation method to use. I{(int)} 872 @return: Value interpolated in the data brick. I{(float)} 873 """ 874 return None
875
876 - def clear():
877 """ 878 Fills a data brick with zeroes. 879 880 @since: 2.31 881 882 """ 883 pass
884
885 - def fill(value):
886 """ 887 Fills a data brick with specified value. 888 889 @since: 2.31 890 891 @param value: Value to fill data brick with. I{(float)} 892 """ 893 pass
894
895 - def multiply(value):
896 """ 897 Multiplies all values in a data brick with a specified value. 898 899 @since: 2.31 900 901 @param value: Value to multiply data brick with. I{(float)} 902 """ 903 pass
904
905 - def add(value):
906 """ 907 Adds a specified value to all values in a data brick. 908 909 @since: 2.31 910 911 @param value: Value to be added. I{(float)} 912 """ 913 pass
914
915 - def extract_plane(target, istart, jstart, kstart, width, height, depth, keep_offsets):
916 """ 917 Extract a plane (DataField) from the brick. 918 919 One value of set (B{C{width}}, B{C{height}}, B{C{depth}}) needs to be -1, determining the 920 plane orientation. 921 922 @since: 2.31 923 924 @param target: Datafield to be filled by extracted plane. It will be resized if 925 necessary. I{(L{DataField})} 926 @param istart: Column where to start (pixel coordinates). I{(int)} 927 @param jstart: Row where to start (pixel coordinates). I{(int)} 928 @param kstart: Level where to start (pixel coordinates). I{(int)} 929 @param width: Pixel width of extracted plane. If B{C{width}} is -1, the yz plane will 930 be extracted. I{(int)} 931 @param height: Pixel height of extracted plane. If B{C{height}} is -1, the xz plane 932 will be extracted I{(int)} 933 @param depth: Pixel depth of extracted plane. If B{C{depth}} is -1, the xy plane will 934 be extracted I{(int)} 935 @param keep_offsets: Keep the physical offsets in extracted field. I{(bool)} 936 """ 937 pass
938
939 - def sum_plane(target, istart, jstart, kstart, width, height, depth, keep_offsets):
940 """ 941 Sums planes in certain direction and extract the result (DataField). One 942 value of set (B{C{width}}, B{C{height}}, B{C{depth}}) needs to be -1, determining the plane 943 orientation. In contrast to L{Brick.extract_plane}, the appropriate start 944 coordinate (e.g. B{C{istart}} if B{C{width}} = -1) is not used for single plane 945 extraction, but the planes are accumulated in whole range (0..xres for given 946 example) 947 948 @since: 2.31 949 950 @param target: Datafield to be filled by summed plane. It will be resized if 951 necessary. I{(L{DataField})} 952 @param istart: Column where to start (pixel coordinates). I{(int)} 953 @param jstart: Row where to start (pixel coordinates). I{(int)} 954 @param kstart: Level where to start (pixel coordinates). I{(int)} 955 @param width: Pixel width of summed plane. If B{C{width}} is -1, the yz planes will be 956 summed. I{(int)} 957 @param height: Pixel height of summed plane. If B{C{height}} is -1, the xz planes will 958 be summed I{(int)} 959 @param depth: Pixel depth of summed plane. If B{C{depth}} is -1, the xy planes will 960 be summed I{(int)} 961 @param keep_offsets: Keep the physical offsets in extracted field. Not 962 implemented. I{(bool)} 963 """ 964 pass
965
966 - def min_plane(target, istart, jstart, kstart, width, height, depth, keep_offsets):
967 """ 968 Finds minima of planes in certain direction and extract the result 969 (DataField). One value of set (B{C{width}}, B{C{height}}, B{C{depth}}) needs to be -1, 970 determining the plane orientation. In contrast to L{Brick.extract_plane}, 971 the appropriate start coordinate (e.g. B{C{istart}} if B{C{width}} = -1) is not used 972 for single plane extraction, but the planes are accumulated in whole range 973 (0..xres for given example) 974 975 @since: 2.32 976 977 @param target: Datafield to be filled by the minima plane. It will be resized if 978 necessary. I{(L{DataField})} 979 @param istart: Column where to start (pixel coordinates). I{(int)} 980 @param jstart: Row where to start (pixel coordinates). I{(int)} 981 @param kstart: Level where to start (pixel coordinates). I{(int)} 982 @param width: Pixel width of summarized plane. If B{C{width}} is -1, the yz planes will 983 be summarized. I{(int)} 984 @param height: Pixel height of summarized plane. If B{C{height}} is -1, the xz planes 985 will be summarized. I{(int)} 986 @param depth: Pixel depth of summarized plane. If B{C{depth}} is -1, the xy planes will 987 be summarized I{(int)} 988 @param keep_offsets: Keep the physical offsets in extracted field. Not 989 implemented. I{(bool)} 990 """ 991 pass
992
993 - def max_plane(target, istart, jstart, kstart, width, height, depth, keep_offsets):
994 """ 995 Finds minima of planes in certain direction and extract the result 996 (DataField). One value of set (B{C{width}}, B{C{height}}, B{C{depth}}) needs to be -1, 997 determining the plane orientation. In contrast to L{Brick.extract_plane}, 998 the appropriate start coordinate (e.g. B{C{istart}} if B{C{width}} = -1) is not used 999 for single plane extraction, but the planes are accumulated in whole range 1000 (0..xres for given example) 1001 1002 @since: 2.32 1003 1004 @param target: Datafield to be filled by the maxima plane. It will be resized if 1005 necessary. I{(L{DataField})} 1006 @param istart: Column where to start (pixel coordinates). I{(int)} 1007 @param jstart: Row where to start (pixel coordinates). I{(int)} 1008 @param kstart: Level where to start (pixel coordinates). I{(int)} 1009 @param width: Pixel width of summarized plane. If B{C{width}} is -1, the yz planes will 1010 be summarized. I{(int)} 1011 @param height: Pixel height of summarized plane. If B{C{height}} is -1, the xz planes 1012 will be summarized. I{(int)} 1013 @param depth: Pixel depth of extracted plane. If B{C{depth}} is -1, the xy planes will 1014 be summarized I{(int)} 1015 @param keep_offsets: Keep the physical offsets in extracted field. Not 1016 implemented. I{(bool)} 1017 """ 1018 pass
1019
1020 - def minpos_plane(target, istart, jstart, kstart, width, height, depth, keep_offsets):
1021 """ 1022 Finds minima positions of planes in certain direction and extract the result 1023 (DataField). One value of set (B{C{width}}, B{C{height}}, B{C{depth}}) needs to be -1, 1024 determining the plane orientation. In contrast to L{Brick.extract_plane}, 1025 the appropriate start coordinate (e.g. B{C{istart}} if B{C{width}} = -1) is not used 1026 for single plane extraction, but the planes are accumulated in whole range 1027 (0..xres for given example) 1028 1029 @since: 2.32 1030 1031 @param target: Datafield to be filled by the minima positions plane. 1032 It will be resized if necessary. I{(L{DataField})} 1033 @param istart: Column where to start (pixel coordinates). I{(int)} 1034 @param jstart: Row where to start (pixel coordinates). I{(int)} 1035 @param kstart: Level where to start (pixel coordinates). I{(int)} 1036 @param width: Pixel width of summarized plane. If B{C{width}} is -1, the yz planes will 1037 be summarized. I{(int)} 1038 @param height: Pixel height of summarized plane. If B{C{height}} is -1, the xz planes 1039 will be summarized. I{(int)} 1040 @param depth: Pixel depth of summarized plane. If B{C{depth}} is -1, the xy planes will 1041 be summarized I{(int)} 1042 @param keep_offsets: Keep the physical offsets in summarized field. Not 1043 implemented. I{(bool)} 1044 """ 1045 pass
1046
1047 - def maxpos_plane(target, istart, jstart, kstart, width, height, depth, keep_offsets):
1048 """ 1049 Finds maxima positions of planes in certain direction and extract the result 1050 (DataField). One value of set (B{C{width}}, B{C{height}}, B{C{depth}}) needs to be -1, 1051 determining the plane orientation. In contrast to L{Brick.extract_plane}, 1052 the appropriate start coordinate (e.g. B{C{istart}} if B{C{width}} = -1) is not used 1053 for single plane extraction, but the planes are accumulated in whole range 1054 (0..xres for given example) 1055 1056 @since: 2.32 1057 1058 @param target: Datafield to be filled by the maxima positions plane. 1059 It will be resized if necessary. I{(L{DataField})} 1060 @param istart: Column where to start (pixel coordinates). I{(int)} 1061 @param jstart: Row where to start (pixel coordinates). I{(int)} 1062 @param kstart: Level where to start (pixel coordinates). I{(int)} 1063 @param width: Pixel width of summarized plane. If B{C{width}} is -1, the yz planes will 1064 be summarized. I{(int)} 1065 @param height: Pixel height of summarized plane. If B{C{height}} is -1, the xz planes 1066 will be summarized I{(int)} 1067 @param depth: Pixel depth of summarized plane. If B{C{depth}} is -1, the xy planes will 1068 be summarized I{(int)} 1069 @param keep_offsets: Keep the physical offsets in summarized field. Not 1070 implemented. I{(bool)} 1071 """ 1072 pass
1073
1074 - def mean_plane(target, istart, jstart, kstart, width, height, depth, keep_offsets):
1075 """ 1076 Finds mean of planes in certain direction and extract the result 1077 (DataField). One value of set (B{C{width}}, B{C{height}}, B{C{depth}}) needs to be -1, 1078 determining the plane orientation. In contrast to L{Brick.extract_plane}, 1079 the appropriate start coordinate (e.g. B{C{istart}} if B{C{width}} = -1) is not used 1080 for single plane extraction, but the planes are accumulated in whole range 1081 (0..xres for given example) 1082 1083 @since: 2.32 1084 1085 @param target: Datafield to be filled by the mean plane. It will be resized if 1086 necessary. I{(L{DataField})} 1087 @param istart: Column where to start (pixel coordinates). I{(int)} 1088 @param jstart: Row where to start (pixel coordinates). I{(int)} 1089 @param kstart: Level where to start (pixel coordinates). I{(int)} 1090 @param width: Pixel width of summarized plane. If B{C{width}} is -1, the yz planes will 1091 be summarized. I{(int)} 1092 @param height: Pixel height of summarized plane. If B{C{height}} is -1, the xz planes 1093 will be summarized. I{(int)} 1094 @param depth: Pixel depth of summarized plane. If B{C{depth}} is -1, the xy planes will 1095 be summarized. I{(int)} 1096 @param keep_offsets: Keep the physical offsets in summarized field. Not 1097 implemented. I{(bool)} 1098 """ 1099 pass
1100
1101 - def rms_plane(target, istart, jstart, kstart, width, height, depth, keep_offsets):
1102 """ 1103 Finds rms of planes in certain direction and extract the result 1104 (DataField). One value of set (B{C{width}}, B{C{height}}, B{C{depth}}) needs to be -1, 1105 determining the plane orientation. In contrast to L{Brick.extract_plane}, 1106 the appropriate start coordinate (e.g. B{C{istart}} if B{C{width}} = -1) is not used 1107 for single plane extraction, but the planes are accumulated in whole range 1108 (0..xres for given example) 1109 1110 @since: 2.32 1111 1112 @param target: Datafield to be filled by the rms plane. It will be resized if 1113 necessary. I{(L{DataField})} 1114 @param istart: Column where to start (pixel coordinates). I{(int)} 1115 @param jstart: Row where to start (pixel coordinates). I{(int)} 1116 @param kstart: Level where to start (pixel coordinates). I{(int)} 1117 @param width: Pixel width of summarized plane. If B{C{width}} is -1, the yz planes will 1118 be summarized. I{(int)} 1119 @param height: Pixel height of summarized plane. If B{C{height}} is -1, the xz planes 1120 will be summarized. I{(int)} 1121 @param depth: Pixel depth of summarized plane. If B{C{depth}} is -1, the xy planes will 1122 be summarized. I{(int)} 1123 @param keep_offsets: Keep the physical offsets in extracted field. Not 1124 implemented. I{(bool)} 1125 """ 1126 pass
1127
1128 - def extract_line(target, istart, jstart, kstart, iend, jend, kend, keep_offsets):
1129 """ 1130 Extract a line (DataLine) from the brick. 1131 1132 Only line orientations parallel to coordinate axes are supported now, i.e. 1133 two of the start coordinates need to be same as end ones. 1134 1135 @since: 2.31 1136 1137 @param target: Dataline to be filled by extracted line. It will be resized if 1138 necessary. I{(L{DataLine})} 1139 @param istart: Column where to start (pixel coordinates). I{(int)} 1140 @param jstart: Row where to start (pixel coordinates). I{(int)} 1141 @param kstart: Level where to start (pixel coordinates). I{(int)} 1142 @param iend: Column where to start (pixel coordinates). I{(int)} 1143 @param jend: Row where to start (pixel coordinates). I{(int)} 1144 @param kend: Level where to start (pixel coordinates). I{(int)} 1145 @param keep_offsets: Keep physical offsets in extracted line. I{(bool)} 1146 """ 1147 pass
1148
1149 - def get_zcalibration():
1150 """ 1151 Gets the z-axis non-linear calibration of a data brick. 1152 1153 @since: 2.32 1154 1155 @return: Z Calibration (non-linear Z-axis values as ordinates). I{(L{DataLine})} 1156 """ 1157 return None
1158
1159 - def set_zcalibration(calibration):
1160 """ 1161 Sets the z-axis non-linear calibration of a data brick. 1162 1163 @since: 2.32 1164 1165 @param calibration: DataLine pointer with z-axis non-linear calibration 1166 of a data brick (values are stored as ordinates). It can also 1167 be B{C{None}} to unset the calibration. I{(L{DataLine})} 1168 """ 1169 pass
1170
1171 - def transpose(target, type, xflipped, yflipped, zflipped):
1172 """ 1173 Transposes a data brick, exchanging and/or flipping axes. 1174 1175 Real dimensions and units are updated. Since real sizes cannot go backward, 1176 flipping an axis results in the corresponding offset being reset (the 1177 real dimension stays positive). If the Z axis is preserved its calibration 1178 is copied to the target; otherwise the target will have no Z axis 1179 calibration. 1180 1181 @since: 2.51 1182 1183 @param target: Destination data brick. It will be resized as needed. I{(L{Brick})} 1184 @param type: Basic transposition type (which axes are swapped). Expected values: C{B{BRICK_TRANSPOSE_XYZ}}, C{B{BRICK_TRANSPOSE_XZY}}, C{B{BRICK_TRANSPOSE_YXZ}}, C{B{BRICK_TRANSPOSE_YZX}}, C{B{BRICK_TRANSPOSE_ZXY}}, C{B{BRICK_TRANSPOSE_ZYX}}. I{(L{BrickTransposeType})} 1185 @param xflipped: New X axis will be inverted. I{(bool)} 1186 @param yflipped: New Y axis will be inverted. I{(bool)} 1187 @param zflipped: New Z axis will be inverted. I{(bool)} 1188 """ 1189 pass
1190
1191 - def set_plane(plane, istart, jstart, kstart, width, height, depth):
1192 """ 1193 Fill a single plane in the brick by a two-dimensional data (DataField). 1194 1195 One value of set (B{C{width}}, B{C{height}}, B{C{depth}}) needs to be -1, determining the 1196 plane orientation. 1197 1198 @since: 2.51 1199 1200 @param plane: Datafield to be inserted into brick. It must have the appropriated size. I{(L{DataField})} 1201 @param istart: Column where to start (pixel coordinates). I{(int)} 1202 @param jstart: Row where to start (pixel coordinates). I{(int)} 1203 @param kstart: Level where to start (pixel coordinates). I{(int)} 1204 @param width: Pixel width of the inserted plane. If B{C{width}} is -1, the yz plane will 1205 be filled. I{(int)} 1206 @param height: Pixel height of insered plane. If B{C{height}} is -1, the xz plane 1207 will be filled I{(int)} 1208 @param depth: Pixel depth of inserted plane. If B{C{depth}} is -1, the xy plane will 1209 be filled I{(int)} 1210 """ 1211 pass
1212
1213 - def get_data():
1214 """ 1215 Extract the data of a data brick. 1216 1217 The returned list contains a copy of the data. Changing its contents does 1218 not change the data brick's data. 1219 1220 1221 @return: List containing extracted data brick data. I{(list)} 1222 """ 1223 return None
1224
1225 - def set_data(data):
1226 """ 1227 Sets the entire contents of a data brick. 1228 1229 The length of B{C{data}} must be equal to the number of elements of the data 1230 brick. 1231 1232 @param data: Sequence of floating point values. I{(list)} 1233 """ 1234 pass
1235
1236 - def duplicate():
1237 """ 1238 Convenience macro doing L{gwy_serializable_duplicate}() with all the necessary 1239 typecasting. 1240 1241 @since: 2.31 1242 1243 @return: I{(L{Brick})} 1244 """ 1245 return None
1246
1247 - def get_data_pointer():
1248 """ 1249 Gets pointer to data which the brick contains. 1250 1251 1252 @return: integer pointing to the raw data of the brick I{(long)} 1253 """ 1254 return None
1255 1256
1257 -class ColorAxis:
1258 - def __init__(orientation):
1259 """ 1260 Creates a new color axis. 1261 1262 1263 @param orientation: The orientation of the axis. I{(GtkOrientation)} 1264 @return: The newly created color axis as a B{C{GtkWidget}}. I{(L{gtk.Widget})} 1265 """ 1266 return None
1267
1268 - def get_range():
1269 """ 1270 Gets the range of a color axis. 1271 1272 @return: Tuple consisting of 2 values (B{C{min}}, B{C{max}}). (I{(float)}, I{(float)}) 1273 """ 1274 return None, None
1275
1276 - def set_range(min, max):
1277 """ 1278 Sets the range of a color axis. 1279 1280 @param min: The range minimum. I{(float)} 1281 @param max: The range maximum. I{(float)} 1282 """ 1283 pass
1284
1285 - def get_si_unit():
1286 """ 1287 Gets the SI unit a color axis displays. 1288 1289 1290 @return: The SI unit. I{(L{SIUnit})} 1291 """ 1292 return None
1293
1294 - def set_si_unit(unit):
1295 """ 1296 Sets the SI unit a color axis displays. 1297 1298 @param unit: A SI unit to display next to minimum and maximum value. I{(L{SIUnit})} 1299 """ 1300 pass
1301
1302 - def set_gradient(gradient):
1303 """ 1304 Sets the color gradient a color axis should use. 1305 1306 @param gradient: Name of gradient B{C{axis}} should use. It should exist. I{(string)} 1307 """ 1308 pass
1309
1310 - def get_gradient():
1311 """ 1312 Gets the color gradient a color axis uses. 1313 1314 1315 @return: The color gradient. I{(string)} 1316 """ 1317 return None
1318
1319 - def get_ticks_style():
1320 """ 1321 Gets ticks style of a color axis. 1322 1323 1324 @return: The ticks style. I{(TicksStyle)} 1325 """ 1326 return None
1327
1328 - def set_ticks_style(ticks_style):
1329 """ 1330 Sets the ticks style of a color axis. 1331 1332 @param ticks_style: The ticks style to use. Expected values: C{B{TICKS_STYLE_NONE}}, C{B{TICKS_STYLE_CENTER}}, C{B{TICKS_STYLE_AUTO}}, C{B{TICKS_STYLE_UNLABELED}}, C{B{TICKS_STYLE_UNLABELLED}}. I{(L{TicksStyle})} 1333 """ 1334 pass
1335
1336 - def get_labels_visible():
1337 """ 1338 Gets the visibility of labels of a color axis. 1339 1340 1341 @return: B{C{True}} if labels are displayed, B{C{False}} if they are omitted. I{(bool)} 1342 """ 1343 return None
1344
1345 - def set_labels_visible(labels_visible):
1346 """ 1347 Sets the visibility of labels of a color axis. 1348 1349 @param labels_visible: B{C{True}} to display labels with minimum and maximum values, 1350 B{C{False}} to display no labels. I{(bool)} 1351 """ 1352 pass
1353 1354
1355 -class ColorButton:
1356 - def __init__():
1357 """ 1358 Creates a new color button. This returns a widget in the form of 1359 a small button containing a swatch representing the current selected 1360 color. When the button is clicked, a color-selection dialog will open, 1361 allowing the user to select a color. The swatch will be updated to reflect 1362 the new color when the user finishes. 1363 1364 1365 @return: a new color button. I{(L{gtk.Widget})} 1366 """ 1367 return None
1368
1369 - def set_color(color):
1370 """ 1371 Sets the current color to be B{C{color}}. 1372 1373 @param color: A B{C{RGBA}} to set the current color with. I{(const-RGBA*)} 1374 """ 1375 pass
1376
1377 - def get_color():
1378 """ 1379 Sets B{C{color}} to be the current color in the B{C{ColorButton}} widget. 1380 1381 @return: Value B{C{color}}. (I{(RGBAOutArg)}) 1382 """ 1383 return None
1384
1385 - def set_use_alpha(use_alpha):
1386 """ 1387 Sets whether or not the color button should use the alpha channel. 1388 1389 @param use_alpha: B{C{True}} if color button should use alpha channel, B{C{False}} if not. I{(bool)} 1390 """ 1391 pass
1392
1393 - def get_use_alpha():
1394 """ 1395 Does the color selection dialog use the alpha channel? 1396 1397 1398 @return: B{C{True}} if the color sample uses alpha channel, B{C{False}} if not. I{(bool)} 1399 """ 1400 return None
1401 1402
1403 -class Container:
1404 """ 1405 A container with items identified by a GQuark 1406 1407 1408 B{C{Container}} is a general-purpose container, it can hold atomic types, 1409 strings and objects. However, objects must implement the B{C{Serializable}} 1410 interface, because the container itself is serializable. 1411 1412 A new container can be created with L{Container.new}(), items can be stored 1413 with function like L{Container.set_double}(), read with 1414 L{Container.get_double}(), and removed with L{Container.remove}() or 1415 L{Container.remove_by_prefix}(). A presence of a value can be tested with 1416 L{Container.contains}(), convenience functions for reading (updating) a 1417 value only if it is present like L{Container.gis_double}(), are available 1418 too. 1419 1420 B{C{Container}} takes ownership of stored non-atomic items. For strings, this 1421 means you cannot store static strings (use g_strdup() to duplicate them), 1422 and must not free stored dynamic strings, as the container will free them 1423 itself when they are removed or when the container is finalized. For 1424 objects, this means it takes a reference on the object (released when the 1425 object is removed or the container is finalized), so you usually want to 1426 g_object_unref() objects after storing them to a container. 1427 1428 Items in a B{C{Container}} can be identified by a B{C{GQuark}} or the corresponding 1429 string. While B{C{GQuark}}'s are atomic values and allow faster acces, they are 1430 less convenient for casual usage -- each B{C{GQuark}} key function like 1431 L{Container.set_double}() thus has a string-key counterpart 1432 L{Container.set_double_by_name}(). 1433 1434 """
1435 - def __init__():
1436 """ 1437 Creates a new B{C{Container}}. 1438 1439 1440 @return: The container, as a B{C{GObject}}. I{(L{Container})} 1441 """ 1442 return None
1443
1444 - def get_n_items():
1445 """ 1446 Gets the number of items in a container. 1447 1448 1449 @return: The number of items. I{(int)} 1450 """ 1451 return None
1452
1453 - def value_type(key):
1454 """ 1455 Returns the type of value in B{C{container}} identified by B{C{key}}. 1456 1457 1458 @param key: A B{C{GQuark}} key. I{(int)} 1459 @return: The value type as B{C{GType}}; 0 if there is no such value. I{(GType)} 1460 """ 1461 return None
1462
1463 - def contains(key):
1464 """ 1465 Returns B{C{True}} if B{C{container}} contains a value identified by B{C{key}}. 1466 1467 1468 @param key: A B{C{GQuark}} key. I{(int)} 1469 @return: Whether B{C{container}} contains something identified by B{C{key}}. I{(bool)} 1470 """ 1471 return None
1472
1473 - def remove(key):
1474 """ 1475 Removes a value identified by B{C{key}} from a container. 1476 1477 1478 @param key: A B{C{GQuark}} key. I{(int)} 1479 @return: B{C{True}} if there was such a value and was removed. I{(bool)} 1480 """ 1481 return None
1482
1483 - def remove_by_prefix(prefix):
1484 """ 1485 Removes a values whose key start with B{C{prefix}} from container B{C{container}}. 1486 1487 B{C{prefix}} can be B{C{None}}, all values are then removed. 1488 1489 1490 @param prefix: A nul-terminated id prefix. I{(string)} 1491 @return: The number of values removed. I{(int)} 1492 """ 1493 return None
1494
1495 - def transfer(dest, source_prefix, dest_prefix, force):
1496 """ 1497 Copies a items from one place in container to another place. 1498 1499 The copies are shallow, objects are not physically duplicated, only 1500 referenced in B{C{dest}}. 1501 1502 1503 @param dest: Destination container. It may be the same container as B{C{source}}, but 1504 B{C{source_prefix}} and B{C{dest_prefix}} may not overlap then. I{(L{Container})} 1505 @param source_prefix: Prefix in B{C{source}} to take values from. I{(string)} 1506 @param dest_prefix: Prefix in B{C{dest}} to put values to. I{(string)} 1507 @param force: B{C{True}} to replace existing values in B{C{dest}}. I{(bool)} 1508 @return: The number of actually transferred items. I{(int)} 1509 """ 1510 return None
1511
1512 - def rename(key, newkey, force):
1513 """ 1514 Makes a value in B{C{container}} identified by B{C{key}} to be identified by B{C{newkey}}. 1515 1516 When B{C{force}} is B{C{True}} existing value at B{C{newkey}} is removed from B{C{container}}. 1517 When it's B{C{False}}, an existing value B{C{newkey}} inhibits the rename and B{C{False}} 1518 is returned. 1519 1520 1521 @param key: The current key. I{(int)} 1522 @param newkey: A new key for the value. I{(int)} 1523 @param force: Whether to replace existing value at B{C{newkey}}. I{(bool)} 1524 @return: Whether the rename succeeded. I{(bool)} 1525 """ 1526 return None
1527
1528 - def foreach(prefix, function, user_data):
1529 """ 1530 Calls B{C{function}} on each B{C{container}} item whose identifier starts with 1531 B{C{prefix}}. 1532 1533 The function is called B{C{function}}(B{C{GQuark}} key, B{C{GValue}} *value, user_data). 1534 1535 1536 @param prefix: A nul-terminated id prefix. I{(string)} 1537 @param function: The function called on the items. I{(GHFunc)} 1538 @param user_data: The user data passed to B{C{function}}. I{(gpointer)} 1539 @return: The number of items B{C{function}} was called on. I{(int)} 1540 """ 1541 return None
1542
1543 - def set_boolean(key, value):
1544 """ 1545 Stores a boolean into B{C{container}}, identified by B{C{key}}. 1546 1547 @param key: A B{C{GQuark}} key. I{(int)} 1548 @param value: A boolean. I{(bool)} 1549 """ 1550 pass
1551
1552 - def get_boolean(key):
1553 """ 1554 Returns the boolean in B{C{container}} identified by B{C{key}}. 1555 1556 1557 @param key: A B{C{GQuark}} key. I{(int)} 1558 @return: The boolean as B{C{gboolean}}. I{(bool)} 1559 """ 1560 return None
1561
1562 - def set_uchar(key, value):
1563 """ 1564 Stores an unsigned character into B{C{container}}, identified by B{C{key}}. 1565 1566 @param key: A B{C{GQuark}} key. I{(int)} 1567 @param value: An unsigned character. I{(guchar)} 1568 """ 1569 pass
1570
1571 - def get_uchar(key):
1572 """ 1573 Returns the unsigned character in B{C{container}} identified by B{C{key}}. 1574 1575 1576 @param key: A B{C{GQuark}} key. I{(int)} 1577 @return: The character as B{C{guchar}}. I{(guchar)} 1578 """ 1579 return None
1580
1581 - def set_int32(key, value):
1582 """ 1583 Stores a 32bit integer into B{C{container}}, identified by B{C{key}}. 1584 1585 @param key: A B{C{GQuark}} key. I{(int)} 1586 @param value: A 32bit integer. I{(int)} 1587 """ 1588 pass
1589
1590 - def get_int32(key):
1591 """ 1592 Returns the 32bit integer in B{C{container}} identified by B{C{key}}. 1593 1594 1595 @param key: A B{C{GQuark}} key. I{(int)} 1596 @return: The integer as B{C{guint32}}. I{(int)} 1597 """ 1598 return None
1599
1600 - def set_enum(key, value):
1601 """ 1602 Stores an enum into B{C{container}}, identified by B{C{key}}. 1603 1604 Note enums are treated as 32bit integers. 1605 1606 @param key: A B{C{GQuark}} key. I{(int)} 1607 @param value: An enum integer. I{(int)} 1608 """ 1609 pass
1610
1611 - def get_enum(key):
1612 """ 1613 Returns the enum in B{C{container}} identified by B{C{key}}. 1614 1615 Note enums are treated as 32bit integers. 1616 1617 1618 @param key: A B{C{GQuark}} key. I{(int)} 1619 @return: The enum as B{C{gint}}. I{(int)} 1620 """ 1621 return None
1622
1623 - def set_int64(key, value):
1624 """ 1625 Stores a 64bit integer into B{C{container}}, identified by B{C{key}}. 1626 1627 @param key: A B{C{GQuark}} key. I{(int)} 1628 @param value: A 64bit integer. I{(gint64)} 1629 """ 1630 pass
1631
1632 - def get_int64(key):
1633 """ 1634 Returns the 64bit integer in B{C{container}} identified by B{C{key}}. 1635 1636 1637 @param key: A B{C{GQuark}} key. I{(int)} 1638 @return: The 64bit integer as B{C{guint64}}. I{(gint64)} 1639 """ 1640 return None
1641
1642 - def set_double(key, value):
1643 """ 1644 Stores a double into B{C{container}}, identified by B{C{key}}. 1645 1646 @param key: A B{C{GQuark}} key. I{(int)} 1647 @param value: A double. I{(float)} 1648 """ 1649 pass
1650
1651 - def get_double(key):
1652 """ 1653 Returns the double in B{C{container}} identified by B{C{key}}. 1654 1655 1656 @param key: A B{C{GQuark}} key. I{(int)} 1657 @return: The double as B{C{gdouble}}. I{(float)} 1658 """ 1659 return None
1660
1661 - def get_string(key):
1662 """ 1663 Returns the string in B{C{container}} identified by B{C{key}}. 1664 1665 The returned string must be treated as constant and never freed or modified. 1666 1667 1668 @param key: A B{C{GQuark}} key. I{(int)} 1669 @return: The string. I{(string)} 1670 """ 1671 return None
1672
1673 - def set_object(key, value):
1674 """ 1675 Stores an object into B{C{container}}, identified by B{C{key}}. 1676 1677 The container claims ownership on the object, i.e. its reference count is 1678 incremented. 1679 1680 The object must implement B{C{Serializable}} interface to allow serialization 1681 of the container. 1682 1683 @param key: A B{C{GQuark}} key. I{(int)} 1684 @param value: An object to store into container. I{(L{gobject.GObject})} 1685 """ 1686 pass
1687
1688 - def get_object(key):
1689 """ 1690 Returns the object in B{C{container}} identified by B{C{key}}. 1691 1692 The returned object doesn't have its reference count increased, use 1693 g_object_ref() if you want to access it even when B{C{container}} may cease 1694 to exist. 1695 1696 1697 @param key: A B{C{GQuark}} key. I{(int)} 1698 @return: The object as B{C{gpointer}}. I{(L{gobject.GObject})} 1699 """ 1700 return None
1701
1702 - def keys():
1703 """ 1704 Gets all quark keys of a container. 1705 1706 @since: 2.7 1707 1708 @return: A newly allocated array with quark keys of all B{C{container}} items, 1709 in no particular order. The number of items can be obtained 1710 with L{Container.get_n_items}(). If there are no items, B{C{None}} 1711 is returned. I{(list)} 1712 """ 1713 return None
1714
1715 - def keys_by_name():
1716 """ 1717 Gets all string keys of a container. 1718 1719 @since: 2.7 1720 1721 @return: A newly allocated array with string keys of all B{C{container}} items, 1722 in no particular order. The number of items can be obtained 1723 with L{Container.get_n_items}(). If there are no items, B{C{None}} 1724 is returned. Unlike the array the strings are owned by GLib and 1725 must not be freed. I{(ConstStringArray*)} 1726 """ 1727 return None
1728
1729 - def duplicate_by_prefix(keys):
1730 """ 1731 Duplicates a container keeping only values under given prefixes. 1732 1733 Like L{Container.duplicate}(), this method creates a deep copy, that is 1734 contained object are physically duplicated too, not just referenced again. 1735 1736 1737 @param keys: I{(StringArray*)} 1738 @return: A newly created container. I{(L{Container})} 1739 """ 1740 return None
1741
1742 - def serialize_to_text():
1743 """ 1744 Creates a text representation of B{C{container}} contents. 1745 1746 Note only simple data types are supported as serialization of compound 1747 objects is not controllable. 1748 1749 1750 @return: A pointer array, each item containing string with one container 1751 item representation (name, type, value). The array is sorted by name. I{(StringArray*)} 1752 """ 1753 return None
1754
1755 - def contains_by_name(n):
1756 """ 1757 Expands to B{C{True}} if container B{C{c}} contains a value identified by name B{C{n}}. 1758 1759 @param n: A nul-terminated name (id). I{(string)} 1760 @return: I{(bool)} 1761 """ 1762 return None
1763
1764 - def remove_by_name(n):
1765 """ 1766 Removes a value identified by name B{C{n}} from container B{C{c}}. 1767 1768 Expands to B{C{True}} if there was such a value and was removed. 1769 1770 @param n: A nul-terminated name (id). I{(string)} 1771 @return: I{(bool)} 1772 """ 1773 return None
1774
1775 - def rename_by_name(n, new_name, force):
1776 """ 1777 Makes a value in container B{C{c}} identified by name B{C{n}} to be identified by 1778 new name B{C{nn}}. 1779 1780 See L{Container.rename}() for details. 1781 1782 @param n: A nul-terminated name (id). I{(string)} 1783 @param new_name: I{(string)} 1784 @param force: I{(bool)} 1785 @return: I{(bool)} 1786 """ 1787 return None
1788
1789 - def set_boolean_by_name(n, v):
1790 """ 1791 Stores a boolean into container B{C{c}}, identified by name B{C{n}}. 1792 1793 @param n: A nul-terminated name (id). I{(string)} 1794 @param v: A boolean. I{(bool)} 1795 """ 1796 pass
1797
1798 - def set_double_by_name(n, v):
1799 """ 1800 Stores a double into container B{C{c}}, identified by name B{C{n}}. 1801 1802 @param n: A nul-terminated name (id). I{(string)} 1803 @param v: A double integer. I{(float)} 1804 """ 1805 pass
1806
1807 - def set_enum_by_name(n, v):
1808 """ 1809 Stores an enum into container B{C{c}}, identified by name B{C{n}}. 1810 1811 Note enums are treated as 32bit integers. 1812 1813 @param n: A nul-terminated name (id). I{(string)} 1814 @param v: An enum. I{(int)} 1815 """ 1816 pass
1817
1818 - def set_int32_by_name(n, v):
1819 """ 1820 Stores a 32bit integer into container B{C{c}}, identified by name B{C{n}}. 1821 1822 @param n: A nul-terminated name (id). I{(string)} 1823 @param v: A 32bit integer. I{(int)} 1824 """ 1825 pass
1826
1827 - def set_int64_by_name(n, v):
1828 """ 1829 Stores a 64bit integer into container B{C{c}}, identified by name B{C{n}}. 1830 1831 @param n: A nul-terminated name (id). I{(string)} 1832 @param v: A 64bit integer. I{(gint64)} 1833 """ 1834 pass
1835
1836 - def set_object_by_name(n, v):
1837 """ 1838 Stores an object into container B{C{c}}, identified by name B{C{n}}. 1839 1840 See L{Container.set_object}() for details. 1841 1842 @param n: A nul-terminated name (id). I{(string)} 1843 @param v: An object to store into container. I{(L{gobject.GObject})} 1844 """ 1845 pass
1846
1847 - def set_uchar_by_name(n, v):
1848 """ 1849 Stores an unsigned character into container B{C{c}}, identified by name B{C{n}}. 1850 1851 @param n: A nul-terminated name (id). I{(string)} 1852 @param v: An unsigned character. I{(guchar)} 1853 """ 1854 pass
1855
1856 - def get_boolean_by_name(n):
1857 """ 1858 Gets the boolean in container B{C{c}} identified by name B{C{n}}. 1859 1860 @param n: A nul-terminated name (id). I{(string)} 1861 @return: I{(bool)} 1862 """ 1863 return None
1864
1865 - def get_double_by_name(n):
1866 """ 1867 Gets the double in container B{C{c}} identified by name B{C{n}}. 1868 1869 @param n: A nul-terminated name (id). I{(string)} 1870 @return: I{(float)} 1871 """ 1872 return None
1873
1874 - def get_enum_by_name(n):
1875 """ 1876 Gets the enum in container B{C{c}} identified by name B{C{n}}. 1877 1878 Note enums are treated as 32bit integers. 1879 1880 @param n: A nul-terminated name (id). I{(string)} 1881 @return: I{(int)} 1882 """ 1883 return None
1884
1885 - def get_int32_by_name(n):
1886 """ 1887 Gets the 32bit integer in container B{C{c}} identified by name B{C{n}}. 1888 1889 @param n: A nul-terminated name (id). I{(string)} 1890 @return: I{(int)} 1891 """ 1892 return None
1893
1894 - def get_int64_by_name(n):
1895 """ 1896 Gets the 64bit integer in container B{C{c}} identified by name B{C{n}}. 1897 1898 @param n: A nul-terminated name (id). I{(string)} 1899 @return: I{(gint64)} 1900 """ 1901 return None
1902
1903 - def get_uchar_by_name(n):
1904 """ 1905 Gets the unsigned character in container B{C{c}} identified by name B{C{n}}. 1906 1907 @param n: A nul-terminated name (id). I{(string)} 1908 @return: I{(guchar)} 1909 """ 1910 return None
1911
1912 - def get_object_by_name(n):
1913 """ 1914 Gets the object in container B{C{c}} identified by name B{C{n}}. 1915 1916 The returned object doesn't have its reference count increased, use 1917 g_object_ref() if you want to access it even when B{C{container}} may cease 1918 to exist. 1919 1920 @param n: A nul-terminated name (id). I{(string)} 1921 @return: I{(L{gobject.GObject})} 1922 """ 1923 return None
1924
1925 - def get_string_by_name(n):
1926 """ 1927 Gets the string in container B{C{c}} identified by name B{C{n}}. 1928 1929 The returned string must be treated as constant and never freed or modified. 1930 1931 @param n: A nul-terminated name (id). I{(string)} 1932 @return: I{(string)} 1933 """ 1934 return None
1935
1936 - def duplicate():
1937 """ 1938 Convenience macro doing L{gwy_serializable_duplicate}() with all the necessary 1939 typecasting. 1940 1941 @return: I{(L{Container})} 1942 """ 1943 return None
1944
1945 - def set_string_by_name(name, value):
1946 """ 1947 Stores a string into container B{C{c}}, identified by name B{C{n}}. 1948 1949 The container makes a copy of the string, so it can be used on static 1950 strings. 1951 1952 @since: 2.38 1953 1954 @param name: I{(string)} 1955 @param value: I{(string)} 1956 """ 1957 pass
1958
1959 - def set_string(key, value):
1960 """ 1961 Stores a string into B{C{container}}, identified by B{C{key}}. 1962 1963 The container makes a copy of the string, so it can be used on static 1964 strings. 1965 1966 @since: 2.38 1967 1968 @param key: A B{C{GQuark}} key. I{(int)} 1969 @param value: A nul-terminated string. I{(string)} 1970 """ 1971 pass
1972
1973 - def keys_by_name():
1974 """ 1975 Gets all string keys of a container. 1976 1977 @since: 2.7 1978 1979 @return: A newly allocated array with string keys of all B{C{container}} items, 1980 in no particular order. The number of items can be obtained 1981 with L{Container.get_n_items}(). If there are no items, B{C{None}} 1982 is returned. Unlike the array the strings are owned by GLib and 1983 must not be freed. I{(list)} 1984 """ 1985 return None
1986
1987 - def get_value_by_name(name):
1988 """ 1989 Gets the value in container B{C{c}} identified by name B{C{n}}. 1990 1991 @param name: I{(string)} 1992 @return: I{(any)} 1993 """ 1994 return None
1995
1996 - def get_value(key):
1997 """ 1998 Returns the value in B{C{container}} identified by B{C{key}}. 1999 2000 2001 @param key: A B{C{GQuark}} key. I{(int)} 2002 @return: The value as a B{C{GValue}}. I{(any)} 2003 """ 2004 return None
2005
2006 - def set_value_by_name(name, value):
2007 """ 2008 Inserts or updates several values in B{C{container}}. 2009 2010 @param name: I{(string)} 2011 @param value: I{(any)} 2012 """ 2013 pass
2014
2015 - def set_value(key, value):
2016 """ 2017 Inserts or updates several values in B{C{container}}. 2018 2019 @param key: I{(int)} 2020 @param value: I{(any)} 2021 """ 2022 pass
2023 2024
2025 -class Curve:
2026 - def __init__():
2027 """ 2028 Creates B{C{Curve}} widget. By default, the widget will have 3 curves. 2029 2030 2031 @return: new B{C{Curve}} widget. I{(L{gtk.Widget})} 2032 """ 2033 return None
2034
2035 - def reset():
2036 """ 2037 Removes all control points, resetting the curves to their initial state. 2038 2039 2040 """ 2041 pass
2042
2043 - def set_range(min_x, max_x, min_y, max_y):
2044 pass
2045
2046 - def set_curve_type(type):
2047 pass
2048
2049 - def set_channels(num_channels, colors):
2050 pass
2051 2052
2053 -class DataField:
2054 """ 2055 Two-dimensional data representation 2056 2057 2058 B{C{DataField}} is an object that is used for representation of all 2059 two-dimensional data matrices. Most of the basic data handling and 2060 processing functions in Gwyddion are declared here as they are connected 2061 with B{C{DataField}}. 2062 2063 """
2064 - def __init__(xres, yres, xreal, yreal, nullme):
2065 """ 2066 Creates a new data field. 2067 2068 2069 @param xres: X-resolution, i.e., the number of columns. I{(int)} 2070 @param yres: Y-resolution, i.e., the number of rows. I{(int)} 2071 @param xreal: Real horizontal physical dimension. I{(float)} 2072 @param yreal: Real vertical physical dimension. I{(float)} 2073 @param nullme: Whether the data field should be initialized to zeroes. If B{C{False}}, 2074 the data will not be initialized. I{(bool)} 2075 @return: A newly created data field. I{(L{DataField})} 2076 """ 2077 return None
2078
2079 - def sum_fields(operand1, operand2):
2080 """ 2081 Sums two data fields. 2082 2083 @param operand1: First data field operand. I{(L{DataField})} 2084 @param operand2: Second data field operand. I{(L{DataField})} 2085 """ 2086 pass
2087
2088 - def subtract_fields(operand1, operand2):
2089 """ 2090 Subtracts one data field from another. 2091 2092 @param operand1: First data field operand. I{(L{DataField})} 2093 @param operand2: Second data field operand. I{(L{DataField})} 2094 """ 2095 pass
2096
2097 - def divide_fields(operand1, operand2):
2098 """ 2099 Divides one data field with another. 2100 2101 @param operand1: First data field operand. I{(L{DataField})} 2102 @param operand2: Second data field operand. I{(L{DataField})} 2103 """ 2104 pass
2105
2106 - def multiply_fields(operand1, operand2):
2107 """ 2108 Multiplies two data fields. 2109 2110 @param operand1: First data field operand. I{(L{DataField})} 2111 @param operand2: Second data field operand. I{(L{DataField})} 2112 """ 2113 pass
2114
2115 - def min_of_fields(operand1, operand2):
2116 """ 2117 Finds point-wise maxima of two data fields. 2118 2119 @param operand1: First data field operand. I{(L{DataField})} 2120 @param operand2: Second data field operand. I{(L{DataField})} 2121 """ 2122 pass
2123
2124 - def max_of_fields(operand1, operand2):
2125 """ 2126 Finds point-wise minima of two data fields. 2127 2128 @param operand1: First data field operand. I{(L{DataField})} 2129 @param operand2: Second data field operand. I{(L{DataField})} 2130 """ 2131 pass
2132
2133 - def hypot_of_fields(operand1, operand2):
2134 """ 2135 Finds point-wise hypotenuse of two data fields. 2136 2137 @since: 2.31 2138 2139 @param operand1: First data field operand. I{(L{DataField})} 2140 @param operand2: Second data field operand. I{(L{DataField})} 2141 """ 2142 pass
2143
2144 - def check_compatibility(data_field2, check):
2145 """ 2146 Checks whether two data fields are compatible. 2147 2148 2149 @param data_field2: Another data field. I{(L{DataField})} 2150 @param check: The compatibility tests to perform. Expected values: C{B{DATA_COMPATIBILITY_RES}}, C{B{DATA_COMPATIBILITY_REAL}}, C{B{DATA_COMPATIBILITY_MEASURE}}, C{B{DATA_COMPATIBILITY_LATERAL}}, C{B{DATA_COMPATIBILITY_VALUE}}, C{B{DATA_COMPATIBILITY_AXISCAL}}, C{B{DATA_COMPATIBILITY_ALL}}. I{(L{DataCompatibilityFlags})} 2151 @return: Zero if all tested properties are compatible. Flags corresponding 2152 to failed tests if data fields are not compatible. I{(DataCompatibilityFlags)} 2153 """ 2154 return None
2155
2156 - def check_compatibility_with_brick_xy(brick, check):
2157 """ 2158 Checks whether a data field is compatible with brick XY-planes. 2159 2160 @since: 2.51 2161 2162 @param brick: A three-dimensional data brick. I{(L{Brick})} 2163 @param check: The compatibility tests to perform. Expected values: C{B{DATA_COMPATIBILITY_RES}}, C{B{DATA_COMPATIBILITY_REAL}}, C{B{DATA_COMPATIBILITY_MEASURE}}, C{B{DATA_COMPATIBILITY_LATERAL}}, C{B{DATA_COMPATIBILITY_VALUE}}, C{B{DATA_COMPATIBILITY_AXISCAL}}, C{B{DATA_COMPATIBILITY_ALL}}. I{(L{DataCompatibilityFlags})} 2164 @return: Zero if all tested properties are compatible. Flags corresponding 2165 to failed tests if the data objects are not compatible. I{(DataCompatibilityFlags)} 2166 """ 2167 return None
2168
2169 - def extend(left, right, up, down, exterior, fill_value, keep_offsets):
2170 """ 2171 Creates a new data field by extending another data field using the specified 2172 method of exterior handling. 2173 2174 @since: 2.36 2175 2176 @param left: Number of pixels to extend to the left (towards lower column indices). I{(int)} 2177 @param right: Number of pixels to extend to the right (towards higher column 2178 indices). I{(int)} 2179 @param up: Number of pixels to extend up (towards lower row indices). I{(int)} 2180 @param down: Number of pixels to extend down (towards higher row indices). I{(int)} 2181 @param exterior: Exterior pixels handling. Expected values: C{B{EXTERIOR_UNDEFINED}}, C{B{EXTERIOR_BORDER_EXTEND}}, C{B{EXTERIOR_MIRROR_EXTEND}}, C{B{EXTERIOR_PERIODIC}}, C{B{EXTERIOR_FIXED_VALUE}}, C{B{EXTERIOR_LAPLACE}}. I{(L{ExteriorType})} 2182 @param fill_value: The value to use with B{C{EXTERIOR_FIXED_VALUE}} exterior. I{(float)} 2183 @param keep_offsets: B{C{True}} to set the X and Y offsets of the new field 2184 using B{C{field}} offsets. B{C{False}} to set offsets 2185 of the new field to zeroes. I{(bool)} 2186 @return: A newly created data field. I{(L{DataField})} 2187 """ 2188 return None
2189
2190 - def laplace_solve(mask, grain_id, qprec):
2191 """ 2192 Replaces masked areas by the solution of Laplace equation. 2193 2194 The boundary conditions on mask boundaries are Dirichlet with values given 2195 by pixels on the outer boundary of the masked area. Boundary conditions at 2196 field edges are Neumann conditions ∂z/∂n=0 where n denotes the normal to the 2197 edge. If entire area of B{C{field}} is to be replaced the problem is 2198 underspecified; B{C{field}} will be filled with zeros. 2199 2200 For the default value of B{C{qprec}} the the result should be good enough for any 2201 image processing purposes with the typical local error of order 10⁻⁵ for 2202 very large grains and possibly much smaller for small grains. You can lower 2203 B{C{qprec}} down to about 0.3 or even 0.2 if speed is crucial and some precision 2204 can be sacrificed. Below that the result just starts becoming somewhat 2205 worse for not much speed increase. Conversely, you may wish to increase 2206 B{C{qprec}} up to 3 or even 5 if accuracy is important and you can afford the 2207 increased computation time. 2208 2209 @since: 2.47 2210 2211 @param mask: A two-dimensional data field containing mask defining the areas to 2212 interpolate. I{(L{DataField})} 2213 @param grain_id: The id number of the grain to replace with the solution of 2214 Laplace equation, from 1 to B{C{ngrains}} (see 2215 L{DataField.grain_numbers}()). Passing 0 means to replace the 2216 entire empty space outside grains while passing a negative value 2217 means to replace the entire masked area. I{(int)} 2218 @param qprec: Speed-accuracy tuning parameter. Pass 1.0 for the default that is 2219 fast and sufficiently precise. I{(float)} 2220 """ 2221 pass
2222
2223 - def correct_laplace_iteration(mask_field, buffer_field, corrfactor):
2224 """ 2225 Performs one interation of Laplace data correction. 2226 2227 Tries to remove all the points in mask off the data by using 2228 iterative method similar to solving heat flux equation. 2229 2230 Use this function repeatedly until reasonable B{C{error}} is reached. 2231 2232 @warning:For almost all purposes this function was superseded by 2233 non-iteratie L{DataField.laplace_solve}() which is simultaneously much 2234 faster and more accurate. 2235 2236 @param mask_field: Mask of places to be corrected. I{(L{DataField})} 2237 @param buffer_field: Initialized to same size as mask and data. I{(L{DataField})} 2238 @param corrfactor: Correction factor within step. I{(float)} 2239 @return: Value B{C{error}}. (I{(float)}) 2240 """ 2241 return None
2242
2243 - def correct_average(mask_field):
2244 """ 2245 Fills data under mask with the average value. 2246 2247 This function simply puts average value of all the B{C{data_field}} values (both 2248 masked and unmasked) into points in B{C{data_field}} lying under points where 2249 B{C{mask_field}} values are nonzero. 2250 2251 In most cases you probably want to use 2252 L{DataField.correct_average_unmasked}() instead. 2253 2254 @param mask_field: Mask of places to be corrected. I{(L{DataField})} 2255 """ 2256 pass
2257
2258 - def correct_average_unmasked(mask_field):
2259 """ 2260 Fills data under mask with the average value of unmasked data. 2261 2262 This function calculates the average value of all unmasked pixels in 2263 B{C{data_field}} and then fills all the masked pixels with this average value. 2264 It is useful as the first rough step of correction of data under the mask. 2265 2266 If all data are masked the field is filled with zeroes. 2267 2268 @since: 2.44 2269 2270 @param mask_field: Mask of places to be corrected. I{(L{DataField})} 2271 """ 2272 pass
2273
2274 - def mask_outliers(mask_field, thresh):
2275 """ 2276 Creates mask of data that are above or below B{C{thresh}}*sigma from average 2277 height. 2278 2279 Sigma denotes root-mean square deviation of heights. This criterium 2280 corresponds to the usual Gaussian distribution outliers detection if 2281 B{C{thresh}} is 3. 2282 2283 @param mask_field: A data field to be filled with mask. I{(L{DataField})} 2284 @param thresh: Threshold value. I{(float)} 2285 """ 2286 pass
2287
2288 - def mask_outliers2(mask_field, thresh_low, thresh_high):
2289 """ 2290 Creates mask of data that are above or below multiples of rms from average 2291 height. 2292 2293 Data that are below B{C{mean}}-B{C{thresh_low}}*B{C{sigma}} or above 2294 B{C{mean}}+B{C{thresh_high}}*B{C{sigma}} are marked as outliers, where B{C{sigma}} denotes the 2295 root-mean square deviation of heights. 2296 2297 @since: 2.26 2298 2299 @param mask_field: A data field to be filled with mask. I{(L{DataField})} 2300 @param thresh_low: Lower threshold value. I{(float)} 2301 @param thresh_high: Upper threshold value. I{(float)} 2302 """ 2303 pass
2304
2305 - def distort(dest, invtrans, user_data, interp, exterior, fill_value):
2306 """ 2307 Distorts a data field in the horizontal plane. 2308 2309 Note the transform function B{C{invtrans}} is the inverse transform, in other 2310 words it calculates the old coordinates from the new coordinates (the 2311 transform would not be uniquely defined the other way round). 2312 2313 The B{C{EXTERIOR_LAPLACE}} exterior type cannot be used with this function. 2314 2315 @since: 2.5 2316 2317 @param dest: Destination data field. I{(L{DataField})} 2318 @param invtrans: Inverse transform function, that is the transformation from 2319 new coordinates to old coordinates. It gets 2320 (B{C{j}}+0.5, B{C{i}}+0.5), where B{C{i}} and B{C{j}} are the new row and column 2321 indices, passed as the input coordinates. The output coordinates 2322 should follow the same convention. Unless a special exterior 2323 handling is required, the transform function does not need to 2324 concern itself with coordinates being outside of the data. I{(CoordTransform2DFunc)} 2325 @param user_data: Pointer passed as B{C{user_data}} to B{C{invtrans}}. I{(gpointer)} 2326 @param interp: Interpolation type to use. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 2327 @param exterior: Exterior pixels handling. Expected values: C{B{EXTERIOR_UNDEFINED}}, C{B{EXTERIOR_BORDER_EXTEND}}, C{B{EXTERIOR_MIRROR_EXTEND}}, C{B{EXTERIOR_PERIODIC}}, C{B{EXTERIOR_FIXED_VALUE}}, C{B{EXTERIOR_LAPLACE}}. I{(L{ExteriorType})} 2328 @param fill_value: The value to use with B{C{EXTERIOR_FIXED_VALUE}}. I{(float)} 2329 """ 2330 pass
2331
2332 - def sample_distorted(dest, coords, interp, exterior, fill_value):
2333 """ 2334 Resamples a data field in an arbitrarily distorted manner. 2335 2336 Each item in B{C{coords}} corresponds to one pixel in B{C{dest}} and gives the 2337 coordinates in B{C{source}} defining the value to set in this pixel. 2338 2339 The B{C{EXTERIOR_LAPLACE}} exterior type cannot be used with this function. 2340 2341 @since: 2.45 2342 2343 @param dest: Destination data field. I{(L{DataField})} 2344 @param coords: Array of B{C{source}} coordinates with the same number of items as 2345 B{C{dest}}, ordered as data field data. 2346 See L{DataField.distort}() for coordinate convention discussion. I{(const-XY*)} 2347 @param interp: Interpolation type to use. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 2348 @param exterior: Exterior pixels handling. Expected values: C{B{EXTERIOR_UNDEFINED}}, C{B{EXTERIOR_BORDER_EXTEND}}, C{B{EXTERIOR_MIRROR_EXTEND}}, C{B{EXTERIOR_PERIODIC}}, C{B{EXTERIOR_FIXED_VALUE}}, C{B{EXTERIOR_LAPLACE}}. I{(L{ExteriorType})} 2349 @param fill_value: The value to use with B{C{EXTERIOR_FIXED_VALUE}}. I{(float)} 2350 """ 2351 pass
2352
2353 - def mark_scars(result, threshold_high, threshold_low, min_scar_len, max_scar_width, negative):
2354 """ 2355 Find and marks scars in a data field. 2356 2357 Scars are linear horizontal defects, consisting of shifted values. 2358 Zero or negative values in B{C{result}} siginify normal data, positive 2359 values siginify samples that are part of a scar. 2360 2361 @since: 2.46 2362 2363 @param result: A data field to store the result to (it is resized to match 2364 B{C{data_field}}). I{(L{DataField})} 2365 @param threshold_high: Miminum relative step for scar marking, must be positive. I{(float)} 2366 @param threshold_low: Definite relative step for scar marking, must be at least 2367 equal to B{C{threshold_high}}. I{(float)} 2368 @param min_scar_len: Minimum length of a scar, shorter ones are discarded 2369 (must be at least one). I{(float)} 2370 @param max_scar_width: Maximum width of a scar, must be at least one. I{(float)} 2371 @param negative: B{C{True}} to detect negative scars, B{C{False}} to positive. I{(bool)} 2372 """ 2373 pass
2374
2375 - def get_correlation_score(kernel_field, col, row, kernel_col, kernel_row, kernel_width, kernel_height):
2376 """ 2377 Calculates a correlation score in one point. 2378 2379 Correlation window size is given 2380 by B{C{kernel_col}}, B{C{kernel_row}}, B{C{kernel_width}}, B{C{kernel_height}}, 2381 postion of the correlation window on data is given by 2382 B{C{col}}, B{C{row}}. 2383 2384 If anything fails (data too close to boundary, etc.), 2385 function returns -1.0 (none correlation).. 2386 2387 2388 @param kernel_field: Kernel to correlate data field with. I{(L{DataField})} 2389 @param col: Upper-left column position in the data field. I{(int)} 2390 @param row: Upper-left row position in the data field. I{(int)} 2391 @param kernel_col: Upper-left column position in kernel field. I{(int)} 2392 @param kernel_row: Upper-left row position in kernel field. I{(int)} 2393 @param kernel_width: Width of kernel field area. I{(int)} 2394 @param kernel_height: Heigh of kernel field area. I{(int)} 2395 @return: Correlation score (between -1.0 and 1.0). Value 1.0 denotes 2396 maximum correlation, -1.0 none correlation. I{(float)} 2397 """ 2398 return None
2399
2400 - def get_weighted_correlation_score(kernel_field, weight_field, col, row, kernel_col, kernel_row, kernel_width, kernel_height):
2401 """ 2402 Calculates a correlation score in one point using weights to center 2403 the used information to the center of kernel. 2404 2405 Correlation window size is given 2406 by B{C{kernel_col}}, B{C{kernel_row}}, B{C{kernel_width}}, B{C{kernel_height}}, 2407 postion of the correlation window on data is given by 2408 B{C{col}}, B{C{row}}. 2409 2410 If anything fails (data too close to boundary, etc.), 2411 function returns -1.0 (none correlation).. 2412 2413 2414 @param kernel_field: Kernel to correlate data field with. I{(L{DataField})} 2415 @param weight_field: data field of same size as kernel window size I{(L{DataField})} 2416 @param col: Upper-left column position in the data field. I{(int)} 2417 @param row: Upper-left row position in the data field. I{(int)} 2418 @param kernel_col: Upper-left column position in kernel field. I{(int)} 2419 @param kernel_row: Upper-left row position in kernel field. I{(int)} 2420 @param kernel_width: Width of kernel field area. I{(int)} 2421 @param kernel_height: Heigh of kernel field area. I{(int)} 2422 @return: Correlation score (between -1.0 and 1.0). Value 1.0 denotes 2423 maximum correlation, -1.0 none correlation. I{(float)} 2424 """ 2425 return None
2426
2427 - def crosscorrelate(data_field2, x_dist, y_dist, score, search_width, search_height, window_width, window_height):
2428 """ 2429 Algorithm for matching two different images of the same object under changes. 2430 2431 It does not use any special features 2432 for matching. It simply searches for all points (with their neighbourhood) 2433 of B{C{data_field1}} within B{C{data_field2}}. Parameters B{C{search_width}} and 2434 B{C{search_height}} 2435 determine maimum area where to search for points. The area is cenetered 2436 in the B{C{data_field2}} at former position of points at B{C{data_field1}}. 2437 2438 @param data_field2: A data field. I{(L{DataField})} 2439 @param x_dist: A data field to store x-distances to. I{(L{DataField})} 2440 @param y_dist: A data field to store y-distances to. I{(L{DataField})} 2441 @param score: Data field to store correlation scores to. I{(L{DataField})} 2442 @param search_width: Search area width. I{(int)} 2443 @param search_height: Search area height. I{(int)} 2444 @param window_width: Correlation window width. This parameter is not actually 2445 used. Pass zero. I{(int)} 2446 @param window_height: Correlation window height. This parameter is not actually 2447 used. Pass zero. I{(int)} 2448 """ 2449 pass
2450
2451 - def crosscorrelate_init(data_field2, x_dist, y_dist, score, search_width, search_height, window_width, window_height):
2452 """ 2453 Initializes a cross-correlation iterator. 2454 2455 This iterator reports its state as B{C{ComputationStateType}}. 2456 2457 2458 @param data_field2: A data field. I{(L{DataField})} 2459 @param x_dist: A data field to store x-distances to, or B{C{None}}. I{(L{DataField})} 2460 @param y_dist: A data field to store y-distances to, or B{C{None}}. I{(L{DataField})} 2461 @param score: Data field to store correlation scores to, or B{C{None}}. I{(L{DataField})} 2462 @param search_width: Search area width. I{(int)} 2463 @param search_height: Search area height. I{(int)} 2464 @param window_width: Correlation window width. I{(int)} 2465 @param window_height: Correlation window height. I{(int)} 2466 @return: A new cross-correlation iterator. I{(ComputationState*)} 2467 """ 2468 return None
2469
2470 - def correlate(kernel_field, score, method):
2471 """ 2472 Computes correlation score for all positions in a data field. 2473 2474 Correlation score is compute for all points in data field B{C{data_field}} 2475 and full size of correlation kernel B{C{kernel_field}}. 2476 2477 The points in B{C{score}} correspond to centers of kernel. More precisely, the 2478 point ((B{C{kxres}}-1)/2, (B{C{kyres}}-1)/2) in B{C{score}} corresponds to kernel field 2479 top left corner coincident with data field top left corner. Points outside 2480 the area where the kernel field fits into the data field completely are 2481 set to -1 for B{C{CORRELATION_NORMAL}}. 2482 2483 This function is mostly made obsolete by L{DataField.correlation_search}() 2484 which offers, beside the plain FFT-based correlation, a method equivalent to 2485 B{C{CORRELATION_NORMAL}} as well as several others, all computed efficiently 2486 using FFT. 2487 2488 @param kernel_field: Correlation kernel. I{(L{DataField})} 2489 @param score: Data field to store correlation scores to. I{(L{DataField})} 2490 @param method: Correlation score calculation method. Expected values: C{B{CORRELATION_NORMAL}}, C{B{CORRELATION_FFT}}, C{B{CORRELATION_POC}}. I{(L{CorrelationType})} 2491 """ 2492 pass
2493
2494 - def correlate_init(kernel_field, score):
2495 """ 2496 Creates a new correlation iterator. 2497 2498 This iterator reports its state as B{C{ComputationStateType}}. 2499 2500 This function is mostly made obsolete by L{DataField.correlation_search}() 2501 which offers, beside the plain FFT-based correlation, a method equivalent to 2502 B{C{CORRELATION_NORMAL}} as well as several others, all computed efficiently 2503 using FFT. 2504 2505 2506 @param kernel_field: Kernel to correlate data field with. I{(L{DataField})} 2507 @param score: Data field to store correlation scores to. I{(L{DataField})} 2508 @return: A new correlation iterator. I{(ComputationState*)} 2509 """ 2510 return None
2511
2512 - def correlation_search(kernel, kernel_weight, target, method, regcoeff, exterior, fill_value):
2513 """ 2514 Performs correlation search of a detail in a larger data field. 2515 2516 There are two basic classes of methods: Covariance (products of kernel and 2517 data values are summed) and height difference (squared differences between 2518 kernel and data values are summed). For the second class, the sign of the 2519 output is inverted. So in both cases higher values mean better match. 2520 All methods are implemented efficiently using FFT. 2521 2522 Usually you want to use B{C{CORR_SEARCH_COVARIANCE}} or 2523 B{C{CORR_SEARCH_HEIGHT_DIFF}}, in which the absolute data offsets play no 2524 role (only the differences). 2525 2526 If the detail can also occur with different height scales, use 2527 B{C{CORR_SEARCH_COVARIANCE_SCORE}} or B{C{CORR_SEARCH_HEIGHT_DIFF_SCORE}} in 2528 which the local data variance is normalised. In this case B{C{dfield}} regions 2529 with very small (or zero) variance can lead to odd results and spurious 2530 maxima. Use B{C{regcoeff}} to suppress them: Score of image details is 2531 suppressed if their variance is B{C{regcoeff}} times the mean local variance. 2532 2533 If B{C{kernel_weight}} is non-B{C{None}} is allows specify masking/weighting of 2534 kernel. The simplest use is masking when searching for a non-rectangular 2535 detail. Fill B{C{kernel_weight}} with 1s for important kernel pixels and with 0s 2536 for irrelevant pixels. However, you can use arbitrary non-negative weights. 2537 2538 @since: 2.50 2539 2540 @param kernel: Detail to find (kernel). I{(L{DataField})} 2541 @param kernel_weight: Kernel weight, or B{C{None}}. If given, its dimensions must 2542 match B{C{kernel}}. I{(L{DataField})} 2543 @param target: Data field to fill with the score. It will be resampled to match 2544 B{C{dfield}}. I{(L{DataField})} 2545 @param method: Method, determining the type of output to put into B{C{target}}. Expected values: C{B{CORR_SEARCH_COVARIANCE_RAW}}, C{B{CORR_SEARCH_COVARIANCE}}, C{B{CORR_SEARCH_COVARIANCE_SCORE}}, C{B{CORR_SEARCH_HEIGHT_DIFF_RAW}}, C{B{CORR_SEARCH_HEIGHT_DIFF}}, C{B{CORR_SEARCH_HEIGHT_DIFF_SCORE}}. I{(L{CorrSearchType})} 2546 @param regcoeff: Regularisation coefficient, any positive number. Pass something 2547 like 0.1 if unsure. You can also pass zero, it means the same 2548 as B{C{glib.MINDOUBLE}}. I{(float)} 2549 @param exterior: Exterior pixels handling. Expected values: C{B{EXTERIOR_UNDEFINED}}, C{B{EXTERIOR_BORDER_EXTEND}}, C{B{EXTERIOR_MIRROR_EXTEND}}, C{B{EXTERIOR_PERIODIC}}, C{B{EXTERIOR_FIXED_VALUE}}, C{B{EXTERIOR_LAPLACE}}. I{(L{ExteriorType})} 2550 @param fill_value: The value to use with B{C{EXTERIOR_FIXED_VALUE}} exterior. I{(float)} 2551 """ 2552 pass
2553
2554 - def invalidate():
2555 """ 2556 Invalidates cached data field stats. 2557 2558 User code should rarely need this macro, as all B{C{DataField}} methods do 2559 proper invalidation when they change data, as well as 2560 L{DataField.get_data}() does. 2561 2562 However, if you get raw data with L{DataField.get_data}() and then mix 2563 direct changes to it with calls to methods like L{DataField.get_max}(), 2564 you may need to explicitely invalidate cached values to let 2565 L{DataField.get_max}() know it has to recompute the maximum. 2566 2567 """ 2568 pass
2569
2570 - def new_alike(nullme):
2571 """ 2572 Creates a new data field similar to an existing one. 2573 2574 Use L{DataField.duplicate}() if you want to copy a data field including 2575 data. 2576 2577 2578 @param nullme: Whether the data field should be initialized to zeroes. If B{C{False}}, 2579 the data will not be initialized. I{(bool)} 2580 @return: A newly created data field. I{(L{DataField})} 2581 """ 2582 return None
2583
2584 - def data_changed():
2585 """ 2586 Emits signal "data-changed" on a data field. 2587 2588 """ 2589 pass
2590
2591 - def new_resampled(xres, yres, interpolation):
2592 """ 2593 Creates a new data field by resampling an existing one. 2594 2595 This method is equivalent to L{DataField.duplicate}() followed by 2596 L{DataField.resample}(), but it is more efficient. 2597 2598 2599 @param xres: Desired X resolution. I{(int)} 2600 @param yres: Desired Y resolution. I{(int)} 2601 @param interpolation: Interpolation method to use. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 2602 @return: A newly created data field. I{(L{DataField})} 2603 """ 2604 return None
2605
2606 - def resample(xres, yres, interpolation):
2607 """ 2608 Resamples a data field using given interpolation method 2609 2610 This method may invalidate raw data buffer returned by 2611 L{DataField.get_data}(). 2612 2613 @param xres: Desired X resolution. I{(int)} 2614 @param yres: Desired Y resolution. I{(int)} 2615 @param interpolation: Interpolation method to use. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 2616 """ 2617 pass
2618
2619 - def new_binned(binw, binh, xoff, yoff, trimlowest, trimhighest):
2620 """ 2621 Creates a new data field by binning an existing one. 2622 2623 The data field is divided into rectangles of dimensions B{C{binw}}×B{C{binh}}, offset 2624 by (B{C{xoff}}, B{C{yoff}}). The values in each complete rectangle are averaged and 2625 the average becomes the pixel value in the newly created, smaller data 2626 field. 2627 2628 Note that the result is the average – not sum – of the individual values. 2629 Multiply the returned data field with B{C{binw}}×B{C{binh}} if you want sum. 2630 2631 By giving non-zero B{C{trimlowest}} and B{C{trimhighest}} you can change the plain 2632 average to a trimmed one (even turning it to median in the extreme case). 2633 It must always hold that B{C{trimlowest}} + B{C{trimhighest}} is smaller than 2634 B{C{binw}}×B{C{binh}}. 2635 2636 @since: 2.50 2637 2638 @param binw: Bin height (in pixels). I{(int)} 2639 @param binh: Bin width (in pixels). I{(int)} 2640 @param xoff: Horizontal offset of bins (in pixels). I{(int)} 2641 @param yoff: Vertical offset of bins (in pixels). I{(int)} 2642 @param trimlowest: Number of lowest values to discard. I{(int)} 2643 @param trimhighest: Number of highest values to discard. I{(int)} 2644 @return: A newly created data field. I{(L{DataField})} 2645 """ 2646 return None
2647
2648 - def resize(ulcol, ulrow, brcol, brrow):
2649 """ 2650 Resizes (crops) a data field. 2651 2652 Crops a data field to a rectangle between upper-left and bottom-right 2653 points, recomputing real size. 2654 2655 This method may invalidate raw data buffer returned by 2656 L{DataField.get_data}(). 2657 2658 @param ulcol: Upper-left column coordinate. I{(int)} 2659 @param ulrow: Upper-left row coordinate. I{(int)} 2660 @param brcol: Bottom-right column coordinate + 1. I{(int)} 2661 @param brrow: Bottom-right row coordinate + 1. I{(int)} 2662 """ 2663 pass
2664
2665 - def area_extract(col, row, width, height):
2666 """ 2667 Extracts a rectangular part of a data field to a new data field. 2668 2669 2670 @param col: Upper-left column coordinate. I{(int)} 2671 @param row: Upper-left row coordinate. I{(int)} 2672 @param width: Area width (number of columns). I{(int)} 2673 @param height: Area height (number of rows). I{(int)} 2674 @return: The extracted area as a newly created data field. I{(L{DataField})} 2675 """ 2676 return None
2677
2678 - def copy(dest, nondata_too):
2679 """ 2680 Copies the contents of an already allocated data field to a data field 2681 of the same size. 2682 2683 @param dest: Destination data field. I{(L{DataField})} 2684 @param nondata_too: Whether non-data (units) should be copied too. I{(bool)} 2685 """ 2686 pass
2687
2688 - def area_copy(dest, col, row, width, height, destcol, destrow):
2689 """ 2690 Copies a rectangular area from one data field to another. 2691 2692 The area starts at (B{C{col}}, B{C{row}}) in B{C{src}} and its dimension is B{C{width}}*B{C{height}}. 2693 It is copied to B{C{dest}} starting from (B{C{destcol}}, B{C{destrow}}). 2694 2695 The source area has to be completely contained in B{C{src}}. No assumptions are 2696 made about destination position, however, parts of the source area sticking 2697 out the destination data field B{C{dest}} are cut off. 2698 2699 If B{C{src}} is equal to B{C{dest}}, the areas may not overlap. 2700 2701 @param dest: Destination data field. I{(L{DataField})} 2702 @param col: Area upper-left column coordinate in B{C{src}}. I{(int)} 2703 @param row: Area upper-left row coordinate B{C{src}}. I{(int)} 2704 @param width: Area width (number of columns), pass -1 for full B{C{src}} widdth. I{(int)} 2705 @param height: Area height (number of rows), pass -1 for full B{C{src}} height. I{(int)} 2706 @param destcol: Destination column in B{C{dest}}. I{(int)} 2707 @param destrow: Destination row in B{C{dest}}. I{(int)} 2708 """ 2709 pass
2710
2711 - def get_xres():
2712 """ 2713 Gets X resolution (number of columns) of a data field. 2714 2715 2716 @return: X resolution. I{(int)} 2717 """ 2718 return None
2719
2720 - def get_yres():
2721 """ 2722 Gets Y resolution (number of rows) of the field. 2723 2724 2725 @return: Y resolution. I{(int)} 2726 """ 2727 return None
2728
2729 - def get_xreal():
2730 """ 2731 Gets the X real (physical) size of a data field. 2732 2733 2734 @return: X real size value. I{(float)} 2735 """ 2736 return None
2737
2738 - def get_yreal():
2739 """ 2740 Gets the Y real (physical) size of a data field. 2741 2742 2743 @return: Y real size value. I{(float)} 2744 """ 2745 return None
2746
2747 - def set_xreal(xreal):
2748 """ 2749 Sets X real (physical) size value of a data field. 2750 2751 @param xreal: New X real size value. I{(float)} 2752 """ 2753 pass
2754
2755 - def set_yreal(yreal):
2756 """ 2757 Sets Y real (physical) size value of a data field. 2758 2759 @param yreal: New Y real size value. I{(float)} 2760 """ 2761 pass
2762
2763 - def get_xoffset():
2764 """ 2765 Gets the X offset of data field origin. 2766 2767 2768 @return: X offset value. I{(float)} 2769 """ 2770 return None
2771
2772 - def get_yoffset():
2773 """ 2774 Gets the Y offset of data field origin. 2775 2776 2777 @return: Y offset value. I{(float)} 2778 """ 2779 return None
2780
2781 - def set_xoffset(xoff):
2782 """ 2783 Sets the X offset of a data field origin. 2784 2785 Note offsets don't affect any calculation, nor functions like 2786 L{DataField.rtoj}(). 2787 2788 @param xoff: New X offset value. I{(float)} 2789 """ 2790 pass
2791
2792 - def set_yoffset(yoff):
2793 """ 2794 Sets the Y offset of a data field origin. 2795 2796 Note offsets don't affect any calculation, nor functions like 2797 L{DataField.rtoi}(). 2798 2799 @param yoff: New Y offset value. I{(float)} 2800 """ 2801 pass
2802
2803 - def get_si_unit_xy():
2804 """ 2805 Returns lateral SI unit of a data field. 2806 2807 2808 @return: SI unit corresponding to the lateral (XY) dimensions of the data 2809 field. Its reference count is not incremented. I{(L{SIUnit})} 2810 """ 2811 return None
2812
2813 - def get_si_unit_z():
2814 """ 2815 Returns value SI unit of a data field. 2816 2817 2818 @return: SI unit corresponding to the "height" (Z) dimension of the data 2819 field. Its reference count is not incremented. I{(L{SIUnit})} 2820 """ 2821 return None
2822
2823 - def set_si_unit_xy(si_unit):
2824 """ 2825 Sets the SI unit corresponding to the lateral (XY) dimensions of a data 2826 field. 2827 2828 It does not assume a reference on B{C{si_unit}}, instead it adds its own 2829 reference. 2830 2831 @param si_unit: SI unit to be set. I{(L{SIUnit})} 2832 """ 2833 pass
2834
2835 - def set_si_unit_z(si_unit):
2836 """ 2837 Sets the SI unit corresponding to the "height" (Z) dimension of a data 2838 field. 2839 2840 It does not assume a reference on B{C{si_unit}}, instead it adds its own 2841 reference. 2842 2843 @param si_unit: SI unit to be set. I{(L{SIUnit})} 2844 """ 2845 pass
2846
2847 - def get_value_format_xy(style):
2848 """ 2849 Finds value format good for displaying coordinates of a data field. 2850 2851 2852 @param style: Unit format style. Expected values: C{B{SI_UNIT_FORMAT_NONE}}, C{B{SI_UNIT_FORMAT_PLAIN}}, C{B{SI_UNIT_FORMAT_MARKUP}}, C{B{SI_UNIT_FORMAT_VFMARKUP}}, C{B{SI_UNIT_FORMAT_TEX}}, C{B{SI_UNIT_FORMAT_VFTEX}}, C{B{SI_UNIT_FORMAT_UNICODE}}, C{B{SI_UNIT_FORMAT_VFUNICODE}}. I{(L{SIUnitFormatStyle})} 2853 @return: Tuple consisting of 2 values (B{C{value}}, B{C{format}}). (I{(L{SIValueFormat})}, I{(SkipArg)}) 2854 """ 2855 return None, None
2856
2857 - def get_value_format_z(style):
2858 """ 2859 Finds value format good for displaying values of a data field. 2860 2861 2862 @param style: Unit format style. Expected values: C{B{SI_UNIT_FORMAT_NONE}}, C{B{SI_UNIT_FORMAT_PLAIN}}, C{B{SI_UNIT_FORMAT_MARKUP}}, C{B{SI_UNIT_FORMAT_VFMARKUP}}, C{B{SI_UNIT_FORMAT_TEX}}, C{B{SI_UNIT_FORMAT_VFTEX}}, C{B{SI_UNIT_FORMAT_UNICODE}}, C{B{SI_UNIT_FORMAT_VFUNICODE}}. I{(L{SIUnitFormatStyle})} 2863 @return: Tuple consisting of 2 values (B{C{value}}, B{C{format}}). (I{(L{SIValueFormat})}, I{(SkipArg)}) 2864 """ 2865 return None, None
2866
2867 - def copy_units(target):
2868 """ 2869 Sets lateral and value units of a data field to match another data field. 2870 2871 @since: 2.49 2872 2873 @param target: Target data field. I{(L{DataField})} 2874 """ 2875 pass
2876
2877 - def copy_units_to_data_line(data_line):
2878 """ 2879 Sets lateral and value units of a data line to match a data field. 2880 2881 @param data_line: A data line to set units of. I{(L{DataLine})} 2882 """ 2883 pass
2884
2885 - def itor(row):
2886 """ 2887 Transforms vertical pixel coordinate to real (physical) Y coordinate. 2888 2889 That is it maps range [0..y-resolution] to range [0..real-y-size]. 2890 It is not suitable for conversion of matrix indices to physical coordinates, 2891 you have to use L{DataField.itor}(B{C{data_field}}, B{C{row}} + 0.5) for that. 2892 2893 2894 @param row: Vertical pixel coordinate. I{(float)} 2895 @return: Real Y coordinate. I{(float)} 2896 """ 2897 return None
2898
2899 - def jtor(col):
2900 """ 2901 Transforms horizontal pixel coordinate to real (physical) X coordinate. 2902 2903 That is it maps range [0..x-resolution] to range [0..real-x-size]. 2904 It is not suitable for conversion of matrix indices to physical coordinates, 2905 you have to use L{DataField.jtor}(B{C{data_field}}, B{C{col}} + 0.5) for that. 2906 2907 2908 @param col: Horizontal pixel coordinate. I{(float)} 2909 @return: Real X coordinate. I{(float)} 2910 """ 2911 return None
2912
2913 - def rtoi(realy):
2914 """ 2915 Transforms real (physical) Y coordinate to row. 2916 2917 That is it maps range [0..real-y-size] to range [0..y-resolution]. 2918 2919 2920 @param realy: Real (physical) Y coordinate. I{(float)} 2921 @return: Vertical pixel coodinate. I{(float)} 2922 """ 2923 return None
2924
2925 - def rtoj(realx):
2926 """ 2927 Transforms real (physical) X coordinate to column. 2928 2929 That is it maps range [0..real-x-size] to range [0..x-resolution]. 2930 2931 2932 @param realx: Real (physical) X coodinate. I{(float)} 2933 @return: Horizontal pixel coordinate. I{(float)} 2934 """ 2935 return None
2936
2937 - def get_val(col, row):
2938 """ 2939 Gets value at given position in a data field. 2940 2941 Do not access data with this function inside inner loops, it's slow. 2942 Get the raw data buffer with L{DataField.get_data_const}() and access it 2943 directly instead. 2944 2945 2946 @param col: Column index. I{(int)} 2947 @param row: Row index. I{(int)} 2948 @return: Value at (B{C{col}}, B{C{row}}). I{(float)} 2949 """ 2950 return None
2951
2952 - def set_val(col, row, value):
2953 """ 2954 Sets value at given position in a data field. 2955 2956 Do not set data with this function inside inner loops, it's slow. Get the 2957 raw data buffer with L{DataField.get_data}() and write to it directly 2958 instead. 2959 2960 @param col: Column index. I{(int)} 2961 @param row: Row index. I{(int)} 2962 @param value: Value to set. I{(float)} 2963 """ 2964 pass
2965
2966 - def get_dval(x, y, interpolation):
2967 """ 2968 Gets interpolated value at arbitrary data field point indexed by pixel 2969 coordinates. 2970 2971 Note pixel values are centered in pixels, so to get the same 2972 value as L{DataField.get_val}(B{C{data_field}}, B{C{j}}, B{C{i}}) returns, 2973 it's necessary to add 0.5: 2974 L{DataField.get_dval}(B{C{data_field}}, B{C{j}}+0.5, B{C{i}}+0.5, B{C{interpolation}}). 2975 2976 See also L{DataField.get_dval_real}() that does the same, but takes 2977 real coordinates. 2978 2979 2980 @param x: Horizontal position in pixel units, in range [0, x-resolution]. I{(float)} 2981 @param y: Vertical postition in pixel units, in range [0, y-resolution]. I{(float)} 2982 @param interpolation: Interpolation method to be used. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 2983 @return: Interpolated value at position (B{C{x}},B{C{y}}). I{(float)} 2984 """ 2985 return None
2986
2987 - def get_dval_real(x, y, interpolation):
2988 """ 2989 Gets interpolated value at arbitrary data field point indexed by real 2990 coordinates. 2991 2992 See also L{DataField.get_dval}() that does the same, but takes pixel 2993 coordinates. 2994 2995 2996 @param x: X postion in real coordinates. I{(float)} 2997 @param y: Y postition in real coordinates. I{(float)} 2998 @param interpolation: Interpolation method to use. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 2999 @return: Value at position (B{C{x}},B{C{y}}). I{(float)} 3000 """ 3001 return None
3002
3003 - def rotate(angle, interpolation):
3004 """ 3005 Rotates a data field by a given angle. 3006 3007 This function is mostly obsolete. See L{DataField.new_rotated}() 3008 and L{DataField.new_rotated_90}(). 3009 3010 Values that get outside of data field by the rotation are lost. 3011 Undefined values from outside of data field that get inside are set to 3012 data field minimum value. 3013 3014 The rotation is performed in pixel space, i.e. it can be in fact a more 3015 general affine transform in the real coordinates when pixels are not square. 3016 3017 @param angle: Rotation angle (in radians). I{(float)} 3018 @param interpolation: Interpolation method to use. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 3019 """ 3020 pass
3021
3022 - def new_rotated(exterior_mask, angle, interp, resize):
3023 """ 3024 Creates a new data field by rotating a data field by an atribtrary angle. 3025 3026 The returned data field can have pixel corresponding to exterior in B{C{dfield}} 3027 (unless B{C{resize}} is B{C{ROTATE_RESIZE_CUT}}). They are filled with a neutral 3028 value; pass B{C{exterior_mask}} and replace them as you wish if you need more 3029 control. 3030 3031 The rotation is performed in real space, i.e. it is a more general affine 3032 transform in the pixel space for data field with non-square pixels. 3033 See L{DataField.rotate}() which rotates in the pixel space. 3034 3035 The returned data field has always square pixels. If you want to rotate 3036 by a multiple of B{C{glib.PI}}/2 while preserving non-square pixels, you must use 3037 explicitly a function such as L{DataField.new_rotated_90}(). 3038 3039 @since: 2.46 3040 3041 @param exterior_mask: Optional data field where pixels corresponding to exterior 3042 will be set to 1. It will be resized to match the returned 3043 field. I{(L{DataField})} 3044 @param angle: Rotation angle (in radians). I{(float)} 3045 @param interp: Interpolation type to use. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 3046 @param resize: Controls how the result size is determined. Expected values: C{B{ROTATE_RESIZE_SAME_SIZE}}, C{B{ROTATE_RESIZE_EXPAND}}, C{B{ROTATE_RESIZE_CUT}}. I{(L{RotateResizeType})} 3047 @return: A newly created data field. I{(L{DataField})} 3048 """ 3049 return None
3050
3051 - def new_rotated_90(clockwise):
3052 """ 3053 Creates a new data field by rotating a data field by 90 degrees. 3054 3055 @since: 2.46 3056 3057 @param clockwise: B{C{True}} to rotate clocwise, B{C{False}} to rotate anti-clockwise. I{(bool)} 3058 @return: A newly created data field. I{(L{DataField})} 3059 """ 3060 return None
3061
3062 - def invert(x, y, z):
3063 """ 3064 Reflects amd/or inverts a data field. 3065 3066 In the case of value reflection, it's inverted about the mean value. 3067 3068 @param x: B{C{True}} to reflect about X axis (i.e., invert columns vertically). I{(bool)} 3069 @param y: B{C{True}} to reflect about Y axis (i.e., invert rows horizontally). I{(bool)} 3070 @param z: B{C{True}} to invert in Z direction (i.e., invert values). I{(bool)} 3071 """ 3072 pass
3073
3074 - def flip_xy(dest, minor):
3075 """ 3076 Copies data from one data field to another with transposition. 3077 3078 The destination data field is resized as necessary, its real dimensions set 3079 to transposed B{C{src}} dimensions and its offsets are reset. Units are not 3080 updated. 3081 3082 @since: 2.49 3083 3084 @param dest: Destination data field. I{(L{DataField})} 3085 @param minor: B{C{True}} to mirror about the minor diagonal; B{C{False}} to mirror about 3086 major diagonal. I{(bool)} 3087 """ 3088 pass
3089
3090 - def area_flip_xy(col, row, width, height, dest, minor):
3091 """ 3092 Copies data from a rectangular part of one data field to another with 3093 transposition. 3094 3095 The destination data field is resized as necessary, its real dimensions set 3096 to transposed B{C{src}} area dimensions and its offsets are reset. Units are not 3097 updated. 3098 3099 @since: 2.49 3100 3101 @param col: Upper-left column coordinate in B{C{src}}. I{(int)} 3102 @param row: Upper-left row coordinate in B{C{src}}. I{(int)} 3103 @param width: Area width (number of columns) in B{C{src}}. I{(int)} 3104 @param height: Area height (number of rows) in B{C{src}}. I{(int)} 3105 @param dest: Destination data field. I{(L{DataField})} 3106 @param minor: B{C{True}} to mirror about the minor diagonal; B{C{False}} to mirror about 3107 major diagonal. I{(bool)} 3108 """ 3109 pass
3110
3111 - def fill(value):
3112 """ 3113 Fills a data field with given value. 3114 3115 @param value: Value to be entered. I{(float)} 3116 """ 3117 pass
3118
3119 - def clear():
3120 """ 3121 Fills a data field with zeroes. 3122 3123 """ 3124 pass
3125
3126 - def multiply(value):
3127 """ 3128 Multiplies all values in a data field by given value. 3129 3130 @param value: Value to multiply B{C{data_field}} with. I{(float)} 3131 """ 3132 pass
3133
3134 - def add(value):
3135 """ 3136 Adds given value to all values in a data field. 3137 3138 @param value: Value to be added to data field values. I{(float)} 3139 """ 3140 pass
3141
3142 - def area_fill(col, row, width, height, value):
3143 """ 3144 Fills a rectangular part of a data field with given value. 3145 3146 @param col: Upper-left column coordinate. I{(int)} 3147 @param row: Upper-left row coordinate. I{(int)} 3148 @param width: Area width (number of columns). I{(int)} 3149 @param height: Area height (number of rows). I{(int)} 3150 @param value: Value to be entered I{(float)} 3151 """ 3152 pass
3153
3154 - def area_fill_mask(mask, mode, col, row, width, height, value):
3155 """ 3156 Fills a masked rectangular part of a data field with given value. 3157 3158 @since: 2.44 3159 3160 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 3161 @param mode: Masking mode to use. See the introduction for description of 3162 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 3163 @param col: Upper-left column coordinate. I{(int)} 3164 @param row: Upper-left row coordinate. I{(int)} 3165 @param width: Area width (number of columns). I{(int)} 3166 @param height: Area height (number of rows). I{(int)} 3167 @param value: Value to be entered I{(float)} 3168 """ 3169 pass
3170
3171 - def area_clear(col, row, width, height):
3172 """ 3173 Fills a rectangular part of a data field with zeroes. 3174 3175 @param col: Upper-left column coordinate. I{(int)} 3176 @param row: Upper-left row coordinate. I{(int)} 3177 @param width: Area width (number of columns). I{(int)} 3178 @param height: Area height (number of rows). I{(int)} 3179 """ 3180 pass
3181
3182 - def area_multiply(col, row, width, height, value):
3183 """ 3184 Multiplies values in a rectangular part of a data field by given value 3185 3186 @param col: Upper-left column coordinate. I{(int)} 3187 @param row: Upper-left row coordinate. I{(int)} 3188 @param width: Area width (number of columns). I{(int)} 3189 @param height: Area height (number of rows). I{(int)} 3190 @param value: Value to multiply area with. I{(float)} 3191 """ 3192 pass
3193
3194 - def area_add(col, row, width, height, value):
3195 """ 3196 Adds given value to all values in a rectangular part of a data field. 3197 3198 @param col: Upper-left column coordinate. I{(int)} 3199 @param row: Upper-left row coordinate. I{(int)} 3200 @param width: Area width (number of columns). I{(int)} 3201 @param height: Area height (number of rows). I{(int)} 3202 @param value: Value to be added to area values. I{(float)} 3203 """ 3204 pass
3205
3206 - def get_profile(scol, srow, ecol, erow, res, thickness, interpolation):
3207 """ 3208 Extracts a possibly averaged profile from data field to a data line. 3209 3210 3211 @param scol: The column the line starts at (inclusive). I{(int)} 3212 @param srow: The row the line starts at (inclusive). I{(int)} 3213 @param ecol: The column the line ends at (inclusive). I{(int)} 3214 @param erow: The row the line ends at (inclusive). I{(int)} 3215 @param res: Requested resolution of data line (the number of samples to take). 3216 If nonpositive, data line resolution is chosen to match B{C{data_field}}'s. I{(int)} 3217 @param thickness: Thickness of line to be averaged. I{(int)} 3218 @param interpolation: Interpolation type to use. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 3219 @return: Tuple consisting of 2 values (B{C{value}}, B{C{data_line}}). (I{(L{DataLine})}, I{(SkipArg)}) 3220 """ 3221 return None, None
3222
3223 - def get_row(data_line, row):
3224 """ 3225 Extracts a data field row into a data line. 3226 3227 @param data_line: A data line. It will be resized to width ot B{C{data_field}}. I{(L{DataLine})} 3228 @param row: Row index. I{(int)} 3229 """ 3230 pass
3231
3232 - def get_column(data_line, col):
3233 """ 3234 Extracts a data field column into a data line. 3235 3236 @param data_line: A data line. It will be resized to height of B{C{data_field}}. I{(L{DataLine})} 3237 @param col: Column index. I{(int)} 3238 """ 3239 pass
3240
3241 - def set_row(data_line, row):
3242 """ 3243 Sets a row in the data field to values of a data line. 3244 3245 Data line length must be equal to width of data field. 3246 3247 @param data_line: A data line. I{(L{DataLine})} 3248 @param row: Row index. I{(int)} 3249 """ 3250 pass
3251
3252 - def set_column(data_line, col):
3253 """ 3254 Sets a column in the data field to values of a data line. 3255 3256 Data line length must be equal to height of data field. 3257 3258 @param data_line: A data line. I{(L{DataLine})} 3259 @param col: Column index. I{(int)} 3260 """ 3261 pass
3262
3263 - def get_row_part(data_line, row, from_, to):
3264 """ 3265 Extracts part of a data field row into a data line. 3266 3267 @param data_line: A data line. It will be resized to the row part width. I{(L{DataLine})} 3268 @param row: Row index. I{(int)} 3269 @param from_: I{(int)} 3270 @param to: End column index + 1. I{(int)} 3271 """ 3272 pass
3273
3274 - def get_column_part(data_line, col, from_, to):
3275 """ 3276 Extracts part of a data field column into a data line. 3277 3278 @param data_line: A data line. It will be resized to the column part height. I{(L{DataLine})} 3279 @param col: Column index. I{(int)} 3280 @param from_: I{(int)} 3281 @param to: End row index + 1. I{(int)} 3282 """ 3283 pass
3284
3285 - def set_row_part(data_line, row, from_, to):
3286 """ 3287 Puts a data line into a data field row. 3288 3289 If data line length differs from B{C{to}}-B{C{from}}, it is resampled to this length. 3290 3291 @param data_line: A data line. I{(L{DataLine})} 3292 @param row: Row index. I{(int)} 3293 @param from_: I{(int)} 3294 @param to: End row index + 1. I{(int)} 3295 """ 3296 pass
3297
3298 - def set_column_part(data_line, col, from_, to):
3299 """ 3300 Puts a data line into data field column. 3301 3302 If data line length differs from B{C{to}}-B{C{from}}, it is resampled to this length. 3303 3304 @param data_line: A data line. I{(L{DataLine})} 3305 @param col: Column index. I{(int)} 3306 @param from_: I{(int)} 3307 @param to: End row index + 1. I{(int)} 3308 """ 3309 pass
3310
3311 - def get_xder(col, row):
3312 """ 3313 Computes central derivative in X direction. 3314 3315 On border points, one-side derivative is returned. 3316 3317 3318 @param col: Column index. I{(int)} 3319 @param row: Row index. I{(int)} 3320 @return: Derivative in X direction. I{(float)} 3321 """ 3322 return None
3323
3324 - def get_yder(col, row):
3325 """ 3326 Computes central derivative in Y direction. 3327 3328 On border points, one-side derivative is returned. 3329 3330 Note the derivative is for legacy reasons calulcated for the opposite 3331 y direction than is usual elsewhere in Gwyddion, i.e. if values increase 3332 with increasing row number, the returned value is negative. 3333 3334 3335 @param col: Column index. I{(int)} 3336 @param row: Row index. I{(int)} 3337 @return: Derivative in Y direction I{(float)} 3338 """ 3339 return None
3340
3341 - def get_angder(col, row, theta):
3342 """ 3343 Computes derivative in direction specified by given angle. 3344 3345 3346 @param col: Column index. I{(int)} 3347 @param row: Row index. I{(int)} 3348 @param theta: Angle defining the direction (in radians, counterclockwise). I{(float)} 3349 @return: Derivative in direction given by angle B{C{theta}}. I{(float)} 3350 """ 3351 return None
3352
3353 - def average_xyz(density_map, points, npoints):
3354 """ 3355 Fills a data field with regularised XYZ data using a simple method. 3356 3357 The real dimensions and offsets of B{C{field}} determine the rectangle in the XY 3358 plane that will be regularised. The regularisation method is fast but 3359 simple and there are no absolute guarantees of quality, even though the 3360 result will be usually quite acceptable. 3361 3362 This especially applies to reasonable views of the XYZ data. Unreasonable 3363 views can be rendered unreasonably. In particular if the rectangle does not 3364 contain any point from B{C{points}} (either due to high zoom to an empty region 3365 or by just being completely off) B{C{data_field}} will be filled entirely with 3366 the value of the closest point or something similar. 3367 3368 @since: 2.44 3369 3370 @param density_map: Optional data field to fill with XYZ point density map. It can 3371 be B{C{None}}. I{(L{DataField})} 3372 @param points: Array of XYZ points. Coordinates X and Y represent positions in 3373 the plane; the Z-coordinate represents values. I{(const-XYZ*)} 3374 @param npoints: Number of points. I{(int)} 3375 """ 3376 pass
3377
3378 - def xdwt(wt_coefs, direction, minsize):
3379 """ 3380 Performs steps of the X-direction image wavelet decomposition. 3381 3382 The smallest low pass coefficients block is equal to B{C{minsize}}. Run with 3383 B{C{minsize}} = B{C{dfield}}->xres/2 to perform one step of decomposition 3384 or B{C{minsize}} = 4 to perform full decomposition (or anything between). 3385 3386 3387 @param wt_coefs: Data line where the wavelet transform coefficients are stored. I{(L{DataLine})} 3388 @param direction: Transform direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 3389 @param minsize: size of minimal transform result block I{(int)} 3390 """ 3391 pass
3392
3393 - def ydwt(wt_coefs, direction, minsize):
3394 """ 3395 Performs steps of the Y-direction image wavelet decomposition. 3396 3397 The smallest low pass coefficients block is equal to B{C{minsize}}. Run with 3398 B{C{minsize}} = B{C{dfield}}->yres/2 to perform one step of decomposition 3399 or B{C{minsize}} = 4 to perform full decomposition (or anything between). 3400 3401 3402 @param wt_coefs: Data line where the wavelet transform coefficients are stored. I{(L{DataLine})} 3403 @param direction: Transform direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 3404 @param minsize: size of minimal transform result block I{(int)} 3405 """ 3406 pass
3407
3408 - def dwt(wt_coefs, direction, minsize):
3409 """ 3410 Performs steps of the 2D image wavelet decomposition. 3411 3412 The smallest low pass coefficients block is equal to B{C{minsize}}. Run with 3413 B{C{minsize}} = B{C{dfield}}->xres/2 to perform one step of decomposition 3414 or B{C{minsize}} = 4 to perform full decomposition (or anything between). 3415 3416 3417 @param wt_coefs: Data line where the wavelet transform coefficients are stored. I{(L{DataLine})} 3418 @param direction: Transform direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 3419 @param minsize: size of minimal transform result block I{(int)} 3420 """ 3421 pass
3422
3423 - def dwt_mark_anisotropy(mask, wt_coefs, ratio, lowlimit):
3424 """ 3425 Performs steps of the 2D image wavelet decomposition. 3426 3427 The smallest low pass coefficients block is equal to B{C{minsize}}. Run with 3428 B{C{minsize}} = B{C{dfield}}->xres/2 to perform one step of decomposition 3429 or B{C{minsize}} = 4 to perform full decomposition (or anything between). 3430 3431 3432 @param mask: I{(L{DataField})} 3433 @param wt_coefs: Data line to store wavelet transform coefficients to. I{(L{DataLine})} 3434 @param ratio: I{(float)} 3435 @param lowlimit: I{(int)} 3436 """ 3437 pass
3438
3439 - def elliptic_area_fill(col, row, width, height, value):
3440 """ 3441 Fills an elliptic region of a data field with given value. 3442 3443 The elliptic region is defined by its bounding box which must be completely 3444 contained in the data field. 3445 3446 3447 @param col: Upper-left bounding box column coordinate. I{(int)} 3448 @param row: Upper-left bounding box row coordinate. I{(int)} 3449 @param width: Bounding box width (number of columns). I{(int)} 3450 @param height: Bounding box height (number of rows). I{(int)} 3451 @param value: Value to be entered. I{(float)} 3452 @return: The number of filled values. I{(int)} 3453 """ 3454 return None
3455
3456 - def circular_area_fill(col, row, radius, value):
3457 """ 3458 Fills an elliptic region of a data field with given value. 3459 3460 3461 @param col: Row index of circular area centre. I{(int)} 3462 @param row: Column index of circular area centre. I{(int)} 3463 @param radius: Circular area radius (in pixels). Any value is allowed, although 3464 to get areas that do not deviate from true circles after 3465 pixelization too much, half-integer values are recommended, 3466 integer values are NOT recommended. I{(float)} 3467 @param value: Value to be entered. I{(float)} 3468 @return: The number of filled values. I{(int)} 3469 """ 3470 return None
3471
3472 - def normalize():
3473 """ 3474 Normalizes data in a data field to range 0.0 to 1.0. 3475 3476 It is equivalent to L{DataField.renormalize}(B{C{data_field}}, 1.0, 0.0); 3477 3478 If B{C{data_field}} is filled with only one value, it is changed to 0.0. 3479 3480 """ 3481 pass
3482
3483 - def renormalize(range, offset):
3484 """ 3485 Transforms data in a data field with linear function to given range. 3486 3487 When B{C{range}} is positive, the new data range is (B{C{offset}}, B{C{offset}}+B{C{range}}); 3488 when B{C{range}} is negative, the new data range is (B{C{offset}}-B{C{range}}, B{C{offset}}). 3489 In neither case the data are flipped, negative range only means different 3490 selection of boundaries. 3491 3492 When B{C{range}} is zero, this method is equivalent to 3493 L{DataField.fill}(B{C{data_field}}, B{C{offset}}). 3494 3495 @param range: New data interval size. I{(float)} 3496 @param offset: New data interval offset. I{(float)} 3497 """ 3498 pass
3499
3500 - def area_renormalize(col, row, width, height, range, offset):
3501 """ 3502 Transforms data in a part of a data field with linear function to given 3503 range. 3504 3505 When B{C{range}} is positive, the new data range is (B{C{offset}}, B{C{offset}}+B{C{range}}); 3506 when B{C{range}} is negative, the new data range is (B{C{offset}}-B{C{range}}, B{C{offset}}). 3507 In neither case the data are flipped, negative range only means different 3508 selection of boundaries. 3509 3510 When B{C{range}} is zero, this method is equivalent to 3511 L{DataField.fill}(B{C{data_field}}, B{C{offset}}). 3512 3513 @since: 2.45 3514 3515 @param col: Upper-left column coordinate. I{(int)} 3516 @param row: Upper-left row coordinate. I{(int)} 3517 @param width: Area width (number of columns). I{(int)} 3518 @param height: Area height (number of rows). I{(int)} 3519 @param range: New data interval size. I{(float)} 3520 @param offset: New data interval offset. I{(float)} 3521 """ 3522 pass
3523
3524 - def threshold(threshval, bottom, top):
3525 """ 3526 Tresholds values of a data field. 3527 3528 Values smaller than B{C{threshold}} are set to value B{C{bottom}}, values higher 3529 than B{C{threshold}} or equal to it are set to value B{C{top}} 3530 3531 3532 @param threshval: Threshold value. I{(float)} 3533 @param bottom: Lower replacement value. I{(float)} 3534 @param top: Upper replacement value. I{(float)} 3535 @return: The total number of values above threshold. I{(int)} 3536 """ 3537 return None
3538
3539 - def area_threshold(col, row, width, height, threshval, bottom, top):
3540 """ 3541 Tresholds values of a rectangular part of a data field. 3542 3543 Values smaller than B{C{threshold}} are set to value B{C{bottom}}, values higher 3544 than B{C{threshold}} or equal to it are set to value B{C{top}} 3545 3546 3547 @param col: Upper-left column coordinate. I{(int)} 3548 @param row: Upper-left row coordinate. I{(int)} 3549 @param width: Area width (number of columns). I{(int)} 3550 @param height: Area height (number of rows). I{(int)} 3551 @param threshval: Threshold value. I{(float)} 3552 @param bottom: Lower replacement value. I{(float)} 3553 @param top: Upper replacement value. I{(float)} 3554 @return: The total number of values above threshold. I{(int)} 3555 """ 3556 return None
3557
3558 - def clamp(bottom, top):
3559 """ 3560 Limits data field values to a range. 3561 3562 3563 @param bottom: Lower limit value. I{(float)} 3564 @param top: Upper limit value. I{(float)} 3565 @return: The number of changed values, i.e., values that were outside 3566 [B{C{bottom}}, B{C{top}}]. I{(int)} 3567 """ 3568 return None
3569
3570 - def area_clamp(col, row, width, height, bottom, top):
3571 """ 3572 Limits values in a rectangular part of a data field to a range. 3573 3574 3575 @param col: Upper-left column coordinate. I{(int)} 3576 @param row: Upper-left row coordinate. I{(int)} 3577 @param width: Area width (number of columns). I{(int)} 3578 @param height: Area height (number of rows). I{(int)} 3579 @param bottom: Lower limit value. I{(float)} 3580 @param top: Upper limit value. I{(float)} 3581 @return: The number of changed values, i.e., values that were outside 3582 [B{C{bottom}}, B{C{top}}]. I{(int)} 3583 """ 3584 return None
3585
3586 - def area_gather(result, buffer, hsize, vsize, average, col, row, width, height):
3587 """ 3588 Sums or averages values in reactangular areas around each sample in a data 3589 field. 3590 3591 When the gathered area extends out of calculation area, only samples from 3592 their intersection are taken into the local sum (or average). 3593 3594 There are no restrictions on values of B{C{hsize}} and B{C{vsize}} with regard to 3595 B{C{width}} and B{C{height}}, but they have to be positive. 3596 3597 The result is calculated by the means of two-dimensional rolling sums. 3598 One one hand it means the calculation time depends linearly on 3599 (B{C{width}} + B{C{hsize}})*(B{C{height}} + B{C{vsize}}) instead of 3600 B{C{width}}*B{C{hsize}}*B{C{height}}*B{C{vsize}}. On the other hand it means absolute rounding 3601 errors of all output values are given by the largest input values, that is 3602 relative precision of results small in absolute value may be poor. 3603 3604 @param result: A data field to put the result to, it may be B{C{data_field}} itself. I{(L{DataField})} 3605 @param buffer: A data field to use as a scratch area, its size must be at least 3606 B{C{width}}*B{C{height}}. May be B{C{None}} to allocate a private temporary 3607 buffer. I{(L{DataField})} 3608 @param hsize: Horizontal size of gathered area. The area is centered around 3609 each sample if B{C{hsize}} is odd, it extends one pixel more to the 3610 right if B{C{hsize}} is even. I{(int)} 3611 @param vsize: Vertical size of gathered area. The area is centered around 3612 each sample if B{C{vsize}} is odd, it extends one pixel more down 3613 if B{C{vsize}} is even. I{(int)} 3614 @param average: B{C{True}} to divide resulting sums by the number of involved samples 3615 to get averages instead of sums. I{(bool)} 3616 @param col: Upper-left column coordinate. I{(int)} 3617 @param row: Upper-left row coordinate. I{(int)} 3618 @param width: Area width (number of columns). I{(int)} 3619 @param height: Area height (number of rows). I{(int)} 3620 """ 3621 pass
3622
3623 - def convolve(kernel_field):
3624 """ 3625 Convolves a data field with given kernel. 3626 3627 @param kernel_field: Kenrel field to convolve B{C{data_field}} with. I{(L{DataField})} 3628 """ 3629 pass
3630
3631 - def area_convolve(kernel_field, col, row, width, height):
3632 """ 3633 Convolves a rectangular part of a data field with given kernel. 3634 3635 @param kernel_field: Kenrel field to convolve B{C{data_field}} with. I{(L{DataField})} 3636 @param col: Upper-left column coordinate. I{(int)} 3637 @param row: Upper-left row coordinate. I{(int)} 3638 @param width: Area width (number of columns). I{(int)} 3639 @param height: Area height (number of rows). I{(int)} 3640 """ 3641 pass
3642
3643 - def area_ext_convolve(col, row, width, height, target, kernel, exterior, fill_value, as_integral):
3644 """ 3645 Convolve a field with a two-dimensional kernel. 3646 3647 Pixel dimensions of B{C{target}} may match either B{C{field}} or just the rectangular 3648 area. In the former case the result is written in the same rectangular 3649 area; in the latter case the result fills the entire B{C{target}}. 3650 3651 The convolution is performed with the kernel centred on the respective field 3652 pixels. For directions in which the kernel has an odd size this holds 3653 precisely. For an even-sized kernel this means the kernel centre is placed 3654 0.5 pixel left or up (towards lower indices) from the respective field 3655 pixel. 3656 3657 See L{DataField.extend}() for what constitutes the exterior and how it is 3658 handled. 3659 3660 If B{C{as_integral}} is B{C{False}} the function performs a simple discrete 3661 convolution sum and the value units of B{C{target}} are set to product of B{C{field}} 3662 and B{C{kernel}} units. 3663 3664 If B{C{as_integral}} is B{C{True}} the function approximates a convolution integral. 3665 In this case B{C{kernel}} should be a sampled continuous transfer function. 3666 The units of value B{C{target}} are set to product of B{C{field}} and B{C{kernel}} value 3667 units and B{C{field}} lateral units squared. Furthermore, the discrete sum is 3668 multiplied by the pixel size (i.e. dB{C{x}} dB{C{y}} in the integral). 3669 3670 In either case, the lateral units and pixel size of B{C{kernel}} are assumed to 3671 be the same as for B{C{field}} (albeit not checked), because the convolution does 3672 not make sense otherwise. 3673 3674 @since: 2.49 3675 3676 @param col: Upper-left column coordinate. I{(int)} 3677 @param row: Upper-left row coordinate. I{(int)} 3678 @param width: Area width (number of columns). I{(int)} 3679 @param height: Area height (number of rows). I{(int)} 3680 @param target: A two-dimensional data field where the result will be placed. 3681 It may be B{C{field}} for an in-place modification. I{(L{DataField})} 3682 @param kernel: Kernel to convolve B{C{field}} with. I{(L{DataField})} 3683 @param exterior: Exterior pixels handling. Expected values: C{B{EXTERIOR_UNDEFINED}}, C{B{EXTERIOR_BORDER_EXTEND}}, C{B{EXTERIOR_MIRROR_EXTEND}}, C{B{EXTERIOR_PERIODIC}}, C{B{EXTERIOR_FIXED_VALUE}}, C{B{EXTERIOR_LAPLACE}}. I{(L{ExteriorType})} 3684 @param fill_value: The value to use with B{C{EXTERIOR_FIXED_VALUE}} exterior. I{(float)} 3685 @param as_integral: B{C{True}} for normalisation and units as a convolution integral, 3686 B{C{False}} as a sum. I{(bool)} 3687 """ 3688 pass
3689
3690 - def convolve_1d(kernel_line, orientation):
3691 """ 3692 Convolves a data field with given linear kernel. 3693 3694 @since: 2.4 3695 3696 @param kernel_line: Kenrel line to convolve B{C{data_field}} with. I{(L{DataLine})} 3697 @param orientation: Filter orientation (see L{DataField.area_convolve_1d}()). Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 3698 """ 3699 pass
3700
3701 - def area_convolve_1d(kernel_line, orientation, col, row, width, height):
3702 """ 3703 Convolves a rectangular part of a data field with given linear kernel. 3704 3705 For large separable kernels it can be more efficient to use a sequence of 3706 horizontal and vertical convolutions instead one 2D convolution. 3707 3708 @since: 2.4 3709 3710 @param kernel_line: Kernel line to convolve B{C{data_field}} with. I{(L{DataLine})} 3711 @param orientation: Filter orientation (B{C{ORIENTATION_HORIZONTAL}} for 3712 row-wise convolution, B{C{ORIENTATION_VERTICAL}} for 3713 column-wise convolution). Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 3714 @param col: Upper-left column coordinate. I{(int)} 3715 @param row: Upper-left row coordinate. I{(int)} 3716 @param width: Area width (number of columns). I{(int)} 3717 @param height: Area height (number of rows). I{(int)} 3718 """ 3719 pass
3720
3721 - def area_ext_row_convolve(col, row, width, height, target, kernel, exterior, fill_value, as_integral):
3722 """ 3723 Convolve a field row-wise with a one-dimensional kernel. 3724 3725 Pixel dimensions of B{C{target}} may match either B{C{field}} or just the rectangular 3726 area. In the former case the result is written in the same rectangular 3727 area; in the latter case the result fills the entire B{C{target}}. 3728 3729 The convolution is performed with the kernel centred on the respective field 3730 pixels. For an odd-sized kernel this holds precisely. For an even-sized 3731 kernel this means the kernel centre is placed 0.5 pixel to the left 3732 (towards lower column indices) from the respective field pixel. 3733 3734 See L{DataField.extend}() for what constitutes the exterior and how it is 3735 handled. 3736 3737 If B{C{as_integral}} is B{C{False}} the function performs a simple discrete 3738 convolution sum and the value units of B{C{target}} are set to product of B{C{field}} 3739 and B{C{kernel}} units. 3740 3741 If B{C{as_integral}} is B{C{True}} the function approximates a convolution integral. 3742 In this case B{C{kernel}} should be a sampled continuous transfer function. 3743 The units of value B{C{target}} are set to product of B{C{field}} and B{C{kernel}} value 3744 units and B{C{field}} lateral units. Furthermore, the discrete sum is multiplied 3745 by the pixel size (i.e. dB{C{x}} in the integral). 3746 3747 In either case, the lateral units and pixel size of B{C{kernel}} are assumed to 3748 be the same as for a B{C{field}}'s row (albeit not checked), because 3749 the convolution does not make sense otherwise. 3750 3751 @since: 2.49 3752 3753 @param col: Upper-left column coordinate. I{(int)} 3754 @param row: Upper-left row coordinate. I{(int)} 3755 @param width: Area width (number of columns). I{(int)} 3756 @param height: Area height (number of rows). I{(int)} 3757 @param target: A two-dimensional data field where the result will be placed. 3758 It may be B{C{field}} for an in-place modification. I{(L{DataField})} 3759 @param kernel: Kernel to convolve B{C{field}} with. I{(L{DataLine})} 3760 @param exterior: Exterior pixels handling. Expected values: C{B{EXTERIOR_UNDEFINED}}, C{B{EXTERIOR_BORDER_EXTEND}}, C{B{EXTERIOR_MIRROR_EXTEND}}, C{B{EXTERIOR_PERIODIC}}, C{B{EXTERIOR_FIXED_VALUE}}, C{B{EXTERIOR_LAPLACE}}. I{(L{ExteriorType})} 3761 @param fill_value: The value to use with B{C{EXTERIOR_FIXED_VALUE}} exterior. I{(float)} 3762 @param as_integral: B{C{True}} for normalisation and units as a convolution integral, 3763 B{C{False}} as a sum. I{(bool)} 3764 """ 3765 pass
3766
3767 - def filter_median(size):
3768 """ 3769 Filters a data field with median filter. 3770 3771 @param size: Size of area to take median of. I{(int)} 3772 """ 3773 pass
3774
3775 - def area_filter_median(size, col, row, width, height):
3776 """ 3777 Filters a rectangular part of a data field with median filter. 3778 3779 @param size: Size of area to take median of. I{(int)} 3780 @param col: Upper-left column coordinate. I{(int)} 3781 @param row: Upper-left row coordinate. I{(int)} 3782 @param width: Area width (number of columns). I{(int)} 3783 @param height: Area height (number of rows). I{(int)} 3784 """ 3785 pass
3786
3787 - def filter_mean(size):
3788 """ 3789 Filters a data field with mean filter of size B{C{size}}. 3790 3791 @param size: Averaged area size. I{(int)} 3792 """ 3793 pass
3794
3795 - def area_filter_mean(size, col, row, width, height):
3796 """ 3797 Filters a rectangular part of a data field with mean filter of size B{C{size}}. 3798 3799 This method is a simple L{DataField.area_gather}() wrapper. 3800 3801 @param size: Averaged area size. I{(int)} 3802 @param col: Upper-left column coordinate. I{(int)} 3803 @param row: Upper-left row coordinate. I{(int)} 3804 @param width: Area width (number of columns). I{(int)} 3805 @param height: Area height (number of rows). I{(int)} 3806 """ 3807 pass
3808
3809 - def filter_conservative(size):
3810 """ 3811 Filters a data field with conservative denoise filter. 3812 3813 @param size: Filtered area size. I{(int)} 3814 """ 3815 pass
3816
3817 - def area_filter_conservative(size, col, row, width, height):
3818 """ 3819 Filters a rectangular part of a data field with conservative denoise filter. 3820 3821 @param size: Filtered area size. I{(int)} 3822 @param col: Upper-left column coordinate. I{(int)} 3823 @param row: Upper-left row coordinate. I{(int)} 3824 @param width: Area width (number of columns). I{(int)} 3825 @param height: Area height (number of rows). I{(int)} 3826 """ 3827 pass
3828
3829 - def filter_laplacian():
3830 """ 3831 Filters a data field with Laplacian filter. 3832 3833 """ 3834 pass
3835
3836 - def area_filter_laplacian(col, row, width, height):
3837 """ 3838 Filters a rectangular part of a data field with Laplacian filter. 3839 3840 @param col: Upper-left column coordinate. I{(int)} 3841 @param row: Upper-left row coordinate. I{(int)} 3842 @param width: Area width (number of columns). I{(int)} 3843 @param height: Area height (number of rows). I{(int)} 3844 """ 3845 pass
3846
3848 """ 3849 Filters a data field with Laplacian of Gaussians filter. 3850 3851 @since: 2.23 3852 3853 """ 3854 pass
3855
3856 - def area_filter_laplacian_of_gaussians(col, row, width, height):
3857 """ 3858 Filters a rectangular part of a data field 3859 with Laplacian of Gaussians filter. 3860 3861 @since: 2.23 3862 3863 @param col: Upper-left column coordinate. I{(int)} 3864 @param row: Upper-left row coordinate. I{(int)} 3865 @param width: Area width (number of columns). I{(int)} 3866 @param height: Area height (number of rows). I{(int)} 3867 """ 3868 pass
3869
3870 - def filter_sobel(orientation):
3871 """ 3872 Filters a data field with a directional Sobel filter. 3873 3874 @param orientation: Filter orientation. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 3875 """ 3876 pass
3877
3878 - def area_filter_sobel(orientation, col, row, width, height):
3879 """ 3880 Filters a rectangular part of a data field with a directional Sobel filter. 3881 3882 @param orientation: Filter orientation. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 3883 @param col: Upper-left column coordinate. I{(int)} 3884 @param row: Upper-left row coordinate. I{(int)} 3885 @param width: Area width (number of columns). I{(int)} 3886 @param height: Area height (number of rows). I{(int)} 3887 """ 3888 pass
3889
3890 - def filter_sobel_total():
3891 """ 3892 Filters a data field with total Sobel filter. 3893 3894 @since: 2.31 3895 3896 """ 3897 pass
3898
3899 - def filter_prewitt(orientation):
3900 """ 3901 Filters a data field with Prewitt filter. 3902 3903 @param orientation: Filter orientation. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 3904 """ 3905 pass
3906
3907 - def area_filter_prewitt(orientation, col, row, width, height):
3908 """ 3909 Filters a rectangular part of a data field with a directional Prewitt 3910 filter. 3911 3912 @param orientation: Filter orientation. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 3913 @param col: Upper-left column coordinate. I{(int)} 3914 @param row: Upper-left row coordinate. I{(int)} 3915 @param width: Area width (number of columns). I{(int)} 3916 @param height: Area height (number of rows). I{(int)} 3917 """ 3918 pass
3919
3920 - def filter_prewitt_total():
3921 """ 3922 Filters a data field with total Prewitt filter. 3923 3924 @since: 2.31 3925 3926 """ 3927 pass
3928
3929 - def filter_slope(xder, yder):
3930 """ 3931 Calculates x and y derivaties for an entire field. 3932 3933 The derivatives are calculated as the simple symmetrical differences (in 3934 physical units, not pixel-wise), except at the edges where the differences 3935 are one-sided. 3936 3937 @since: 2.37 3938 3939 @param xder: Data field where the x-derivarive is to be stored, or B{C{None}} if you 3940 are only interested in the y-derivarive. I{(L{DataField})} 3941 @param yder: Data field where the y-derivarive is to be stored, or B{C{None}} if you 3942 are only interested in the x-derivarive. I{(L{DataField})} 3943 """ 3944 pass
3945
3946 - def filter_dechecker():
3947 """ 3948 Filters a data field with 5x5 checker pattern removal filter. 3949 3950 @since: 2.1 3951 3952 """ 3953 pass
3954
3955 - def area_filter_dechecker(col, row, width, height):
3956 """ 3957 Filters a rectangular part of a data field with 5x5 checker pattern removal 3958 filter. 3959 3960 @since: 2.1 3961 3962 @param col: Upper-left column coordinate. I{(int)} 3963 @param row: Upper-left row coordinate. I{(int)} 3964 @param width: Area width (number of columns). I{(int)} 3965 @param height: Area height (number of rows). I{(int)} 3966 """ 3967 pass
3968
3969 - def filter_gaussian(sigma):
3970 """ 3971 Filters a data field with a Gaussian filter. 3972 3973 @since: 2.4 3974 3975 @param sigma: The sigma parameter of the Gaussian. I{(float)} 3976 """ 3977 pass
3978
3979 - def area_filter_gaussian(sigma, col, row, width, height):
3980 """ 3981 Filters a rectangular part of a data field with a Gaussian filter. 3982 3983 The Gausian is normalized, i.e. it is sum-preserving. 3984 3985 @since: 2.4 3986 3987 @param sigma: The sigma parameter of the Gaussian. I{(float)} 3988 @param col: Upper-left column coordinate. I{(int)} 3989 @param row: Upper-left row coordinate. I{(int)} 3990 @param width: Area width (number of columns). I{(int)} 3991 @param height: Area height (number of rows). I{(int)} 3992 """ 3993 pass
3994
3995 - def filter_minimum(size):
3996 """ 3997 Filters a data field with minimum filter. 3998 3999 @param size: Neighbourhood size for minimum search. I{(int)} 4000 """ 4001 pass
4002
4003 - def area_filter_minimum(size, col, row, width, height):
4004 """ 4005 Filters a rectangular part of a data field with minimum filter. 4006 4007 This operation is often called erosion filter. 4008 4009 @param size: Neighbourhood size for minimum search. I{(int)} 4010 @param col: Upper-left column coordinate. I{(int)} 4011 @param row: Upper-left row coordinate. I{(int)} 4012 @param width: Area width (number of columns). I{(int)} 4013 @param height: Area height (number of rows). I{(int)} 4014 """ 4015 pass
4016
4017 - def filter_maximum(size):
4018 """ 4019 Filters a data field with maximum filter. 4020 4021 @param size: Neighbourhood size for maximum search. I{(int)} 4022 """ 4023 pass
4024
4025 - def area_filter_maximum(size, col, row, width, height):
4026 """ 4027 Filters a rectangular part of a data field with maximum filter. 4028 4029 This operation is often called dilation filter. 4030 4031 @param size: Neighbourhood size for maximum search. I{(int)} 4032 @param col: Upper-left column coordinate. I{(int)} 4033 @param row: Upper-left row coordinate. I{(int)} 4034 @param width: Area width (number of columns). I{(int)} 4035 @param height: Area height (number of rows). I{(int)} 4036 """ 4037 pass
4038
4039 - def area_filter_min_max(kernel, filtertype, col, row, width, height):
4040 """ 4041 Applies a morphological operation with a flat structuring element to a 4042 part of a data field. 4043 4044 Morphological operations with flat structuring elements can be expressed 4045 using minimum (erosion) and maximum (dilation) filters that are the basic 4046 operations this function can perform. 4047 4048 The kernel field is a mask that defines the shape of the flat structuring 4049 element. It is reflected for all maximum operations (dilation). For 4050 symmetrical kernels this does not matter. You can use 4051 L{DataField.elliptic_area_fill}() to create a true circular (or 4052 elliptical) kernel. 4053 4054 The kernel is implicitly centered, i.e. it will be applied symmetrically to 4055 avoid unexpected data movement. Even-sized kernels (generally not 4056 recommended) will extend farther towards the top left image corner for 4057 minimum (erosion) and towards the bottom right corner for maximum (dilation) 4058 operations due to the reflection. If you need off-center structuring 4059 elements you can add empty rows or columns to one side of the kernel to 4060 counteract the symmetrisation. 4061 4062 The operation is linear-time in kernel size for any convex kernel. Note 4063 L{DataField.area_filter_minimum}() and 4064 L{DataField.area_filter_maximum}(), which are limited to square 4065 structuring elements, are much faster for large sizes of the squares. 4066 4067 The exterior is always handled as B{C{EXTERIOR_BORDER_EXTEND}}. 4068 4069 @since: 2.43 4070 4071 @param kernel: Data field defining the flat structuring element. I{(L{DataField})} 4072 @param filtertype: The type of filter to apply. Expected values: C{B{MIN_MAX_FILTER_MINIMUM}}, C{B{MIN_MAX_FILTER_EROSION}}, C{B{MIN_MAX_FILTER_MAXIMUM}}, C{B{MIN_MAX_FILTER_DILATION}}, C{B{MIN_MAX_FILTER_OPENING}}, C{B{MIN_MAX_FILTER_CLOSING}}, C{B{MIN_MAX_FILTER_RANGE}}, C{B{MIN_MAX_FILTER_NORMALIZATION}}. I{(L{MinMaxFilterType})} 4073 @param col: Upper-left column coordinate. I{(int)} 4074 @param row: Upper-left row coordinate. I{(int)} 4075 @param width: Area width (number of columns). I{(int)} 4076 @param height: Area height (number of rows). I{(int)} 4077 """ 4078 pass
4079
4080 - def area_filter_disc_asf(radius, closing, col, row, width, height):
4081 """ 4082 Applies an alternating sequential morphological filter with a flat disc 4083 structuring element to a part of a data field. 4084 4085 Alternating sequential filter is a filter consisting of repeated opening and 4086 closing (or closing and opening) with progressively larger structuring 4087 elements. This function performs such filtering for sequence of structuring 4088 elements consisting of true Euclidean discs with increasing radii. The 4089 largest disc in the sequence fits into a (2B{C{size}} + 1) × (2B{C{size}} + 1) square. 4090 4091 @since: 2.43 4092 4093 @param radius: Maximum radius of the circular structuring element, in pixels. 4094 For radius 0 and smaller the filter is no-op. I{(int)} 4095 @param closing: B{C{True}} requests an opening-closing filter (i.e. ending with 4096 closing), B{C{False}} requests a closing-opening filter (i.e. ending 4097 with opening). I{(bool)} 4098 @param col: Upper-left column coordinate. I{(int)} 4099 @param row: Upper-left row coordinate. I{(int)} 4100 @param width: Area width (number of columns). I{(int)} 4101 @param height: Area height (number of rows). I{(int)} 4102 """ 4103 pass
4104
4105 - def filter_rms(size):
4106 """ 4107 Filters a data field with RMS filter. 4108 4109 @param size: Area size. I{(int)} 4110 """ 4111 pass
4112
4113 - def area_filter_rms(size, col, row, width, height):
4114 """ 4115 Filters a rectangular part of a data field with RMS filter of size B{C{size}}. 4116 4117 RMS filter computes root mean square in given area. 4118 4119 @param size: Area size. I{(int)} 4120 @param col: Upper-left column coordinate. I{(int)} 4121 @param row: Upper-left row coordinate. I{(int)} 4122 @param width: Area width (number of columns). I{(int)} 4123 @param height: Area height (number of rows). I{(int)} 4124 """ 4125 pass
4126
4127 - def filter_kuwahara():
4128 """ 4129 Filters a data field with Kuwahara filter. 4130 4131 """ 4132 pass
4133
4134 - def area_filter_kuwahara(col, row, width, height):
4135 """ 4136 Filters a rectangular part of a data field with a Kuwahara 4137 (edge-preserving smoothing) filter. 4138 4139 @param col: Upper-left column coordinate. I{(int)} 4140 @param row: Upper-left row coordinate. I{(int)} 4141 @param width: Area width (number of columns). I{(int)} 4142 @param height: Area height (number of rows). I{(int)} 4143 """ 4144 pass
4145
4146 - def filter_canny(threshold):
4147 """ 4148 Filters a rectangular part of a data field with canny edge detector filter. 4149 4150 @param threshold: Slope detection threshold (range 0..1). I{(float)} 4151 """ 4152 pass
4153
4154 - def shade(target_field, theta, phi):
4155 """ 4156 Shades a data field. 4157 4158 @param target_field: A data field to put the shade to. It will be resized to 4159 match B{C{data_field}}. I{(L{DataField})} 4160 @param theta: Shading angle (in radians, from north pole). I{(float)} 4161 @param phi: Shade orientation in xy plane (in radians, counterclockwise). I{(float)} 4162 """ 4163 pass
4164
4165 - def filter_harris(y_gradient, result, neighbourhood, alpha):
4166 """ 4167 Applies Harris corner detection filter to a pair of gradient data fields. 4168 4169 All passed data field must have the same size. 4170 4171 @param y_gradient: Data field with pre-calculated vertical derivative. I{(L{DataField})} 4172 @param result: Data field for the result. I{(L{DataField})} 4173 @param neighbourhood: Neighbourhood size. I{(int)} 4174 @param alpha: Sensitivity paramter (the squared trace is multiplied by it). I{(float)} 4175 """ 4176 pass
4177
4178 - def deconvolve_wiener(operand, out, sigma2):
4179 """ 4180 Performs deconvolution of a data field using simple Wiener filter. 4181 4182 The filter can be used to deblur an imagr or conversely recover the point 4183 spread function from ideal response image. 4184 4185 Convolving the result with the operand using 4186 L{DataField.area_ext_convolve}() with B{C{as_integral}}=B{C{True}} will recover 4187 (approximately) the image. This means the deconvolution assumes continous 4188 convolution, not discrete sums. Note that for the latter case this means 4189 the point spread function will be centered in B{C{out}}. 4190 4191 @since: 2.51 4192 4193 @param operand: One of the factors entering the convolution resulting in B{C{dfield}}. 4194 It must have the same dimensions as B{C{dfield}} and it is assumed it 4195 has also the same physical size. I{(L{DataField})} 4196 @param out: Data field where to put the result into. It will be resized to match 4197 B{C{dfield}}. It can also be B{C{dfield}} itself. I{(L{DataField})} 4198 @param sigma2: Noise-to-signal ratio, assumed to be the same at all frequencies. I{(float)} 4199 """ 4200 pass
4201
4202 - def estimate_noise_for_psf(ideal):
4203 """ 4204 Estimates noise-to-signal for point spread function calculation by Wiener 4205 filter. 4206 4207 The estimated value should be suitable for reconstruction of the point 4208 spread function using L{DataField.deconvolve_wiener}(). The estimation 4209 method is based on cross-validation. Therefore, it is only suitable for 4210 PSF, it does not work for image sharpening using a known PSF. 4211 4212 @since: 2.51 4213 4214 @param ideal: A data field with ideal sharp data. I{(L{DataField})} 4215 @return: Estimated noise-to-signal ratio (constant for all frequencies). I{(float)} 4216 """ 4217 return None
4218
4219 - def fractal_partitioning(xresult, yresult, interpolation):
4220 """ 4221 Computes data for log-log plot by partitioning. 4222 4223 Data lines B{C{xresult}} and B{C{yresult}} will be resized to the output size and 4224 they will contain corresponding values at each position. 4225 4226 @param xresult: Data line to store x-values for log-log plot to. I{(L{DataLine})} 4227 @param yresult: Data line to store y-values for log-log plot to. I{(L{DataLine})} 4228 @param interpolation: Interpolation type. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4229 """ 4230 pass
4231
4232 - def fractal_cubecounting(xresult, yresult, interpolation):
4233 """ 4234 Computes data for log-log plot by cube counting. 4235 4236 Data lines B{C{xresult}} and B{C{yresult}} will be resized to the output size and 4237 they will contain corresponding values at each position. 4238 4239 @param xresult: Data line to store x-values for log-log plot to. I{(L{DataLine})} 4240 @param yresult: Data line to store y-values for log-log plot to. I{(L{DataLine})} 4241 @param interpolation: Interpolation type. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4242 """ 4243 pass
4244
4245 - def fractal_triangulation(xresult, yresult, interpolation):
4246 """ 4247 Computes data for log-log plot by triangulation. 4248 4249 Data lines B{C{xresult}} and B{C{yresult}} will be resized to the output size and 4250 they will contain corresponding values at each position. 4251 4252 @param xresult: Data line to store x-values for log-log plot to. I{(L{DataLine})} 4253 @param yresult: Data line to store y-values for log-log plot to. I{(L{DataLine})} 4254 @param interpolation: Interpolation type. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4255 """ 4256 pass
4257
4258 - def fractal_psdf(xresult, yresult, interpolation):
4259 """ 4260 Computes data for log-log plot by spectral density method. 4261 4262 Data lines B{C{xresult}} and B{C{yresult}} will be resized to the output size and 4263 they will contain corresponding values at each position. 4264 4265 @param xresult: Data line to store x-values for log-log plot to. I{(L{DataLine})} 4266 @param yresult: Data line to store y-values for log-log plot to. I{(L{DataLine})} 4267 @param interpolation: Interpolation type. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4268 """ 4269 pass
4270
4271 - def fractal_correction(mask_field, interpolation):
4272 """ 4273 Replaces data under mask with interpolated values using fractal 4274 interpolation. 4275 4276 @param mask_field: Mask of places to be corrected. I{(L{DataField})} 4277 @param interpolation: Interpolation type. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4278 """ 4279 pass
4280
4281 - def grains_mark_curvature(grain_field, threshval, below):
4282 """ 4283 Marks data that are above/below curvature threshold. 4284 4285 @param grain_field: Data field to store the resulting mask to. I{(L{DataField})} 4286 @param threshval: Relative curvature threshold, in percents. I{(float)} 4287 @param below: If B{C{True}}, data below threshold are marked, otherwise data above 4288 threshold are marked. I{(bool)} 4289 """ 4290 pass
4291
4292 - def grains_mark_watershed(grain_field, locate_steps, locate_thresh, locate_dropsize, wshed_steps, wshed_dropsize, prefilter, below):
4293 """ 4294 Performs watershed algorithm. 4295 4296 @param grain_field: Result of marking (mask). I{(L{DataField})} 4297 @param locate_steps: Locating algorithm steps. I{(int)} 4298 @param locate_thresh: Locating algorithm threshold. I{(int)} 4299 @param locate_dropsize: Locating drop size. I{(float)} 4300 @param wshed_steps: Watershed steps. I{(int)} 4301 @param wshed_dropsize: Watershed drop size. I{(float)} 4302 @param prefilter: Use prefiltering. I{(bool)} 4303 @param below: If B{C{True}}, valleys are marked, otherwise mountains are marked. I{(bool)} 4304 """ 4305 pass
4306
4307 - def grains_remove_grain(col, row):
4308 """ 4309 Removes one grain at given position. 4310 4311 4312 @param col: Column inside a grain. I{(int)} 4313 @param row: Row inside a grain. I{(int)} 4314 @return: B{C{True}} if a grain was actually removed (i.e., (B{C{col}},B{C{row}}) was 4315 inside a grain). I{(bool)} 4316 """ 4317 return None
4318
4319 - def grains_extract_grain(col, row):
4320 """ 4321 Removes all grains except that one at given position. 4322 4323 If there is no grain at (B{C{col}}, B{C{row}}), all grains are removed. 4324 4325 4326 @param col: Column inside a grain. I{(int)} 4327 @param row: Row inside a grain. I{(int)} 4328 @return: B{C{True}} if a grain remained (i.e., (B{C{col}},B{C{row}}) was inside a grain). I{(bool)} 4329 """ 4330 return None
4331
4332 - def grains_remove_by_number(number):
4333 """ 4334 Removes grain identified by B{C{number}}. 4335 4336 @since: 2.35 4337 4338 @param number: Grain number was filled by L{DataField.number_grains}(). I{(int)} 4339 """ 4340 pass
4341
4342 - def grains_remove_by_size(size):
4343 """ 4344 Removes all grains below specified area. 4345 4346 @param size: Grain area threshold, in square pixels. I{(int)} 4347 """ 4348 pass
4349
4350 - def grains_remove_by_height(grain_field, threshval, below):
4351 """ 4352 Removes grains that are higher/lower than given threshold value. 4353 4354 @param grain_field: Field of marked grains (mask) I{(L{DataField})} 4355 @param threshval: Relative height threshold, in percents. I{(float)} 4356 @param below: If B{C{True}}, grains below threshold are removed, otherwise grains above 4357 threshold are removed. I{(bool)} 4358 """ 4359 pass
4360
4362 """ 4363 Removes all grains that touch field borders. 4364 4365 @since: 2.30 4366 4367 """ 4368 pass
4369
4370 - def grains_watershed_init(grain_field, locate_steps, locate_thresh, locate_dropsize, wshed_steps, wshed_dropsize, prefilter, below):
4371 """ 4372 Initializes the watershed algorithm. 4373 4374 This iterator reports its state as B{C{WatershedStateType}}. 4375 4376 4377 @param grain_field: Result of marking (mask). I{(L{DataField})} 4378 @param locate_steps: Locating algorithm steps. I{(int)} 4379 @param locate_thresh: Locating algorithm threshold. I{(int)} 4380 @param locate_dropsize: Locating drop size. I{(float)} 4381 @param wshed_steps: Watershed steps. I{(int)} 4382 @param wshed_dropsize: Watershed drop size. I{(float)} 4383 @param prefilter: Use prefiltering. I{(bool)} 4384 @param below: If B{C{True}}, valleys are marked, otherwise mountains are marked. I{(bool)} 4385 @return: A new watershed iterator. I{(ComputationState*)} 4386 """ 4387 return None
4388
4389 - def grains_mark_height(grain_field, threshval, below):
4390 """ 4391 Marks data that are above/below height threshold. 4392 4393 @param grain_field: Data field to store the resulting mask to. I{(L{DataField})} 4394 @param threshval: Relative height threshold, in percents. I{(float)} 4395 @param below: If B{C{True}}, data below threshold are marked, otherwise data above 4396 threshold are marked. I{(bool)} 4397 """ 4398 pass
4399
4400 - def grains_mark_slope(grain_field, threshval, below):
4401 """ 4402 Marks data that are above/below slope threshold. 4403 4404 @param grain_field: Data field to store the resulting mask to. I{(L{DataField})} 4405 @param threshval: Relative slope threshold, in percents. I{(float)} 4406 @param below: If B{C{True}}, data below threshold are marked, otherwise data above 4407 threshold are marked. I{(bool)} 4408 """ 4409 pass
4410
4411 - def otsu_threshold():
4412 """ 4413 Finds Otsu's height threshold for a data field. 4414 4415 The Otsu's threshold is optimal in the sense that it minimises the 4416 inter-class variances of two classes of pixels: above and below theshold. 4417 4418 @since: 2.37 4419 4420 @return: I{(float)} 4421 """ 4422 return None
4423
4424 - def grains_add(add_field):
4425 """ 4426 Adds B{C{add_field}} grains to B{C{grain_field}}. 4427 4428 Note: This function is equivalent to 4429 |[ 4430 L{DataField.max_of_fields}(grain_field, grain_field, add_field); 4431 ]| 4432 4433 @param add_field: Field of marked grains (mask) to be added. I{(L{DataField})} 4434 """ 4435 pass
4436
4437 - def grains_intersect(intersect_field):
4438 """ 4439 Performs intersection betweet two grain fields, 4440 result is stored in B{C{grain_field}}. 4441 4442 Note: This function is equivalent to 4443 |[ 4444 L{DataField.min_of_fields}(grain_field, grain_field, intersect_field); 4445 ]| 4446 4447 @param intersect_field: Field of marked grains (mask). I{(L{DataField})} 4448 """ 4449 pass
4450
4451 - def grains_invert():
4452 """ 4453 Inverts a data field representing a mask. 4454 4455 All non-positive values are transformed to 1.0. All positive values are 4456 transformed to 0.0. 4457 4458 @since: 2.43 4459 4460 """ 4461 pass
4462
4463 - def grains_autocrop(symmetrically):
4464 """ 4465 Removes empty border rows and columns from a data field representing a mask. 4466 4467 If there are border rows and columns filled completely with non-positive 4468 values the size of the data field is reduced, removing these rows. The 4469 parameter B{C{symmetrically}} controls whether the size reduction is maximum 4470 possible or symmetrical. 4471 4472 When there is no positive value in the field the field size is reduced to 4473 the smallest possible. This means 1x1 for B{C{symmetrical}} being B{C{False}} and 4474 even original dimensions to 2 for B{C{symmetrical}} being B{C{True}}. 4475 4476 @since: 2.43 4477 4478 @param symmetrically: B{C{True}} to remove borders symmetrically, i.e the same number 4479 of pixels from left and right, and also top and bottom. 4480 B{C{False}} to remove as many empty rows and columns as possible. I{(bool)} 4481 @return: Tuple consisting of 5 values (B{C{value}}, B{C{left}}, B{C{right}}, B{C{up}}, B{C{down}}). (I{(bool)}, I{(int)}, I{(int)}, I{(int)}, I{(int)}) 4482 """ 4483 return None, None, None, None, None
4484
4485 - def area_grains_tgnd(target_line, col, row, width, height, below, nstats):
4486 """ 4487 Calculates threshold grain number distribution. 4488 4489 This function is a simple L{DataField.area_grains_tgnd_range}() that 4490 calculates the distribution in the full range. 4491 4492 @param target_line: A data line to store the distribution to. It will be 4493 resampled to the requested width. I{(L{DataLine})} 4494 @param col: Upper-left column coordinate. I{(int)} 4495 @param row: Upper-left row coordinate. I{(int)} 4496 @param width: Area width (number of columns). I{(int)} 4497 @param height: Area height (number of rows). I{(int)} 4498 @param below: If B{C{True}}, valleys are marked, otherwise mountains are marked. I{(bool)} 4499 @param nstats: The number of samples to take on the distribution function. If 4500 nonpositive, a suitable resolution is determined automatically. I{(int)} 4501 """ 4502 pass
4503
4504 - def area_grains_tgnd_range(target_line, col, row, width, height, min, max, below, nstats):
4505 """ 4506 Calculates threshold grain number distribution in given height range. 4507 4508 This is the number of grains for each of B{C{nstats}} equidistant height 4509 threshold levels. For large B{C{nstats}} this function is much faster than the 4510 equivalent number of L{DataField.grains_mark_height}() calls. 4511 4512 @param target_line: A data line to store the distribution to. It will be 4513 resampled to the requested width. I{(L{DataLine})} 4514 @param col: Upper-left column coordinate. I{(int)} 4515 @param row: Upper-left row coordinate. I{(int)} 4516 @param width: Area width (number of columns). I{(int)} 4517 @param height: Area height (number of rows). I{(int)} 4518 @param min: Minimum threshold value. I{(float)} 4519 @param max: Maximum threshold value. I{(float)} 4520 @param below: If B{C{True}}, valleys are marked, otherwise mountains are marked. I{(bool)} 4521 @param nstats: The number of samples to take on the distribution function. If 4522 nonpositive, a suitable resolution is determined automatically. I{(int)} 4523 """ 4524 pass
4525
4526 - def grains_splash_water(minima, locate_steps, locate_dropsize):
4527 pass
4528
4530 """ 4531 Performs Euclidean distance transform of a data field with grains. 4532 4533 Each non-zero value will be replaced with Euclidean distance to the grain 4534 boundary, measured in pixels. 4535 4536 See also L{DataField.grain_simple_dist_trans}() for simple distance 4537 transforms such as city-block or chessboard. 4538 4539 @since: 2.36 4540 4541 """ 4542 pass
4543
4544 - def grain_simple_dist_trans(dtype, from_border):
4545 """ 4546 Performs a distance transform of a data field with grains. 4547 4548 Each non-zero value will be replaced with a distance to the grain boundary, 4549 measured in pixels. 4550 4551 Note this function can calculate the true Euclidean distance transform 4552 only since 2.43. Use L{DataField.grain_distance_transform}() for the EDT 4553 if you need compatibility with older versions. 4554 4555 @since: 2.41 4556 4557 @param dtype: Type of simple distance to use. Expected values: C{B{DISTANCE_TRANSFORM_CITYBLOCK}}, C{B{DISTANCE_TRANSFORM_CONN4}}, C{B{DISTANCE_TRANSFORM_CHESS}}, C{B{DISTANCE_TRANSFORM_CONN8}}, C{B{DISTANCE_TRANSFORM_OCTAGONAL48}}, C{B{DISTANCE_TRANSFORM_OCTAGONAL84}}, C{B{DISTANCE_TRANSFORM_OCTAGONAL}}, C{B{DISTANCE_TRANSFORM_EUCLIDEAN}}. I{(L{DistanceTransformType})} 4558 @param from_border: B{C{True}} to consider image edges to be grain boundaries. I{(bool)} 4559 """ 4560 pass
4561
4562 - def grains_shrink(amount, dtype, from_border):
4563 """ 4564 Erodes a data field containing mask by specified amount using a distance 4565 measure. 4566 4567 Non-zero pixels in B{C{data_field}} will be replaced with zeroes if they are not 4568 farther than B{C{amount}} from the grain boundary as defined by B{C{dtype}}. 4569 4570 @since: 2.43 4571 4572 @param amount: How much the grains should be reduced, in pixels. It is inclusive, 4573 i.e. pixels that are B{C{amount}} far from the border will be removed. I{(float)} 4574 @param dtype: Type of simple distance to use. Expected values: C{B{DISTANCE_TRANSFORM_CITYBLOCK}}, C{B{DISTANCE_TRANSFORM_CONN4}}, C{B{DISTANCE_TRANSFORM_CHESS}}, C{B{DISTANCE_TRANSFORM_CONN8}}, C{B{DISTANCE_TRANSFORM_OCTAGONAL48}}, C{B{DISTANCE_TRANSFORM_OCTAGONAL84}}, C{B{DISTANCE_TRANSFORM_OCTAGONAL}}, C{B{DISTANCE_TRANSFORM_EUCLIDEAN}}. I{(L{DistanceTransformType})} 4575 @param from_border: B{C{True}} to consider image edges to be grain boundaries. 4576 B{C{False}} to reduce grains touching field boundaries only along 4577 the boundaries. I{(bool)} 4578 """ 4579 pass
4580
4581 - def grains_grow(amount, dtype, prevent_merging):
4582 """ 4583 Dilates a data field containing mask by specified amount using a distance 4584 measure. 4585 4586 Non-positive pixels in B{C{data_field}} will be replaced with ones if they are 4587 not farther than B{C{amount}} from the grain boundary as defined by B{C{dtype}}. 4588 4589 @since: 2.43 4590 4591 @param amount: How much the grains should be expanded, in pixels. It is 4592 inclusive, i.e. exterior pixels that are B{C{amount}} far from the 4593 border will be filled. I{(float)} 4594 @param dtype: Type of simple distance to use. Expected values: C{B{DISTANCE_TRANSFORM_CITYBLOCK}}, C{B{DISTANCE_TRANSFORM_CONN4}}, C{B{DISTANCE_TRANSFORM_CHESS}}, C{B{DISTANCE_TRANSFORM_CONN8}}, C{B{DISTANCE_TRANSFORM_OCTAGONAL48}}, C{B{DISTANCE_TRANSFORM_OCTAGONAL84}}, C{B{DISTANCE_TRANSFORM_OCTAGONAL}}, C{B{DISTANCE_TRANSFORM_EUCLIDEAN}}. I{(L{DistanceTransformType})} 4595 @param prevent_merging: B{C{True}} to prevent grain merging, i.e. the growth stops 4596 where two grains would merge. B{C{False}} to simply expand the 4597 grains, without regard to grain connectivity. I{(bool)} 4598 """ 4599 pass
4600
4601 - def grains_thin():
4602 """ 4603 Performs thinning of a data field containing mask. 4604 4605 The result of thinning is a ‘skeleton’ mask consisting of single-pixel thin 4606 lines. 4607 4608 @since: 2.48 4609 4610 """ 4611 pass
4612
4613 - def fill_voids(nonsimple):
4614 """ 4615 Fills voids in grains in a data field representing a mask. 4616 4617 Voids in grains are zero pixels in B{C{data_field}} from which no path exists 4618 through other zero pixels to the field boundary. The paths are considered 4619 in 8-connectivity because grains themselves are considered in 4620 4-connectivity. 4621 4622 @since: 2.37 4623 4624 @param nonsimple: Pass B{C{True}} to fill also voids that are not simple-connected 4625 (e.g. ring-like). This can result in grain merging if a small 4626 grain is contained within a void. Pass B{C{False}} to fill only 4627 simple-connected grains. I{(bool)} 4628 @return: B{C{True}} if any voids were filled at all, B{C{False}} if no change was 4629 made. I{(bool)} 4630 """ 4631 return None
4632
4633 - def mark_extrema(extrema, maxima):
4634 """ 4635 Marks local maxima or minima in a two-dimensional field. 4636 4637 Local (or regional) maximum is a contiguous set of pixels that have the same 4638 value and this value is sharply greater than the value of any pixel touching 4639 the set. A minimum is defined analogously. A field filled with a single 4640 value is considered to have neither minimum nor maximum. 4641 4642 @since: 2.37 4643 4644 @param extrema: Target field for the extrema mask. I{(L{DataField})} 4645 @param maxima: B{C{True}} to mark maxima, B{C{False}} to mark minima. I{(bool)} 4646 """ 4647 pass
4648
4649 - def hough_line(x_gradient, y_gradient, result, hwidth, overlapping):
4650 pass
4651
4652 - def hough_circle(x_gradient, y_gradient, result, radius):
4653 pass
4654
4655 - def hough_line_strenghten(x_gradient, y_gradient, hwidth, threshold):
4656 pass
4657
4658 - def hough_circle_strenghten(x_gradient, y_gradient, radius, threshold):
4659 pass
4660
4661 - def hough_polar_line_to_datafield(rho, theta):
4662 return None, None, None, None
4663
4664 - def fft1d(iin, rout, iout, orientation, windowing, direction, interpolation, preserverms, level):
4665 """ 4666 Transforms all rows or columns in a data field with Fast Fourier Transform. 4667 4668 If requested a windowing and/or leveling is applied to preprocess data to 4669 obtain reasonable results. 4670 4671 @param iin: Imaginary input data field. It can be B{C{None}} for real-to-complex 4672 transform which can be somewhat faster than complex-to-complex 4673 transform. I{(L{DataField})} 4674 @param rout: Real output data field, it will be resized to area size. I{(L{DataField})} 4675 @param iout: Imaginary output data field, it will be resized to area size. I{(L{DataField})} 4676 @param orientation: Orientation: pass B{C{ORIENTATION_HORIZONTAL}} to 4677 transform rows, B{C{ORIENTATION_VERTICAL}} to transform 4678 columns. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 4679 @param windowing: Windowing type. Expected values: C{B{WINDOWING_NONE}}, C{B{WINDOWING_HANN}}, C{B{WINDOWING_HAMMING}}, C{B{WINDOWING_BLACKMANN}}, C{B{WINDOWING_LANCZOS}}, C{B{WINDOWING_WELCH}}, C{B{WINDOWING_RECT}}, C{B{WINDOWING_NUTTALL}}, C{B{WINDOWING_FLAT_TOP}}, C{B{WINDOWING_KAISER25}}. I{(L{WindowingType})} 4680 @param direction: FFT direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 4681 @param interpolation: Interpolation type. 4682 Ignored since 2.8 as no resampling is performed. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4683 @param preserverms: B{C{True}} to preserve RMS while windowing. I{(bool)} 4684 @param level: 0 to perform no leveling, 1 to subtract mean value, 2 to subtract 4685 line (the number can be interpreted as the first polynomial degree 4686 to keep, but only the enumerated three values are available). I{(int)} 4687 """ 4688 pass
4689
4690 - def area_1dfft(iin, rout, iout, col, row, width, height, orientation, windowing, direction, interpolation, preserverms, level):
4691 """ 4692 Transforms all rows or columns in a rectangular part of a data field with 4693 Fast Fourier Transform. 4694 4695 If requested a windowing and/or leveling is applied to preprocess data to 4696 obtain reasonable results. 4697 4698 @param iin: Imaginary input data field. It can be B{C{None}} for real-to-complex 4699 transform which can be somewhat faster than complex-to-complex 4700 transform. I{(L{DataField})} 4701 @param rout: Real output data field, it will be resized to area size. I{(L{DataField})} 4702 @param iout: Imaginary output data field, it will be resized to area size. I{(L{DataField})} 4703 @param col: Upper-left column coordinate. I{(int)} 4704 @param row: Upper-left row coordinate. I{(int)} 4705 @param width: Area width (number of columns), must be at least 2 for horizontal 4706 transforms. I{(int)} 4707 @param height: Area height (number of rows), must be at least 2 for vertical 4708 transforms. I{(int)} 4709 @param orientation: Orientation: pass B{C{ORIENTATION_HORIZONTAL}} to 4710 transform rows, B{C{ORIENTATION_VERTICAL}} to transform 4711 columns. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 4712 @param windowing: Windowing type. Expected values: C{B{WINDOWING_NONE}}, C{B{WINDOWING_HANN}}, C{B{WINDOWING_HAMMING}}, C{B{WINDOWING_BLACKMANN}}, C{B{WINDOWING_LANCZOS}}, C{B{WINDOWING_WELCH}}, C{B{WINDOWING_RECT}}, C{B{WINDOWING_NUTTALL}}, C{B{WINDOWING_FLAT_TOP}}, C{B{WINDOWING_KAISER25}}. I{(L{WindowingType})} 4713 @param direction: FFT direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 4714 @param interpolation: Interpolation type. 4715 Ignored since 2.8 as no resampling is performed. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4716 @param preserverms: B{C{True}} to preserve RMS while windowing. I{(bool)} 4717 @param level: 0 to perform no leveling, 1 to subtract mean value, 2 to subtract 4718 lines (the number can be interpreted as the first polynomial degree 4719 to keep, but only the enumerated three values are available). I{(int)} 4720 """ 4721 pass
4722
4723 - def fft1d_raw(iin, rout, iout, orientation, direction):
4724 """ 4725 Transforms all rows or columns in a data field with Fast Fourier Transform. 4726 4727 No leveling, windowing nor scaling is performed. 4728 4729 The normalisation of FFT is symmetrical, so transformations in both 4730 directions are unitary. 4731 4732 Since 2.8 the dimensions need not to be from the set of sizes returned 4733 by L{gwy_fft_find_nice_size}(). 4734 4735 @since: 2.1 4736 4737 @param iin: Imaginary input data field. It can be B{C{None}} for real-to-complex 4738 transform. I{(L{DataField})} 4739 @param rout: Real output data field, it will be resized to B{C{rin}} size. I{(L{DataField})} 4740 @param iout: Imaginary output data field, it will be resized to B{C{rin}} size. I{(L{DataField})} 4741 @param orientation: Orientation: pass B{C{ORIENTATION_HORIZONTAL}} to 4742 transform rows, B{C{ORIENTATION_VERTICAL}} to transform 4743 columns. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 4744 @param direction: FFT direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 4745 """ 4746 pass
4747
4748 - def fft2d(iin, rout, iout, windowing, direction, interpolation, preserverms, level):
4749 """ 4750 Calculates 2D Fast Fourier Transform of a rectangular a data field. 4751 4752 If requested a windowing and/or leveling is applied to preprocess data to 4753 obtain reasonable results. 4754 4755 Lateral dimensions, offsets and units are unchanged. See 4756 L{DataField.fft_postprocess}() for that. 4757 4758 @param iin: Imaginary input data field. It can be B{C{None}} for real-to-complex 4759 transform which can be somewhat faster than complex-to-complex 4760 transform. I{(L{DataField})} 4761 @param rout: Real output data field, it will be resized to area size. I{(L{DataField})} 4762 @param iout: Imaginary output data field, it will be resized to area size. I{(L{DataField})} 4763 @param windowing: Windowing type. Expected values: C{B{WINDOWING_NONE}}, C{B{WINDOWING_HANN}}, C{B{WINDOWING_HAMMING}}, C{B{WINDOWING_BLACKMANN}}, C{B{WINDOWING_LANCZOS}}, C{B{WINDOWING_WELCH}}, C{B{WINDOWING_RECT}}, C{B{WINDOWING_NUTTALL}}, C{B{WINDOWING_FLAT_TOP}}, C{B{WINDOWING_KAISER25}}. I{(L{WindowingType})} 4764 @param direction: FFT direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 4765 @param interpolation: Interpolation type. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4766 @param preserverms: B{C{True}} to preserve RMS while windowing. I{(bool)} 4767 @param level: 0 to perform no leveling, 1 to subtract mean value, 2 to subtract 4768 plane (the number can be interpreted as the first polynomial degree 4769 to keep, but only the enumerated three values are available). I{(int)} 4770 """ 4771 pass
4772
4773 - def area_2dfft(iin, rout, iout, col, row, width, height, windowing, direction, interpolation, preserverms, level):
4774 """ 4775 Calculates 2D Fast Fourier Transform of a rectangular area of a data field. 4776 4777 If requested a windowing and/or leveling is applied to preprocess data to 4778 obtain reasonable results. 4779 4780 @param iin: Imaginary input data field. It can be B{C{None}} for real-to-complex 4781 transform which can be somewhat faster than complex-to-complex 4782 transform. I{(L{DataField})} 4783 @param rout: Real output data field, it will be resized to area size. I{(L{DataField})} 4784 @param iout: Imaginary output data field, it will be resized to area size. I{(L{DataField})} 4785 @param col: Upper-left column coordinate. I{(int)} 4786 @param row: Upper-left row coordinate. I{(int)} 4787 @param width: Area width (number of columns), must be at least 2. I{(int)} 4788 @param height: Area height (number of rows), must be at least 2. I{(int)} 4789 @param windowing: Windowing type. Expected values: C{B{WINDOWING_NONE}}, C{B{WINDOWING_HANN}}, C{B{WINDOWING_HAMMING}}, C{B{WINDOWING_BLACKMANN}}, C{B{WINDOWING_LANCZOS}}, C{B{WINDOWING_WELCH}}, C{B{WINDOWING_RECT}}, C{B{WINDOWING_NUTTALL}}, C{B{WINDOWING_FLAT_TOP}}, C{B{WINDOWING_KAISER25}}. I{(L{WindowingType})} 4790 @param direction: FFT direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 4791 @param interpolation: Interpolation type. 4792 Ignored since 2.8 as no resampling is performed. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4793 @param preserverms: B{C{True}} to preserve RMS while windowing. I{(bool)} 4794 @param level: 0 to perform no leveling, 1 to subtract mean value, 2 to subtract 4795 plane (the number can be interpreted as the first polynomial degree 4796 to keep, but only the enumerated three values are available). I{(int)} 4797 """ 4798 pass
4799
4800 - def fft2d_raw(iin, rout, iout, direction):
4801 """ 4802 Calculates 2D Fast Fourier Transform of a data field. 4803 4804 No leveling, windowing nor scaling is performed. 4805 4806 The normalisation of FFT is symmetrical, so transformations in both 4807 directions are unitary. 4808 4809 Since 2.8 the dimensions need not to be from the set of sizes returned 4810 by L{gwy_fft_find_nice_size}(). 4811 4812 Lateral dimensions, offsets and units are unchanged. See 4813 L{DataField.fft_postprocess}() for that. 4814 4815 @since: 2.1 4816 4817 @param iin: Imaginary input data field. It can be B{C{None}} for real-to-complex 4818 transform. I{(L{DataField})} 4819 @param rout: Real output data field, it will be resized to B{C{rin}} size. I{(L{DataField})} 4820 @param iout: Imaginary output data field, it will be resized to B{C{rin}} size. I{(L{DataField})} 4821 @param direction: FFT direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 4822 """ 4823 pass
4824
4825 - def fft2d_humanize():
4826 """ 4827 Rearranges 2D FFT output to a human-friendly form. 4828 4829 Top-left, top-right, bottom-left and bottom-right sub-rectangles are swapped 4830 to obtain a humanized 2D FFT output with (0,0) in the centre. 4831 4832 More precisely, for even field dimensions the equally-sized blocks starting 4833 with the Nyquist frequency and with the zero frequency (constant component) 4834 will exchange places. For odd field dimensions, the block containing the 4835 zero frequency is one item larger and the constant component will actually 4836 end up in the exact centre. 4837 4838 Also note if both dimensions are even, this function is involutory and 4839 identical to L{DataField.fft2d_dehumanize}(). However, if any dimension 4840 is odd, L{DataField.fft2d_humanize}() and 4841 L{DataField.fft2d_dehumanize}() are different, therefore they must be 4842 paired properly. 4843 4844 """ 4845 pass
4846
4847 - def fft2d_dehumanize():
4848 """ 4849 Rearranges 2D FFT output back from the human-friendly form. 4850 4851 Top-left, top-right, bottom-left and bottom-right sub-rectangles are swapped 4852 to reshuffle a humanized 2D FFT output back into the natural positions. 4853 4854 See L{DataField.fft2d_humanize}() for discussion. 4855 4856 @since: 2.8 4857 4858 """ 4859 pass
4860
4861 - def fft_postprocess(humanize):
4862 """ 4863 Updates units, dimensions and offsets for a 2D FFT-processed field. 4864 4865 The field is expected to have dimensions and units of the original 4866 direct-space data. The lateral units and resolutions are updated to 4867 correspond to its Fourier transform. 4868 4869 If B{C{humanize}} is B{C{True}} L{DataField.fft2d_humanize}() is applied to the 4870 field data and the lateral offsets are set accordingly. Otherwise the 4871 offsets are cleared. 4872 4873 Value units are kept intact. 4874 4875 @since: 2.38 4876 4877 @param humanize: B{C{True}} to rearrange data to have the frequency origin in the 4878 centre. I{(bool)} 4879 """ 4880 pass
4881
4882 - def fft_filter_1d(result_field, weights, orientation, interpolation):
4883 """ 4884 Performs 1D FFT filtering of a data field. 4885 4886 @param result_field: A data field to store the result to. It will be resampled 4887 to B{C{data_field}}'s size. I{(L{DataField})} 4888 @param weights: Filter weights for the lower half of the spectrum (the other 4889 half is symmetric). Its size can be arbitrary, it will be 4890 interpolated. I{(L{DataLine})} 4891 @param orientation: Filter direction. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 4892 @param interpolation: The interpolation to use for resampling. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4893 """ 4894 pass
4895
4896 - def cwt(interpolation, scale, wtype):
4897 """ 4898 Computes a continuous wavelet transform (CWT) at given 4899 scale and using given wavelet. 4900 4901 @param interpolation: Interpolation type. 4902 Ignored since 2.8 as no resampling is performed. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4903 @param scale: Wavelet scale. I{(float)} 4904 @param wtype: Wavelet type. Expected values: C{B{2DCWT_GAUSS}}, C{B{2DCWT_HAT}}. I{(L{2DCWTWaveletType})} 4905 """ 4906 pass
4907
4908 - def area_fit_plane(mask, col, row, width, height):
4909 """ 4910 Fits a plane through a rectangular part of a data field. 4911 4912 The coefficients can be used for plane leveling using the same relation 4913 as in L{DataField.fit_plane}(), counting indices from area top left 4914 corner. 4915 4916 @param mask: Mask of values to take values into account, or B{C{None}} for full 4917 B{C{data_field}}. Values equal to 0.0 and below cause corresponding 4918 B{C{data_field}} samples to be ignored, values equal to 1.0 and above 4919 cause inclusion of corresponding B{C{data_field}} samples. The behaviour 4920 for values inside (0.0, 1.0) is undefined (it may be specified 4921 in the future). I{(L{DataField})} 4922 @param col: Upper-left column coordinate. I{(int)} 4923 @param row: Upper-left row coordinate. I{(int)} 4924 @param width: Area width (number of columns). I{(int)} 4925 @param height: Area height (number of rows). I{(int)} 4926 @return: Tuple consisting of 3 values (B{C{pa}}, B{C{pbx}}, B{C{pby}}). (I{(float)}, I{(float)}, I{(float)}) 4927 """ 4928 return None, None, None
4929
4930 - def fit_plane():
4931 """ 4932 Fits a plane through a data field. 4933 4934 The coefficients can be used for plane leveling using relation 4935 data[i] := data[i] - (pa + pby*i + pbx*j); 4936 4937 @return: Tuple consisting of 3 values (B{C{pa}}, B{C{pbx}}, B{C{pby}}). (I{(float)}, I{(float)}, I{(float)}) 4938 """ 4939 return None, None, None
4940
4941 - def fit_facet_plane(mfield, masking):
4942 """ 4943 Calculates the inclination of a plane close to the dominant plane in a data 4944 field. 4945 4946 The dominant plane is determined by taking into account larger local slopes 4947 with exponentially smaller weight. 4948 4949 This is the basis of so-called facet levelling algorithm. Usually, the 4950 plane found by this method is subtracted using L{DataField.plane_level}() 4951 and the entire process is repeated until it converges. A convergence 4952 criterion may be sufficiently small values of the x and y plane 4953 coefficients. Note that since L{DataField.plane_level}() uses pixel-based 4954 lateral coordinates, the coefficients must be divided by 4955 L{DataField.get_xmeasure}(data_field) and 4956 L{DataField.get_ymeasure}(data_field) to obtain physical plane 4957 coefficients. 4958 4959 @since: 2.37 4960 4961 @param mfield: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 4962 @param masking: Masking mode to use. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 4963 @return: Tuple consisting of 4 values (B{C{value}}, B{C{pa}}, B{C{pbx}}, B{C{pby}}). (I{(bool)}, I{(float)}, I{(float)}, I{(float)}) 4964 """ 4965 return None, None, None, None
4966
4967 - def plane_level(a, bx, by):
4968 """ 4969 Subtracts plane from a data field. 4970 4971 See L{DataField.fit_plane}() for details. 4972 4973 @param a: Constant coefficient. I{(float)} 4974 @param bx: X plane coefficient. I{(float)} 4975 @param by: Y plane coefficient. I{(float)} 4976 """ 4977 pass
4978
4979 - def plane_rotate(xangle, yangle, interpolation):
4980 """ 4981 Performs rotation of plane along x and y axis. 4982 4983 @param xangle: Rotation angle in x direction (rotation along y axis, in radians). I{(float)} 4984 @param yangle: Rotation angle in y direction (rotation along x axis, in radians). I{(float)} 4985 @param interpolation: Interpolation type (can be only of two-point type). Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4986 """ 4987 pass
4988
4989 - def fit_lines(col, row, width, height, degree, exclude, orientation):
4990 """ 4991 Independently levels profiles on each row/column in a data field. 4992 4993 Lines that have no intersection with area selected by B{C{ulcol}}, B{C{ulrow}}, 4994 B{C{brcol}}, B{C{brrow}} are always leveled as a whole. Lines that have intersection 4995 with selected area, are leveled using polynomial coefficients computed only 4996 from data inside (or outside for B{C{exclude}} = B{C{True}}) the area. 4997 4998 @param col: Upper-left column coordinate. I{(int)} 4999 @param row: Upper-left row coordinate. I{(int)} 5000 @param width: Area width (number of columns). I{(int)} 5001 @param height: Area height (number of rows). I{(int)} 5002 @param degree: Fitted polynomial degree. I{(int)} 5003 @param exclude: If B{C{True}}, outside of area selected by B{C{ulcol}}, B{C{ulrow}}, B{C{brcol}}, 5004 B{C{brrow}} will be used for polynomial coefficients computation, 5005 instead of inside. I{(bool)} 5006 @param orientation: Line orientation. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 5007 """ 5008 pass
5009
5010 - def area_local_plane_quantity(size, col, row, width, height, type, result):
5011 """ 5012 Convenience function to get just one quantity from 5013 L{DataField.area_fit_local_planes}(). 5014 5015 5016 @param size: Neighbourhood size. I{(int)} 5017 @param col: Upper-left column coordinate. I{(int)} 5018 @param row: Upper-left row coordinate. I{(int)} 5019 @param width: Area width (number of columns). I{(int)} 5020 @param height: Area height (number of rows). I{(int)} 5021 @param type: The type of requested quantity. Expected values: C{B{PLANE_FIT_A}}, C{B{PLANE_FIT_BX}}, C{B{PLANE_FIT_BY}}, C{B{PLANE_FIT_ANGLE}}, C{B{PLANE_FIT_SLOPE}}, C{B{PLANE_FIT_S0}}, C{B{PLANE_FIT_S0_REDUCED}}. I{(L{PlaneFitQuantity})} 5022 @param result: A data field to store result to, or B{C{None}} to allocate a new one. I{(L{DataField})} 5023 @return: B{C{result}} if it isn't B{C{None}}, otherwise a newly allocated data field. I{(L{DataField})} 5024 """ 5025 return None
5026
5027 - def local_plane_quantity(size, type, result):
5028 """ 5029 Convenience function to get just one quantity from 5030 L{DataField.fit_local_planes}(). 5031 5032 5033 @param size: Neighbourhood size. I{(int)} 5034 @param type: The type of requested quantity. Expected values: C{B{PLANE_FIT_A}}, C{B{PLANE_FIT_BX}}, C{B{PLANE_FIT_BY}}, C{B{PLANE_FIT_ANGLE}}, C{B{PLANE_FIT_SLOPE}}, C{B{PLANE_FIT_S0}}, C{B{PLANE_FIT_S0_REDUCED}}. I{(L{PlaneFitQuantity})} 5035 @param result: A data field to store result to, or B{C{None}} to allocate a new one. I{(L{DataField})} 5036 @return: B{C{result}} if it isn't B{C{None}}, otherwise a newly allocated data field. I{(L{DataField})} 5037 """ 5038 return None
5039
5040 - def mfm_perpendicular_stray_field(out, height, thickness, sigma, walls, wall_a, wall_kn):
5041 """ 5042 Calculates stray field for perpendicular media. 5043 5044 @since: 2.51 5045 5046 @param out: Target data field to put the result to. It will be resized to match 5047 B{C{mfield}}. I{(L{DataField})} 5048 @param height: I{(float)} 5049 @param thickness: I{(float)} 5050 @param sigma: I{(float)} 5051 @param walls: I{(bool)} 5052 @param wall_a: I{(float)} 5053 @param wall_kn: I{(float)} 5054 """ 5055 pass
5056
5057 - def mfm_perpendicular_medium_force(fz, type, mtip, bx, by, length):
5058 """ 5059 Calculates ... 5060 5061 @since: 2.51 5062 5063 @param fz: Target data field to put the result to. It will be resized to match 5064 B{C{hz}}. I{(L{DataField})} 5065 @param type: Expected values: C{B{MFM_PROBE_CHARGE}}, C{B{MFM_PROBE_BAR}}. I{(L{MFMProbeType})} 5066 @param mtip: I{(float)} 5067 @param bx: I{(float)} 5068 @param by: I{(float)} 5069 @param length: I{(float)} 5070 """ 5071 pass
5072
5073 - def mfm_shift_z(out, zdiff):
5074 """ 5075 Shifts magnetic field to a different lift height above the surface. 5076 5077 Positive B{C{zdiff}} means away from the measured surface and blurring the data. 5078 Negative B{C{zdiff}} means shifting towards (or within) the measured surface 5079 and sharpening the data. For negative B{C{zdiff}} the result grows exponentially 5080 and is generally not very useful. 5081 5082 @since: 2.51 5083 5084 @param out: Target data field to put the result to. I{(L{DataField})} 5085 @param zdiff: The shift distance in physical units. I{(float)} 5086 """ 5087 pass
5088
5089 - def mfm_find_shift_z(shifted, zdiffmin, zdiffmax):
5090 """ 5091 Estimates the height difference between two magnetic field images. 5092 5093 See L{DataField.mfm_shift_z}() for the sign convention. It is generally 5094 only meaningful to estimate the shift whe B{C{shifted}} was measured at larger 5095 lift height than B{C{dfield}}. 5096 5097 @since: 2.51 5098 5099 @param shifted: Data field containing magnetic field component measured at 5100 a different lift height. I{(L{DataField})} 5101 @param zdiffmin: Start of shift scan range. I{(float)} 5102 @param zdiffmax: Start of shift scan range. I{(float)} 5103 @return: The estimated shift between B{C{shifted}} and B{C{dfield}}. I{(float)} 5104 """ 5105 return None
5106
5107 - def mfm_parallel_medium(height, size_a, size_b, size_c, magnetisation, thickness, component):
5108 """ 5109 Calculates ... 5110 5111 TODO: Document that the field is added to existing values in B{C{hfield}}. 5112 5113 @since: 2.51 5114 5115 @param height: I{(float)} 5116 @param size_a: I{(float)} 5117 @param size_b: I{(float)} 5118 @param size_c: I{(float)} 5119 @param magnetisation: I{(float)} 5120 @param thickness: I{(float)} 5121 @param component: Expected values: C{B{MFM_COMPONENT_HX}}, C{B{MFM_COMPONENT_HY}}, C{B{MFM_COMPONENT_HZ}}, C{B{MFM_COMPONENT_DHZ_DZ}}, C{B{MFM_COMPONENT_D2HZ_DZ2}}. I{(L{MFMComponentType})} 5122 """ 5123 pass
5124
5125 - def mfm_current_line(height, width, position, current, component):
5126 """ 5127 Calculates ... 5128 5129 TODO: Document that the field is added to existing values in B{C{hfield}}. 5130 5131 @since: 2.51 5132 5133 @param height: I{(float)} 5134 @param width: I{(float)} 5135 @param position: I{(float)} 5136 @param current: I{(float)} 5137 @param component: Expected values: C{B{MFM_COMPONENT_HX}}, C{B{MFM_COMPONENT_HY}}, C{B{MFM_COMPONENT_HZ}}, C{B{MFM_COMPONENT_DHZ_DZ}}, C{B{MFM_COMPONENT_D2HZ_DZ2}}. I{(L{MFMComponentType})} 5138 """ 5139 pass
5140
5141 - def get_max():
5142 """ 5143 Finds the maximum value of a data field. 5144 5145 This quantity is cached. 5146 5147 5148 @return: The maximum value. I{(float)} 5149 """ 5150 return None
5151
5152 - def get_min():
5153 """ 5154 Finds the minimum value of a data field. 5155 5156 This quantity is cached. 5157 5158 5159 @return: The minimum value. I{(float)} 5160 """ 5161 return None
5162
5163 - def get_min_max():
5164 """ 5165 Finds minimum and maximum values of a data field. 5166 5167 @return: Tuple consisting of 2 values (B{C{min}}, B{C{max}}). (I{(float)}, I{(float)}) 5168 """ 5169 return None, None
5170
5171 - def get_avg():
5172 """ 5173 Computes average value of a data field. 5174 5175 This quantity is cached. 5176 5177 5178 @return: The average value. I{(float)} 5179 """ 5180 return None
5181
5182 - def get_rms():
5183 """ 5184 Computes root mean square value of a data field. 5185 5186 This quantity is cached. 5187 5188 5189 @return: The root mean square value. I{(float)} 5190 """ 5191 return None
5192
5193 - def get_sum():
5194 """ 5195 Sums all values in a data field. 5196 5197 This quantity is cached. 5198 5199 5200 @return: The sum of all values. I{(float)} 5201 """ 5202 return None
5203
5204 - def get_median():
5205 """ 5206 Computes median value of a data field. 5207 5208 This quantity is cached. 5209 5210 5211 @return: The median value. I{(float)} 5212 """ 5213 return None
5214
5215 - def get_surface_area():
5216 """ 5217 Computes surface area of a data field. 5218 5219 This quantity is cached. 5220 5221 5222 @return: The surface area. I{(float)} 5223 """ 5224 return None
5225
5226 - def get_variation():
5227 """ 5228 Computes the total variation of a data field. 5229 5230 See L{DataField.area_get_variation}() for the definition. 5231 5232 This quantity is cached. 5233 5234 @since: 2.38 5235 5236 @return: The variation. I{(float)} 5237 """ 5238 return None
5239
5240 - def get_entropy():
5241 """ 5242 Computes the entropy of a data field. 5243 5244 See L{DataField.area_get_entropy}() for the definition. 5245 5246 This quantity is cached. 5247 5248 @since: 2.42 5249 5250 @return: The value distribution entropy. I{(float)} 5251 """ 5252 return None
5253
5254 - def get_entropy_2d(yfield):
5255 """ 5256 Computes the entropy of a two-dimensional point cloud. 5257 5258 Each pair of corresponding B{C{xfield}} and B{C{yfield}} pixels is assumed to 5259 represent the coordinates (B{C{x}},B{C{y}}) of a point in plane. Hence they must have 5260 the same dimensions. 5261 5262 @since: 2.44 5263 5264 @param yfield: A data field containing the B{C{y}}-coordinates. I{(L{DataField})} 5265 @return: The two-dimensional distribution entropy. I{(float)} 5266 """ 5267 return None
5268
5269 - def area_get_max(mask, col, row, width, height):
5270 """ 5271 Finds the maximum value in a rectangular part of a data field. 5272 5273 5274 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5275 @param col: Upper-left column coordinate. I{(int)} 5276 @param row: Upper-left row coordinate. I{(int)} 5277 @param width: Area width (number of columns). I{(int)} 5278 @param height: Area height (number of rows). I{(int)} 5279 @return: The maximum value. When the number of samples to calculate 5280 maximum of is zero, -B{C{glib.MAXDOUBLE}} is returned. I{(float)} 5281 """ 5282 return None
5283
5284 - def area_get_min(mask, col, row, width, height):
5285 """ 5286 Finds the minimum value in a rectangular part of a data field. 5287 5288 5289 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5290 @param col: Upper-left column coordinate. I{(int)} 5291 @param row: Upper-left row coordinate. I{(int)} 5292 @param width: Area width (number of columns). I{(int)} 5293 @param height: Area height (number of rows). I{(int)} 5294 @return: The minimum value. When the number of samples to calculate 5295 minimum of is zero, -B{C{glib.MAXDOUBLE}} is returned. I{(float)} 5296 """ 5297 return None
5298
5299 - def area_get_min_max(mask, col, row, width, height):
5300 """ 5301 Finds minimum and maximum values in a rectangular part of a data field. 5302 5303 This function is equivalent to calling 5304 B{C{L{DataField.area_get_min_max_mask}}}() 5305 with masking mode B{C{MASK_INCLUDE}}. 5306 5307 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5308 @param col: Upper-left column coordinate. I{(int)} 5309 @param row: Upper-left row coordinate. I{(int)} 5310 @param width: Area width (number of columns). I{(int)} 5311 @param height: Area height (number of rows). I{(int)} 5312 @return: Tuple consisting of 2 values (B{C{min}}, B{C{max}}). (I{(float)}, I{(float)}) 5313 """ 5314 return None, None
5315
5316 - def area_get_min_max_mask(mask, mode, col, row, width, height):
5317 """ 5318 Finds minimum and maximum values in a rectangular part of a data field. 5319 5320 @since: 2.18 5321 5322 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5323 @param mode: Masking mode to use. See the introduction for description of 5324 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5325 @param col: Upper-left column coordinate. I{(int)} 5326 @param row: Upper-left row coordinate. I{(int)} 5327 @param width: Area width (number of columns). I{(int)} 5328 @param height: Area height (number of rows). I{(int)} 5329 @return: Tuple consisting of 2 values (B{C{min}}, B{C{max}}). (I{(float)}, I{(float)}) 5330 """ 5331 return None, None
5332
5333 - def area_get_avg(mask, col, row, width, height):
5334 """ 5335 Computes average value of a rectangular part of a data field. 5336 5337 This function is equivalent to calling B{C{L{DataField.area_get_avg_mask}}}() 5338 with masking mode B{C{MASK_INCLUDE}}. 5339 5340 5341 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5342 @param col: Upper-left column coordinate. I{(int)} 5343 @param row: Upper-left row coordinate. I{(int)} 5344 @param width: Area width (number of columns). I{(int)} 5345 @param height: Area height (number of rows). I{(int)} 5346 @return: The average value. I{(float)} 5347 """ 5348 return None
5349
5350 - def area_get_avg_mask(mask, mode, col, row, width, height):
5351 """ 5352 Computes average value of a rectangular part of a data field. 5353 5354 @since: 2.18 5355 5356 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5357 @param mode: Masking mode to use. See the introduction for description of 5358 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5359 @param col: Upper-left column coordinate. I{(int)} 5360 @param row: Upper-left row coordinate. I{(int)} 5361 @param width: Area width (number of columns). I{(int)} 5362 @param height: Area height (number of rows). I{(int)} 5363 @return: The average value. I{(float)} 5364 """ 5365 return None
5366
5367 - def area_get_rms(mask, col, row, width, height):
5368 """ 5369 Computes root mean square value of a rectangular part of a data field. 5370 5371 5372 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5373 @param col: Upper-left column coordinate. I{(int)} 5374 @param row: Upper-left row coordinate. I{(int)} 5375 @param width: Area width (number of columns). I{(int)} 5376 @param height: Area height (number of rows). I{(int)} 5377 @return: The root mean square value. 5378 5379 This function is equivalent to calling B{C{L{DataField.area_get_rms_mask}}}() 5380 with masking mode B{C{MASK_INCLUDE}}. I{(float)} 5381 """ 5382 return None
5383
5384 - def area_get_rms_mask(mask, mode, col, row, width, height):
5385 """ 5386 Computes root mean square value of deviations of a rectangular part of a 5387 data field. 5388 5389 @since: 2.18 5390 5391 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5392 @param mode: Masking mode to use. See the introduction for description of 5393 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5394 @param col: Upper-left column coordinate. I{(int)} 5395 @param row: Upper-left row coordinate. I{(int)} 5396 @param width: Area width (number of columns). I{(int)} 5397 @param height: Area height (number of rows). I{(int)} 5398 @return: The root mean square value of deviations from the mean value. I{(float)} 5399 """ 5400 return None
5401
5402 - def area_get_grainwise_rms(mask, mode, col, row, width, height):
5403 """ 5404 Computes grain-wise root mean square value of deviations of a rectangular 5405 part of a data field. 5406 5407 Grain-wise means that the mean value is determined for each grain (i.e. 5408 cotinguous part of the mask or inverted mask) separately and the deviations 5409 are calculated from these mean values. 5410 5411 @since: 2.29 5412 5413 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5414 @param mode: Masking mode to use. See the introduction for description of 5415 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5416 @param col: Upper-left column coordinate. I{(int)} 5417 @param row: Upper-left row coordinate. I{(int)} 5418 @param width: Area width (number of columns). I{(int)} 5419 @param height: Area height (number of rows). I{(int)} 5420 @return: The root mean square value of deviations from the mean value. I{(float)} 5421 """ 5422 return None
5423
5424 - def area_get_sum(mask, col, row, width, height):
5425 """ 5426 Sums values of a rectangular part of a data field. 5427 5428 This function is equivalent to calling B{C{L{DataField.area_get_sum_mask}}}() 5429 with masking mode B{C{MASK_INCLUDE}}. 5430 5431 5432 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5433 @param col: Upper-left column coordinate. I{(int)} 5434 @param row: Upper-left row coordinate. I{(int)} 5435 @param width: Area width (number of columns). I{(int)} 5436 @param height: Area height (number of rows). I{(int)} 5437 @return: The sum of all values inside area. I{(float)} 5438 """ 5439 return None
5440
5441 - def area_get_sum_mask(mask, mode, col, row, width, height):
5442 """ 5443 Sums values of a rectangular part of a data field. 5444 5445 @since: 2.18 5446 5447 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5448 @param mode: Masking mode to use. See the introduction for description of 5449 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5450 @param col: Upper-left column coordinate. I{(int)} 5451 @param row: Upper-left row coordinate. I{(int)} 5452 @param width: Area width (number of columns). I{(int)} 5453 @param height: Area height (number of rows). I{(int)} 5454 @return: The sum of all values inside area. I{(float)} 5455 """ 5456 return None
5457
5458 - def area_get_median(mask, col, row, width, height):
5459 """ 5460 Computes median value of a data field area. 5461 5462 This function is equivalent to calling 5463 B{C{L{DataField.area_get_median_mask}}}() 5464 with masking mode B{C{MASK_INCLUDE}}. 5465 5466 5467 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5468 @param col: Upper-left column coordinate. I{(int)} 5469 @param row: Upper-left row coordinate. I{(int)} 5470 @param width: Area width (number of columns). I{(int)} 5471 @param height: Area height (number of rows). I{(int)} 5472 @return: The median value. I{(float)} 5473 """ 5474 return None
5475
5476 - def area_get_median_mask(mask, mode, col, row, width, height):
5477 """ 5478 Computes median value of a data field area. 5479 5480 @since: 2.18 5481 5482 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5483 @param mode: Masking mode to use. See the introduction for description of 5484 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5485 @param col: Upper-left column coordinate. I{(int)} 5486 @param row: Upper-left row coordinate. I{(int)} 5487 @param width: Area width (number of columns). I{(int)} 5488 @param height: Area height (number of rows). I{(int)} 5489 @return: The median value. I{(float)} 5490 """ 5491 return None
5492
5493 - def area_get_surface_area(mask, col, row, width, height):
5494 """ 5495 Computes surface area of a rectangular part of a data field. 5496 5497 This function is equivalent to calling 5498 B{C{L{DataField.area_get_surface_area_mask}}}() with masking mode 5499 B{C{MASK_INCLUDE}}. 5500 5501 5502 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5503 @param col: Upper-left column coordinate. I{(int)} 5504 @param row: Upper-left row coordinate. I{(int)} 5505 @param width: Area width (number of columns). I{(int)} 5506 @param height: Area height (number of rows). I{(int)} 5507 @return: The surface area. I{(float)} 5508 """ 5509 return None
5510
5511 - def area_get_surface_area_mask(mask, mode, col, row, width, height):
5512 """ 5513 Computes surface area of a rectangular part of a data field. 5514 5515 This quantity makes sense only if the lateral dimensions and values of 5516 B{C{data_field}} are the same physical quantities. 5517 5518 @since: 2.18 5519 5520 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5521 @param mode: Masking mode to use. See the introduction for description of 5522 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5523 @param col: Upper-left column coordinate. I{(int)} 5524 @param row: Upper-left row coordinate. I{(int)} 5525 @param width: Area width (number of columns). I{(int)} 5526 @param height: Area height (number of rows). I{(int)} 5527 @return: The surface area. I{(float)} 5528 """ 5529 return None
5530
5531 - def area_get_entropy_at_scales(target_line, mask, mode, col, row, width, height, maxdiv):
5532 """ 5533 Calculates estimates of value distribution entropy at various scales. 5534 5535 @since: 2.44 5536 5537 @param target_line: A data line to store the result to. It will be resampled to 5538 B{C{maxdiv}}+1 items. I{(L{DataLine})} 5539 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5540 @param mode: Masking mode to use. See the introduction for description of 5541 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5542 @param col: Upper-left column coordinate. I{(int)} 5543 @param row: Upper-left row coordinate. I{(int)} 5544 @param width: Area width (number of columns). I{(int)} 5545 @param height: Area height (number of rows). I{(int)} 5546 @param maxdiv: Maximum number of divisions of the value range. Pass zero to 5547 choose it automatically. I{(int)} 5548 @return: The best estimate, as L{DataField.area_get_entropy}(). I{(float)} 5549 """ 5550 return None
5551
5552 - def get_entropy_2d_at_scales(yfield, target_line, maxdiv):
5553 """ 5554 Calculates estimates of entropy of two-dimensional point cloud at various 5555 scales. 5556 5557 @since: 2.44 5558 5559 @param yfield: A data field containing the B{C{y}}-coordinates. I{(L{DataField})} 5560 @param target_line: A data line to store the result to. It will be resampled to 5561 B{C{maxdiv}}+1 items. I{(L{DataLine})} 5562 @param maxdiv: Maximum number of divisions of the value range. Pass zero to 5563 choose it automatically. I{(int)} 5564 @return: The best estimate, as L{DataField.get_entropy_2d}(). I{(float)} 5565 """ 5566 return None
5567
5568 - def area_get_variation(mask, mode, col, row, width, height):
5569 """ 5570 Computes the total variation of a rectangular part of a data field. 5571 5572 The total variation is estimated as the integral of the absolute value of 5573 local gradient. 5574 5575 This quantity has the somewhat odd units of value unit times lateral unit. 5576 It can be envisioned as follows. If the surface has just two height levels 5577 (upper and lower planes) then the quantity is the length of the boundary 5578 between the upper and lower part, multiplied by the step height. If the 5579 surface is piece-wise constant, then the variation is the step height 5580 integrated along the boundaries between the constant parts. Therefore, for 5581 non-fractal surfaces it scales with the linear dimension of th