# Resampling Image: Finding original point in new resampled Image

**URL:** <https://discourse.itk.org/t/resampling-image-finding-original-point-in-new-resampled-image/5818>\
**Category:** Algorithms\
**Tags:** simpleitk\
**Created:** [March 21, 2023, 8:34pm UTC](https://discourse.itk.org/t/resampling-image-finding-original-point-in-new-resampled-image/5818 "2023-03-21T20:34:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![elapins](https://discourse.itk.org/letter_avatar_proxy/v4/letter/e/96bed5/32.png) [@elapins](https://discourse.itk.org/u/elapins)\
**Post date:** [March 21, 2023, 8:34pm UTC](https://discourse.itk.org/t/resampling-image-finding-original-point-in-new-resampled-image/5818/1 "2023-03-21T20:34:57Z")

</div>

I have a smaller image that is (512x512). I resampled it to a new space (692x512) and am now wondering how I can determine of a point in the smaller image, for example: location 25,25, in the larger image.

I tried using resampler.GetTranform(), but it says none. Is there a certain function that will allow me to track specific points after the resampling?

Thank you!

---

<div class="post-metadata">

**Author:** ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)\
**Post date:** [March 22, 2023, 1:04pm UTC](https://discourse.itk.org/t/resampling-image-finding-original-point-in-new-resampled-image/5818/2 "2023-03-22T13:04:51Z")

</div>

Hello @elapins,

A key concept in ITK/SimpleITK is that images are a physical object, they occupy a region in space. Hence we treat them as continuous objects, working with physical points and not indexes, though it is easy to move between the two representations using the following [Image](https://simpleitk.org/doxygen/latest/html/classitk_1_1simple_1_1Image.html) methods:

- `TransformContinuousIndexToPhysicalPoint`
- `TransformIndexToPhysicalPoint`
- `TransformPhysicalPointToContinuousIndex`
- `TransformPhysicalPointToIndex`

**Note** : transformations are always applied to physical points.

More specifically to your question, the following pseudo-code should clarify how indexes are mapped from a `resampled_image` to the `original_image` given the transformation mapping between the two `tx`:

```auto
original_image

#resampled_image_grid_info can be an image or an explicit description of the grid, i.e. origin, spacing, size, direction cosine
resampled_image = sitk.Resample(original_image, resampled_image_grid_info, tx)
resampled_image_index = []

original_image_point = tx.TransformPoint(resampled_image.TransformIndexToPhysicalPoint(resampled_image_index))
original_image_index = original_image.TransformPhysicalPointToIndex(original_image_point)

```

The other way round requires inverting `tx`.
