parameters: (request, project_id=None, roi_id=None)
return_statement: return redirect(url)
docstring: Returns the URL to the cropped image, described by the ROI.  These
      images are cached, and won't get removed automatically. If the image is
      already present its URL is used and returned. For performance reasons it
      might be a good idea, to add this test to the web-server config.
docstring_summary: Returns the URL to the cropped image, described by the ROI.  These
      images are cached, and won't get removed automatically. If the image is
      already present its URL is used and returned. For performance reasons it
      might be a good idea, to add this test to the web-server config.
docstring_tokens: Returns the URL to the cropped image described by the ROI . These images are cached and won t get removed automatically . If the image is already present its URL is used and returned . For performance reasons it might be a good idea to add this test to the web - server config .
function: def get_roi_image(request, project_id=None, roi_id=None) -> HttpResponseRedirect:
      """ Returns the URL to the cropped image, described by the ROI.  These
      images are cached, and won't get removed automatically. If the image is
      already present its URL is used and returned. For performance reasons it
      might be a good idea, to add this test to the web-server config.
      """
      file_name, file_path = create_roi_path(roi_id)
      if not os.path.exists(file_path):
          # Start async processing
          create_roi_image(request.user, project_id, roi_id, file_path)
          # Use waiting image
          url = urljoin(settings.STATIC_URL,
              "images/wait_bgwhite.gif")
      else:
          # Create real image di
          url_base = urljoin(settings.MEDIA_URL,
              settings.MEDIA_ROI_SUBDIRECTORY)
          url = urljoin(url_base, file_name)
  
      return redirect(url)
function_tokens: def get_roi_image ( request , project_id = None , roi_id = None ) -> HttpResponseRedirect : file_name , file_path = create_roi_path ( roi_id ) if not os . path . exists ( file_path ) : # Start async processing create_roi_image ( request . user , project_id , roi_id , file_path ) # Use waiting image url = urljoin ( settings . STATIC_URL , "images/wait_bgwhite.gif" ) else : # Create real image di url_base = urljoin ( settings . MEDIA_URL , settings . MEDIA_ROI_SUBDIRECTORY ) url = urljoin ( url_base , file_name ) return redirect ( url )