Skip to content

Question: Why have EventImage2D be a const-only container? #28

@twongjirad

Description

@twongjirad

Any reason to enforce this?

Here is my current use case that would require the underlying vector to be mutable. this would mean allowing an as_vector() command that doesnt pass a const reference.

I have a routine to crop a whole event image into many subimages (162), whose meta do not change, event-by-event. The need to allocate and reallocate the eventimage2d vector is inefficient. it would seem better to keep the images in memory, and just update the values. (of course, this also requires that iomanager does not clear the event container after writing it -- which is another question i guess.)

I do see that one could create two vector and swap them from event to event using eventimage::emplace. but for large vectors of images, that's double the memory.

maybe better yet is to just make eventimage2d inheret from both eventbase and std::vectorlarcv::Image2D.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions