Guest User

Untitled

a guest
Jul 20th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. # Copy/paste into the Avizo/Amira Python console.
  2. # Alternatively, save to a file, add that file to your path, and import.
  3. # See docstring for usage.
  4. def get_cell_contents(tablelike_object,row,column,table=0):
  5. """
  6. Retrieves contents of cell i,j in a table through
  7. HxSpreadSheetInterface.
  8.  
  9. You must use the object handle, not just the name of the object! For example,
  10. to get the contents of row 4 from column 5 of a HxLabelAnalysis data object
  11. named "chocolate-bar.Label-Analysis" with only one tab:
  12.  
  13. >>> spreadsheet_data = hx_project.get('chocolate-bar.Label-Analysis')
  14. >>> cell_value = get_cell_contents(spreadsheet_data,4,5)
  15.  
  16. Parameters
  17. ----------
  18. tablelike_object : HxLabelAnalysis, HxSpreadSheet, HxImageAnalysis
  19. The handle to the table-like object.
  20. row : Int
  21. Row number from which to retrieve value (starting at 0).
  22. column : Int
  23. Column number from which to retrieve value (starting at 0).
  24. table : Int
  25. Table (i.e. tab) from which to retrieve value (starting at 0).
  26. Defaults to the first (or only) tab. Useful for results of
  27. spatial graphs, where there are 3+ tabs.
  28.  
  29. Returns
  30. -------
  31. out : See note
  32. Contents of the specified cell.
  33. Note: returned valued has same type of column the item is
  34. received from.
  35. """
  36. ssi = tablelike_object.all_interfaces.HxSpreadSheetInterface
  37. return ssi.tables[table].items[row,column]
Add Comment
Please, Sign In to add comment