Questions tagged [transformation]

Generally means modifying the shape or appearance of objects while preserving the content. Common applications are transformations of vectors, quaternions, matrices or XML files.

2955 questions
133
votes
8 answers

The easiest way to transform collection to array?

Suppose we have a Collection. What is the best (shortest in LoC in current context) way to transform it to Foo[]? Any well-known libraries are allowed. UPD: (one more case in this section; leave comments if you think it's worth to create…
Roman
  • 59,060
  • 84
  • 230
  • 322
68
votes
4 answers

Understanding `scale` in R

I'm trying to understand the definition of scale that R provides. I have data (mydata) that I want to make a heat map with, and there is a VERY strong positive skew. I've created a heatmap with a dendrogram for both scale(mydata) and log(my data),…
Jen
  • 1,021
  • 2
  • 10
  • 16
51
votes
0 answers

Is it possible to directly apply an affine transformation matrix to a Mayavi ImageActor object?

I'm using Mayavi to render some imaging data that consists of multiple 2D planes within a 3D volume, the position, orientation, and scale of which are defined by 4x4 rigid body affine transformation matrices. Each plane consists of: An array of 2D…
ali_m
  • 62,795
  • 16
  • 193
  • 270
42
votes
2 answers

Advanced tasks using Web.Config transformation

Does anyone know if there is a way to "transform" specific sections of values instead of replacing the whole value or an attribute? For example, I've got several appSettings entries that specify the Urls for different webservices. These entries are…
36
votes
4 answers

how to use the Box-Cox power transformation in R

I need to transform some data into a 'normal shape' and I read that Box-Cox can identify the exponent to use to transform the data. For what I understood car::boxCoxVariable(y) is used for response variables in linear models,…
dede
  • 1,007
  • 3
  • 13
  • 28
36
votes
2 answers

Perspective transform of SVG paths (four corner distort)

How is it possible to distort paths in SVG in browser so that they are distorted to certain perspective using possibly javascript or css? The perspective distort can be made easily in Photoshop, Illustrator etc, but how about browsers? This is…
Timo Kähkönen
  • 10,897
  • 8
  • 64
  • 105
34
votes
1 answer

How do I get mogenerator to recognize the proper type for Transformable attributes?

I have a Core Data model with a single transformable attribute. I also have this attribute use a custom NSValueTransformer, setup in the model properly. When I use mogenerator to generate/update my machine and human files, the machine files for the…
casademora
  • 60,192
  • 15
  • 66
  • 77
33
votes
3 answers

bounding box of numpy array

Suppose you have a 2D numpy array with some random values and surrounding zeros. Example "tilted rectangle": import numpy as np from skimage import transform img1 = np.zeros((100,100)) img1[25:75,25:75] = 1. img2 = transform.rotate(img1, 45) Now I…
a.smiet
  • 1,447
  • 1
  • 16
  • 35
32
votes
3 answers

How to apply config transformations to an external config file

I can't find an example of my question on the web and was wondering if anybody knew a solution. Basically, if on our web.config we point to another file, like so:
bastos.sergio
  • 6,456
  • 4
  • 23
  • 33
32
votes
4 answers

Android image view matrix scale + translate

I am trying to manually get an image inside an imageview centered and fitting the screen. I need to do it with a matrix (I will later dynamically change the matrix transformation). Problem is I can't get the image centered in the view (scale is…
Vincent Mimoun-Prat
  • 26,900
  • 13
  • 74
  • 118
30
votes
5 answers

CGAffineTransform scale and translation - jump before animation

I am struggling with an issue regarding CGAffineTransform scale and translation where when I set a transform in an animation block on a view that already has a transform the view jumps a bit before animating. Example: // somewhere in view did load…
matteok
  • 1,903
  • 3
  • 26
  • 44
29
votes
5 answers

Is it possible to interpret a C# expression tree to emit JavaScript?

For example, if you have an expression like this: Expression> fn = x => x * x; Is there anything that will traverse the expression tree and generate this? "function(x) { return x * x; }"
Chris Fulstow
  • 38,141
  • 9
  • 83
  • 109
28
votes
2 answers

IItemTransform and existing minified files

TL;DR: IItemTransform isn't getting executed when a minified file already exists in the same folder as the original (non-minified) file. Problem explanation I'm having this issue mainly because of CSS relative image references. If you used…
26
votes
6 answers

How to add config transformations for a custom config file in Visual Studio?

The project I am working on involves reading a lot of service endpoints (url) from a config file. Since the list would be quite large I decided to keep them in a custom config file to keep my web.config clean and small. I included the custom section…
TejSoft
  • 2,893
  • 5
  • 26
  • 52
25
votes
3 answers

How can you produce sharp paint results when rotating a BufferedImage?

One attempted approach was to use TexturePaint and g.fillRect() to paint the image. This however requires you to create a new TexturePaint and Rectangle2D object each time you paint an image, which isn't ideal - and doesn't help anyway. When I use…
rtheunissen
  • 6,831
  • 5
  • 30
  • 60
1
2 3
99 100