diff --git a/Readme.md b/Readme.md
index 16454c2..d63a31b 100644
--- a/Readme.md
+++ b/Readme.md
@@ -1,6 +1,6 @@
-October 31, 2024
+November 1, 2024
-Version: 1.1.1
+Version: 1.1.2
diff --git a/myptv/segmentation_mod.py b/myptv/segmentation_mod.py
index 3ba5ef4..913d559 100644
--- a/myptv/segmentation_mod.py
+++ b/myptv/segmentation_mod.py
@@ -8,13 +8,18 @@
contains a class for segmentation of circular particles
"""
-from tracking_2D_mod import track_2D_multiframe
+from myptv.tracking_2D_mod import track_2D_multiframe
from myptv.TsaiModel.camera import camera_Tsai
+from myptv.tracking_mod import fill_in_trajectory
-from numpy import ones, savetxt, meshgrid
+from pandas import read_csv
+
+from numpy import ones, savetxt, meshgrid, float32
from numpy import sum as npsum
from numpy import abs as npabs
from numpy import median as npmedian
+from numpy import array
+from numpy import append as npappend
from skimage.io import imread
from skimage import io
@@ -101,13 +106,23 @@ def __init__(self, image, sigma=None, threshold=10, mask=1.0,
def local_filter(self, image):
'''returns a new image where the local mean neighbourhood of
each pixel is subtracted.'''
- w = self.loc_filter
- window = ones((w, w)) / w**2
- local_mean = convolve2d(image, window, mode='same')
- new_im = image - local_mean
- new_im[new_im<0] = 0
- new_im = new_im.astype('uint8')
- return new_im
+ # w = self.loc_filter
+ # window = ones((w, w)) / w**2
+ # local_mean = convolve2d(image, window, mode='same')
+ # new_im = image - local_mean
+ # new_im[new_im<0] = 0
+ # new_im = new_im.astype('uint8')
+
+ S = self.loc_filter
+ flt = image.astype(float32) #/ 255.0
+ blur = gaussian_filter(flt, S)
+ num = flt - blur
+
+ blur = gaussian_filter(num*num, S)
+ den = blur**0.5
+ normed = num / den
+
+ return image * (normed>1)
@@ -610,10 +625,6 @@ def save_results(self, fname):
-from numpy import array
-from numpy import append as npappend
-from pandas import read_csv
-from tracking_mod import fill_in_trajectory
class tracking_augmented_segmentation(track_2D_multiframe):
diff --git a/setup.py b/setup.py
index f9dbea0..740d65a 100644
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,7 @@
setup(
name='myptv',
packages=find_packages(include=['myptv', 'myptv.fibers', 'myptv.TsaiModel', 'myptv.extendedZolof', 'myptv.makePlots', 'myptv.sheets']),
- version='1.1.1',
+ version='1.1.2',
description='A 3D Particle Tracking Velocimetry library',
install_requires=['numpy', 'scipy', 'scikit-image','pandas','matplotlib','pyyaml', 'tk', 'Pillow>=9.5.0'],
author='Ron Shnapp',
diff --git a/user_manual/user_manual.aux b/user_manual/user_manual.aux
index 4cc6f55..4634128 100644
--- a/user_manual/user_manual.aux
+++ b/user_manual/user_manual.aux
@@ -97,31 +97,33 @@
\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.3.1}How to segment in MyPTV}{14}{subsubsection.3.3.1}}
\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.3.2}Two methods of segmentation}{14}{subsubsection.3.3.2}}
\citation{Bourgoin2020}
-\@writefile{lof}{\contentsline {figure}{\numberline {9}{\ignorespaces The effect oft various image filters on the segmentation.\relax }}{15}{figure.caption.13}}
-\newlabel{fig:image_filters}{{9}{15}{The effect oft various image filters on the segmentation.\relax }{figure.caption.13}{}}
-\@writefile{lof}{\contentsline {figure}{\numberline {10}{\ignorespaces An example showing that segmentation using the dilation method can be very useful when segmenting large objects as it can resolve overlap issues.\relax }}{15}{figure.caption.14}}
-\newlabel{fig:Labeling_vs_Dilation}{{10}{15}{An example showing that segmentation using the dilation method can be very useful when segmenting large objects as it can resolve overlap issues.\relax }{figure.caption.14}{}}
+\@writefile{lof}{\contentsline {figure}{\numberline {9}{\ignorespaces An example showing that segmentation using the dilation method can be very useful when segmenting large objects as it can resolve overlap issues.\relax }}{15}{figure.caption.13}}
+\newlabel{fig:Labeling_vs_Dilation}{{9}{15}{An example showing that segmentation using the dilation method can be very useful when segmenting large objects as it can resolve overlap issues.\relax }{figure.caption.13}{}}
+\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.3.3}Segmentation filters}{15}{subsubsection.3.3.3}}
+\newlabel{sec:segment_filters}{{3.3.3}{15}{Segmentation filters}{subsubsection.3.3.3}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.4}Matching}{15}{subsection.3.4}}
\newlabel{sec:workflow_match}{{3.4}{15}{Matching}{subsection.3.4}{}}
\citation{Ouellette2006}
-\citation{Luthi2005}
-\citation{Xu2008}
+\@writefile{lof}{\contentsline {figure}{\numberline {10}{\ignorespaces The effect oft various image filters on the segmentation.\relax }}{16}{figure.caption.14}}
+\newlabel{fig:image_filters}{{10}{16}{The effect oft various image filters on the segmentation.\relax }{figure.caption.14}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.5}Tracking}{16}{subsection.3.5}}
\newlabel{sec:workflow_track}{{3.5}{16}{Tracking}{subsection.3.5}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.6}Calibration with particles}{16}{subsection.3.6}}
\newlabel{sec:workflow_calibration_with_particles}{{3.6}{16}{Calibration with particles}{subsection.3.6}{}}
-\@writefile{toc}{\contentsline {subsection}{\numberline {3.7}Smoothing}{16}{subsection.3.7}}
-\newlabel{sec:workflow_smooth}{{3.7}{16}{Smoothing}{subsection.3.7}{}}
+\citation{Luthi2005}
+\citation{Xu2008}
\@writefile{lof}{\contentsline {figure}{\numberline {11}{\ignorespaces An example for experimental setup for 2D tracking. Note that the camera doesn't have to be perpendicular to the particles' plane and that the particles don't have to be at $z=0$. \relax }}{17}{figure.caption.20}}
\newlabel{fig:2D_tracking}{{11}{17}{An example for experimental setup for 2D tracking. Note that the camera doesn't have to be perpendicular to the particles' plane and that the particles don't have to be at $z=0$. \relax }{figure.caption.20}{}}
+\@writefile{toc}{\contentsline {subsection}{\numberline {3.7}Smoothing}{17}{subsection.3.7}}
+\newlabel{sec:workflow_smooth}{{3.7}{17}{Smoothing}{subsection.3.7}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.8}Stitching}{17}{subsection.3.8}}
\newlabel{sec:workflow_stitch}{{3.8}{17}{Stitching}{subsection.3.8}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.9}2D tracking guide}{17}{subsection.3.9}}
\newlabel{sec:2D_tracking}{{3.9}{17}{2D tracking guide}{subsection.3.9}{}}
-\@writefile{toc}{\contentsline {subsection}{\numberline {3.10}Manual Matching GUI}{17}{subsection.3.10}}
-\newlabel{sec:man_match}{{3.10}{17}{Manual Matching GUI}{subsection.3.10}{}}
\citation{Shnapp2023}
\citation{Shnapp2023}
+\@writefile{toc}{\contentsline {subsection}{\numberline {3.10}Manual Matching GUI}{18}{subsection.3.10}}
+\newlabel{sec:man_match}{{3.10}{18}{Manual Matching GUI}{subsection.3.10}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.11}Fiber tracking}{18}{subsection.3.11}}
\newlabel{sec:fibers}{{3.11}{18}{Fiber tracking}{subsection.3.11}{}}
\@writefile{toc}{\contentsline {subsection}{\numberline {3.12}Plotting the results}{18}{subsection.3.12}}
diff --git a/user_manual/user_manual.log b/user_manual/user_manual.log
index 3431185..8543484 100644
--- a/user_manual/user_manual.log
+++ b/user_manual/user_manual.log
@@ -1,4 +1,4 @@
-This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian) (preloaded format=pdflatex 2023.7.13) 31 OCT 2024 18:21
+This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian) (preloaded format=pdflatex 2023.7.13) 1 NOV 2024 11:43
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
@@ -497,7 +497,7 @@ LaTeX Info: Redefining \nameref on input line 50.
\@outlinefile=\write3
\openout3 = `user_manual.out'.
-<./figs/logo.png, id=233, 695.7192pt x 152.0079pt>
+<./figs/logo.png, id=237, 695.7192pt x 152.0079pt>
File: ./figs/logo.png Graphic file (type png)