Images in a multistateobject - adobe-indesign

I want to change the position of a picture located within a multistate object.
I have joined two rectangles (one of which contains a placed bitmap) to form a multistate object together. But now I can't address these rectangles as rectangles anymore, only as pageitems. So:
app.activeDocument.multiStateObjects[0].states[0].rectangles.length
gives 0.
while
app.activeDocument.multiStateObjects[0].states[0].pageItems.length
gives 1.
Since I can't address the picture frame as a rectangle anymore, I can't do anything with the picture it contains... (I would like to apply the fit function on it: myFrame.fit(FitOptions.CONTENT_TO_FRAME), but then myFrame should be a rectangle, not just a pageItem)

The pageItem is most likely a group. When you create a multistateObject, it creates groups for each state and these groups become the parents of the pageItens you had. So you should be able to access your rectangles like this:
app.activeDocument.multiStateObjects[0].states[0].groups[0].rectangles

Related

How can I create a pixel labelled image for Semantic Segmentation?

I am following the Semantic Segmentation Examples tutorial by MathWorks.
I understand that I can load pixel labeled images
pxDir = fullfile(dataDir,'buildingPixelLabels');
Define the class names.
classNames = ["sky" "grass" "building" "sidewalk"];
Define the label ID for each class name.
pixelLabelID = [1 2 3 4];
and create a pixelLabelDatastore.
pxds = pixelLabelDatastore(pxDir,classNames,pixelLabelID);
But, how do I create a custom pixel labelled image where every pixel value represents the categorical label of that pixel?
I would then proceed by writing:
pxDir = fullfile(dataDir,'myCustomPixelLabels');
If I understood correctly, imageDatastore holds the actual image and not the pixel labels for that image.
EDIT:
On my system pxDir points to 'C:\Program Files\MATLAB\R2017a\toolbox\vision\visiondata\buildingPixelLabels'. Since I am on Matlab2017a so this example is not included by default, and I cannot compare or view the file to get a better understanding of what I need to do to reproduce this example.
The answer can be found here.
Matlab 2017a
Go to the APPS tab, and search for Image Labeler, or Training Image Labeler
Click on Add Images to add your training images.
Click on Add ROI Labels to add class names for the regions of interest.
Proceed to select the regions of interest manually from the uploaded images.
Once areas are selected, the data can be exported to workspace as a Ground Truth object.

Developing an image frame sequence generator in MATLAB

I am doing a project where I have to create frames of images, to show a track path of an object and detect it. The end goal of my code is to create a line that shows the track path of the object as it moves and a box to detect the object at it's final position on the image (original image and desired output image that I would like is shown as an example).
In order to do this, I need help with generating the frames with different object positions. I have already created an object from an array (using the zeros function) with a set intensity value and have overlayed it on to the original background image (using imadd(image, object)). I have different frames with the object at different positions. Any idea, how I can show a streak/line to show the track path of the object?
I would really appreciate any help with this.
Kind regards,
Vanessa
P.S. This is the how original data looks like:
1]
And this is the desired output:

D3JS Change TSV Data Column Ordering

