Batched Downsizing of GB Sized TIF Images - command-line

I have 300+ TIFF images ranging in size from 600MB to 4GB; these are medical images converted from MRXS file format.
I want to downsize and make copies of the images at 512 x 445-pixel dimensions, as most of the files are currently sized at 5 figure dimensions (86K x 75K pixels). I need to downsize the files so that I can extract features from the images for a classification related problem.
I am using an i5-3470 CPU, Windows 10 Pro machine, with 20 GB RAM and a 4TB external HDD which holds the files.
I've tried a couple of GUI and command-based applications like XnConvert, Total Image Converter, but each GUI or CMD function causes the application to freeze up.
Is downsizing such large files even feasible using my hardware, or must I try a different command/BAT approach?

Related

yolov4..cfg : increasing subdivisions parameter consequences

I'm trying to train a custom dataset using Darknet framework and Yolov4. I built up my own dataset but I get a Out of memory message in google colab. It also said "try to change subdivisions to 64" or something like that.
I've searched around the meaning of main .cfg parameters such as batch, subdivisions, etc. and I can understand that increasing the subdivisions number means splitting into smaller "pictures" before processing, thus avoiding to get the fatal "CUDA out of memory". And indeed switching to 64 worked well. Now I couldn't find anywhere the answer to the ultimate question: is the final weight file and accuracy "crippled" by doing this? More specifically what are the consequences on the final result? If we put aside the training time (which would surely increase since there are more subdivisions to train), how will be the accuracy?
In other words: if we use exactly the same dataset and train using 8 subdivisions, then do the same using 64 subdivisions, will the best_weight file be the same? And will the object detections success % be the same or worse?
Thank you.
first read comments
suppose you have 100 batches.
batch size = 64
subdivision = 8
it will divide your batch = 64/8 => 8
Now it will load and work one by one on 8 divided parts into the RAM, because of LOW RAM capacity you can change the parameter according to ram capacity.
you can also reduce batch size , so it will take low space in ram.
It will do nothing to the datasets images.
It is just splitting the large batch size which can't be load in RAM, so divided into small pieces.

How to reduce size and size on disk?

We have created Automation Projects using Katalon Studio..
Currently The project folder size is it shows like:
Size: 1.61 MB
Size on Disk: 4.45 MB
Contains: 1033 Files, 444 Folders
How to reduce the difference between Size and Size on Disk.. When project grows is it needs to be sorted out?
This is probably related to your disk cluster size. Files can be no smaller than the cluster size, which is usually somewhere in the range of a few KB. For example, if your cluster size is 4KB then a 1 byte file will still take up 4KB on the disk. Generally this is more noticeable when you have many small files. If you want to change this you will need to reformat your filesystem and choose a smaller cluster size.

improve cell variables in Matlab

I am preparing training images in Matlab. The problem is the number of images are too much and the size of variables are huge as well. Here is the specification of work:
There are 10 .mat files each contain in average 15000 images. It is in format of 1x15000 cell and the size of each file is in average 1.35 GB.(900 kilobytes average per image)
Average size of each image is 110x110 pixels, each image has different dimensions. Each cell is saved as single type with value between 0 and 1.
Loading all 10 .mat files at once is impossible because it makes Matlab freezes. My questions are:
Isn't the file sizes are too big? 900 kilobytes in average for small 110x110 pixel image is really too much,isn't it?!
Is usage of cell of single variable is the best practice for training images? or there exist a more convenient alternative variable type?
update: to compare the image size, this icon file with 110x110 pixel is around 2kb in comparison to 900 kb images in matlab!!!

Accessing Individual Images in Multipage TIFF in Mathematica

I have 12 large (1gb each) multi-page TIFF files containing 1500 images that represent a time series of 3D data.
To keep memory consumption at bay, i would like to only read individual images from the multi-page TIFF files, instead of reading everything and then selecting only the required file.
Is there an option to Import that I'm missing or is there another approach?
Thanks,
Try for example:
pageNbr = 3;
Import["C:\\test1.tif", {"ImageList", pageNbr}]

How big image can be read and displayed in matlab?

I have a problem with image reading. I want to make sure how big image can be read and displayed in matlab? It is possible to display huge images like (12689,4562,7). If not, how can I check whether this image loaded correctly in matlab?
Thanks a lot
There are two questions here:
Is it possible to load a large image from the disk to RAM?
Is it possible to show a large image?
The answer to the first question is that it depends on your amount of RAM and operating system. The answer to the second question is that Matlab (or any program) downscales the image before showing, since there aren't that much pixels on the image. So it depends on the internal algorithm, and again, on your amount of RAM.
The number of MB of RAM required for such an image would be (assuming 8 bits/pixel (uint8)):
12689*4562*7 / 1e6 = 405.2 MB
The number of elements a single matrix can contain in your version of Matlab:
[~, numEls] = computer;
which is 2.147483647e+09 on my 32-bit R2010b. This is much more than 12689*4562*7, so in principle, if you have 406GB of unused RAM, you should be able to load the image in its entirety into RAM. And in principle, displaying said image will involve some additional RAM (and probably take a looong time), but should nevertheless be possible (aside from the fact that displaying an image with 7 colour layers is not very standard AFAIK).