Skip to content

Instantly share code, notes, and snippets.

View zitmen's full-sized avatar

Martin Ovesny zitmen

  • Prague, Czech Republic
View GitHub Profile
@zitmen
zitmen / detector_wavelet.m
Created March 29, 2022 21:22
Matlab/modules/detector_wavelet.m
function loc = detector_wavelet(image,params)
% finds molecule candidates using undecimated wavelet transform
% params.watershed : if nonzero, performs splitting of nonconvex regions by
% watershed transform
% params.upsample : if nonzero, upsample by 2 before watershed transform and then
% downsample
% steps of localization:
% -first two planes of UWT are calculated
% -threshold is selected as a combination of std of the first UWT plane and a multiplier
% -second UWT plane is thresholded to create a mask
@zitmen
zitmen / igraph
Last active December 19, 2015 03:39
My blogpost on graphs in R.
```{r eval=FALSE, include=FALSE}
# Staci spustit tyto 3 radky pro vygenerovani a zobrazeni clanku!
setwd('C:/Users/Martin/Desktop')
knitr::knit2html('graf-knit.Rmd', fragment.only=FALSE)
browseURL(paste('file:///', getwd(), '/graf-knit.html', sep=''))
```
Rychlý náhled grafu v R (+ krátce o knitru)
===========================================
Každý, kdo někdy řešil grafový problém, asi ví, že málo co pomůže vymyslet efektivní řešení jako dobré pochopení úlohy. K tomu je dost potřeba si pár takových grafů načmárat na papír. To ale může být pěkná otrava, protože například v různých programovacích úlohách máme na vstupu soubor se seznamem hran nebo např. maticí sousednosti. V trošku zamotanějším grafu se pak snadno udělá chyba. Proto jsem se podíval jak je to se softwarem v této oblasti.
@zitmen
zitmen / integral_by_rectangles.cpp
Last active December 16, 2015 00:19
Integral by rectangles method (the name is almost surely wrong :-) ...I don't know how is this method called - it is straightforward from definition).
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
// ============= Integral by rectangles method ================= //
// fp - integrated function
// a - lower bound
// b - upper bound
@zitmen
zitmen / heap.cpp
Last active December 16, 2015 00:19
Binary Heap - very simple, but works correctly and fast
#ifndef __BINARY_HEAP_H__
#define __BINARY_HEAP_H__
#include <exception>
#include <ostream>
using std::exception;
using std::ostream;
template<typename T>
class BinaryHeap
% Note: the difference between 'density' and 'gauss' is that 'gauss' is
% using amplitude parameter and the 'density' does not
%
function projection3D
addpath('./qrot3d');
%
% config
imsiz = [ 256 256 ]; % [rows cols] => [height width]
resolution = 0.25; % (r < 1)=>upscaling; (r > 1)=>downscaling
roi = [ 0 imsiz(1) 0 imsiz(2) ];
@zitmen
zitmen / conjgrad.cpp
Last active December 16, 2015 00:18
Since I'm still not much familiar with Boost, I don't know how big difference in performance is between vector<double> and matrix<double>, so I used matrices everywhere. It is more convenient since I couldn't figure out how to store result of two vectors as a scalar. It is also a question if vector is interpreted as a row/column matrix as in Mat…
#include <iostream>
#include <string>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/matrix_expression.hpp>
using namespace boost::numeric::ublas;
void print(std::ostream &os, const matrix<double> &M, const std::string &name)
{
os << name << " = [\n";