Changing the thickness of outlines in wb_view

95 views
Skip to first unread message

Joern Alexander Quent

unread,
Jul 7, 2025, 1:57:21 PM7/7/25
to hcp-...@humanconnectome.org
Hello everyone,

As per a reviewer's request, I have to increase the thickness of the
outlines that one can create inside the Palette tab (e.g. outline only)
to visualise significant regions on the cortical surface. Is there a way
to do this?

A colleague suggested to create an ".border" file, where one can change
the thickness of the borders but I am wondering if there is a simpler
way. That being said if a simpler way does not exist how can one create
a custom ".border" file?

Kind regards,

Alex Quent

Rosen, Burke

unread,
Jul 7, 2025, 2:19:00 PM7/7/25
to hcp-...@humanconnectome.org
Workbench border outlines can be displayed more flexibly than those of labels. The command you are looking for to create them is wb_command -label-to-border. Once you have the border file, you can tweak their presentation in Workbench’s Features Toolbox tab. 

Outside of workbench, I’ve found this matlab toolbox by Stuart Oldham helpful https://github.com/StuartJO/plotSurfaceROIBoundary

-Burke

--
You received this message because you are subscribed to the Google Groups "HCP-Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hcp-users+...@humanconnectome.org.
To view this discussion visit https://groups.google.com/a/humanconnectome.org/d/msgid/hcp-users/57a5949f-3c2b-41ff-ab41-36b8f6f9a8da%40rub.de.

 


The materials in this message are private and may contain Protected Healthcare Information or other information of a sensitive nature. If you are not the intended recipient, be advised that any unauthorized use, disclosure, copying or the taking of any action in reliance on the contents of this information is strictly prohibited. If you have received this email in error, please immediately notify the sender via telephone or return mail.

Tim Coalson

unread,
Jul 7, 2025, 5:07:27 PM7/7/25
to hcp-...@humanconnectome.org
I can also offer a more complicated way:  convert the labels to ROIs, erode them by the desired thickness, subtract the result from the original ROIs, and then convert back to labels.  The commands to look at are wb_command -gifti-all-labels-to-rois, -metric-erode, -metric-math, and then to convert back to labels needs a song and dance around -metric-reduce with INDEXMAX (and MAX to generate a mask so the centers become unlabeled), followed by -metric-label-import.  There are similar commands for volume or cifti.

Tim


Joern Alexander Quent

unread,
Aug 1, 2025, 1:05:46 AM8/1/25
to 'Joern Alexander Quent' via HCP-Users

Hello everyone,

Thanks to Burke Rosen, I managed to use a brain map to a .border file, which lets me choose the thickness as intended but now each parcel has an open bit. See

Is there a way to avoid this? Did I do something wrong?

I created the file using this code:

# .dlabel.nii to .gii

wb_command -cifti-separate ${dlabel_file} COLUMN -label CORTEX_LEFT  ${label_L_file}

# .label.gii to .border

wb_command -label-to-border ${surfLeft}  ${label_L_file}  test_L.border -placement 0.9

Inside wb_view I used in the Attributes tab:

  • Draw As Polylines (Lines has the same issue)
  • Line Diameter 5px
  • Symbol Diameter 2 mm
  • Unstretched lines (checked) 5 mm
  • Above offset 0

Best wishes,

Alex

Rosen, Burke

unread,
Aug 1, 2025, 2:24:39 PM8/1/25
to hcp-...@humanconnectome.org
You could try making all the borders in the file closed with something like
sed 's|<BorderPart Closed="False">|<BorderPart Closed="True">|g’ test_L.border > test_L_closed.border

If that doesn’t work, you can use 'Edit Borders' Mode in wb_view, then use the ‘Draw' Border mode and 'Extend Border' Operation to manually fill the gap. 

An attentive that might be worth testing is to resample the label file to a higher res mesh, convert it to a border file, then resample the border file to the original mesh. 

-Burke


On Aug 1, 2025, at 12:05 AM, 'Joern Alexander Quent' via HCP-Users <hcp-...@humanconnectome.org> wrote:

Hello everyone,

Thanks to Burke Rosen, I managed to use a brain map to a .border file, which lets me choose the thickness as intended but now each parcel has an open bit. See

<border_file_issue.png>

Is there a way to avoid this? Did I do something wrong?

I created the file using this code:

# .dlabel.nii to .gii

wb_command -cifti-separate ${dlabel_file} COLUMN -label CORTEX_LEFT  ${label_L_file}

# .label.gii to .border

wb_command -label-to-border ${surfLeft}  ${label_L_file}  test_L.border -placement 0.9

Inside wb_view I used in the Attributes tab:

  • Draw As Polylines (Lines has the same issue)
  • Line Diameter 5px
  • Symbol Diameter 2 mm
  • Unstretched lines (checked) 5 mm
  • Above offset 0

Best wishes,

Alex


On 2025/7/6 16:43, 'Joern Alexander Quent' via HCP-Users wrote:
Hello everyone,

As per a reviewer's request, I have to increase the thickness of the outlines that one can create inside the Palette tab (e.g. outline only) to visualise significant regions on the cortical surface. Is there a way to do this?

A colleague suggested to create an ".border" file, where one can change the thickness of the borders but I am wondering if there is a simpler way. That being said if a simpler way does not exist how can one create a custom ".border" file?

Kind regards,

Alex Quent

--
You received this message because you are subscribed to the Google Groups "HCP-Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hcp-users+...@humanconnectome.org.

Tim Coalson

unread,
Aug 1, 2025, 4:54:46 PM8/1/25
to hcp-...@humanconnectome.org
It is supposed to output closed borders.  Looking at this, I found a bug when writing the older format of border file that failed to save whether the border was closed or not.  The newer border file version shouldn't have this issue, though.

However, it looks like the display logic in wb_view may also not be checking whether the border is closed, and as such not closing the loop.

Tim


Reply all
Reply to author
Forward
0 new messages