int getFieldNum(BigInteger lineIndex, int fieldOffset, FieldFactory[] factories) {
		int firstActiveFactoryIndex = getFirstActiveFactoryIndex(lineIndex, factories);
		if (firstActiveFactoryIndex < 0) {
			return 0;
		}
		int lastActiveFactoryIndex = getLastActiveFactoryIndex(lineIndex, factories);
		for (int i = firstActiveFactoryIndex; i < lastActiveFactoryIndex; i++) {
			if (factories[i].getFieldOffset() == fieldOffset) {
				return i - firstActiveFactoryIndex;
			}
		}

		return lastActiveFactoryIndex - firstActiveFactoryIndex;
	}
Gets field factory index for the given fieldOffset, adjusting for inactive fields such
that the first active field has a fieldNum of 0. For example, if the group size is 2 and
bytes per line is 8,then the factories have fieldOffsets of 0,2,4,6. So if all fields are
visible, the fieldNum for 4 is 2. But if the first field is non active, then the offset of
4 maps to fieldNum of 1.
@param lineIndex the line index to get a fieldNum for
@param fieldOffset the byte offset from the byte that would be displayed by the first factory
(the first factory always has an offset of 0)
@param factories the list of factories for a line
@return the active index of the factory that displays bytes at the given fieldOffset.
Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/IndexMap.java