From 303f8e227a38eb9aaaa44a3116c604becbdb4735 Mon Sep 17 00:00:00 2001
From: Christopher Rhodes <christopher.rhodes@embl.de>
Date: Tue, 5 Sep 2023 10:26:21 +0200
Subject: [PATCH] Removed ImageJ demo scripts, now on its own branch

---
 imagej/infer_ilastik_by_api.py | 48 ----------------------------------
 1 file changed, 48 deletions(-)
 delete mode 100644 imagej/infer_ilastik_by_api.py

diff --git a/imagej/infer_ilastik_by_api.py b/imagej/infer_ilastik_by_api.py
deleted file mode 100644
index c4f0dda3..00000000
--- a/imagej/infer_ilastik_by_api.py
+++ /dev/null
@@ -1,48 +0,0 @@
-import httplib
-import json
-import urllib
-
-import os
-import sys
-print(sys.version)
-
-from ij import IJ
-
-host = '127.0.0.1'
-port = 8001
-uri = 'http://{}:{}/'.format(host, port)
-
-abspath = IJ.getImage().getProp('Location')
-input_filename = os.path.split(abspath)[-1]
-
-outpath = 'C:\\Users\\rhodes\\projects\\proj0015-model-server\\resources\\testdata'
-
-def hit_endpoint(method, endpoint, params=None, verbose=False):
-    connection = httplib.HTTPConnection(host, port)
-    if not method in ['GET', 'PUT']:
-        raise Exception('Can only handle GET and PUT requests')
-    if params:
-        url = endpoint + '?' + urllib.urlencode(params)
-    else:
-        url = endpoint
-    connection.request(method, url)
-    resp = connection.getresponse()
-    resp_str = resp.read()
-    if verbose:
-    	print(method + ' ' + url + ', status ' + str(resp.status) + ':\n' + resp_str)
-    return json.loads(resp_str)
-
-#hit_endpoint('GET', '/')
-#hit_endpoint('GET', '/models')
-#hit_endpoint('PUT', '/bounce_back', {'par1': 'ghij'})
-resp = hit_endpoint('PUT', '/models/ilastik/pixel_classification/load/', {'project_file': 'demo_px.ilp'})
-pxmid = resp['model_id']
-resp = hit_endpoint('GET', '/models', verbose=True)
-
-infer_params = {
-	'model_id': pxmid,
-	'input_filename': input_filename,
-	'channel': 0
-	}
-
-hit_endpoint('PUT', '/infer/from_image_file', infer_params)
\ No newline at end of file
-- 
GitLab