How to convert the filetype from .png to .mha? - image-segmentation

I am doing brain tumor segmentation with the BTATS2013. I have gotten the test result with the testing dataset of BRATS 2013 which don't have ground truth, so I can't get the Dice, PPV, Sensitivity directly. I want to use the online platform to evaluate the segmentations, it requires the filetype of input is .mha, but the filetype of segmentations that I get is .png. I don't know how to convert the .png to .mha. Is there anyone can help me to solve the problem, or can you give me some advice of getting the indicators of segmentation? Thanks.

Load your data in 3DSlicer,
You can load Png files there.
Then store it in mha format:

Related

Load PDF Image into MATLAB

I have a PDF of building schematics. I would like to load it into MATLAB, and visualize the image via a GUI, so I can measure distances and such for some calculations.
I have no idea if this is even possible?
Furthermore, the PDF has an embedded scale (i.e. 1 cm = 1 meter). If I can extract this as well, that would be awesome.
I found extractFileText which can be used to extract text, but not much else.
I found the easiest way to do this was to convert the pdf to a image, for example using imagemagick. See this question
If you add an example of the image someone might be able to suggest some ideas for extracting the scale information using image processing.

How to convert .png to bitmap (.bmp) in MATLAB?

I am having difficulties converting a png file of simple black-coloured patterns I made using Illustrator into a bitmap. I need to do this in order to 3D print it (vector printer).
I was instructed to use MATLAB to do it however I tried using imread and imwrite but I'm rather confused as to what the first argument of imwrite, A, should be? Is there a particular format I need to use for it to work?
I tried doing it with an online converter and it gave me the same exact image but of type .bmp. Is that what's meant to happen?
I would appreciate any insight on the problem.
Use imread to read your png, then imwrite to save it in bmp format.
Implementation:
pic = imread('mypic.png');
imwrite(pic,'mypic.bmp','bmp');

Convert dicom .dcm files into .obj format

I have sets of .dcm files of an MRI scan. I am trying to convert them into 3d formats like obj (preferably) or fbx to import them into Unity 3d. I used the following open source software dcmtk to convert .dcm file into text file.
Converting DICOM files to text files
However, the dcm files lack the needed information. Is it even possible to convert .dcm files to obj and fbx. if so, could you suggest something?
Thanks
(Edit)
I would like to put my question more precisely: I want to visualize MRI data as a 3D model in Unity 3d. This is possible only when I it stored as .obj or .fbx format. Which format of MRI medical data should I start with to convert to these formats?
Thanks
According to your previous comments you are looking for the necessary information in order to obtain the geometrical information of a DICOM series representing volumetric information (RM, TC, PET, ...)
In this case, you should have a look at the Roni Zaharia web site where he explains very clearly the concepts related to orientation and geometry of the DICOM images: DICOM is easy: Getting oriented
In this particular page you will find information about Pixel Spacing, Image Orientation, Image Position, Slice Thickness, and Slice Location, as well as additional information references.

tesseract OCR in iphone application

I am using tesseract open source engine for OCR to read text from image.
But I didn't get 100% result for a single time. Please give your suggestions about quality improvement for OCR using tesseract.
Thanks
here is how to get best result from tesseract
Please make sure that you have done preprocessing on image. OVR will produce best results for the images which have following properties:
fix DPI (if needed) 300 DPI is minimum
fix text size (e.g. 12 pt should be ok)
try to fix text lines (deskew and dewarp text)
try to fix illumination of image (e.g. no dark part of image
binarize and de-noise image
https://groups.google.com/forum/?fromgroups=#!topic/tesseract-ocr/g5aE_OvgyTU

Setting DPI for PNG files

I have a bunch of diagrams created using a Java diagramming tool that I wrote - they are mostly black and white diagrams, with the blocks in aqua, and occasional other colours. They are currently being saved as JPG files, and I want to insert them into a book that I am preparing for Print On Demand.
The book is an OpenOffice ODT file, which will later be converted to a PDF.
Currently I use JPG files, but the print facility they use requires 300 DPI, so I modified my diagramming tool to set the xDensity and yDensity to 300, and resUnits to 1, using getAsTree(), and then expand the diagram by a factor of 3 (300/96). IMO the result looks pretty good!
Unfortunately, someone on another forum pointed out that line diagrams are "fuzzed" on JPG files, so suggested that I change over to PNG, or possibly BMP files, both of which ODT files allow to be inserted.
My problem is that BMPs don't seem to have a DPI, and PNGMetadata doesn't seem to support getAsTree(). Can someone point me in the right direction? Thanks.
I don't understand the getAsTree() part, but answering the question that appears in the title, setting dpi for PNG files, you could use the imagemagick convert tool:
convert -density 300 -units pixelsperinch infile.jpg outfile.png
PNG, BMP and dozens of other image formats don't compress your diagrams - compression is probably what your commentor was getting at. JPEGs are great for photos but suck at diagrams.
You might want to look into SVG and other vector formats. Or if your environment allows, exporting 0% compression JPEGs and converting them into another format for lossless reproduction at 300DPI.
Hope that helps!
I decided not to try to do this programmatically. Instead I create the original diagram in PNG, then convert to 300 DPI using Irfanview. Irfanview's batch capability lets me convert to 300 DPI, scale up to compensate, and set to grey scale, all in one operation - and on multiple files at a time. This seems to be the best solution - but thanks to everyone anyway!