Closed yuan0821 closed 3 years ago
Can you please describe in more detail what exactly you are trying to run (i.e. the exact command) and with what data? and what version of Matlab are you using?
Hi, thank you very much for your reply!! i just try to run the script of preprocess_dannce.mat as the demo page shows:
filename_in = 'predictions.mat'; filename_out = 'predictions_preprocessed.mat'; species_name = 'mouse' preprocess_dannce(filename_in,filename_out,species_name, ' ')
Error using filtfilt Expected input to be finite.
Error in filtfilt>efiltfilt (line 114) validateattributes(x,{'double'},{'finite','nonempty'},'filtfilt');
Error in filtfilt (line 89) y=efiltfilt(b,a,x);
Error in compute_preprocessed_mocapstruct (line 44) abs_velocity_antialiased(ll,:) = filtfilt(f1,f2, marker_velocity(ll,:,4));
Error in preprocess_ratception_struct_demo (line 43) ratception_struct_temppreproc = compute_preprocessed_mocapstruct(ratception_struct_temp,preprocessing_parameters);
Error in preprocess_dannce (line 107) ratception_struct = preprocess_ratception_struct_demo(datahere,preprocessing_parameters,params); ############################################################################################ i think it is cased by the calculation of abs_velocity_antialiased value as it has infinite values. So i wonder whether it is possible to ask how to fix the issue of infinite values? or is there any suggestions? thank you so so much for all!!! @spoonsso
Hi Yuan,
You are right that the filtfilt was the problem. I added a simple masking in that section of the code (in the CAPTURE repo) to address this. I pushed the change to the capture demo and included the fix below. Did this work?
frames_to_mask = union(find(isnan(marker_velocity(ll,:,4))),find(isinf(marker_velocity(ll,:,4)))); marker_velocity(ll,frames_to_mask,4) = 0; abs_velocity_antialiased(ll,:) = filtfilt(f1,f2, marker_velocity(ll,:,4)); marker_velocity(ll,frames_to_mask,4) = nan; abs_velocity_antialiased(ll,frames_to_mask) = nan;
Hi Jesse, thank you so so much for your update. yes!! it works smoothly !!! thanks a lot!
cool! Let us know if you need any other help.
Hi. I try to run the demo scrip preprocess_dannce, the error occur as below. i think it is better to modify the original code that can deal with the issue of infinite values. many thanks for your effort @spoonsso @jessedmarshall ################################################################ median filtering getting velocities Error using filtfilt Expected input to be finite.
Error in filtfilt>efiltfilt (line 114) validateattributes(x,{'double'},{'finite','nonempty'},'filtfilt');
Error in filtfilt (line 89) y=efiltfilt(b,a,x);
Error in compute_preprocessed_mocapstruct (line 44) abs_velocity_antialiased(ll,:) = filtfilt(f1,f2, marker_velocity(ll,:,4));
Error in preprocess_ratception_struct_demo (line 43) ratception_struct_temppreproc = compute_preprocessed_mocapstruct(ratception_struct_temp,preprocessing_parameters);
Error in preprocess_dannce (line 105) ratception_struct = preprocess_ratception_struct_demo(datahere,preprocessing_parameters,params);