Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

List of things we want to include

TODOs

...

Adding steps about the tools and installing those tools ( rawtherapee, mobaxterm)

...

Steps in rawtherapee

...

Command line instructions

...

Pics or screenshots will be very helpful

  1. Provide video overview

...

Requirements

  1. How to get requirements

...

Additional requirements and instructions

  1. Azure

  2. SUNNY

  3. NFS Locker Access

1. Download Batch

Description of this step

Code Block
code snippet here

2. Color Profiling

Description of step

2.1 Sub heading step

Setting up a new user

...

panelIconIdatlassian-info
panelIcon:info:
bgColor#E3FCEF

Step 1

Establishing VPN:

...

  1. Be sure Cisco Secure Client is downloaded

  2. Launch program

  3. Be sure the NCSU VPN is chosen - “vpn.ncsu.edu”

  4. Click “Connect”

  5. Enter username, password, and “push”, “sms” or “passcode” to authenticate via Duo

  6. Once authenticated, we can log into the SUNNY server via MobaXTerm

Log into MobaXTerm (MXT):

...

Open program

...

Choose Light/Dark mode

...

Click Start local terminal

...

Code Block
ssh <user>@SUNNY.ece.ncsu.edu

...

Enter password if prompted (will not see password being typed, if incorrect, MXT will reprompt to enter password)

...

Code Block
cd ..

...

Code Block
cd psa_images

We’ve navigated to the PSA images location. From here - for our purposes - we will choose either the “semifield_tools” folder or “field_tools” folder.

...

If choosing Semifield

  1. Code Block
    cd semifield_tools

If choosing Field

Code Block
cd field_tools

...

Now we have navigated to where we work with our batches. From here we will:

  1. “download” field batches

  2. Open new screens

  3. “copy” semifield batches

  4. Launch RawTherapee to adjust images

  5. Send batches into the respective pipeline

  6. Check available batches

  7. Check/Crosscheck # of images, jpgs, arws, pp3s, etc.

Backlog Spreadsheet:

Lref gdrive file
urlhttps://docs.google.com/spreadsheets/d/18fwdSJxMy1WjCBCSCTb3uERj5D32H5jmBEh5dVpvrog/edit?gid=1066600493#gid=1066600493

Info

Using the Backlog Spreadsheet

video1420686139.mp4
  • Must obtain view/edit permission to spreadsheet

  • Filling out each column respectively is important

  • Hiding Developed batches' rows helps keep organized

  • Color coded format also helps keep organized

    • Downloaded - Field batch has been brought over to local user

    • Downloading - field batch is in the process of being brought to local user

    • Copied - Semifield batch has been brought over to local user

    • Copying - Semifield batch is in the process of being brought to local user

    • Processed* - Batch has been opened within RawTherapee and settings have been toggled appropriately

    • Processing* - Batch has been sent into it’s respective pipeline

    • Redo - Must redownload/copy batch again, adjust profile again, then send back into pipeline

    • Revisit - Something seems to have gone wrong in the pipeline. Errors have been given. Must investigate. Image count does not match up, no storage remains, etc.

    • Developed - Batch has been sent through pipeline successfully. Image count matches

*Processed refers to settings changed, while Processing refers to sending into pipeline. Yes, it is a bit counterintuitive.

Common & Useful Commands

Available batches:

Code Block
breakoutModewide
ls /mnt/research-projects/s/screberg/longterm_images2/semifield-upload/ -lh

# of images in batch:

...

TODOs (updated 12/10/2024)

  1. Flow chart of data transfer and processing for both Field and SemiF (Matthew Kutugata) could be a general flowchart placed in the main preprocessing page.

    1. Courtney Belcher Courtney Belcher could give it a shot

Backlog Spreadsheet:

Lref gdrive file
urlhttps://docs.google.com/spreadsheets/d/18fwdSJxMy1WjCBCSCTb3uERj5D32H5jmBEh5dVpvrog/edit?gid=1066600493#gid=1066600493

1. Download Batch

...

When downloading a Semifield batch, It copies over to the local user from the NFS Lockers.

Code Block
cd ..
cd psa_images/semifield_tools/
screen -R <batch_name>
python3 copy_from_lockers_test.py <batch_name>

Semifield batches can take anywhere from a few minutes to half an hour to copy over, depending on the batch size. It is important to open a new screen for copying. Only to copy one or two batches at a time within their respective screens to avoid disk space problems.

To exit the screen, use CTRL+A D

Checking in to see if the copying of a batch has been completed by using this string of commands:

