Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kostrykin committed Mar 11, 2024
1 parent 047bcf4 commit 699e642
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/orientationpy/orientationpy-cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@
if args.output_angle_tsv:
with open(args.output_angle_tsv, 'w') as fp:
writer = csv.writer(fp, delimiter='\t', lineterminator='\n')
writer.writerow('Degrees')
writer.writerow('Angle')
writer.writerow(angle)
32 changes: 31 additions & 1 deletion tools/orientationpy/orientationpy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,39 @@
<data format="tsv" name="output_angle_tsv" from_work_dir="output_angle.tsv" />
</outputs>
<tests>
<test>
<param name="image" value="input1.tif" />
<param name="mode" value="finite_difference" />
<param name="sigma" value="2" />
<param name="min_energy" value="0.1" />
<param name="min_coherency" value="0.2" />
<output name="output_angle_tsv">
<assert_contents>
<has_line line="Angle" />
<has_line line="45" />
<has_n_lines n="2" />
<has_n_columns n="1" />
</assert_contents>
</output>
</test>
<test>
<param name="image" value="input2.tif" />
<param name="mode" value="finite_difference" />
<param name="sigma" value="2" />
<param name="min_energy" value="0.1" />
<param name="min_coherency" value="0.2" />
<output name="output_angle_tsv">
<assert_contents>
<has_line line="Angle" />
<has_line line="-45" />
<has_n_lines n="2" />
<has_n_columns n="1" />
</assert_contents>
</output>
</test>
</tests>
<help>
Compute image orientation based on OrientationPy.
Compute image orientation in degrees using OrientationPy.

OrientationPy is the pythonic successor to the well-loved OrientationJ Fiji Plugin.
It is a library that takes in 2D images or 3D volumes and computes the orientation of the greylevels.
Expand Down
Binary file added tools/orientationpy/test-data/input1.tif
Binary file not shown.
Binary file added tools/orientationpy/test-data/input2.tif
Binary file not shown.

0 comments on commit 699e642

Please sign in to comment.