original_docstring: Partitions image into smaller images.
  
      Partitions a large image into irows x icols images of size ires and write
      them to the drive. Default input image sizes are from a Nikon/Hamamatsu
      camera setup (2048 x 2044 pixels).
  
      Parameters
      ----------
      tiffname : string
          Location of input image to be partitioned.
      irows : int
          Number of rows of size ires pixels to be partitioned from source image.
      icols : int
          Number of columns of size ires pixels to be partitioned from source image.
      ores : tuple of int
          Input images are scaled to size ores pixels prior to splitting.
      ires : tuple of int
          Output images are of size ires pixels.
  
      Returns
      --------
      names : list of str
          List of output image filenames
  
      Examples
      --------
      >>> partition_im('your/sample/image.tif', irows=8, icols=8, ires=(256, 256))
  
      
docstring: Partitions image into smaller images.
  Partitions a large image into irows x icols images of size ires and write
  them to the drive. Default input image sizes are from a Nikon/Hamamatsu
  camera setup (2048 x 2044 pixels).
  
  Parameters
  
  tiffname : string
  Location of input image to be partitioned.
  irows : int
  Number of rows of size ires pixels to be partitioned from source image.
  icols : int
  Number of columns of size ires pixels to be partitioned from source image.
  ores : tuple of int
  Input images are scaled to size ores pixels prior to splitting.
  ires : tuple of int
  Output images are of size ires pixels.
  
  Returns
  
  names : list of str
  List of output image filenames
  
  Examples
  
  
docstring_tokens: Partitions image into smaller images . Partitions a large image into irows x icols images of size ires and write them to the drive . Default input image sizes are from a Nikon / Hamamatsu camera setup ( 2048 x 2044 pixels ) . Parameters tiffname : string Location of input image to be partitioned . irows : int Number of rows of size ires pixels to be partitioned from source image . icols : int Number of columns of size ires pixels to be partitioned from source image . ores : tuple of int Input images are scaled to size ores pixels prior to splitting . ires : tuple of int Output images are of size ires pixels . Returns names : list of str List of output image filenames Examples
code: def partition_im(tiffname, irows=4, icols=4, ores=(2048, 2048),
                   ires=(512, 512)):
      """Partitions image into smaller images.
  
      Partitions a large image into irows x icols images of size ires and write
      them to the drive. Default input image sizes are from a Nikon/Hamamatsu
      camera setup (2048 x 2044 pixels).
  
      Parameters
      ----------
      tiffname : string
          Location of input image to be partitioned.
      irows : int
          Number of rows of size ires pixels to be partitioned from source image.
      icols : int
          Number of columns of size ires pixels to be partitioned from source image.
      ores : tuple of int
          Input images are scaled to size ores pixels prior to splitting.
      ires : tuple of int
          Output images are of size ires pixels.
  
      Returns
      --------
      names : list of str
          List of output image filenames
  
      Examples
      --------
      >>> partition_im('your/sample/image.tif', irows=8, icols=8, ires=(256, 256))
  
      """
      test = sio.imread(tiffname)
      oshape = test.shape
      test2 = np.zeros((oshape[0], ores[0], ores[1]), dtype=test.dtype)
      test2[0:oshape[0], 0:oshape[1], :] = test
  
      new_image = np.zeros((oshape[0], ires[0], ires[1]), dtype=test.dtype)
      names = []
  
      for row in range(irows):
          for col in range(icols):
              new_image = test2[:, row*ires[0]:(row+1)*ires[0],
                                col*ires[1]:(col+1)*ires[1]]
              current = tiffname.split('.tif')[0] + '_%s_%s.tif' % (row, col)
              sio.imsave(current, new_image)
              names.append(current)
  
      return names
code_tokens: def partition_im ( tiffname , irows = 4 , icols = 4 , ores = ( 2048 , 2048 ) , ires = ( 512 , 512 ) ) : test = sio . imread ( tiffname ) oshape = test . shape test2 = np . zeros ( ( oshape [ 0 ] , ores [ 0 ] , ores [ 1 ] ) , dtype = test . dtype ) test2 [ 0 : oshape [ 0 ] , 0 : oshape [ 1 ] , : ] = test new_image = np . zeros ( ( oshape [ 0 ] , ires [ 0 ] , ires [ 1 ] ) , dtype = test . dtype ) names = [ ] for row in range ( irows ) : for col in range ( icols ) : new_image = test2 [ : , row * ires [ 0 ] : ( row + 1 ) * ires [ 0 ] , col * ires [ 1 ] : ( col + 1 ) * ires [ 1 ] ] current = tiffname . split ( '.tif' ) [ 0 ] + '_%s_%s.tif' % ( row , col ) sio . imsave ( current , new_image ) names . append ( current ) return names
short_docstring: Partitions image into smaller images.
short_docstring_tokens: Partitions image into smaller images .
comment: """Partitions image into smaller images.
  
      Partitions a large image into irows x icols images of size ires and write
      them to the drive. Default input image sizes are from a Nikon/Hamamatsu
      camera setup (2048 x 2044 pixels).
  
      Parameters
      ----------
      tiffname : string
          Location of input image to be partitioned.
      irows : int
          Number of rows of size ires pixels to be partitioned from source image.
      icols : int
          Number of columns of size ires pixels to be partitioned from source image.
      ores : tuple of int
          Input images are scaled to size ores pixels prior to splitting.
      ires : tuple of int
          Output images are of size ires pixels.
  
      Returns
      --------
      names : list of str
          List of output image filenames
  
      Examples
      --------
      >>> partition_im('your/sample/image.tif', irows=8, icols=8, ires=(256, 256))
  
      """