Code Block
cd psa_images/semifield_tools/
screen -r <batch_name>

If the batch has either been completed copying or there has been an error copying, there will be an input line. If no input line, the process has not completed.

To exit the screen, use CTRL+A D

1.1 Checking if the batch was completely copied

It is important to check if the copied batch was brought to the local user entirely.

We must know the # of images in the original batch. Use this command:

Code Block
ls /mnt/research-projects/s/screberg/longterm_images2/semifield-upload/<batch>/*.ARW | wc -l

Sometimes this command may need to be run two or three times before it output the correct value.

Check the # of images in the local directory after download has completed.

(Moving files from longterm storage to the local working directory, before you run the the pipeline).

*The output should be equal to the above command; should be 0 after running the pipeline

Use this command:

Code Block
ls /home/psa_images/temp_data/semifield-upload/<batch>/*.ARW | wc -l

After running the pipeline, check if all the ARW files have converted to JPGs and have moved to the longterm “developed” storage.

Use this command:

Code Block
ls /mnt/research-projects/s/screberg/longterm_images2/semifield-developed-images/<batch>/images/*.jpg | wc -l

Example: MD_2024-07-02

Code Block
 ls /mnt/research-projects/s/screberg/longterm_images2/semifield-upload/MD_2024-07-02/*.ARW | wc -l

output: 560

Code Block
ls /home/psa_images/temp_data/semifield-upload/MD_2024-07-02/*.ARW | wc -l

output (before running the pipeline): 560

output (after running the pipeline): 0

Code Block
ls /mnt/research-projects/s/screberg/longterm_images2/semifield-developed-images/MD_2024-07-02/images/*.jpg | wc -l

output (after running the pipeline): 560

Trouble shooting:

If developed jpgs are not in the longterm storage, check to see if they’re still in the local temp_data outputs folder:

  • Check for jpgs:

Code Block
ls /home/psa_images/temp_data/semifield-outputs/MD_2024-07-26/images/*.jpg | wc -l

check for same number of .pp3 files (how you know they’ve been developed):

Code Block
ls /home/psa_images/temp_data/semifield-outputs/MD_2024-07-26/images/*.pp3 | wc -l

If they’re both present and have the same number, we know they’ve been successfully preprpocessed, but may not have been successfully move to the longterm locker storage location.

  • If there is an “Assertion Error”, try going into RawTherapee, and create & save the profile again.

2. Color Profiling in RawTherapee

...

Launch RawTherapee:

Code Block
./RawTherapee_5.8.AppImage

RawTherapee will launch in an separate window and open to the most recent profile that has been worked on. Select the appropriate batch and allow it to load. Scroll through and make a mental note if some images are out of the ordinary (i.e. too bright, too dark, out of focus, etc.).

...

2.1 Creating a color profile

Our goal when creating a color profile is to have every image look similarly to the rest of the batch. When RawTherapee launches, it will bring us to the last batch we worked on by default. Be sure to navigate to the intended batch. Note when there is more than one folder within the batch. We must adjust every image in each folder before sending the batch into the pipeline.

It is good practice to scan through all images to get an idea of what they are looking like, if there are any outliers, or anything to make note of.

2.2 Look for a Color Checker

We want to use an image with a color checker, if one is available within the batch. Choose the most average looking picture (lighting and color-wise). It is preferred to select an average image with both a color checker and biomass. If there is no biomass present, choose an average image with a color checker.

...

*In Semifield applications, a smaller Color Checker lanyard is typically used. The Field Color Checker might be used instead, but the smaller one is preferred for this application. Either is acceptable.

2.12 Bring in a Recent profile & Color Picker

...

To bring in a recent profile, find the folder icon towards the top right of the screen, located to the left of the save button. This will open a window containing a list of saved profiles within the local user. Choose the most recent date in relation to the image being worked on.

Once a previous profile is loaded in and applied, use the color picker tool. The Color Picker tool is found on the tool bar above the working image or use the White Balance tab on the panel to the right. Choose “Pick”.

...

Only one square on the Color Checker is used for in this application. Referring to the image above, the gray residing two squares above the black is the color to use. Use this gray for every profile. Choose the hand icon to return to normal cursor mode.

2.13 Adjust exposure & saturation

...

Now, navigate into the Exposure tab. This is the only tab used in preprocessing, aside from the tab to access the Color Picker. There are only a few helpful settings to toggle here.

The goal is to create an image that looks most closely like a real-life view of these plants. The human eye is the most accurate check, but it can be helpful to reference the color graph located on the top left of the scree. It shifts when settings are changed. A good rule of thumb is for the peak of the three curves to land near this region of the graph.

...

*Laptop screens and Monitor settings will impact perception of images. Try to use the same screen when creating color profiles.

  • Exposure Compensation & Highlight Compression

    • These two go hand-in-hand. Exposure compensation should always be set to slightly more than Highlight Compression

  • Lightness

    • Has a similar effect to Exposure Compensation

  • Saturation

    • Toggle keeping in mind the intensity of colors on the color checker.

3. Running the pipeline

...

** Don't run >3 batches in the pipeline at once. This applies to both Semifield and Field combined. **

Profiling can be done and batches can be prepared for the pipeline, but wait to run them until another batch finished.

After the color profile has been saved, send it through the pipeline. Be sure to be navigated to the Semifield folder and make a new screen, use uppercase r (-R). If returning to an already existing screen, use lowercase r (-r) with the appropriate screen name.

Code Block
cd ..
cd psa_images/semifield_tools/
screen -R <batch_name>
python3 semifield_CLOUDY_pipeline.py <batch_name>

To exit the screen, use CTRL+A D

Check on a batch sent into the pipeline by using this string of commands:

Code Block
cd psa_images/semifield_tools/
screen -r <batch_name>

If the pipeline has either been completed running or there has been an error running it, there will be an input line. If there is no input line, the process has not completed.

To exit the screen, use CTRL+A D

3.1 Checking the success of the pipeline

If there is an indication the pipeline is finished running, crosscheck the # of images in the original batch with the # of JPGs and PP3s created.

We can use both of these lines respectively:

Code Block
ls /mnt/research-projects/s/screberg/longterm_images2/semifield-developed-uploadimages/<batch>/images/*.ARWjpg | wc -l

...

breakoutMode
Code Block
wide
ls /mnt/research-projects/s/screberg/longterm_images2/semifield-developed-images/<batch>/images/*.jpgpp3 | wc -l

And compare to the # of pp3 files createdARWs using this:

wide
Code Block
breakoutMode
ls /mnt/research-projects/s/screberg/longterm_images2/semifield-developed-imagesupload/<batch>/images/*.pp3ARW | wc -l

As long as the output # are equivalent, the color profile has successfully been applied to every image in the batch.

If the # of JPGs and PP3s are not equivalent to the original # of images, try running the pipeline again within the same screen. Double check the name of the batch that was typed in, this is where errors are likely to happen. Also, be sure to be navigated to the Semifield folder. If navigated to the Field folder, the pipeline will not be successful.

5. Update Backlog Spreadsheet

Change the progress column to the appropriate term to indicate where that batch is in the process. Make any notes/check box when done, if applicable.

When entire batch is fully completed, the row can be hidden by right clicking on the row #, then click hide.

4. Blob Analyzer (????)

...

4.1 Installing conda (miniconda) 

Use these commands below from the command line in the SUNNY server:

Code Block
mkdir -p ~/miniconda3

...


wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh

...


bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3

...


rm  ~/miniconda3/miniconda.sh

...


~/miniconda3/bin/conda init bash

Close the remote connection, then

...

SSH back in

4.2 Setting up a conda environment

Still in the command line inside of SUNNY:

Code Block
conda create -n <your env name> python=3.10

...


conda activate <your env name>

...


cd /home/psa_images/analyze_blobs

...


pip install -r requirements.txt

4.3 Running the code 

Your conda environment must be activated to run the code.

Run these in the command line

...

:

Code Block
conda activate <your env name>

...


cd /home/psa_images/analyze_blobs

...


python ANALYZE_BLOB.py
  1. Creates 2 time stamped files in the “results” folder in the main project directory. 

    1. A text files that provides a general summary of missing batches

    2. A csv file that can be viewed in excel or google docs

5. Common & Useful Commands

...

Available batches:

Code Block
ls /mnt/research-projects/s/screberg/longterm_images2/semifield-upload/ -lh

# of images in batch:

Code Block
ls /mnt/research-projects/s/screberg/longterm_images2/semifield-upload/<batch>/*.ARW | wc -l

# of JPGs processed:

Code Block
ls /mnt/research-projects/s/screberg/longterm_images2/semifield-developed-images/<batch>/images/*.jpg | wc -l

# of PP3 files created:

Code Block
ls /mnt/research-projects/s/screberg/longterm_images2/semifield-developed-images/<batch>/images/*.pp3 | wc -l