-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding in python viz scripts that are more generic.
- Loading branch information
1 parent
7e0ccb5
commit afd5ea0
Showing
12 changed files
with
187 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,19 @@ | ||
# Python Imaging | ||
# Python Visualizations | ||
|
||
In an effort to create some better imaging to view cells, ECM components and other things simultaneously, these scripts have been written. | ||
`image_processing_for_physicell.py` contains the class `PhysiCellPlotter`. This class enables reproducible visualization with many options - including setting which layers to include (cell, ECM components, diffusing fields), positional tracking of cell movement history, and smoothly generating stills and movies sequentially. It uses a modified version of [`pyMCDS.py`](https://github.com/PhysiCell-Tools/python-loader) - `pyMCDS_ECM.py`. The modifications include loading ECM data .mat outputs and formatting that data for use in visualizations. | ||
|
||
|
||
## Scripts | ||
|
||
* `basic_cell_plot.py`: create a plot with Cells plotted. | ||
* `basic_oxygen_density.py`: Plot the density of oxygen. | ||
* `basic_ecm_density.py`: Plot the ECM density. | ||
* `basic_ecm_anisotropy.py`: Plot the ECM anisotropy. | ||
|
||
## ToDo | ||
* Read in data | ||
* ECM anisotropy plot | ||
* ECM alignment plot | ||
* Overlap all elements / modularity | ||
* Panels | ||
|
||
## Other stuff | ||
|
||
### Helpful function to load in ECM matlab data | ||
``` | ||
import scipy.io as sci | ||
|
||
sim_frame = 'output00001192' # The name of the simulation frame (eg. `initial`, `output00001192`). This is not the file name | ||
output_path = 'example_output' # The folder with all the output data | ||
Advanced scripts - using the PhysiCellPlotter class in `image_processing_for_physicell.py`. Place scripts in `output` or other directory at same level or alter path assignment. | ||
* | ||
|
||
def load_ecm_data(file_name): | ||
mat = sci.loadmat(file_name)['ECM_Data'] | ||
data = {"x":mat[0], "y":mat[1], "z":mat[2], "anisotropy":mat[3], "density":mat[4], "fiber_alignment_x":mat[5], "fiber_alignment_y":mat[6], "fiber_alignment_z":mat[7], "gradient_x":mat[8], "gradient_y":mat[9], "gradient_z":mat[10]} | ||
|
||
return data | ||
# load data | ||
ecm_data = load_ecm_data(output_path + '/' + sim_frame + '_ECM.mat') | ||
``` | ||
Basic scripts. Original basis for integrated plotter in `image_processing_for_physicell.py`. Included as basic original examples. Place scripts in `output` or other directory at same level or alter path assignment. | ||
* `basic_cell_plot.py`: create a plot with Cells plotted. | ||
* `cell_plus_environment_movie_maker.py`: Generates a movie of the ECM anisotorpy and orientations with cell overlay. Alter as needed for need. | ||
* `cell_plus_environment_plotter.py`: Generates a still of the ECM anisotorpy and orientations with cell overlay. Alter as needed for need. | ||
* `cell_track_plotter.py`: Plots still of cells and cell positional histories. | ||
* `cell_tracker_movie.py`: Generates a movie of cells and cell positional histories. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.