@@ -179,6 +179,7 @@ def get_tile_renderparams(
179179@renderaccess
180180def get_tile_image_data (stack , tileId , channel = None , normalizeForMatching = True ,
181181 excludeAllTransforms = False , scale = None ,
182+ minIntensity = None , maxIntensity = None ,
182183 filter = None , host = None , port = None , owner = None ,
183184 project = None , img_format = None ,
184185 session = requests .session (), render = None , ** kwargs ):
@@ -205,6 +206,10 @@ def get_tile_image_data(stack, tileId, channel=None, normalizeForMatching=True,
205206 (or remove till there are max 3 transforms)
206207 scale : float
207208 force scale of image
209+ minIntensity : int
210+ Minimum pixel value to rescale image
211+ maxIntensity : int
212+ Maximum pixel value to rescale image
208213 filter : bool
209214 whether to apply server side filtering to image
210215 img_format : str
@@ -245,6 +250,10 @@ def get_tile_image_data(stack, tileId, channel=None, normalizeForMatching=True,
245250 qparams ['excludeAllTransforms' ] = jbool (excludeAllTransforms )
246251 if channel is not None :
247252 qparams .update ({'channels' : channel })
253+ if minIntensity is not None :
254+ qparams ['minIntensity' ] = minIntensity
255+ if maxIntensity is not None :
256+ qparams ['maxIntensity' ] = maxIntensity
248257 logger .debug (request_url )
249258
250259 r = session .get (request_url , params = qparams )
@@ -286,6 +295,7 @@ def get_section_renderparams(stack, z, binaryMask=None, channel=None,
286295
287296@renderaccess
288297def get_section_image (stack , z , scale = 1.0 , channel = None ,
298+ minIntensity = None , maxIntensity = None ,
289299 filter = False ,
290300 maxTileSpecsToRender = None , img_format = None ,
291301 host = None , port = None , owner = None , project = None ,
@@ -307,6 +317,10 @@ def get_section_image(stack, z, scale=1.0, channel=None,
307317 channel: str
308318 channel name to render, (e.g. 'DAPI') or a weighted average of channels of the format
309319 e.g 'DAPI___.8___GFP___.2'
320+ minIntensity : int
321+ Minimum pixel value to rescale image
322+ maxIntensity : int
323+ Maximum pixel value to rescale image
310324 filter : bool
311325 whether or not to apply server side filtering
312326 maxTileSpecsToRender : int
@@ -345,6 +359,10 @@ def get_section_image(stack, z, scale=1.0, channel=None,
345359 qparams .update ({'maxTileSpecsToRender' : maxTileSpecsToRender })
346360 if channel is not None :
347361 qparams .update ({'channels' : channel })
362+ if minIntensity is not None :
363+ qparams ['minIntensity' ] = minIntensity
364+ if maxIntensity is not None :
365+ qparams ['maxIntensity' ] = maxIntensity
348366
349367 r = session .get (request_url , params = qparams )
350368 return np .asarray (Image .open (io .BytesIO (r .content )))
0 commit comments