%load_ext autoreload
%autoreload 2
basedir = '/groups/turaga/home/speisera/share_TUM/FishSIM/sim_density_fac1_2/'
img, gt_df, fq_nog_df, fq_gmm_df = load_sim_fish(basedir, 250, 'random', 'NR', 2)
plt.hist(gt_df['int'])
f_name = '../../../deepstorm/datasets/CodFish/smFISH_data_Titlow/detections/sgg_smFISH_4_spots.csv'
tiff = load_tiff_image(Path(f_name).parent.parent/'sgg_smFISH_4.tif')
print(tiff.shape)
df = big_fishq_to_df(f_name)
from decode_fish.funcs.plotting import *
from decode_fish.funcs.emitter_io import *
axes = plot_3d_projections(tiff[0], size=20)
axes[0].scatter(df['x'],df['y'], color='red', s=1)
axes[1].scatter(df['x'],df['z'], color='red', s=1)
axes[2].scatter(df['y'],df['z'], color='red', s=1)
axes[0].set_xlim(400,500)
axes[0].set_ylim(0,200)
cfg = OmegaConf.load('../config/experiment/msp300_smFISH_3_6.yaml')
cfg = OmegaConf.load(default_conf)
psf = load_psf(cfg)
# psf.load_state_dict(torch.load(Path(cfg.output.save_dir)/'psf.pkl'))
torch.clamp_min(psf.psf_volume[0],0).sum()
psf.psf_volume[0].max()
from decode_fish.funcs.plotting import *
plot_3d_projections(psf.psf_volume[0])
!nbdev_build_lib