# crop and move to origin structured data

**URL:** <https://discourse.paraview.org/t/crop-and-move-to-origin-structured-data/17831>\
**Category:** ParaView Support\
**Created:** [December 1, 2026, 10:56am UTC](https://discourse.paraview.org/t/crop-and-move-to-origin-structured-data/17831 "2026-12-01T10:56:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![otaolafr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/otaolafr/32/3595_2.png) [@otaolafr](https://discourse.paraview.org/u/otaolafr)\
**Post date:** [December 1, 2026, 10:56am UTC](https://discourse.paraview.org/t/crop-and-move-to-origin-structured-data/17831/1 "2026-12-01T10:56:27Z")

</div>

Hello,  
I have a image data, with unecessary excess data as it can be seen in the image:

 ![image](https://discourse.paraview.org/uploads/default/original/3X/9/4/94ef8335553149b44fe1f98fb06a6abb38dc509a.jpeg)  
the image have as extends: 1972 x 1972 x 1 (just testing on one slice)  
so I would like to:

- cutout the excess undesired data (so make a square that is just slightly larger than the circle)
- move to 0,0,0 the begining (so the BB is equal to the bounds of it)

For this I am doing the following steps but I am pretty sure that it is not the correct way to do it:

1. define the size of the small square and its center
2. crop the data to the square
3. move the min corner to the 0,0,0 with transform
4. resample to image (to make it an image again)
5. save data

there is some issues with this,

1. the crop filter show in Information the same values (of bounds/extend) as the original image, but if i show in the spreadsheet it is smaller in number of cells and points, so… is it really removing the unecessary data or not?
2. the moving with transform, transforms the data to Structured (Curvilinear) Grid so i need the resample to image
3. when doing the resample to image the minimum position get lost by a small dimensions (it goes from [0,0,0] to [0.0008449999731965363, 0.0008449999731965363, 0.0])

my current code:

```python

c = [980, 930, 0]
b = [1690, 1690, 1]

f = GetActiveSource()

crop1 = Crop(Input=f)
crop1.OutputWholeExtent = [int(i) for i in [c[0]- b[0]/2, c[0] + b[0]/2, c[1]- b[1]/2, c[1] + b[1]/2, 0, 0]]

transform1 = Transform(Input=crop1)
transform1.Transform.Translate = [-(c[0]- b[0]/2), -(c[1]- b[1]/2), -c[2]]

resampleToImage1 = ResampleToImage(Input=transform1,SamplingDimensions = [b[0], b[1], 1])

```

and here is a slice as example:  
[slice00000.tif](https://discourse.paraview.org/uploads/short-url/kcWZeD5VSs58fW4aNuYlH4Bp3Eu.tif) (7.4 MB)

---

<div class="post-metadata">

**Author:** ![otaolafr](https://discourse.paraview.org/user_avatar/discourse.paraview.org/otaolafr/32/3595_2.png) [@otaolafr](https://discourse.paraview.org/u/otaolafr)\
**Post date:** [December 1, 2026, 11:03am UTC](https://discourse.paraview.org/t/crop-and-move-to-origin-structured-data/17831/2 "2026-12-01T11:03:00Z")

</div>

okey it looks like simply saving the crop and re opening it solves the issue…
