import%20marimo%0A%0A__generated_with%20%3D%20%220.25.2%22%0Aapp%20%3D%20marimo.App()%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20import%20marimo%20as%20mo%0A%0A%20%20%20%20return%20(mo%2C)%0A%0A%0A%40app.cell(hide_code%3DTrue)%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(r%22%22%22%0A%20%20%20%20%23%20Active%20nematics%20demo%20case%0A%0A%20%20%20%20The%20source%20from%20the%20openpiv-users%20group%3A%0A%0A%20%20%20%20https%3A%2F%2Fgroups.google.com%2Fg%2Fopenpiv-users%2Fc%2FUs_q7h3Uri8%2Fm%2F1p8XAYkHCQAJ%0A%0A%20%20%20%20https%3A%2F%2Fgithub.com%2FOpenPIV%2Fopenpiv-python-examples%2Fblob%2Fmain%2Ftest18%2Factive-nematics.gif%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20from%20IPython.display%20import%20Image%0A%20%20%20%20Image('..%2Ftest18%2Factive-nematics.gif')%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20from%20openpiv%20import%20windef%0A%0A%0A%20%20%20%20from%20openpiv%20import%20tools%2C%20scaling%2C%20validation%2C%20filters%2C%20preprocess%0A%20%20%20%20import%20numpy%20as%20np%0A%20%20%20%20import%20pathlib%0A%0A%0A%20%20%20%20import%20matplotlib.pyplot%20as%20plt%0A%20%20%20%20%23%20'%25matplotlib%20inline'%20command%20supported%20automatically%20in%20marimo%0A%0A%20%20%20%20import%20matplotlib%0A%20%20%20%20matplotlib.rcParams%5B'figure.figsize'%5D%20%3D%20(6.0%2C%206.0)%0A%20%20%20%20return%20pathlib%2C%20windef%0A%0A%0A%40app.cell%0Adef%20_(pathlib%2C%20windef)%3A%0A%20%20%20%20settings%20%3D%20windef.PIVSettings()%0A%0A%0A%20%20%20%20'Data%20related%20settings'%0A%20%20%20%20%23%20Folder%20with%20the%20images%20to%20process%0A%20%20%20%20settings.filepath_images%20%3D%20pathlib.Path('..%2Ftest18')%0A%20%20%20%20%23%20Folder%20for%20the%20outputs%0A%20%20%20%20settings.save_path%20%3D%20pathlib.Path('..%2Ftest18%2F')%0A%20%20%20%20%23%20Root%20name%20of%20the%20output%20Folder%20for%20Result%20Files%0A%20%20%20%20settings.save_folder_suffix%20%3D%20'Test_1'%0A%20%20%20%20%23%20Format%20and%20Image%20Sequence%0A%20%20%20%20settings.frame_pattern_a%20%3D%20'active-nematics0*.tif'%0A%20%20%20%20settings.frame_pattern_b%20%3D%20'(1%2B2)%2C(3%2B4)'%0A%20%20%20%20%23%20see%20documentation%20for%20more%20options.%20https%3A%2F%2Fopenpiv.readthedocs.io%2Fen%2Flatest%2Fsrc%2Fwindef.html%20%0A%0A%20%20%20%20'Region%20of%20interest'%0A%20%20%20%20%23%20(50%2C300%2C50%2C300)%20%23Region%20of%20interest%3A%20(xmin%2Cxmax%2Cymin%2Cymax)%20or%20'full'%20for%20full%20image%0A%20%20%20%20settings.ROI%20%3D%20'full'%0A%0A%20%20%20%20'Processing%20Parameters'%0A%20%20%20%20settings.correlation_method%3D'linear'%20%23'circular'%20or%20'linear'%0A%20%20%20%20settings.normalized_correlation%20%3D%20True%0A%0A%20%20%20%20settings.num_iterations%20%3D%203%20%20%23%20select%20the%20number%20of%20PIV%20passes%0A%20%20%20%20%23%20add%20the%20interrogation%20window%20size%20for%20each%20pass.%20%0A%20%20%20%20%23%20For%20the%20moment%2C%20it%20should%20be%20a%20power%20of%202%20%0A%0A%20%20%20%20settings.windowsizes%3D(64%2C%2032%2C%2024%2C%208)%0A%20%20%20%20settings.overlap%3D(32%2C%2016%2C%2012%2C%204)%0A%0A%20%20%20%20%23%20settings.windowsizes%20%3D%20(128%2C%2064%2C%2032%2C%2016%2C%208)%20%23%20if%20longer%20than%20n%20iteration%20the%20rest%20is%20ignored%0A%20%20%20%20%23%20The%20overlap%20of%20the%20interroagtion%20window%20for%20each%20pass.%0A%20%20%20%20%23%20settings.overlap%20%3D%20(64%2C%2032%2C%2016%2C%208%2C%204)%20%23%20This%20is%2050%25%20overlap%0A%0A%20%20%20%20settings.show_plot%20%3D%20True%0A%20%20%20%20settings.scale_plot%20%3D%20200%20%20%23%20select%20a%20value%20to%20scale%20the%20quiver%20plot%20of%20the%20vectorfield%0A%20%20%20%20%23%20run%20the%20script%20with%20the%20given%20settings%0A%0A%20%20%20%20settings.show_all_plots%20%3D%20False%0A%20%20%20%20return%20(settings%2C)%0A%0A%0A%40app.cell%0Adef%20_(settings%2C%20windef)%3A%0A%20%20%20%20windef.piv(settings)%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
ea43a0af1af557cf7f36ea5696bb7f95