Tuesday, January 23, 2018

Fiji complex ROIs

Double-click on oval selection to change for brush

Use Plugins->Segmentation->Segmentation Editor to interpolate ROIs between slices

Friday, October 20, 2017

Mendeley Standalone Bibliography

If you want to create a bibliography, without having a document that has in-text citations, you can do so directly from Mendeley Desktop.
Select all the records you wish to add to your list, from your Mendeley Library, and then go to Edit and click on Copy. Once you have done this you can go to a text document, like Word, and simply click Paste. This will create a bibliography in your chosen citation style.

Src: http://guides.nyu.edu/c.php?g=277051&p=1846896

Monday, September 25, 2017

Batch explore and process dicom files

https://wiki.xnat.org/xnat-tools/dicombrowser

Wednesday, August 16, 2017

python matplotlib save svg with text as text

https://stackoverflow.com/questions/14600948/matplotlib-plot-outputs-text-as-paths-and-cannot-be-converted-to-latex-by-inks

The matplotlib documentation in http://matplotlib.org/users/customizing.html states that the default value for the parameter svg.fonttype is 'path', which means that characters will be converted to paths when exporting to svg format.
All I needed to do was add the following line in my script:
matplotlib.rcParams['svg.fonttype'] = 'none'
This way all characters are embedded correctly,


Another, more permanent option, is to put
svg.fonttype : none
in your matplotlibrc (~/.config/matplotlib/matplotlibrc, for example)

Friday, June 2, 2017

Ubuntu wipe directory

  1. Install the package 'secure-delete'
  2. Use the command 'srm -r pathname' to remove your folder and files
The default settings are for 38 (!!!) passes of overwrites which is extreme overkill imho (see more info about this here:
For my usage, I only want a single pass of random data so I use 'srm -rfll pathname'

Src:  https://askubuntu.com/questions/122549/how-to-shred-a-folder

Monday, May 8, 2017

Compare revisions of latex files using latexdiff

Acquire latexdiff package (depends on OS)­. Also available on CTAN.

run:

$ latexdiff draft.tex revision.tex > diff.tex

Compile diff.tex using your favorite sequence.

In order to take into account for \input and \include,
use the --flatten option.
The includes will point to their respective directories.
 
NOTE: the diff can take a long time for large document, like a PhD thesis :D 

Friday, April 21, 2017

format float to string converstion using C

Example of use:

float val = 123.456789123 ;
char output[11];
snprintf(output, 11, "%f", val);

src: http://stackoverflow.com/questions/7228438/convert-double-float-to-string