Skip to content
Snippets Groups Projects
Commit 91091b3d authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Pixel classification in 3D works, but pixel maps are not aligned with original...

Pixel classification in 3D works, but pixel maps are not aligned with original image, suspect X-Y flipped
parent 8f06a837
No related branches found
No related tags found
No related merge requests found
......@@ -30,21 +30,22 @@ if __name__ == '__main__':
resp_paths = requests.get(uri + 'paths')
paths = resp_paths.json()
def request_put(endpoint, params):
resp = requests.put(uri + endpoint, params=params)
assert resp.status_code == 200, resp.content.decode()
return resp.json()
# load ilastik pixel model
resp_load_px = requests.put(
uri + 'models/ilastik/pixel_classification/load/',
params={'project_file': px3d_ilp},
)
assert resp_load_px.status_code == 200, resp_load_px.content.decode()
model_id_px = resp_load_px.json()['model_id']
model_id_px = request_put(
'models/ilastik/pixel_classification/load/',
{'project_file': px3d_ilp}
)['model_id']
# load ilastik object model
resp_load_ob = requests.put(
uri + 'models/ilastik/object_classification/load/',
params={'project_file': ob3d_ilp},
)
assert resp_load_ob.status_code == 200, resp_load_ob.content.decode()
model_id_ob = resp_load_ob.json()['model_id']
model_id_ob = request_put(
'models/ilastik/object_classification/load/',
{'project_file': ob3d_ilp}
)['model_id']
# copy files from network storage to processing directory
for ff in czis:
......@@ -53,26 +54,14 @@ if __name__ == '__main__':
copyfile(infile, outfile)
# infer pixel maps
resp_infer_px = requests.put(
uri + f'infer/from_image_file',
params={
request_put(
'infer/from_image_file',
{
'model_id': model_id_px,
'input_filename': ff,
'channel': channel,
},
)
assert resp_infer_px == 200, resp_load_px.content.decode()
# infer object maps
resp_infer_ob = requests.put(
uri + f'infer/from_image_file',
params={
'model_id': model_id_ob,
'input_filename': ff,
'channel': channel,
},
}
)
assert resp_infer_ob == 200, resp_infer_ob.content.decode()
resp_models = requests.get(uri + 'models')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment