Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support JPEG image file format #714

Open
Phoebegit opened this issue Nov 20, 2019 · 4 comments
Open

Support JPEG image file format #714

Phoebegit opened this issue Nov 20, 2019 · 4 comments

Comments

@Phoebegit
Copy link

Hi, I'm a new MIRTKer,

Few days age, I just install MIRTK in ubuntu, I made install the\Example\helloworld\ flip.cc and generated flip.exe.

when I ran a code in terminal : flip testgray.jpg laa.jpg , there was a error :`ImageReader::New: Unsupported file format or image reader not available for: testgray.jpg' . BTW, the testgray.jpg has been placed st the current directory.
image

So, this error make me doubt whether I installed MIRTK successfully? or Dose this function flip really has some requirements for image format?

Thanks very much!

@schuhschuh
Copy link
Member

Welcome to MIRTK!

It seems you installed the toolkit successfully (for runtime efficiency, I suggest you check that WITH_TBB was set to ON in CMake).

As the toolkit was mostly applied to medical image volumes, it only supports PNG as output image format for screenshots. Support for JPEG is currently missing. If you have an interest in it, we could consider adding it. Otherwise, you may convert your images to the MetaImage file format, support for which I added just this week and pushed today. For the conversion, I suggest you have a look at SimpleITK. The main file format used by MIRTK is NIfTI.

import SimpleITK as sitk
sitk.WriteImage(sitk.ReadImage("testgray.jpg"), "testgray.mha")

A note on installation, unless you are planning to extend MIRTK, but are mainly interested in executing its binary tools and are working on Linux (e.g., Ubuntu), you can also install the latest MIRTK version with a single command without source code compilation:

The current latest release build from master is:

wget -O mirtk 'https://bintray.com/schuhschuh/AppImages/download_file?file_path=MIRTK-2.1-pre1-x86_64-glibc2.14.AppImage' && chmod +x mirtk

You can then run the MIRTK commands as follows:

./mirtk flip-image input.mha output.mha -x

@schuhschuh schuhschuh changed the title example running Support JPEG image file format Nov 22, 2019
@Phoebegit
Copy link
Author

Hi schuhschuh,
Thanks very much for your patient explanation. Your reply give me a lot of inspirations. Finally, I ran the example successfully by AppImages. And your explanation on the image format is very clear.

@Phoebegit
Copy link
Author

Maybe We can close the issue?

@schuhschuh
Copy link
Member

Glad the information was useful.

I will keep this issue in the backlog for now as reminder to add support for JPEG.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants