Ops.Create.Img: takes too much time/RAM to create CellImg
- Dominant language
- Java
- Stars
- 94
- Forks
- 44
- PR merge metrics
- No merged PRs in 30d
Description
When using the ops to create images, creating two `ArrayImg` of size 50000x25000 takes a few seconds, while creating one `CellImg` of size 50000x50000 (size exceeds limit of `ArrayImg`), it takes minutes, as mentioned in #339
```
ops().create().img(new FinalInterval(50000, 25000, new ByteType());
ops().create().img(new FinalInterval(50000, 25000, new ByteType()); // takes few seconds
ops().create().img(new FinalInterval(50000, 50000, new ByteType()); // takes literally forever
```
It turns out that this is because the `CellImgFactory` used to create the larger image, [uses the default cell size](https://github.com/imagej/imagej-ops/blob/master/src/main/java/net/imagej/ops/create/imgFactory/DefaultCreateImgFactory.java#L73) (which I think is 10). After assigning larger cell size to the factory, the problem seems to be solved.
However, what should be the optimal cell size/dimensions? should this information be passed to the op by parameter? should we create another `CreateCellImgFactory` op? @ctrueden
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at DefaultCreateImgFactory.java, especially the default CellImgFactory cell-size handling, and reproduce the Ops.create().img cases from the issue with the stated dimensions. Investigate how cell dimensions are selected and whether the create-image API exposes the needed choice. Done should include an agreed cell-sizing approach and a verified improvement for the large CellImg case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- performance
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100