Skip to content

SimulatedCamera as SLM's farfield#99

Open
bodokaiser wants to merge 3 commits intoholodyne:mainfrom
bodokaiser:scam-res
Open

SimulatedCamera as SLM's farfield#99
bodokaiser wants to merge 3 commits intoholodyne:mainfrom
bodokaiser:scam-res

Conversation

@bodokaiser
Copy link
Copy Markdown
Contributor

Hi Ian,

As discussed via email, here's the PR you suggested.

Additionally, I'd like to propose limiting the camera's field of view (FoV) to a displaced subset of the SLM space. The motivation is that when we remove the zeroth diffraction order from the SLM, the actual imaged FoV becomes smaller than the full SLM FoV.

Displacement is already supported via the offset argument in SimulatedCamera.build_affine.

I'd appreciate your feedback on how we want to implement the FoV limitation—so far, your assumption has been that the camera FoV is at least as large as the SLM's? Let me know how you'd prefer to approach this.

Best regards,
Bodo

@bodokaiser
Copy link
Copy Markdown
Contributor Author

Also:

Would you prefer that I check for M is None and b is None in SimulatedCamera.__init__ and set a flag, e.g., self._farfield = True, indicating the "SLM farfield mode" that is then used in both build_affine and set_affine
or should I handle this check only inside set_affine?

Just want to make sure I align with your intended design.

@ichristen ichristen self-requested a review April 3, 2025 18:33
@ichristen
Copy link
Copy Markdown
Collaborator

Re: FoV limitation. I think a good way to do this is to implement window of interest (WOI, also called ROI) for SimulatedCamera. That way, the user would input the desired cropped region of the FOV in units of the full (probably padded) FOV. WOI support is not super comprehensive right now in slmsuite #33 , but the set_woi() function is at least standardized in the template. Does this sound like a reasonable solution?

Re: self._farfield = True. I think the self._interpolate already covers this, where when self._interpolate = False, the SimulatedCamera should be equivalent to the farfield of the SLM.

Copy link
Copy Markdown
Collaborator

@ichristen ichristen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See other comment!

@bodokaiser
Copy link
Copy Markdown
Contributor Author

Re: FoV limitation. I think a good way to do this is to implement window of interest (WOI, also called ROI) for SimulatedCamera. That way, the user would input the desired cropped region of the FOV in units of the full (probably padded) FOV. WOI support is not super comprehensive right now in slmsuite #33 , but the set_woi() function is at least standardized in the template. Does this sound like a reasonable solution?

Re: self._farfield = True. I think the self._interpolate already covers this, where when self._interpolate = False, the SimulatedCamera should be equivalent to the farfield of the SLM.

Yes, my plan was to use set_woi.

1 What do you think about updating Camera.set_woi to set cam._woi which we then use in Camera.get_image to crop the image by indexing? Or would you rather only implement such behavior in SimulatedCamera for now?

2 Does Hologram.plot_farfield "detect" the field of view if we use set_woi?

@ichristen
Copy link
Copy Markdown
Collaborator

  1. A main reason that we have been procrastinating on WOI stuff is that it messes up the calibrations when the WOI changes (e.g. the b value in Fourier calibration). Thus, for now let's keep it inside SimulatedCamera, but eventually it would be a superclass Camera method (yes, a default method that crops via indexing, overwritten by cameras that support WOI restriction to instead do this on hardware).
  2. plot_farfield() plots the full extent of the computational Fourier space, but then also plots the outline of the Camera's FOV in yellow. The current method has no knowledge of WOI. In the future, when WOI stuff is probably implemented, we'll probably draw the full possible extent of the camera with a dashed yellow line and the current WOI-cropped extent of the camera with the solid yellow line.

@bodokaiser bodokaiser requested a review from ichristen April 4, 2025 07:41
@ichristen ichristen added the 0.3.0 Planned part of the 0.3.0 release label Apr 24, 2025
@bodokaiser
Copy link
Copy Markdown
Contributor Author

@ichristen do you request any changes for this to land in 0.3.0?

@ichristen
Copy link
Copy Markdown
Collaborator

ichristen commented May 22, 2025

Hi @bodokaiser ,

I'm debating some more major structural changes to Camera and SimulatedCamera before 0.3.0 as part of a small examples revamp (esp. computational_holography). Some form of this will probably land there (though without the WOI stuff). I'll update you tomorrow.

@ichristen ichristen added 0.4.0 Planned part of the 0.4.0 release and removed 0.3.0 Planned part of the 0.3.0 release labels Sep 28, 2025
@ichristen ichristen added 0.5.0 Planned part of the 0.5.0 release and removed 0.4.0 Planned part of the 0.4.0 release labels Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.5.0 Planned part of the 0.5.0 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants