Docs
Search…
ADKs (Apeer SDKs)
The open source APEER SDKs help to read the inputs and to write the outputs of your module. They help you to create your own module without the pain of considering environment variables or JSONs.

Usage of the Python ADK

This docs article is a small version of the blog article about the APEER SDK Family.
The main idea of the ADKs is that it keeps the technical code to communicate with the APEER environment completely seperate from your code. So you can concentrate on the actual image processing problem and test and use your code independently from APEER.
All our examples have a apeer_main file that serves as the entry point to your module and uses the ADK to read the inputs, writes the outputs and just calls your code, which we will just call your_code.py and assume it has a method run(input_image, threshold).
The Python ADK can easily be installed via pip install apeer-dev-kit.
apeer_main.py
1
from apeer_dev_kit import adk
2
import your_code
3
if __name__ == '__main__':
4
inputs = adk.get_inputs()
5
outputs = your_code.run(inputs['input_image_path'], inputs['threshold_value'])
6
adk.set_output('cell_count', outputs['cell_count'])
7
adk.set_file_output('thresholded_image', outputs['thresholded_image'])
8
adk.finalize()
Copied!
That’s it. That’s all the technical code you need to execute your module on APEER. You can know go ahead and implement your_code.run(...). It actually doesn’t matter how you return the results generated by your code but we recommend a dictionary.
your_code.py
1
def run(input_image_path, red, green, blue):
2
# your processing code goes here ...
3
# just make sure you save all result files and return their paths
4
output_file_path = 'result.tiff'
5
io.imsave(output_file_path, ...)
6
return {'cell_count': 42, 'thresholded_image': output_file_path}
Copied!
We hope that you will have no more pain creating modules on APEER and can concentrate on the actual problem.
We will be working on more ADKs and also aim to solve the other problems on this list to make it even easier to develop a module for APEER.

You couldn't find all the information you need? Contact us!

If you need help, just check out our FAQ. For any further questions please contact us at [email protected] or have a look at How-tos section in our blog or follow us on Twitter to stay up to date.
Last modified 2yr ago