we set up an Android application as the client which takes a photo and sends it to the server (specifically, to the URL of a PHP script on the server).
We would then like the PHP file to save this input image, generate a file indicating that the input image is ready for processing, and invoke the overarching MATLAB code loop (predictASLLoop.m) that will begin the process of interpreting the image. However, the corn server does not allow MATLAB to be launched from our PHP file, which means we have to make sure that predictASLLoop.m is running on the server while we are trying to process an input image.
While it is running, the overarching loop (predictASLLoop.m) continuously checks for the PHP-generated file indicating that an input image is ready for processing. If an input indicator file is present, predictASLLoop.m will read the input image, remove the input indicator file, pass the input image for processing by predictASL.m, save the image result from predictASL.m, and generate a file to indicate that the image result is ready to be sent to the Android app.
The PHP file will be continuously checking for this result indicator file. When the result indicator is detected, the PHP file will automatically push the image result back to the Android app.