Keep track of where the user gets the images.

* src/manualRosetteDetect/rosettedetect_gui.m(put_image_in_axis): Put relevant
directory in handles.current_dir.
Only continue when error type is expected

* src/manualRosetteDetect/segmentRosette_mask.m(segmentRosette_mask): The
error string is segmentRosette_mask not segmentRosette_sqr.
* src/manualRosetteDetect/analyzeImgRosette.m(analyzeImgRosette): Catch the
error in err variable. Continue with loop if error is of expected type;
otherwise, rethrow the error.
Create a more general getKMeansVecMask method.

We can now accept multidimensional data sets.
* src/manualRosetteDetect/getKMeansVecMask.m(getKMeansVecMask): Add the
argument description in the function documentation. We use pdist2 and means to
calculate the distance and mean values of the multidimensional arrays.
* src/manualRosetteDetect/segmentRosette_mask.m(segmentRosette_mask): Modify
mean starting values that are passed to the getKMeansVecMask method.
* src/manualRosetteDetect/segmentRosette_sqr.m(segmentRosette_sqr): Modify the
mean starting value as well as the way we reshape the image before passing
them to the new getKMeansVecMask.
Add logic to segmentRosette_sqr to use the new getKMeansVecMask

* src/manualRosetteDetect/segmentRosette_sqr.m(segmentRosette_sqr): Call
a new getKMeansMask method (Remove the M argument).
(getKMeansMask): Call getFeatures to transform the subimg into a 4 dimensional
feature image. Remove image normalization, we will do it in getFeatures.
* src/manualRosetteDetect/getFeatures.m(getFeatures): New file to calculate
CIELa*b*, texture and excess green transformations.
* src/manualRosetteDetect/rgb2lab.m(rgb2lab): New method to transform images
into CIELa*b* color space.
Normalize in getFeatures.

* src/manualRosetteDetect/getFeatures.m(getFeatures): Add proper 4 space
tabulation. Normalize all transformations and adjust a* of La*b* values.
* src/manualRosetteDetect/segmentRosette_sqr.m(getKMeansMask): Remove logic to
normalize feature values.
Change the call to getKMeansVecMask.

* src/manualRosetteDetect/segmentRosette_mask.m(segmentRosette_mask): Use
getFeatures to calculate the feature space and construct a new vector to pass
to getKMeansVecMask.
Relax the condition of rosette search.

We now stop when we see more than 98 percent of border pixels that are 1.
* src/manualRosetteDetect/rosettedetect_gui.m(imgseries_Callback): Remove
unneeded debugging line.
(vector_Callback): We are not saving rosettes for now.
* src/manualRosetteDetect/segmentRosette_mask.m(segmentRosette_mask): Stop
when less than 2 percent of perimeter is 0.
* src/manualRosetteDetect/segmentRosette_sqr.m(segmentRosette_sqr): Likewise.
Search for the two biggest connected components

... Instead of the only two connected components.
* src/leafscan/leafscanimg.m(leafscanimg): We keep the two connected
components that are larger. And we replace them when we find a segmentation
that has less connected components. The square is still the one closest to the
lower left corner.
Add new file with active contour logic

We find the consecutive rosettes with active contours.
* src/manualRosetteDetect/segmentRosette_levelset.m(segmentRosette_levelset):
New method to handle active contour logic.
(activeContours): New method to run the active contour algorithm.
Call the new method from analyzeImgRosette.

* src/manualRosetteDetect/analyzeImgRosette.m(analyzeImgRosette): Call the new
contour method (segmentRosette_levelset).
Do normalization outside getFeatures.

* src/manualRosetteDetect/getFeatures.m(getFeatures): Do normalization outside
method
* src/manualRosetteDetect/segmentRosette_mask.m(segmentRosette_mask): Do
normalization after getFeatures call.
* src/manualRosetteDetect/segmentRosette_sqr.m(getKMeansMask): Likewise.
Adjust contour levelset values.

We are adjusting maxiter, growth and perimeter proportion of error. The most
important here being growth as it will fail with a 'big' growth (no contours
are found) but it will also fail with a 'small' growth as it will not get the
growth of the plant.
* src/manualRosetteDetect/segmentRosette_levelset.m(segmentRosette_levelset):
We change the way we calculate the growth. Now it will be 5 or less. We need
to put this variable as a method argument.
(segmentRosette_levelset): We are just doing a mask swelling instead of a
swelling and a dillation. This give a better starting point for the contour
algorithm in the next image.
(segmentRosette_levelset): We throw an error if the mask we detect has more
than 10% 1's in the perimeter.
(activeContours): We calculate all smoothing variables outside the loop.
(activeContours): We use imgradient instead of gradient. It make code more
readable.
Change the name of the mask in the rosettes to mask.

* src/manualRosetteDetect/rosettedetect_gui.m
(populate_rosette_struct_from_lines): Populate rosette structure with mask
instead of subimg as the mask name.
* src/manualRosetteDetect/analyzeImgRosette.m(analyzeImgRosette): Change
subimg to mask.
* src/manualRosetteDetect/segmentRosette_mask.m(segmentRosette_mask): Likewise
* src/manualRosetteDetect/segmentRosette_sqr.m(segmentRosette_sqr): Likewise
Keep track of the previous subimg for the bayes cals.

* src/manualRosetteDetect/analyzeImgRosette.m(analyzeImgRosette): Replicate
rosettes(i).subimg and assign its value when we find a good segmentation.
* src/manualRosetteDetect/rosettedetect_gui.m
(populate_rosette_struct_from_lines): Initialize rosettes.subimg with the []
value.
Introduce segmentation based on naive bayesian

Notice that the model does not necessarily need color pixel values. It will
work with all image values even texture transforms.
* src/manualRosetteDetect/segmentRosette_NBayes.m(segmentRosettes_NBayes): New
method that does forward rosette segmentation based on a Naive Bayesian Model
of individual pixel values.
(getBayesModel): New method to calculate probabilities for individual pixel
bins effectively creating the model.
(getBayesClassify): New method to classify new pixel values with existing
model.
Matrix indexes must be integer.

* src/manualRosetteDetect/analyzeImgRosette.m(analyzeImgRosette): We cast the
indexes to integer64.
Adjust the mask at end of method.

* src/manualRosetteDetect/segmentRosette_NBayes.m(segmentRosettes_NBayes): Add
code to throw an exception if we don't find a rosette. Additionally adjust the
rosette enclosing square before returning.
Add logic to calculate maxgrowth

Additionally, add relevant documentation to method.
* src/manualRosetteDetect/segmentRosette_NBayes.m(segmentRosette_NBayes):
Removed an 's' from the name of the method to make it equal to the name of the
file. Add steps and assumptions to the documentation of the method. Add logic
to calculate maxgrowth.
Fix error.

* src/manualRosetteDetect/segmentRosette_NBayes.m(segmentRosette_NBayes):
Replace imgRange with maskRange.
Call segmentRosette_NBayes from analyzeImgRosette.

* src/manualRosetteDetect/analyzeImgRosette.m(analyzeImgRosette): Call
segmentRosette_NBayes from analyzeImgRosette method.