I've just draw a stacked-area-chart with D3JS.
This is my referral implementation
I also need to dynamically swap the ordering of the layers.
I think that there isn't a way to do it dynamically without redrawing (or is there any? :D )
Actually i'm trying to map the data to a new header column, but this implies the redrawing.
Let me show you an example:
Here is the TSV header ['date', 'columnA', 'columnB', 'columnC']
Every column, except of 'date', represent the % of area for that sample.
I would like to dynamically rearrange the area layers, but I'm pretty sure that I also need to parse again the data with a new header
eg: ,
['date', 'columnA', 'columnB', 'columnC']
-map to-
['date','columnB', 'columnC', 'columnA']
and then draw the result.
I'm doing it right? Thanks for your support, cheers.
This is the line that defines the array that will be passed to the stack() function:
var keys = data.columns.slice(1);
Right now, this is the array:
["Google Chrome","Internet Explorer","Firefox","Safari","Microsoft Edge","Opera","Mozilla","Other/Unknown"]
But you can sort it anyway you want. For instance, sorting by alphabetic order:
keys.sort();
Which gives us:
["Firefox","Google Chrome","Internet Explorer","Microsoft Edge","Mozilla","Opera","Other/Unknown","Safari"]
Here is the result: https://bl.ocks.org/anonymous/6a339ed0731a70bb234af150ee6b4a99
Here is another one, with a random permutation (refresh the page to see diferent orders): https://bl.ocks.org/anonymous/662f99901219b8907030ec3c84363f3a
Pay attention to this: the order in the stacked area chart is now different, but the colours don't keep the same for each browser (that is, each stacked area). That's because d3.scaleOrdinal(d3.schemeCategory10) assigns the colours in a first-come, first served basis.

Fixed row position under expandable row group

I am trying to display text on an SSRS report in a fixed position, regardless of the content above it. The problem is the content above may be one to three lines. As the above content fluctuates, so does the beginning of the next row of content. This happens in two places on the report.
In other words, I need two static starting points for dynamic content. I am printing text onto a pre-designed invoice that doesn't contain any customer data. The invoice is just a template (or shell if you will) and I am to position the data to print into spaces provided on that invoice.
Please see attachments. The attachment with two rows in each field is lining up correctly. I have done this intentionally as a basis. As you can see on the other two attachments, with either one or three rows, the content isn't lining up where it should be due to more or less content than my basis.
I have toyed around with cangrow & canshrink but couldn't get the results as desired.
Appreciate the help!
I think you're going to need to re-work your table to get working the way you want.
The way I would do it would be to have one table that groups each page data. Use this table to format your data - putting Rectangles in the area for your lines of data. Rectangles can have a set height so they fill your area when there isn't enough data.
Then you'll have to add another tables inside each of the rectangles to display each sections data.
See my example below - the RED represents where the Rectangles would go and the BLUE for tables.
I would keep the old table intact and copy and paste it in each rectangle. Then remove all the parts that that section doesn't need and set your rectangle to the correct size.

Sketchup Ruby InputPoint.face method on Image object?

I have one problem with InputPoint.face method in Sketchup Ruby API.
When i import one image object and then draw 5-edges polygon on this image. I used InputPoint.face for getting number of edges in the polygon after clicking on it. I think the output is 5, but actually, the output is 4
If i remove the image , result will be 5.
I don't understand why the output is like that, and what can i do to get output 5?
This is my code
# The onLButtonDOwn method is called when the user presses the left mouse button.
def onLButtonDown(flags, x, y, view)
#ip = view.inputpoint x,y
#f = #ip.face
aEdges = #f.edges
puts aEdges.length
end
Thanks you
So you have drawn pentagon faces on the Image entity you imported? And when you use InputPoint to click on one of the pentagons you get a face with four edges?
What happens here is probably that you are getting the Face inside the Image entity. Under the hood an Image entity is a special component instance. You can in fact find the definition for the Image entity in model.definitions.
For more details on SketchUp and Components, Groups and Images read this article: http://www.thomthom.net/thoughts/2012/02/definitions-and-instances-in-sketchup/
InputPoint and PickHelper seem to let you pick the face inside the Image entity instead of stopping when it hits the Image entity.
You will probably want to filter out your results before using them and you probably wantto use the PickHelper class instead of InputPoint.
http://www.sketchup.com/intl/en/developer/docs/ourdoc/pickhelper.php
http://www.thomthom.net/thoughts/2013/01/pickhelper-a-visual-guide/
InputPoint is more for getting 3d points for inference, while PickHelper is best to use to pick and select entities.
You can check the Face entity you get from InputPoint and it's parent to verify which face it is and what context it belongs to.

Resources