Matlab
load_array(file_name, var_names)
This is used to load info from v7.3 or later matlab files. It is also good at dealing with complicated matlab cell arrays which are loaded as numpy object arrays.
If var_names
is str
, one value is returned, otherwise tuple
of all values requested is returned.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_name |
str
|
Path of MATLAB file. |
required |
var_names |
Union[str, List[str]]
|
|
required |
Returns:
Type | Description |
---|---|
Union[tuple, np.ndarray]
|
|
Source code in coppafish/utils/matlab.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
load_cell(file_name, var_name)
If cell is M x N
, will return list of length M
where each entry is another list of length N
and each element of this list is a numpy array.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_name |
str
|
Path of MATLAB file. |
required |
var_name |
str
|
Names of variable in MATLAB file. |
required |
Returns:
Type | Description |
---|---|
list
|
MATLAB cell |
Source code in coppafish/utils/matlab.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
load_v_less_7_3(file_name, var_names)
This is used to load info from earlier than v7.3 matlab files. It is also good at dealing with complicated matlab cell arrays which are loaded as numpy object arrays.
If var_names
is str
, one value is returned, otherwise tuple of all values requested is returned.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
file_name |
str
|
Path of MATLAB file. |
required |
var_names |
Union[str, List[str]]
|
|
required |
Returns:
Type | Description |
---|---|
Union[tuple, np.ndarray]
|
|
Source code in coppafish/utils/matlab.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
save_nb_results(nb, file_name, score_thresh_ref_spots=0.15, score_thresh_omp=0.15)
Saves important information in notebook as a .mat file so can load in MATLAB and plot using python_testing/iss_object_from_python.m scripts
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nb |
Notebook
|
Notebook containing at least |
required |
file_name |
str
|
Path to save matlab version of Notebook. |
required |
score_thresh_ref_spots |
float
|
Only |
0.15
|
score_thresh_omp |
float
|
Only |
0.15
|
Source code in coppafish/utils/matlab.py
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
|
update_dict(nbp, nb, spots_info_dict, score_thresh)
Used in save_nb_results
to reduced amount of spots saved. Only spots with score > score_thresh
kept.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nbp |
NotebookPage
|
Either |
required |
nb |
Notebook
|
Full notebook |
required |
spots_info_dict |
dict
|
Dictionary produced in |
required |
score_thresh |
float
|
All spots with a score above this threshold will be returned. |
required |
Returns:
Type | Description |
---|---|
dict
|
|
Source code in coppafish/utils/matlab.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
|