Setting opacity for .vtk file - vtk

I tried to visualize a brain dataset. Actually, I think it works but I should set the opacity. From what I read on the internet, vtkpiecewisefunction must be used for solution.
However, when I change the code according to http://vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/Medical/Cxx/Medical3.cxx, I encountered with a problem. I do not know how to change the reader and filter part of the code. The code, .vtk file and image that I get exist on the link: https://www.dropbox.com/sh/51kjftvdko3g6s8/wEe88Id9QN
Could you please tell me how I change this? Besides, you may inform me about another way of solution which adjusts the opacity of image.
Please let me know the image that you get is the same with the one on the link because it might be related to the graphics driver of my computer.
Thank you.

When I want to change the opacity, I ause the actor:
actor->GetProperty()->SetOpacity(0.5);

Related

How can you get the "var svgData" out of an image?

Ive been trying to figure out how to code a image into a "var svgData" code for quite some time, yet i only found one similar question in the internet with no helpful solution. There is a webisite called "gtalogo" (http://gtalogo.com/), where you can basically look for emblems you want to apply to your gta crew.
But in order to upload a image on the website, you need a "var svgData='(Code)=';var layerData='(another Code)='" first, and I have no idea how you can get that code out of a svg file, png file, jpg file, or whatever.
Ive tried to convert svg to base64, but that didnt solve the problem because there is still the "var layerData".
I can give you a example of one image which is on the gtalogo webiste, and got coded into "var svgData".
image: https://en.gtalogo.com/img/16479.webp
code: (too long), but you can see it on this link, when you click on "show code": https://en.gtalogo.com/emblem-16479.html". This is a random emblem btw.
And my task is to get the "var svgData" code, which you saw on the website, out of my image. This is the image: My image
(no questions asked (im not a communist)).
And this is the svg: https://mega.nz/file/HGJlCIQS#iOlt6jdVDGJV98Ay_HpnHudtB94rncehgCnKQgq39GY
Base64 code if you need it: https://mega.nz/file/yGRFjQCK#uslnTQe5kqxqE1RJABXnGeBkmxZ19fVPQeiPjg253ks
So, if someone knows what im talking about and is able to describe me how i can get the var svgData code, or is able to code it for me, it would be very appreciated.
TrileX_
svgData is not tied to the image itself. It's a value that Rockstar services create for each of the emblems that are successfully created.
[EDIT: While svgData is actually tied to the image and can be easily reproduced, but you still need layerData which is from Rockstar editor]
To upload an image to "gtalogo" you need to use a command in console (copy(_sc_av_edit+'|||'+document.getElementById("emblemEditor-canvasContainer").innerHTML)). First part is the code generated by Rockstar and the second part is the vector image itself.
While the second part you can get without any issues, the first part you can only get from an already saved emblem (as far as I know).
In conclusion, you either have to use a pre-existing emblem or make one yourself in the Rockstar emblem editor.

Wanted to know about ZPL to image conversion

I have a requirement in my project where in I need to convert the ZPL code to image format. We are not suppose to use Labelary as it is a lisenced product and my clients will not give permission.
Can you please help with an approach?
Use the official docs for getting started. With these informations you can start writing a parser which then can convert the ZPL label to an image. But be aware, that this can be a very timeconsuming task!
Since you don't have have specified your favourite programming language, I can't give you any further advice.

Setting the CompoundStructure.EndCap is not working

I am working on a Revit plugin using RevitAPI.
I create a new WallType by duplicating existing one. Then I edit the structure - adding new layers.
Also, I am setting the OpeningWrapping to Both and I want to set the EndCap to Interior.
Unfortunately, the EndCap never changes and stays Exterior
structure.EndCap = EndCapCondition.Interior;
structure.OpeningWrapping = OpeningWrappingCondition.ExteriorAndInterior;
Does someone have any ideas about why it is not changing?
Thank you in advance!
Ivan
There could be many possible reasons.
Can you set the desired end cap behaviour manually through the user interface?
If not, it will normally not be possible to do so programmatically either.
Do you have an open transaction?
Can you commit other changes in it?
Are you applying other changes to the model that might conflict with the end cap condition?
Instead of asking you hundreds of questions, I suggest that you provide a minimal reproducible case:
http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b
p.s. the same question is also asked and further discussed here:
https://forums.autodesk.com/t5/revit-api-forum/compoundstructure-endcap-is-not-working/m-p/6898895

Hide Detail Point in AchartEngine library

I want to hide Detail Point when using the AChartEngine libary as following image.
I also read the AChartEngine Document but can not find out the answer,
Please tell me how,
Thanks,
Try this
renderer.setShowLegend(false);
where renderer is XYMultipleSeriesRenderer .

CAPTCHAS and img name /displayed value association

Unfortunately I am having trouble summing up this question in one phrase/line, thus I am forced to initially hint as to what my understanding is before asking the question in fear of me asking a question based on wrong facts or assumptions. As I understand “and please correct me if am wrong”, as I understand captchas work like so:
Have numerous images, and associate each image name/source to its displayed characters value.
Display image, then have user input what they see.
Match user's input against the character value which is associated with that image's name/source.
Assuming my understanding is correct: Given an unlimited amount of time,
Can't one associate image
names/sources with the displayed
characters increasing the chance of
cracking the captcha as they gather
more associations?
In that case, wouldn't the security strength of captchas be parallel the size of the image database?
NOTICE: As i suspected my question was based on wrong understanding.
Short answer! These are dynamic images and they are not stored anywhere. You wont even find them in the source code..
Wikipedia has good explanation about this. Alternatively check out the related questions in SO.
Edit: Goto this page where you can see an example of a captcha. Use firebug to see the HTML code for this image and you will see something like this.
<img height="57" width="300" src="http://www.google.com/recaptcha/api/image?c=03AHJ_VutaG4ahxWuQv0e6edYypp_FM8QuFIZkG75AnAm8iu3WRmwQ41jqcvojmKmbSKXxkf_s9fk61-axEp77_omKZZEYliE35BND_hXNh3Jac6ZUAeD08wOMZPj4W2s-A39vAI84eim5q-z9kFnmoSmon1jG2LmmFw" style="display: block;">
Did you notice the source? It does not point to an image file.
You can copy this url and generate the image (just open it in a browser). So you can develop an application which can download this image and then scan for color change in pixels and try to match for alphabets and numbers but if you notice almost all the alphabets and numbers are connected and closer so it is difficult to seperate different alphabets.
Even if you manage to seperate most of the alphabtes are not perfect. example :
(source: watblog.com)

Resources