How to change the default image viewer in SimpleITK - image-processing

I am using the SImpleITK and ipython notebook for image processing and as we know imagej is the default image viewer in simpleitk. But the type of image i am using is .mha and .mha is not supported by imagej. For this I have to use fiji or imagej2.
I have tried to make fiji as a default image viewer according to the instruction mentioned in simpleitk FAQs but did not get success and show the following message:
I want to know what mistake I am doing .
How to make Fiji or imagej2 as a default image viewer for all types of images when I work with simpleitk and ipython notebook.
Thanks.

Looks to me like you still have ImageJ in your STIK_SHOW_COMMAND variable which is not found in your fiji folder.
Read the instructions again. I assume you did not follow them well enough. Your variable should contain the new image viewer and no ImageJ in a different folder.

Try to change the extension of the file with the system variable SITK_SHOW_EXTENSION and try to provide the command to the visualisation software with SITK_SHOW_COMMAND.
In my .bash_profile I have:
export SITK_SHOW_COMMAND='itksnap'
Other instructions can be obtained with ?sitk.Show() .

Try changing the "%F" to "%f". It is case sensitive. Or actually, you can just leave it off. If there is no "%f" it will just put the file name at the end of the command line.
Also, you can use SimpleITK/ImageJ to view MHA files. SimpleITK actually writes out a Nifti file by default when Show is called, regardless of the input image.

Related

Edit Photos via Photoshop on a server

I wart to create a web app where a user enters certain data via a form and then receives a custom rendered image. The image is from a smart object in a psd. It's kind of like a mock-up which definitely requires needs some photoshop filters to be properly rendered.
This should all happen in real time and should be doable from my understanding since the rendering of a single images doesn't need much computing power
I've done some research and haven't really found a solution the matches my problem. Is it necessary to run Photoshop on a server and then remotely run a photoshop script and then upload the generated image somewhere else?
I've used The After Effects Plugin Template by DataClay in the past which offers similar functionality but for video.
Looking forward to hearing your ideas.
Thanks
You can use the Dataclay plugin to handle still image exports out of After Effects. Make a single-frame duration composition in After Effects and rig the layers with the Templater plugin. Then use the PNG Sequence output module to render out a single frame.
From Dataclay's forums:
Exporting
A few extra steps are required to correctly render a project file as a PNG sequence using Templater. By default, a file rendered as a PNG sequence will have the frame number appended to the end of the file name, i.e.:
filename.png00000, filename.png00001, filename.png00002, etc.
In order to designate where in the filename the frame number should be added, we’ll need to use the output column. First, add a column named output to your data source. Next, add a filename with a set of brackets with five # signs to designate where the frame numbering should be added. For example:
filename[#####] would result in filename00001.png
or
[#####]filename would result in 00001filename.png

how to configure Pycharm settings so that the code gets printed as code scheme?

I have a color code, say, like this:
I want to print this code on A4 paper just as shown above.
I did:
And result was not as I expected, for example: string "Test" at line 11 is printed as ocean blue
So, I would really appreciate if someone could point out how to do it.
(the printer is quite good at color printing)
P.S: I can't use plugins since there have to be some url access, I may download any tar.gz or .whl file manually if there is any.

Why jupyter is not able to download as pdf a markdown cell using LaTex \mathscr?

Just created a markdown cell in Jupyter using some equations, and some of them using \mathscr to have like "math" fonts. When I run the kernel containing the equations everything is ok, however when I click the option to Download as PDF via LaTex, I'm getting the error below:
! Undefined control sequence.
l.300 [\mathscr
{L}({\bf{y}}|\beta, \sigma^2, {\bf{X}}) = (2\pi\sigma^2)^{-...
?
! Emergency stop.
l.300 [\mathscr
{L}({\bf{y}}|\beta, \sigma^2, {\bf{X}}) = (2\pi\sigma^2)^{-...
If I remove the \mathscr part everything can be exported with no issues (excepting some convertion problems for special characters), however, I wanted to know ho to solve it. I've been reading and it looks like the nbconvert configuration file can be modified to solve this, but I couldn't find the mentioned file and the exact way to modify it
Thanks for your help
I think the problem is with absent \usepackage{mathrsfs} directive in an intermediate .tex-file.
So you have a several ways to overcome it.
If you face with this problem occasianaly you could the following:
download the .tex-file instead pdf;
manually insert to \usepackage{mathrsfs} to it.
before the first \usepackage for example;
run something like
xelatex file.tex to finally convert to pdf.
If you will do it often, you could try to edit appropriate jinja-template.
At first, find the place where nbconvert was installed. For example with pip: pip show nbconvert. Imagine the path is /home/i/.local/lib/python3.5/site-packages
Then the template would be at /home/i/.local/lib/python3.5/site-packages/nbconvert/templates/latex/base.tplx.
And again: just add \usepackage{mathrsfs} right after ((* block packages *)).
Voila -- the problem should gone.
At the end you have the third option -- you can create your own template from scratch and use it with nbconvert. I don't think it's very convenient way to solve your problem. You could read more in the documentation: http://nbconvert.readthedocs.io/en/latest/customizing.html

scilab - Writing multiple images to a single folder

I am working in Scilab 5.5.2. I need to write multiple images to a single folder. The images which I want to write are cropped images from a set of inputs. I am able to write a single image to the folder with the following command:
imwrite(fname,strcat('C:\Users\dell\Desktop\example_sci\myfolder\1.jpg'));
I have put this in a for loop, so the output image is over written and the result is a single image.
How can i write all the results to a single folder?
You should create the paths like this.
for j=1:10
pathname = "C:\Users\dell\Desktop\example_sci\myfolder\"+ string(j) + ".jpg"
xs2jpg(gcf(), pathname);
end
I usually use the xs2*-command to export a chosen figure. (I use scilab 5.5.0, which does not contain imwrite anymore.)

How can I indicate the bounding box using .bb files in \includegraphics?

Is it possible to use a .bb file (generated with, for instance, the "ebb" program included in MiKTeX) to define the bounding box of .png files when using \includegraphics?
I can define the bounding box in the optional argument to \includegraphics directly, like \includegraphics[bb=0 0 100 100]{file.png}, but I'd like to be able to define this outside of the code, using the generated .bb file. Is this possible?
I figured it out. Applying
\DeclareGraphicsExtensions{.png, .bb}
\DeclareGraphicsRule{.png}{eps}{.bb}{}
before including graphics using \includegraphics{file} (without the extension) solved it. :)
Just in case someone have the same problem.

Resources