klabhub / neurostim

Design and run visual neuroscience experiments using Matlab and the Psychophysics Toolbox.
MIT License
5 stars 3 forks source link

texture.m can now display images from any file. that imread can read. #147

Closed bartkrekelberg closed 4 years ago

bartkrekelberg commented 4 years ago

Added replace function instead of only add. Added optional specification of filterMode and globalAlpha.

adammorrissirrommada commented 4 years ago

This looks pretty harmless to me. I don't use this plugin, but @cnuahs does. I'll leave it to him to sign off on this one.

bartkrekelberg commented 4 years ago

True, but that is not a new problem; with the previous version you also only know which ID is used, not what the actual texture was. (Admittedly in that case you at least know that the id always refers to the same texture)

Do you use this with matlab generated textures, or do you load textures in some other code and then pass the textures to this stimulus? It may be worth incorporating such code int he stimulus class so that more of the texture can be reproduced?

For the new variant (loading a file) it would be easy to at least store the file name. Storing the full texture in the data may be overdoing it a bit...although this could be an optional feature.

For now I'll merge this and leave this as a feature request.


Bart Krekelberg, PhD

Professor, Rutgers University - Newark

Co-Director, Center for Molecular and Behavioral Neuroscience

Associate Director, Rutgers University Brain Imaging Center

197 University Avenue

Newark, NJ 07102

T: +1 551 285 9265

E: bart@rutgers.edu

W: vision.rutgers.edu

Skype: bartkrekelberg


From: Shaun Cloherty notifications@github.com Sent: Tuesday, March 17, 2020 3:11 To: klabhub/neurostim-ptb neurostim-ptb@noreply.github.com Cc: Bart Krekelberg bart@vision.rutgers.edu; Author author@noreply.github.com Subject: Re: [klabhub/neurostim-ptb] texture.m can now display images from any file. that imread can read. (#147)

@cnuahs commented on this pull request.

I made a cosmetic/editorial change to the comment.

Other than that, the issue I see here is that being able to replace a texture, effectively re-using an existing id, would mean you have no way to backout afterward what texture was actually displayed. Only o.id is logged, changes to o.tex are lost.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fklabhub%2Fneurostim-ptb%2Fpull%2F147%23pullrequestreview-375694376&data=02%7C01%7Cbart%40rutgers.edu%7C19cc358e272248b9c97c08d7ca188a1b%7Cb92d2b234d35447093ff69aca6632ffe%7C1%7C1%7C637200079056204970&sdata=vANvrUrlvvULlwimJ8oDHOizkXWF1hR7gGrrDrZsE2M%3D&reserved=0, or unsubscribehttps://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAC3MRUZC6PESIRXRPMX3ENLRH3L5XANCNFSM4LEJBJAQ&data=02%7C01%7Cbart%40rutgers.edu%7C19cc358e272248b9c97c08d7ca188a1b%7Cb92d2b234d35447093ff69aca6632ffe%7C1%7C1%7C637200079056204970&sdata=cjUEi8viQY9ktJSDAkLoEKRsbkja%2B1ajojNHdbXAbbk%3D&reserved=0.

cnuahs commented 4 years ago

Actually, in the old version (and this new version) the texture images are stored forever in o.tex... although admittedly, there is/was no interface provided for getting them back if loading a cic object for analysis (o.tex is currently private). I thought there was a getTex() method, but no. I think the reason I made o.tex private was to make it somewhat immutable... you could o.add() new textures but never overwrite an existing one, so in principle (but not in practice, since i evidently never implemented the get method) you could always get back exactly the image shown at run time.

I only use this stimulus in an eye calibration task, or to present visual feedback. So I've not had need to retrieve the actual textures during analysis. The textures are stored in a .mat file and loaded by other code and passed to the texture stimulus class.

Shaun

On Tue, Mar 17, 2020 at 8:13 PM Bart Krekelberg notifications@github.com wrote:

True, but that is not a new problem; with the previous version you also only know which ID is used, not what the actual texture was. (Admittedly in that case you at least know that the id always refers to the same texture)

Do you use this with matlab generated textures, or do you load textures in some other code and then pass the textures to this stimulus? It may be worth incorporating such code int he stimulus class so that more of the texture can be reproduced?

For the new variant (loading a file) it would be easy to at least store the file name. Storing the full texture in the data may be overdoing it a bit...although this could be an optional feature.

For now I'll merge this and leave this as a feature request.


Bart Krekelberg, PhD

Professor, Rutgers University - Newark

Co-Director, Center for Molecular and Behavioral Neuroscience

Associate Director, Rutgers University Brain Imaging Center

197 University Avenue

Newark, NJ 07102

T: +1 551 285 9265

E: bart@rutgers.edu

W: vision.rutgers.edu

Skype: bartkrekelberg


From: Shaun Cloherty notifications@github.com Sent: Tuesday, March 17, 2020 3:11 To: klabhub/neurostim-ptb neurostim-ptb@noreply.github.com Cc: Bart Krekelberg bart@vision.rutgers.edu; Author < author@noreply.github.com> Subject: Re: [klabhub/neurostim-ptb] texture.m can now display images from any file. that imread can read. (#147)

@cnuahs commented on this pull request.

I made a cosmetic/editorial change to the comment.

Other than that, the issue I see here is that being able to replace a texture, effectively re-using an existing id, would mean you have no way to backout afterward what texture was actually displayed. Only o.id is logged, changes to o.tex are lost.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub< https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fklabhub%2Fneurostim-ptb%2Fpull%2F147%23pullrequestreview-375694376&data=02%7C01%7Cbart%40rutgers.edu%7C19cc358e272248b9c97c08d7ca188a1b%7Cb92d2b234d35447093ff69aca6632ffe%7C1%7C1%7C637200079056204970&sdata=vANvrUrlvvULlwimJ8oDHOizkXWF1hR7gGrrDrZsE2M%3D&reserved=0>, or unsubscribe< https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAC3MRUZC6PESIRXRPMX3ENLRH3L5XANCNFSM4LEJBJAQ&data=02%7C01%7Cbart%40rutgers.edu%7C19cc358e272248b9c97c08d7ca188a1b%7Cb92d2b234d35447093ff69aca6632ffe%7C1%7C1%7C637200079056204970&sdata=cjUEi8viQY9ktJSDAkLoEKRsbkja%2B1ajojNHdbXAbbk%3D&reserved=0

.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/klabhub/neurostim-ptb/pull/147#issuecomment-599961266, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCTL6MO7HK65BIRQHL26P3RH45NBANCNFSM4LEJBJAQ .