How to change node edge lines in Cytoscape.js? - cytoscape.js

I have a bunch of nodes on each side of a central node. I am trying to find a way to position the node lines so that they go to the right or left side of the nodes.
So for this:
http://jsbin.com/ipuxub/4/edit?js,output
I want the lines for the Jerry node to go to right side of Elaine, George, Kramer, etc.
While I don't think this is possible now:
Is there a way to force it, trick it or make it look better?
If it is changing the Cytoscape JS code, any suggestions to where I begin or look at or what would need to be changed?

Controlling edge control points more manually or adding support for node bend points are things we have planned to add in future, and I think either case would satisfy your use case.
However, we do not have the resources to do this in the short term: Both cases require our side to plan how those features would fit in with the model and visual style system (cy.js css).
In the short term, if you want to control where edges are drawn, you have to adjust the positions of the connected nodes -- because the edge positions are inferred between them. The first edge is straight between them, and for 2 or more beziers are used.
If moving node positions does not suffice for your usecase, the first steps would be for us to discuss and plan how this feature would work and how it would fit into the system: https://github.com/cytoscape/cytoscape.js/issues/359
Then if you're interested in implementing it, it would be a straightforward process. We could direct you to the relevant parts of the code that would need to be changed etc over a Google+ call.
Thanks -M

Related

SimpleElastix 3D rigid registration fails to find same image

I've been trying to get a basic registration working with SimpleElastix for a while now, but I'm not able to make it work at all, regardless of the settings used. Note that I'm trying to compare SimpleElastix to other methods, so using another library is not an option.
Here's the task I'm currently trying to do:
Take a 3D ultrasound scan of a fetus (img_scan)
Mask a part of the scan, and apply a rigid transform (img_structure)
Use SimpleElastix to register img_structure to img_scan.
Since img_structure was created from img_scan, I know for certain that there is an ideal solution to the registration. However, unless img_structure is extremely close to it's original position, SimpleElastix seems to barely do anything at all. For example, if I only translate img_structure in one axis, it works. But if I only rotate it 90 degrees, it fails although their centres are basically the same. To clarify, by fail I mean it returns a slightly transformed img_structure, but nowhere near the the actual solution]
This is the basic code I've started with:
elastixImageFilter = sitk.ElastixImageFilter()
elastixImageFilter.SetFixedImage(fixed)
elastixImageFilter.SetMovingImage(moving)
elastixImageFilter.SetMovingMask(mask_moving)
elastixImageFilter.SetFixedMask(mask_fixed)
elastixImageFilter.SetParameterMap(sitk.GetDefaultParameterMap("rigid"))
elastixImageFilter.Execute()
Things I have tried:
With/without masks (or a combination)
Different MaximumStepLength
Different ImageSampler
Affine instead of rigid
Different Optimizers
What could I be missing?

Calculate points inside the mesh of other instances with Geometry Nodes

I'm working on a procedural terrain generator using Geometry Nodes and I want to include the option of having buildings or other objects placed inside a collection that the terrain uses as a reference for where not to put grass, pebbles and rocks. The issue I have is that I've been only able to do it with the faces of the objects in the collection, and when they are big enough, that causes the points to be distributed inside the object. Here's a capture:
I've scoured the internet for help, but since the change in the geometry nodes on 3.0, most of the answers I can find use the old system and I can't find a way to adapt it, so I'm asking for help here, because I ran out of ideas. Here's the current set up I have to make the selection to know where not to put points for the grass:
I did try using the Mesh Boolean approach, but it is too resource heavy. For the buildings is not a problem, but when I use it for avoiding grass from spawning inside the big rocks, it makes the entire geometry nodes really heave resources wise.
Any Help is appreciated, I've been fighting this "bug" for three days now and it's driving me crazy. Thanks!
After many searches, I've managed to find a solution that works! It is using the method explained in this tutorial: https://www.youtube.com/watch?v=tvb2aCeTANM
Basically, you create a raycast on top of the scene and use a Boolean Math node to detect if it's hitting or not. In my case, for deleting the Geometry in the mesh where the points are distributed, I used a "Or" operation. You can see the node setup here: New Node Setup
Hope this helps anyone else having the same problem :). Of course if anyone can think of a better solution, feel free to add it!
Just use Raycast node with position node to evaluate a dot product
and then add map range with clamp checkbox

D* / D* Lite query (dynamic pathfinding algorithms)

I'm writing a paper comparing D*, D* Lite and LPA* and how useful they are in navigating an agent across a dynamic environment.
If anyone has any info that would be helpful for this please leave below.
Specifically, can anyone explain in simple terms why D* and D* lite traverse from goal to start rather than start to goal like LPA*? I understand the g value would then be the distance from the goal but confused as to what benefits this has.
Thanks in advance.
When you search outwards from the start state, all of the outward paths also give you routes back to the start, making it easy to get back there. Then, when you get to the goal, you have one path to the goal, but many paths from other states back to the start.
If the world isn't changing it doesn't matter whether you search backwards or forwards (or bidirectionally), in the end you have a path that you can use.
But, if the world changes and you lose your one path to the goal from a forward search, it can be hard to re-connect to that single path. If instead you search outwards from the goal, you still have many paths back to the goal. If the world changes, you can then search to reconnect the invalidated states back to any path that leads to the goal (of which there are many). Although it may not be optimal, it may only require a small and simple repair.

Changing color nodes in graphDB Free

I am currently working with GraphDB to visualize some data that has a graph nature. I have imported the RDF data into graphDB and actually the graph is pretty nice. The only downside is that every single node is orange.
I was wondering then, if graphDB has some mechanism whereby the color of some nodes could be changed based upon a semantic relationship between them. For example:
<Berners_Lee> <created> <web> .
<Berners_Lee> <works_as_a> <teacher>
If I were to load this onto graphDB all nodes would appear by default in orange. Is there any way I can specify that nodes that are pointed by relationship created appear in blue?
I hope everything is clear. Any help would be much appreciated.
The colors are generated automatically and differentiate the types in one graph, which is their main purpose. Also we do not handle properly the case with multiple types for a node, but we have it in mind. The problem with your data is that all of the subject predicates and objects have no type (which makes them the same type). Here is a small example, based on your data which will produce the desired effect.
<Berners_Lee><created><www>;
<works_as_a><teacher>;
a <Person>.
<teacher> a <Occupation>.

Cytoscape: Avoid overlapping grouping nodes

Is there a layout or an option to avoid grouping nodes to overlap eachother?
I'm getting a graph with standalone and grouped nodes, but the combinations are dependent on dynamic data. So i can not place them on my one, or would like to avoid it.
All layouts i have tried do not take care of the grouping nodes and place their sub nodes together.
For example 'circle' creates one circle of all nodes, not a circle per group.
The goal would be to create something like "http://js.cytoscape.org/demos/5b192c88616af2f75344/", but there the nodes are placed manualy..
I have seen the example "http://js.cytoscape.org/demos/59e38e9f20e25a293e44/" which seems to work as required but it is using an extension. First of all i would like to find a built in solution.
Your requirement for a non-extension solution is erroneous.
Only basic, small KB layouts are included in Cytoscape.js itself, and it makes no functional difference whether a layout is included by default or not: They are both extensions -- some are included by default, some are not.
CoSE Bilkent is the best compound node layout algorithm for graphs/networks -- bar none. You can alternatively use CoSE, which is included by default. CoSE is a more basic version of the algorithm, optimised for speed at the expense of visual results in some cases.