def example_virtual_worm_pipeline(data_file_path): """ This depicts an example of how the data would flow from the virtual worm to the features calculation and plotting This 'virtual' pipeline is simpler because there are no blocks to stitch and also we don't have to verify that our figures are the same as the Schafer figures This might be obsolete now [@Michael Currie, 22 Sep 2014] """ vw = movement_validation.BasicWormData(data_file_path) # NormalizedWorm can load either: # --> a 'VirtualWorm' file (wrapped in a class) or # --> a 'Schafer' file (wrapped in a class) nw = movement_validation.NormalizedWorm('VirtualWorm', vw) wf = movement_validation.WormFeatures(nw) wp = movement_validation.WormPlotter(wf) wp.show()
def main(): # Create a normalized worm from a hardcoded example location #------------------------------------------------------------------- nw = example_nw() # movement_validation.NormalizedWorm # From the basic information in normalized_worm, # create an instance of WormFeatures, which contains all our features data. wf = movement_validation.WormFeatures(nw) # Plotting demonstration # movement_validation.plot_frame_codes(nw) # plt.tight_layout() # I just saved a plaintext file with the motioncodes extracted from # the features result file, by viewing the results file using HDFView #motion_codes = np.genfromtxt('motion_codes.txt', delimiter='\n') #wp = movement_validation.WormPlotter(nw, motion_codes, interactive=False) wp = movement_validation.WormPlotter(nw, interactive=False) wp.show()
def example_real_worm_pipeline(data_file_path, eigen_worm_file_path, other_data_file_path): """ This depicts an example of how the data would flow from the Schafer real worm data to the features calculation and plotting At two places, we verify that our figures are the same as the Schafer figures... This might be obsolete now [@Michael Currie, 22 Sep 2014] """ snw_blocks = movement_validation.SchaferNormalizedWormBlocks(data_file_path, eigen_worm_file_path) snw = snw_blocks.stitch() type(snw) # *** returns <class 'SchaferNormalizedWorm'> # NormalizedWorm can load either: # --> a 'VirtualWorm' file (wrapped in a class) or # --> a 'Schafer' file (wrapped in a class) nw = movement_validation.NormalizedWorm('Schafer', snw) nw.compare_with_schafer(snw) #*** returns True, hopefully! wf = movement_validation.WormFeatures(nw) sef = movement_validation.SchaferExperimentFile(other_data_file_path) wf.compare_with_schafer(sef) #*** returns True, hopefully! wp = movement_validation.WormPlotter(wf) wp.show() # show the plot