Skip to content

Commit f256346

Browse files
committed
add log and about widgets
1 parent 3fce4d2 commit f256346

1 file changed

Lines changed: 75 additions & 0 deletions

File tree

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import pytest
2+
3+
from pymapmanager.interface2 import PyMapManagerApp
4+
# from pymapmanager import stack
5+
from mapmanagercore.data import getTiffChannel_1
6+
7+
from pymapmanager._logger import logger
8+
9+
# this makes qapp be our PyMapManagerApp, it is derived from QApplication
10+
@pytest.fixture(scope="session")
11+
def qapp_cls():
12+
return PyMapManagerApp
13+
14+
def test_app(qtbot, qapp):
15+
logger.info(f'app:{qapp}')
16+
17+
def test_load_tiff(qapp):
18+
tiffpath = getTiffChannel_1()
19+
20+
qapp.loadStackWidget(tiffpath)
21+
22+
def test_stack_from_tif():
23+
import pandas as pd
24+
from mapmanagercore import MapAnnotations, MultiImageLoader
25+
26+
tiffpath = getTiffChannel_1()
27+
28+
loader = MultiImageLoader()
29+
loader.read(tiffpath, channel=0)
30+
# loader.read(tiffpath, channel=1) # our core is defaulting to channel 1 (for brightest path)
31+
32+
map = MapAnnotations(loader,
33+
lineSegments=pd.DataFrame(),
34+
points=pd.DataFrame())
35+
36+
map.points[:]
37+
map.segments[:]
38+
39+
print('map:', map)
40+
print('map.points[:]:', map.points[:])
41+
print('map.segments[:]:', map.segments[:])
42+
43+
# get one time point. Stack does this but it seems to be buggy
44+
sessionID = 0
45+
tp = map.getTimePoint(sessionID)
46+
47+
print('tp:', map)
48+
print('tp.points[:]:', tp.points[:])
49+
print('tp.segments[:]:', tp.segments[:])
50+
51+
if 1:
52+
newSegmentID = tp.newSegment()
53+
print('newSegmentID:', newSegmentID)
54+
55+
tp.appendSegmentPoint(newSegmentID, 10, 10, 0)
56+
tp.appendSegmentPoint(newSegmentID, 20, 20, 0)
57+
tp.appendSegmentPoint(newSegmentID, 30, 30, 0)
58+
59+
# TODO: fix error if we pass in (0, 0, 0)
60+
newSpineID = tp.addSpine(segmentId=newSegmentID,
61+
x=10,
62+
y=10,
63+
z=10)
64+
65+
print('=== after add segment and spine')
66+
print('=== tp.points[:]:')
67+
print(tp.points[:])
68+
print('===tp.segments[:]:')
69+
print(tp.segments[:])
70+
71+
# aStack = stack(zarrMap=map)
72+
73+
if __name__ == '__main__':
74+
test_stack_from_tif()
75+
pass

0 commit comments

Comments
 (0)