Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

743 changes: 743 additions & 0 deletions DeepTrack 1.0/.ipynb_checkpoints/dev-checkpoint.ipynb

Large diffs are not rendered by default.

665 changes: 665 additions & 0 deletions DeepTrack 1.0/DEV - DeepTrack - Example 1b - Training.ipynb

Large diffs are not rendered by default.

8,985 changes: 8,985 additions & 0 deletions DeepTrack 1.0/DEV - DeepTrack - Example 3 - Tracking multiple particles.ipynb

Large diffs are not rendered by default.

460 changes: 460 additions & 0 deletions DeepTrack 1.0/DT_extension_dev.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion DeepTrack 1.0/DeepTrack - Example 1b - Training.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1775,7 +1775,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.6.9"
}
},
"nbformat": 4,
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
391 changes: 0 additions & 391 deletions DeepTrack 1.0/DeepTrack - Example 2 - Tracking single particle.ipynb

This file was deleted.

Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
1,001 changes: 0 additions & 1,001 deletions DeepTrack 1.0/DeepTrack - Example 4 - Tracking multiple particles.ipynb

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
756 changes: 0 additions & 756 deletions DeepTrack 1.0/DeepTrack - Example 6 - Tracking vesicles.ipynb

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file removed DeepTrack 1.0/Video1.mp4
Binary file not shown.
Binary file removed DeepTrack 1.0/Video2.mp4
Binary file not shown.
Binary file removed DeepTrack 1.0/Video3.mp4
Binary file not shown.
Binary file removed DeepTrack 1.0/Video4.mp4
Binary file not shown.
Binary file removed DeepTrack 1.0/Video5.mp4
Binary file not shown.
Binary file removed DeepTrack 1.0/Video6.mp4
Binary file not shown.
Binary file removed DeepTrack 1.0/Video7.mp4
Binary file not shown.
Binary file removed DeepTrack 1.0/Video8.mp4
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
17 changes: 16 additions & 1 deletion DeepTrack 1.0/deeptrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def get_image_parameters(
return image_parameters

def generate_image(image_parameters):

"""Generate image with particles.

Input:
Expand All @@ -92,7 +93,8 @@ def generate_image(image_parameters):
Output:
image: image of the particle [2D numpy array of real numbers betwen 0 and 1]
"""



from numpy import meshgrid, arange, ones, zeros, sin, cos, sqrt, clip, array
from scipy.special import jv as bessel
from numpy.random import poisson as poisson
Expand All @@ -110,6 +112,7 @@ def generate_image(image_parameters):
ellipsoidal_orientation_list = image_parameters['Ellipsoid Orientation']
ellipticity = image_parameters['Ellipticity']


### CALCULATE IMAGE PARAMETERS
# calculate image full size
image_size = image_half_size * 2 + 1
Expand All @@ -120,6 +123,9 @@ def generate_image(image_parameters):
sparse=False,
indexing='ij')




### CALCULATE BACKGROUND
# initialize the image at the background level
image_background = ones((image_size, image_size)) * image_background_level
Expand All @@ -129,15 +135,20 @@ def generate_image(image_parameters):
image_background = image_background + gradient_intensity * (image_coordinate_x * sin(gradient_direction) +
image_coordinate_y * cos(gradient_direction) ) / (sqrt(2) * image_size)



### CALCULATE IMAGE PARTICLES
image_particles = zeros((image_size, image_size))
for particle_center_x, particle_center_y, particle_radius, particle_bessel_orders, particle_intensities, ellipsoidal_orientation in zip(particle_center_x_list, particle_center_y_list, particle_radius_list, particle_bessel_orders_list, particle_intensities_list, ellipsoidal_orientation_list):


# calculate the radial distance from the center of the particle
# normalized by the particle radius
radial_distance_from_particle = sqrt((image_coordinate_x - particle_center_x)**2
+ (image_coordinate_y - particle_center_y)**2
+ .001**2) / particle_radius


# for elliptical particles
rotated_distance_x = (image_coordinate_x - particle_center_x)*cos(ellipsoidal_orientation) + (image_coordinate_y - particle_center_y)*sin(ellipsoidal_orientation)
rotated_distance_y = -(image_coordinate_x - particle_center_x)*sin(ellipsoidal_orientation) + (image_coordinate_y - particle_center_y)*cos(ellipsoidal_orientation)
Expand All @@ -147,17 +158,21 @@ def generate_image(image_parameters):
+ (rotated_distance_y / ellipticity)**2
+ .001**2) / particle_radius


# calculate particle profile
for particle_bessel_order, particle_intensity in zip(particle_bessel_orders, particle_intensities):
image_particle = 4 * particle_bessel_order**2.5 * (bessel(particle_bessel_order, elliptical_distance_from_particle) / elliptical_distance_from_particle)**2
image_particles = image_particles + particle_intensity * image_particle



# calculate image without noise as background image plus particle image
image_particles_without_noise = clip(image_background + image_particles, 0, 1)

### ADD NOISE
image_particles_with_noise = poisson(image_particles_without_noise * signal_to_noise_ratio**2) / signal_to_noise_ratio**2


return image_particles_with_noise

def get_image_generator(image_parameters_function=lambda : get_image_parameters(), max_number_of_images=1e+9):
Expand Down
744 changes: 744 additions & 0 deletions DeepTrack 1.0/dev.ipynb

Large diffs are not rendered by default.