Module Expr Str Import alias identifier Import alias Import alias Import alias Import alias Import alias Import alias identifier ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Assign AttributeStore NameLoad attr Call NameLoad orelse Assign NameStore ListLoad Str Str Str Str Str Str Str For NameStore NameLoad body Expr Call NameLoad NameLoad NameLoad Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults ListLoad body Expr Str Assign NameStore Call NameLoad Assign NameStore NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign TupleStore AttributeStore NameLoad attr NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr Call NameLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call NameLoad BinOpAdd Str NameLoad orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword NameLoad keyword NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore ListLoad Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str For NameStore NameLoad body Expr Call NameLoad NameLoad NameLoad Call NameLoad NameLoad NameLoad Delete AttributeDel NameLoad attr Delete AttributeDel NameLoad attr Delete AttributeDel NameLoad attr Delete AttributeDel NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Delete AttributeDel NameLoad attr Delete AttributeDel NameLoad attr Delete AttributeDel NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Delete AttributeDel NameLoad attr Delete AttributeDel NameLoad attr Delete AttributeDel NameLoad attr Delete AttributeDel NameLoad attr Delete AttributeDel NameLoad attr Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Delete AttributeDel NameLoad attr Assign AttributeStore NameLoad attr BinOpAdd BinOpAdd BinOpAdd AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Delete AttributeDel NameLoad attr Delete AttributeDel NameLoad attr Delete AttributeDel NameLoad attr Delete AttributeDel NameLoad attr Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Return AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body With Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str keyword NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num keyword NameLoad Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Return AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Assign NameStore AttributeLoad NameLoad attr Assign NameStore BinOpSub SubscriptLoad NameLoad ExtSlice Index Num Slice Slice SubscriptLoad NameLoad ExtSlice Index Num Slice Slice Assign AttributeStore NameLoad attr BinOpMult Call AttributeLoad NameLoad attr BinOpDiv SubscriptLoad NameLoad ExtSlice Index Num Slice SubscriptLoad NameLoad ExtSlice Index Num Slice BinOpDiv Num AttributeLoad NameLoad attr Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr ExtSlice Index Num Index Num Slice decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Return AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Assign NameStore AttributeLoad NameLoad attr If CompareNotEq AttributeLoad NameLoad attr Num body Assign NameStore BinOpMult Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BinOpSub NameLoad NameLoad orelse Assign AttributeStore NameLoad attr NameLoad Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Return AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Assign NameStore AttributeLoad NameLoad attr Assign NameStore BinOpMult UnaryOpUSub NameLoad BinOpDiv AttributeLoad NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr ListLoad ListLoad Call AttributeLoad NameLoad attr NameLoad UnaryOpUSub Call AttributeLoad NameLoad attr NameLoad ListLoad Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Assign NameStore ListLoad For NameStore Call NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call AttributeLoad SubscriptLoad NameLoad ExtSlice Slice Slice Index NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Slice Index NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Num Num Num Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str TryExcept body Return AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults Str body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad If CompareLt Call NameLoad AttributeLoad NameLoad attr Num body Raise Call NameLoad Str Return TupleLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index NameLoad Slice Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index NameLoad Slice decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr keyword NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr keyword NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If NameLoad body Return Call AttributeLoad NameLoad attr TupleLoad AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Num Slice Slice orelse Return Call AttributeLoad NameLoad attr TupleLoad AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Num Num Num Slice Slice decorator_list FunctionDef arguments args NameParam defaults body Return SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index Num Slice decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index Num Slice decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index Num Slice decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index Num Slice decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index Num Slice decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index Num Slice decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index Num Slice decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index Num Slice decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListLoad Str Str Str Str Str Str Str Str Str Str Return Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad keyword Num keyword ListLoad Str decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr ExtSlice Index NameLoad Slice Slice Assign NameStore SubscriptLoad AttributeLoad NameLoad attr ExtSlice Index NameLoad Slice Slice Assign NameStore SubscriptLoad AttributeLoad NameLoad attr ExtSlice Index NameLoad Index Num Slice Assign NameStore SubscriptLoad AttributeLoad NameLoad attr ExtSlice Index NameLoad Index Num Slice Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Index Num Slice SubscriptLoad NameLoad ExtSlice Index Num Slice Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Index Num Slice SubscriptLoad NameLoad ExtSlice Index Num Slice Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad Call AttributeLoad NameLoad attr attr Str keyword Str Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Slice Index NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Slice Index NameLoad Assign NameStore SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Slice Index NameLoad Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num SubscriptLoad NameLoad ExtSlice Slice Index Num keyword Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num SubscriptLoad NameLoad ExtSlice Slice Index Num keyword Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index Num SubscriptLoad NameLoad ExtSlice Slice Index Num keyword Str Expr Call AttributeLoad Call AttributeLoad NameLoad attr attr Str keyword Str Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Slice Index NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Num body Expr Str Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Index Num Index NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Slice Index Num Index NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Str keyword Num Expr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword Num Assign NameStore Call NameLoad GeneratorExp Call NameLoad NameLoad comprehension NameStore Call NameLoad Num Call NameLoad NameLoad For TupleStore NameStore TupleStore NameStore NameStore NameStore Call NameLoad Call NameLoad NameLoad NameLoad NameLoad body If CompareLtE NameLoad BinOpSub BinOpFloorDiv Call NameLoad NameLoad Num Num body Assign NameStore TupleLoad Num Num orelse Assign NameStore TupleLoad Num Num Expr Call AttributeLoad NameLoad attr NameLoad keyword TupleLoad NameLoad NameLoad keyword NameLoad keyword Str keyword Str keyword Str keyword Call NameLoad keyword Str keyword Str keyword Num keyword Call NameLoad keyword Str keyword Str decorator_list NameLoad decorator_list
N/A N/A 
This module defines the NormalizedWorm class

 N/A numpy np N/A scipy.io N/A collections N/A copy N/A warnings N/A os N/A matplotlib.pyplot plt N/A config utils basic_worm WormPartition basic_worm BasicWorm pre_features WormParsing pre_features_helpers WormParserHelpers video_info VideoInfo NormalizedWorm N/A WormPartition N/A N/A 
    Encapsulates the notion of a worm's elementary measurements, scaled
    (i.e. "normalized") to 49 points along the length of the worm.

    The data consists of 7 Numpy arrays (where n is the number of frames):
   - Of shape (49,2,n):
        ventral_contour
        dorsal_contour
        skeleton
    - Of shape (49,n):
        angles
        widths
    - Of shape (n):
        length
        area

    It also contains video metadata, in :
        video_info : An instance of VideoInfo

     __init__ N/A N/A self other N/A None N/A N/A 
        Populates an empty normalized worm.
        If other is specified, this becomes a copy constructor.

         N/A N/A N/A WormPartition __init__ self N/A N/A other None N/A N/A N/A self video_info N/A VideoInfo N/A N/A attributes N/A skeleton ventral_contour dorsal_contour angles widths length areavideo_info N/A a attributes N/A N/A N/A setattr self a N/A N/A copy deepcopy N/A getattr other a N/A from_BasicWorm_factory N/A N/A cls basic_worm frames_to_plot_widths N/A N/A N/A N/A 
        Factory classmethod for creating a normalized worm with a basic_worm
        as input.  This requires calculating all the "pre-features" of
        the worm.

        Parameters
        -----------
        basic_worm: Instance of BasicWorm.  Contains either:
            h_skeleton AND/OR
            h_ventral_contour and h_dorsal_contour
        frames_to_plot_widths: list of ints
            Optional list of frames to plot, to show exactly how the
            widths and skeleton were calculated.

        Returns
        -----------
        An instance of NormalizedWorm

        # TODO: Need to add on testing for normalized data as an input

         N/A nw N/A cls N/A bw basic_worm N/A N/A nw video_info N/A bw video_info N/A N/A N/A bw h_ventral_contour None N/A N/A N/A N/A nw widths h_skeleton N/A N/A WormParsing compute_skeleton_and_widths N/A bw h_ventral_contour N/A bw h_dorsal_contour frames_to_plot_widths N/A N/A nw angles N/A N/A WormParsing compute_angles h_skeleton N/A N/A nw skeleton N/A N/A WormParserHelpers normalize_all_frames_xy h_skeleton N/A config N_POINTS_NORMALIZED N/A N/A nw widths N/A N/A WormParserHelpers normalize_all_frames N/A nw widths h_skeleton N/A config N_POINTS_NORMALIZED N/A N/A nw ventral_contour N/A N/A WormParserHelpers normalize_all_frames_xy N/A bw h_ventral_contour N/A config N_POINTS_NORMALIZED N/A N/A nw dorsal_contour N/A N/A WormParserHelpers normalize_all_frames_xy N/A bw h_dorsal_contour N/A config N_POINTS_NORMALIZED N/A N/A nw area N/A N/A WormParsing compute_area N/A nw contour N/A N/A N/A nw angles N/A N/A WormParsing compute_angles N/A bw skeleton N/A N/A nw skeleton N/A N/A WormParserHelpers normalize_all_frames_xy N/A bw h_skeleton N/A config N_POINTS_NORMALIZED N/A N/A nw ventral_contour None N/A N/A nw dorsal_contour None N/A N/A nw area None N/A N/A nw length N/A N/A WormParsing compute_skeleton_length N/A nw skeleton N/A nw N/A classmethod from_schafer_file_factory N/A N/A cls data_file_path N/A N/A N/A 
        Load full Normalized Worm data from the Schafer File

        data_file_path: the path to the MATLAB file

        These files were created at the Schafer Lab in a format used
        prior to MATLAB's switch to HDF5, which they did in
        MATLAB version 7.3.

         N/A nw N/A cls N/A N/A nw video_info N/A VideoInfo N/A N/A N/A N/A N/A os path isfile data_file_path N/A N/A N/A Exception N/A Data file not found:  data_file_path N/A N/A data_file N/A N/A N/A scipy io loadmat data_file_path squeeze_me True struct_as_record False N/A staging_data N/A data_file N/A s N/A data_keys N/A EIGENWORM_PATH frame_codes vulva_contours non_vulva_contours skeletons angles in_out_touches lengths widths head_areas tail_areas vulva_areas non_vulva_areas x y N/A key data_keys N/A N/A N/A setattr nw key N/A getattr staging_data key N/A N/A nw EIGENWORM_PATH N/A N/A nw x N/A N/A nw y N/A N/A nw in_out_touches N/A N/A nw skeleton N/A nw skeletons N/A N/A nw ventral_contour N/A nw vulva_contours N/A N/A nw dorsal_contour N/A nw non_vulva_contours N/A N/A nw skeletons N/A N/A nw vulva_contours N/A N/A nw non_vulva_contours N/A N/A nw length N/A nw lengths N/A N/A nw head_area N/A nw head_areas N/A N/A nw tail_area N/A nw tail_areas N/A N/A nw vulva_area N/A nw vulva_areas N/A N/A nw non_vulva_area N/A nw non_vulva_areas N/A N/A nw lengths N/A N/A nw head_areas N/A N/A nw tail_areas N/A N/A nw vulva_areas N/A N/A nw non_vulva_areas N/A N/A N/A nw video_info frame_code N/A nw frame_codes N/A N/A nw frame_codes N/A N/A nw area N/A N/A N/A N/A nw head_area N/A nw tail_area N/A nw vulva_area N/A nw non_vulva_area N/A N/A nw head_area N/A N/A nw tail_area N/A N/A nw vulva_area N/A N/A nw non_vulva_area N/A nw N/A classmethod get_BasicWorm N/A N/A self N/A N/A N/A 
        Return an instance of NormalizedSkeletonAndContour containing this
        instance of NormalizedWorm's basic data.

        There is no purpose for this within the standard pipeline - going
        back to a BasicWorm from a NormalizedWorm would only be done
        for verification of code integrity purposes.

        Note that we can't "de-normalize" the worm so if the original
        BasicWorm from which this NormalizedWorm was derived was properly
        heterocardinal, that information is lost.  All frames in our
        generated BasicWorm here will have 49 points and thus will remain
        normalized.

         N/A bw N/A N/A BasicWorm from_contour_factory N/A self ventral_contour N/A self dorsal_contour N/A N/A bw video_info N/A self video_info N/A bw N/A validate N/A N/A self N/A N/A N/A 
        Checks array lengths, etc. to ensure that this is a valid
        instance and no further problems will arise if further
        processing is attempted on this instance

         N/A True N/A rotated N/A N/A self theta_d N/A N/A N/A 
        Returns a NormalizedWorm instance with each frame rotated by
        the amount given in the per-frame theta_d array.

        Parameters
        ---------------------------------------
        theta_d: 1-dimensional ndarray of dtype=float
          The frame-by-frame rotation angle in degrees.
          A 1-dimensional n-element array where n is the number of
          frames, giving a rotation angle for each frame.

        Returns
        ---------------------------------------
        A new NormalizedWorm instance with the same worm, rotated
        in each frame by the requested amount.

         N/A self N/A centre N/A N/A self N/A N/A N/A 
        Frame-by-frame mean of the skeleton points

        Returns
        ---------------------------------------
        A numpy array of length n, where n is the number of
        frames, giving for each frame the mean of the skeleton points.

         N/A N/A N/A N/A self _centre N/A N/A N/A AttributeError N/A N/A N/A N/A warnings catch_warnings N/A N/A N/A N/A warnings simplefilter ignore category RuntimeWarning N/A N/A self _centre N/A N/A np nanmean N/A self skeleton 0 keepdims False N/A N/A self _centre N/A property angle N/A N/A self N/A N/A N/A 
        Frame-by-frame mean of the skeleton points

        Returns
        ---------------------------------------
        A numpy array of length n, giving for each frame
        the angle formed by the first and last skeleton point.

         N/A N/A N/A N/A self _angle N/A N/A N/A AttributeError N/A N/A s N/A self skeleton N/A v N/A N/A s N/A N/A 48 N/A N/A N/A s N/A N/A 0 N/A N/A N/A N/A self _angle N/A N/A N/A np arctan N/A N/A v N/A N/A 1 N/A N/A v N/A N/A 0 N/A N/A 180 N/A np pi N/A N/A self _angle N/A property dropped_frames_mask N/A N/A self N/A N/A N/A 
        Which frames are "dropped", i.e. which frames have the first
        skeleton X-coordinate set to NaN.

        Returns
        ------------------
        boolean numpy array of shape (n,) where n is the number of frames
            True if frame is dropped in the skeleton or contour

        Note
        ------------------
        We are assuming that self.validate() == True, i.e. that the
        skeleton and contour are NaN along all points in frames where
        ANY of the points are NaN.

         N/A N/A N/A np isnan N/A N/A self skeleton N/A N/A 0 N/A 0 N/A N/A property centred_skeleton N/A N/A self N/A N/A N/A 
        Return a skeleton numpy array with each frame moved so the
        centroid of the worm is 0,0

        Returns
        ---------------------------------------
        A numpy array with the above properties.

         N/A N/A N/A N/A self _centred_skeleton N/A N/A N/A AttributeError N/A N/A s N/A self skeleton N/A N/A N/A s size 0 N/A N/A s_mean N/A N/A N/A np ones N/A s shape N/A self centre N/A N/A self _centred_skeleton N/A s s_mean N/A N/A N/A self _centred_skeleton s N/A N/A self _centred_skeleton N/A property orientation_free_skeleton N/A N/A self N/A N/A N/A 
        Perform both a rotation and a translation of the skeleton

        Returns
        ---------------------------------------
        A numpy array, which is the centred and rotated normalized
        worm skeleton.

        Notes
        ---------------------------------------
        To perform this matrix multiplication we are multiplying:
          rot_matrix * s
        This is shape 2 x 2 x n, times 2 x 49 x n.
        Basically we want the first matrix treated as two-dimensional,
        and the second matrix treated as one-dimensional,
        with the results applied elementwise in the other dimensions.

        To make this work I believe we need to pre-broadcast rot_matrix
        into the skeleton points dimension (the one with 49 points) so
        that we have
          2 x 2 x 49 x n, times 2 x 49 x n
        #s1 = np.rollaxis(self.skeleton, 1)

        #rot_matrix = np.ones(s1.shape) * rot_matrix

        #self.skeleton_rotated = rot_matrix.dot(self.skeleton)

         N/A N/A N/A N/A self _orientation_free_skeleton N/A N/A N/A AttributeError N/A N/A orientation N/A self angle N/A a N/A N/A orientation N/A N/A np pi 180 N/A rot_matrix N/A N/A np array N/A N/A N/A N/A np cos a N/A N/A N/A np sin a N/A N/A N/A np sin a N/A N/A np cos a N/A s1 N/A N/A np rollaxis N/A self centred_skeleton 1 N/A s1_rotated N/A N/A frame_index N/A range N/A self num_frames N/A N/A N/A N/A s1_rotated append N/A N/A N/A rot_matrix N/A N/A N/A N/A frame_index dot N/A s1 N/A N/A N/A N/A frame_index N/A s1_rotated N/A N/A np array s1_rotated N/A N/A self _orientation_free_skeleton N/A N/A np rollaxis N/A N/A np rollaxis s1_rotated 0 3 1 N/A N/A self _orientation_free_skeleton N/A property num_frames N/A N/A self N/A N/A N/A 
        The number of frames in the video.

        Returns
        ---------------------------------------
        int
          number of frames in the video

         N/A N/A N/A N/A self _num_frames N/A N/A N/A AttributeError N/A N/A N/A self _num_frames N/A N/A N/A self skeleton shape N/A 2 N/A N/A self _num_frames N/A property position_limits N/A N/A self dimension measurement N/A skeleton N/A N/A 
        Maximum extent of worm's travels projected onto a given axis

        Parameters
        ---------------------------------------
        dimension: specify 0 for X axis, or 1 for Y axis.

        Notes
        ---------------------------------------
        Dropped frames show up as NaN.
        nanmin returns the min ignoring such NaNs.

         N/A d N/A getattr self measurement N/A N/A N/A len N/A d shape 3 N/A N/A N/A Exception Position Limits Is Only Implemented for 2D data N/A N/A N/A N/A np nanmin N/A d N/A N/A N/A dimension N/A N/A N/A np nanmax N/A d N/A N/A N/A dimension N/A N/A contour N/A N/A self N/A N/A N/A N/A N/A self get_contour keep_redundant_points True N/A property contour_without_redundant_points N/A N/A self N/A N/A N/A N/A N/A self get_contour keep_redundant_points False N/A property get_contour N/A N/A self keep_redundant_points N/A True N/A N/A 
        The contour of the worm as one 96-point or 98-point polygon.

        That is:

        Go from ventral_contour shape (49,2,n) and
            dorsal_contour shape (49,2,n) to
            contour with      shape (96,2,n) or (98,2,n)

        Why 96 instead of 49x2 = 98?
        Because the first and last points are duplicates, so if
        keep_redundant_points=False, we omit those on the second set.

        In either case we reverse the contour so that
        it encompasses an "out and back" contour.

         N/A keep_redundant_points N/A N/A N/A N/A np concatenate N/A N/A self ventral_contour N/A N/A self dorsal_contour N/A N/A -1 N/A N/A N/A N/A N/A N/A np concatenate N/A N/A self ventral_contour N/A N/A self dorsal_contour N/A N/A -2 0 -1 N/A N/A N/A contour_x N/A N/A self N/A N/A N/A N/A N/A self contour N/A N/A N/A 0 N/A N/A property contour_y N/A N/A self N/A N/A N/A N/A N/A self contour N/A N/A N/A 1 N/A N/A property skeleton_x N/A N/A self N/A N/A N/A N/A N/A self skeleton N/A N/A N/A 0 N/A N/A property skeleton_y N/A N/A self N/A N/A N/A N/A N/A self skeleton N/A N/A N/A 1 N/A N/A property ventral_contour_x N/A N/A self N/A N/A N/A N/A N/A self ventral_contour N/A N/A N/A 0 N/A N/A property ventral_contour_y N/A N/A self N/A N/A N/A N/A N/A self ventral_contour N/A N/A N/A 1 N/A N/A property dorsal_contour_x N/A N/A self N/A N/A N/A N/A N/A self dorsal_contour N/A N/A N/A 0 N/A N/A property dorsal_contour_y N/A N/A self N/A N/A N/A N/A N/A self dorsal_contour N/A N/A N/A 1 N/A N/A property __eq__ N/A N/A self other N/A N/A N/A 
        Compare this Normalized worm against another.

        TODO: Idea from @JimHokanson:
        Do this on a frame by frame basis, do some sort of distance
        computation rather than all together. This might hide bad frames
        i.e. besides using correlation for comparison, a normalized distance
        comparison that could catch extreme outliers would also be useful

         N/A attribute_list N/A skeleton_x skeleton_y ventral_contour_x ventral_contour_y dorsal_contour_x dorsal_contour_y angles widths length area N/A N/A N/A utils compare_attributes self other attribute_list high_corr_value 0.94 merge_nans_list N/A angles N/A __repr__ N/A N/A self N/A N/A N/A N/A N/A utils print_object self N/A plot_path N/A N/A self posture_index N/A N/A N/A 
        Plot the path of the contour, skeleton and widths

        Parameters
        ----------------
        posture_index: int
            The desired posture point (along skeleton and contour) to plot.

         N/A vc N/A N/A self ventral_contour N/A N/A posture_index N/A N/A N/A nvc N/A N/A self dorsal_contour N/A N/A posture_index N/A N/A N/A skeleton_x N/A N/A self skeleton N/A N/A posture_index N/A 0 N/A N/A skeleton_y N/A N/A self skeleton N/A N/A posture_index N/A 1 N/A N/A N/A N/A plt scatter N/A vc N/A N/A 0 N/A N/A vc N/A N/A 1 N/A N/A N/A N/A plt scatter N/A nvc N/A N/A 0 N/A N/A nvc N/A N/A 1 N/A N/A N/A N/A plt scatter skeleton_x skeleton_y N/A N/A N/A N/A N/A plt gca set_aspect equal adjustable box N/A N/A N/A plt show N/A plot_posture N/A N/A self frame_index N/A N/A N/A 
        Show a scatterplot of the contour, skeleton and widths of frame #frame

        Parameters
        ----------------
        frame_index: int
            The desired frame # to plot.

         N/A vc N/A N/A self ventral_contour N/A N/A N/A N/A frame_index N/A nvc N/A N/A self dorsal_contour N/A N/A N/A N/A frame_index N/A skeleton N/A N/A self skeleton N/A N/A N/A N/A frame_index N/A N/A N/A plt scatter N/A vc N/A N/A N/A 0 N/A vc N/A N/A N/A 1 c red N/A N/A N/A plt scatter N/A nvc N/A N/A N/A 0 N/A nvc N/A N/A N/A 1 c blue N/A N/A N/A plt scatter N/A skeleton N/A N/A N/A 0 N/A skeleton N/A N/A N/A 1 c black N/A N/A N/A N/A N/A plt gca set_aspect equal adjustable box N/A N/A N/A plt show N/A plot_contour N/A N/A self frame_index N/A N/A N/A N/A N/A NormalizedWorm plot_contour_with_labels N/A N/A self contour N/A N/A N/A N/A frame_index N/A plot_contour_with_labels N/A N/A contour frame_index N/A 0 N/A N/A 
        Makes a beautiful plot with all the points labeled.

        Parameters:
        One frame's worth of a contour

         N/A contour_x N/A contour N/A N/A N/A 0 N/A frame_index N/A contour_y N/A contour N/A N/A N/A 1 N/A frame_index N/A N/A N/A plt plot contour_x contour_y r lw 3 N/A N/A N/A plt scatter contour_x contour_y s 35 N/A labels N/A list N/A N/A str l N/A l N/A range 0 N/A len contour_x N/A N/A label_index N/A label x y N/A enumerate N/A zip labels contour_x contour_y N/A N/A N/A label_index N/A N/A N/A len contour_x 2 1 N/A N/A xytext N/A 20 -20 N/A N/A xytext N/A -20 20 N/A N/A N/A plt annotate label xy N/A x y xytext xytext textcoords offset points ha right va bottom bbox N/A dict boxstyle round,pad=0.5 fc yellow alpha 0.5 arrowprops N/A dict arrowstyle -> connectionstyle arc3,rad=0 N/A staticmethod N/A